Fourier Series Visualizer — Interactive Harmonic Decomposition

simulator intermediate ~8 min
Loading simulation...
5 harmonics — Fourier approximation of a square wave using the first 5 odd sine terms

A square wave can be approximated by summing odd harmonics: sin(x) + sin(3x)/3 + sin(5x)/5 + ... More terms yield a closer approximation.

Formula

f(x) = a0/2 + sum(n=1..N) [an*cos(nx) + bn*sin(nx)]
Square wave: f(x) = (4/pi) * sum(k=0..N) sin((2k+1)x) / (2k+1)

From Heat to Harmony

Joseph Fourier's 1822 insight was radical: any periodic function, no matter how jagged, can be represented as a sum of smooth sine waves. He developed this theory to solve the heat equation, but it became one of the most powerful tools in all of mathematics. Today, Fourier analysis underpins everything from MRI scanners to streaming music.

Building Waves from Circles

Each term in a Fourier series corresponds to a rotating circle (epicycle) with a specific radius and frequency. When you chain these circles together, the tip of the last one traces the target waveform. Adding more circles (harmonics) produces a more accurate approximation. This simulation shows both the epicycle mechanism and the resulting waveform.

The Gibbs Phenomenon

No matter how many Fourier terms you add, the approximation of a discontinuous function (like a square wave) always overshoots by about 9% at the jump. This Gibbs phenomenon is a fundamental property of Fourier convergence at discontinuities. The ringing narrows but never disappears — a deep result about the nature of function approximation.

Modern Applications

The Fast Fourier Transform (FFT) algorithm, developed by Cooley and Tukey in 1965, made Fourier analysis computationally practical. It reduces the complexity from O(N squared) to O(N log N), enabling real-time audio processing, image compression, and spectral analysis. Every digital device you own relies on FFT thousands of times per second.

FAQ

What is a Fourier series?

A Fourier series represents any periodic function as a sum of sines and cosines at integer multiples of a fundamental frequency. Joseph Fourier proved in 1822 that virtually any periodic signal can be decomposed this way, revolutionizing mathematics and physics.

What is the Gibbs phenomenon?

At points of discontinuity (like the corners of a square wave), the Fourier series always overshoots by about 9%, no matter how many terms you include. This ringing effect was first described by Henry Wilbraham in 1848 and rediscovered by J. Willard Gibbs in 1899.

What are epicycles in Fourier analysis?

Each Fourier term can be visualized as a rotating circle (epicycle). The sum of all these rotations traces out the target waveform. This is the same principle ancient astronomers used to model planetary orbits — circles upon circles.

Where are Fourier series used in practice?

Fourier analysis is fundamental to signal processing, audio compression (MP3), image processing (JPEG), telecommunications, quantum mechanics, and heat transfer analysis. It is one of the most widely applied mathematical tools in engineering.

Sources

Embed

<iframe src="https://homo-deus.com/lab/mathematics/fourier-series/embed" width="100%" height="400" frameborder="0"></iframe>