FOURIER SERIES SIMULATION

Add enough sine waves and you can draw a closed heart. Each harmonic is a gear turning at a steady rate, its radius the amplitude and its speed an integer multiple of the fundamental frequency; chain the gears together and the pen on the last link traces out the target waveform. A square wave needs only the odd harmonics with amplitude 4/(πk), while a triangle wave has coefficients falling as 1/k², so a handful of gears already fits. At a jump discontinuity, though, an overshoot of about 9% refuses to fade no matter how many terms are added: the Gibbs phenomenon.

▸ Initializing Fourier coefficients a₀, a_k, b_k…
▸ Building the chain of rotating epicycles
▸ Attaching frequency kω & amplitude A_k = √(a_k²+b_k²)
▸ Placing the pen at the tip of the last circle
▸ Enabling the approximation trace & stacking harmonics…
▸ Ready — Online. ✅
0%
⌂ Mathematics

Simulation room Fourier series

Fourier Series · Epicycles
Online
rotating epicycles · harmonics · partial sum
Epicycles & approximation
🌀 Fourier series
amplitude spectrum A_k by order k
Epicycle count (N)—
Fundamental frequency ω—
Rotation angle θ—
Approximation error (RMS)—
Target waveform—
Tip
Each rotating circle = one Fourier term (frequency kω, radius = amplitude). Stacked head-to-tail → the pen at the tip draws the shape. The more epicycles, the closer the trace matches the real function.
—
Drag Epicycle count to add/remove harmonics · Speed adjusts the spin rate · switch the Scenario (square · sawtooth · triangle · circle · pulse · heart)
Your browser has canvas disabled.
Pen value over time (approximation vs. true function) Fourier approx.true function
About Fourier / Epicycles

Add enough sine waves and you can draw a closed heart. Each harmonic is a gear turning at a steady rate, its radius the amplitude and its speed an integer multiple of the fundamental frequency; chain the gears together and the pen on the last link traces out the target waveform. A square wave needs only the odd harmonics with amplitude 4/(πk), while a triangle wave has coefficients falling as 1/k², so a handful of gears already fits. At a jump discontinuity, though, an overshoot of about 9% refuses to fade no matter how many terms are added: the Gibbs phenomenon.

Related topics in Mathematics