Math Methods · Learn
Any periodic signal — even a hard-cornered square wave — is secretly a sum of pure sine waves. Here's why that works, how to find the amounts, and why sharp edges never quite behave.
A function with period $2L$ can be written as a sum of sines and cosines whose frequencies are integer multiples of the fundamental:
The lowest frequency is the fundamental; the higher terms are harmonics that fill in the fine detail.
The trick that makes it all work: sines and cosines of different integer frequencies are orthogonal — multiply two different ones and integrate over a period and you get zero. So each coefficient can be read off independently by projecting $f$ onto that harmonic:
Odd functions ($f(-x)=-f(x)$) contain only sines; even functions only cosines; a general signal needs both. This same choice reappears in PDEs: sine series match fixed (Dirichlet) ends, cosine series match insulated (Neumann) ends.
How fast the series converges depends on smoothness. A smooth function's coefficients fall like $1/n^2$ — a few terms nail it. A function with jumps falls only like $1/n$, and near each jump the partial sum overshoots by about 9% no matter how many terms you add. The spike narrows but never shrinks — the Gibbs phenomenon.
Build a square wave term by term and watch the Gibbs overshoot refuse to die; switch to a triangle and see $1/n^2$ convergence nail it in a handful of terms. Open the lab →
Using complex exponentials, $f(x)=\sum_n c_n e^{in\pi x/L}$, each term is a vector rotating at frequency $n$. Stack them tip-to-tail and the chain's end traces the signal — the "epicycle" view in the lab. It's the same mathematics behind an FM radio, an MRI, and JPEG compression.
Bjorn Poonen's free MIT 18.03 lecture notes (PDF) cover Fourier series in §26, and §27.2 shows how to solve $x''+x=f(t)$ when the forcing $f(t)$ is itself given as a Fourier series — superpose the periodic solution for each harmonic. Try it live in the Auto-Tuner lab.
EngineeringCandy · Learn · the theory behind the playground