Fourier Series: Building Signals from Simple Waves

See how sine and cosine waves combine to approximate complex periodic signals, then experiment with an interactive Fourier Lab.

By Rishipal Singh · · 8 min read

A square-like signal emerges as sine-wave harmonics are added together.
Visual guide: A square-like signal emerges as sine-wave harmonics are added together.

A musical note, a sensor reading, and a repeating animation may look complicated when drawn as one curve. Fourier's key idea is that many periodic signals can be described as a weighted sum of simple sine and cosine waves called harmonics.

From one wave to a sum

The fundamental frequency completes one cycle in the signal's period. Its harmonics complete two, three, or more cycles in that same period. A Fourier series assigns each harmonic a coefficient that says how much of that frequency is present, plus a constant term for the signal's average value.

For example, an ideal symmetric square wave can be approximated by adding odd sine harmonics: the fundamental, then the third harmonic at one-third amplitude, the fifth at one-fifth, and so on. Adding terms makes the flat sections and sharp transitions more recognizable.

Read the spectrum

A time-domain plot shows a signal changing over time. A frequency spectrum instead shows which frequencies contribute and how strongly. A single smooth sine wave has one dominant frequency; a sharper shape needs more high-frequency components. This view is useful in audio, communications, image processing, and scientific measurement.

Approximation has limits

A finite number of harmonics cannot reproduce a discontinuity perfectly. Near a sharp jump, the approximation overshoots; this is called the Gibbs phenomenon. More harmonics make the overshoot narrower, but it does not disappear entirely. Real digital signals are also sampled, so sampling rate and the Nyquist limit matter: frequencies above half the sample rate cannot be represented reliably.

Try changing the waveform and the number of harmonics below. Watch both the reconstructed curve and its spectrum; the controls make the relationship between a signal's shape and its frequency ingredients easier to see.

Practice: predict the next harmonic

A square wave's Fourier series uses odd harmonics. After the fundamental frequency, which frequency appears next, and how does its amplitude compare?

Reveal the explanation

The next term is the third harmonic, with one-third the fundamental's amplitude. The fifth harmonic follows at one-fifth; even harmonics are absent for an ideal symmetric square wave.

Interactive Fourier Lab

Choose a waveform, change its harmonics, and watch the reconstruction and spectrum update.

Open the activity in a new tab