This WebWorksheet explores the Fourier Series expansion of a
squarewave.

Each sinewave displayed in W1 is summed to produce
the waveform in W2. The sinewaves are of the form:

Where n is odd and f_{0} is the fundamental frequency of
the waveform. The slider controls the number of sinusoids to sum. As more
sinewaves are added, the more the waveform in W2 looks like a
squarewave.

Frequency Spectrum

W3 displays the frequency spectrum of the waveform in W2. Each bar in
the plot has the same magnitude and is located at the same frequency as
the associated sinusoidal component in W1. The bar amplitudes scale as
1/n and the bars are located at frequency n where n is
odd (1, 3, 5, 7, ...).

W3 represents a visual summary of W1, The frequency spectrum
also indicates the waveform in W2 can be reconstructed by
a sum of sinewaves where the amplitudes and frequencies of the
sinewaves are given by the heights and locations of the bars in W3.

Gibbs Phenomenon

Notice the discontinuities at the edges of the squarewave exhibit "ringing"
or overshoot. This behavior is known as Gibbs Phenomenon and results because
the Fourier Series expansion requires an infinite number of sinusoidal
terms but only a finite number of terms are provided.