Fourier Series Applet


This applet illustrates the properties of fourier series.

Please follow the direction below to learn about this applet. You will need to scroll up and down frequently.



The two graph areas on the top (named "Time Signal") represent a time domain signal of one period. "0" and "T" on the x-axes show that the graphs represent one period of a periodic signal which is infinitely long. For now the real part of the signal is displayed on the left graph area and the imaginary part on the right. So the two top graph areas describe one signal in time domain. (Remember: signals can be complex and you need either real/imaginary or magnitude/phase combination to fully describe them.) You can draw on these graph areas to give an arbitrary shaped signal. Try drawing a rectangular wave on the real graph area (on the left). Don't be afraid to play with it. Reset button might help before you start a new drawing.

Two graph areas in the bottom show the fourier coefficients. Press "Signal => Coefficients" button. The 0th coefficient a0 is shown where "0" is on the x-axes. To the right of 0 on x-axis you will see a1, a2 and so on. To the left of 0 is a-1, a-2 and so on. The button causes the applet to read the signal you drew in the time domain graphs and find its fourier coefficients up to the number specified in the box "Number of Coefficients". It's set to 5 as default. So when you pressed this button coefficient graph areas showed 5 coefficients on the positive side and 5 on the negative side. (Counting a0 both as positive and negative.)  Now also notice in the time domain graph areas (two at the top) that a new red line appears in each graph. This is the approximation made from the fourier coefficients you just got.

Now try changing the number of coefficients by typing a number (say 10) and see how more coefficients make better approximations (or less "error", the difference between the desired signal and the approximation.) See the equations 4.7 and 4.8 in your course note, page L12-4/6 (in lecture 12). Only difference here is that in using equation 4.7, the applet sums up to the number specified in the "Number of Coefficients" box (in positive and negative directions) instead of infinity. That's why it's an approximation.

You can also change the individual coefficient values by clicking on the coefficients graph areas (the bottom two). Then to find the corresponding changes in the time domain signal, press "Coefficients => Signal" button. Press "Signal => Coefficients" button to restore the correct fourier coefficients.

Now press "Animate" button and watch the time domain graph areas (two top ones) until the animation stops. You just saw in a step-by-step manner how each individual harmonics are added up to make the approximation. An orange line appeared to show the individual harmonics which were subsequently added to the approximation. Each harmonic here is made from two fourier coefficients. For example, the kth harmonic is made from ak and a-k (except for a0 which is used alone). Each harmonic is a sinusoidal wave whose amplitude, phase and period are determined by fourier coefficients ak and a-k. The 0th harmonic has frequnecy 0 (flat), the first harmonic has frequency 1/T, the second 2/T, the third 3/T and so on. (In terms of period it is: infinity, T, T/2, T/3 and so on.)

In fact the whole point of the frequency analysis using fourier coefficients is to show you that any arbitrary periodic waves can be made by summing up regular sinusoidal waves of different amplitude, phase and period. Now press "Animate" button again and observe how each harmonics change in amplitude, phase and period. (The period of a sinusoidal wave can be observed by how many complete waves, 1 up and 1 down crescent, fit in from 0 to T on the x-axis.) See also how each harmonic follows the size of corresponding coefficients.

Things to observe:

1. Real signal will give fourier coefficients whose real part is an even function and whose imaginary part is an odd function. (Don't know what an even or odd function is? Draw a purely real signal, i.e. only draw on the left time domain graph area, and observe what kind of coefficient pattern comes out in real and imaginary part.) What do you think a purely imaginary signal's coefficients will look like?

2. 0th harmonic is often called the "DC component". It's specified by a0 and shows the mean value (average) of the signal in one period. You can see 0th harmonic either by typing 1  in the "Number of Coefficients" box or from the first approximation that shows up during animation.

3. Get used to thinking in complex numbers. Real/Imaginary and Magnitude/Phase button will allow you to see two different ways to see the signal approximations* and coefficients. If you have real/imaginary checked then the signal or the coefficient will have the mathematical form: (real)+j(imaginary) at each point of the graph. If you selected to view with magnitude/phase checked then the actual signal or coefficient is in the form of (magnitude)ej(phase) at each point of the graph.

*In the top two graph areas, only the approximations are affected by these two buttons. When you draw in them, the left one is assumed to be real and the right one is assumed to be imaginary at all times.

 

-Pil Joo (pil.joo@mail.mcgill.ca_ANTISPAM_)

remove _ANTISPAM_ to e-mail me for any mistakes or suggestions.