Fourier Series
Add harmonics one at a time and watch a square wave appear — including the overshoot that never goes away.
Skip to the animationAny periodic signal is a sum of sinusoids at integer multiples of its fundamental — exactly, not approximately — and the resulting line spectrum is the more useful description because an LTI system scales each harmonic independently.
Building a square wave
Start with the fundamental: right period, wrong shape. Add the third harmonic at amplitude 1/3, then the fifth, seventh and ninth. The corners sharpen and the tops flatten, and the series converges.
Only odd harmonics appear because a square wave is half-wave symmetric — its second half is the negative of its first — and no even harmonic can produce that. Symmetry always restricts which coefficients can be non-zero, which is worth checking before computing any.
| Signal has | Consequence |
|---|---|
| Even symmetry | Only cosine terms (bₙ = 0) |
| Odd symmetry | Only sine terms (aₙ = 0) |
| Half-wave symmetry | Only odd harmonics |
| Non-zero mean | a₀ ≠ 0 — the DC term |
Convergence, and its rate
Amplitudes fall as 1/n for a square wave, so it converges slowly. The rate is set by the signal's smoothness: a discontinuity costs 1/n, a corner 1/n², and a smooth periodic signal converges exponentially.
Sharpness is therefore expensive in harmonics — which is a statement about bandwidth, and the reason a square wave needs far more of it than a sine of the same frequency.
Gibbs phenomenon
Near a discontinuity the partial sum overshoots by about 9%, and adding harmonics does not reduce it — it only makes the overshoot *narrower*.
The energy in the overshoot goes to zero, so the series does converge in the sense that matters. It is also why sharply filtered audio and images ring at their edges — the same effect, met again as an engineering artefact.
Three forms
- Trigonometric —
a₀ + Σ(aₙcos + bₙsin). Real, and clumsy. - Amplitude-phase —
a₀ + ΣCₙcos(nω₀t + φₙ). What a spectrum analyser displays. - Complex exponential —
Σ cₙ·e^(jnω₀t). One term, negativenallowed, and the one that generalises.
Negative frequencies are bookkeeping: each real sinusoid is a conjugate pair at ±nω₀. Nothing physical oscillates backwards, and the symmetry is what makes the complex form compact.
Why the spectrum is the better picture
The waveform and the line spectrum carry identical information. The spectrum is more useful because a sinusoid is an eigenfunction: an LTI system scales each harmonic independently, so filtering — convolution in time — becomes multiplication component by component.
As the period grows, harmonic spacing ω₀ = 2π/T shrinks and the lines crowd together. In the limit T → ∞ the signal stops repeating and the discrete series becomes a continuous integral: the Fourier transform. Periodic signals have line spectra, aperiodic ones have continuous spectra, and it is one idea taken to a limit.
The numbers you will be asked for
- Complex form
x(t) = Σ cₙ·e^(jnω₀t)
Sum over all integers n, positive and negative.
- Coefficients
cₙ = (1/T)∫ x(t)·e^(−jnω₀t) dt
Over any one period.
- Square wave
cₙ ∝ 1/n, odd n only
Slow convergence, from the discontinuity.
- Parseval
average power = Σ |cₙ|²
Power splits between harmonics with no cross terms.
- Fundamental
ω₀ = 2π/T
Harmonic spacing — it vanishes as T → ∞.
Advantages and disadvantages
Advantages
- Exact for any periodic signal meeting the Dirichlet conditions.
- Turns filtering into multiplication, harmonic by harmonic.
- Symmetry rules eliminate whole families of coefficients before any integration.
- Parseval splits power between harmonics with no cross terms.
Disadvantages
- Applies only to periodic signals — aperiodic ones need the transform.
- Converges slowly for signals with discontinuities.
- Gibbs overshoot never disappears, however many terms are taken.
- Says nothing about how a signal evolves — time information is entirely lost.
Watch it work
Check yourself
question 1 / 4
One question at a time. Pick an answer to see why it is right or wrong, then move on — there is no score to keep and nothing is saved.