Pro 🔒~25 min

Fourier: Making Waves

Build any wave by adding sine components

How it works

Fourier's theorem states that any periodic function can be decomposed into a sum of sine and cosine waves of different frequencies and amplitudes. The fundamental frequency sets the pitch; harmonics add complexity. Square waves require infinitely many odd harmonics; more harmonics = sharper corners. This decomposition is foundational to signal processing, acoustics, and quantum mechanics.

Upgrade to Pro to access this experiment

Step-by-step

  1. Select a target wave shape (square, triangle, sawtooth).
  2. Add harmonics one by one to see how the composite wave approaches the target.
  3. The spectrum panel shows amplitude vs. frequency for each harmonic.

Key formulas

  • f(x)=n=1ansin(nx)+bncos(nx)f(x) = \sum_{n=1}^{\infty} a_n \sin(nx) + b_n \cos(nx)Fourier series
  • Square: an=4nπ (odd n only)\text{Square: } a_n = \frac{4}{n\pi} \text{ (odd n only)}Square wave coefficients

Frequently asked questions

Why does a square wave require odd harmonics only (1st, 3rd, 5th...)?
The symmetry of a square wave means even harmonics cancel out.
What happens to the approximation as you add more harmonics?
The waveform gets closer to the target — but never perfectly matches with finite terms.
How does Fourier analysis relate to the timbre of a musical instrument?
Different instruments have different harmonic profiles — same pitch, different Fourier coefficients.