Mathematics / The Fourier transform

The Fourier transform

How a wiggly signal turns out to be a few pure sine waves added together, and how the Fourier transform finds them. One signal, three waves, seven steps.

Intermediate7 steps~7 min
Signal — the wiggly line we want to take apart
Sine wave — a pure wave: one frequency, one height
Spectrum bar — how much of one frequency is present
// THE SHORT VERSION

In 30 seconds

Any signal, such as a second of sound, can be written as a sum of sine waves of different frequencies and heights.

The Fourier transform finds that recipe. It tests the signal against each frequency in turn and reports how much of it is present. The result is the spectrum: a chart of strength against frequency.

The signal over time and its spectrum hold the same information, so you can work in whichever is easier. Equalisers, MP3 and JPEG all work on the frequency view.

The Fourier transform, step by step

STEPS01 / 07

Simplified: the real transform tests each frequency with a sine and a cosine together (a complex exponential), so it also records where in its cycle each wave starts (its phase).

STEP 01 / 07 A signal over time
THE MATH
x(t) = height of the signal at time t
  1. Step 1: A signal over time. A recorded sound, a heartbeat trace or a row of pixels is a signal: one value at each moment. Plotted against time it is a wiggly line. This view is called the time domain, and it hides a simple structure.
  2. Step 2: The building block: a sine. A sine wave is the purest wiggle there is. Two numbers describe it: its amplitude (how high it swings) and its frequency (how many full cycles it makes each second, in hertz). This one swings to 2 and repeats 3 times a second.
  3. Step 3: Add sines, get the signal. Stack three sines of 1, 3 and 6 Hz and add their heights at every instant. At t = 0.25 s they stand at +3, −2 and 0, so the sum is 1. Do that everywhere and the wiggly signal from step 1 appears. Fourier’s claim: any reasonable signal can be built this way.
  4. Step 4: Test for one frequency. Going backwards is the transform. Multiply the signal by a test sine and average the result. If the signal contains that frequency the product stays mostly positive: at 3 Hz the average is 1, half the hidden height of 2. At 4 Hz the positive and negative parts cancel to 0.
  5. Step 5: The spectrum. Run that test for every frequency and plot the answers: one bar per frequency, as tall as that wave’s amplitude. This chart is the spectrum, the signal seen in the frequency domain. Three bars now say everything the wiggly line said.
  6. Step 6: Edit, then transform back. Nothing is lost between the two views: the inverse transform adds the sines back up and returns the signal exactly. That makes the spectrum a workbench. Delete the 6 Hz bar, transform back, and the fast ripple is gone while the rest is untouched.
  7. Step 7: Where it is used. An equaliser boosts or cuts bars of a sound’s spectrum. JPEG and MP3 use close relatives of the Fourier transform (cosine transforms) to describe small blocks of picture or sound by frequency, then store the weak, barely noticeable parts coarsely or not at all.
VALUES SO FAR
A····term
f····term
1 Hz····part
3 Hz····part
6 Hz····part
avg 3 Hz····test
avg 4 Hz····test
spectrum····result
filtered····result

Spotted a mistake on this page?