This example is a square wave. Adjusting the Number of Terms slider will determine how many terms are used in the Fourier expansion (shown in red). Move the mouse over the white circles to see each term's contribution, in yellow. You can also modify the function with the mouse.
Notice that the Fourier expansion overshoots the square wave at the edges, no matter how many terms are used. This is called the Giibs phenomenon.
This applet has sound if you are using java 2. Click the Sound checkbox to hear the wave. If you don't see a Sound checkbox, then you should get the Java plug-in.