Fourier Series allows us to replace the given periodic function with infinite sum of harmonic functions (sine and cosine), each of them having some specific amplitude and frequency. This is widely used in radio electronics to generate various periodic signals. If we consider that a single period of the periodic function f(x) lies in between -L:L, then Fourier series is:
- the constant coefficient presenting the average value of the function f(x).
- the variable coefficients, depending on n.
First harmonics of Fourier Series have the most contribution to the value of the given function, thus there is no need to use infinite number of harmonics in practice, it's enough to use just some of them, say, first 10.
Here is example of breaking the function f(x) = x with period in range -1:1 by using the first 5 harmonics:
For even functions
Even function is symmetric relative to Y axis, i.e. f(x) = f(-x) for each x. For that kind of functions the Fourier Series will be reduced to a simpler one containing only the constant coefficient and cosines:
For odd functions
Odd function is symmetric relative to Coordinate Origin, i.e. f(x) = -f(-x) for each x. For that kind of functions the Fourier Series will contain the sine harmonics only:
Simulation in Dysolve
In the attached document we will show how you can use Dysolve to simulate the Fourier Series. You can set your own function f(x) and the number N, which is how many first harmonics will be used in calculation.
Caution! Since the app will integrate the function numerically for each n value, the calculation will take time. So, don't use large N values as it will hang up your app, especially on mobile device.
Also, the Dysolve version 3.1.0 (or higher) is required for this simulation