Fourier Series Animation

Building periodic functions from sinusoids — epicycles and spectrum

f(x) = a₀/2 + Σ [aₙcos(nx) + bₙsin(nx)]
The rotating arrows (epicycles) are Fourier harmonics. Each circle spins at an integer multiple of the base frequency. Their tip traces the reconstructed waveform on the right. Notice the Gibbs phenomenon — the ~9% overshoot at discontinuities that never vanishes, even with infinitely many terms. The bottom panel shows the frequency spectrum (coefficient magnitudes).