The Fourier Series
Add harmonics to build the square wave
The gold dashed curve is the target square wave. The blue curve is the partial sum of a few odd harmonics, and below is the strength of each. Increase the number of harmonics and see how close the partial sum gets to the square wave.
A periodic signal is a sum of harmonics
A signal of period T is built only from sinusoids at the fundamental ω₀ = 2π/T and its integer multiples 2ω₀, 3ω₀, …. These integer-multiple components are the harmonics. So any periodic signal is written as a constant term plus a sum of harmonics. Like a musical chord, a fundamental and its overtones combine into one waveform.
More terms, closer fit
A partial sum is an approximation using only the first few harmonics. Adding terms lets higher-frequency harmonics fill in the steep changes, so the edges sharpen. A square wave has only odd harmonics, and the k-th harmonic’s strength is 4/kπ, shrinking as frequency rises. But for a signal with a discontinuity, the overshoot near the jump does not vanish with more terms — it stays at about 9%. This is the Gibbs phenomenon.
The coefficients are the harmonic strengths
The number in front of each harmonic — its Fourier coefficient — sets how much of that harmonic to mix in. By even/odd symmetry (A4) the square wave is odd, so only sines appear, no cosines, and the even harmonics are 0. Lay these coefficients out by frequency and you get the signal’s spectrum. One waveform in time becomes a few bars in frequency — the subject of the next unit.
Back to the first screen
With one term the partial sum was a lone sine, far from square. Adding odd harmonics steepened the edges and flattened the top toward the square, leaving small Gibbs ears at the jumps that never vanish. The bars below were each harmonic’s strength 4/kπ, shorter at higher frequency. This decomposition of a periodic signal into harmonics is the Fourier series, and standing those bars up on a frequency axis is the spectrum.
Now that you have seen each harmonic has a strength, it is time to plot those strengths themselves. The next unit, the spectrum, replaces the waveform on the time axis with bars standing on a frequency axis, one per harmonic. Then the square wave appears as a few bars at odd frequencies only. Viewing the same signal in time or in frequency — the two pictures forming one pair — is the heart of Fourier, and it opens there.