seegongsik
SC · Fourier

The Fourier Series

A periodic signal splits into a sum of sinusoids at integer multiples of its fundamental frequency, its harmonics. See for yourself how, as harmonics are added one by one, the partial sum recovers the shape of the original square wave.

Add harmonics to build the square wave

The gold dashed curve is the target, a ±1 square wave, and the blue curve is the partial sum of a few odd harmonics. The bars below are the strength of each harmonic, and the terms added so far light up in gold. Raise the number of terms through 1, 2, 4, 8 and 20 and check how close the partial sum gets to the square wave.

partial sumtarget square wave
harmonic strength bₖ = 4/kπ
number of harmonics
Partial sum and how close it is
(4/π) Σ sin(kω₀t)/k, k ≤ 1
With only one term, this is a single smooth sine. The fundamental alone cannot follow the square wave's steep corners at all.
One term

A periodic signal is a sum of harmonics

A signal with period T is made only of sinusoids at the fundamental frequency ω₀ = 2π/T and its integer multiples 2ω₀, 3ω₀, …, and these integer-multiple components are called harmonics. So any periodic signal can be written as a constant term plus a sum of harmonics. Just as the sound of an instrument is made of a fundamental tone and overtones, the fundamental and its harmonics come together to form one waveform. The square wave on this screen has ω₀ = 2, so its period is π.

Observef(t) = a₀ + Σ [aₖ cos(kω₀t) + bₖ sin(kω₀t)]
A periodic signal is a constant plus a sum of harmonics.
Chooseω₀ = ?
The fundamental frequency is 2π over the period.
Fill inbₖ = ? (k odd)
The square wave sine coefficient is 4/kπ.
On your ownharmonics at ?
Harmonics are integer multiples of the fundamental frequency.

More terms, a closer fit

A partial sum is an approximation that adds only the first few harmonics. Adding terms lets the higher-frequency harmonics fill in the steep changes, so the corners sharpen. A square wave has only odd harmonics, and the strength of the k-th is 4/kπ, smaller for higher frequencies; with 20 terms, harmonics up to the 39th are included. In a signal with a discontinuity, however, the overshoot near the jump does not go away as terms are added but stays at about 9% of the jump height: this is the Gibbs phenomenon.

The coefficients are the strengths of the harmonics

The number in front of each harmonic, the Fourier coefficient, decides how much of that harmonic goes into the mix. Seen through the even-odd decomposition (A4), a square wave is an odd function, so only sines appear and no cosines, and because it has half-wave symmetry the even harmonics are 0 as well. Lining up these coefficients in order of frequency gives the signal's spectrum, so one waveform in the time domain becomes a few bars in the frequency domain. That is the topic of the next unit.

Back to the first screen

With one term the partial sum was just one sine, far from the square wave. As odd harmonics were added, the corners steepened, the crests flattened and it came to resemble the square wave, while a small Gibbs ear that never disappears remained at each discontinuity. The bars below were the harmonic strengths 4/kπ, shorter at higher frequencies. This decomposition of a periodic signal into harmonics is the Fourier series, and the picture of those bars standing on a frequency axis is the spectrum.

The Fourier series writes a signal of period T as a sum of harmonics at integer multiples of the fundamental frequency ω₀ = 2π/T: f(t) = a₀ + Σ [aₖ cos(kω₀t) + bₖ sin(kω₀t)], where the Fourier coefficients aₖ, bₖ are the strengths of the harmonics. A square wave is an odd function, so only sines remain, bₖ = 4/kπ (k odd), and the even harmonics are 0. More terms bring the partial sum closer, but at a discontinuity an overshoot of about 9% of the jump (the Gibbs phenomenon) remains.
On to the next unit

Now that each harmonic has been seen to have a strength, it is time to draw those strengths themselves. In the next unit, the spectrum, the magnitude of each harmonic is stood up as a bar on a frequency axis instead of a waveform on a time axis, and the square wave then appears as a few bars standing only at odd multiples of the frequency. Seeing the same signal in time or in frequency, two pictures that form a pair: that is where the heart of Fourier opens up.