FísicaEterna
← Back to Concepts
AnalysisAdvanced

Fourier: a corner built from nothing but curves

A square wave has perfect corners and vertical jumps. You can build it by adding up sines, which have no corners anywhere at all.

What you are looking at

  1. The dashed line is the wave we are after. The gold one is the sum, and at first it looks nothing like it.
  2. Behind it, faintly, are the individual harmonics: every one a smooth curve, without a single corner. The corner is what is left when they cancel each other out.
  3. Watch the edges of the jump: the little ears never disappear, however many terms you add. They only get narrower.

01An idea of outrageous ambition

Fourier claimed something his contemporaries found excessive: any periodic signal, however strange, is a sum of sines and cosines. With corners or without. You only have to find the right amplitudes.

For a square wave the recipe turns out to be surprisingly clean: you add the odd harmonics — the first, the third, the fifth — each with amplitude 1/k. The even ones are exactly zero.

02How a corner appears

With a single term the sum is a sine and looks like nothing. With three, a step starts to show. With twenty-five it is hard to believe there is not one straight line in the whole drawing.

The faint harmonics behind are the key: each is a smooth curve. What produces the vertical edge is none of them, but how they cancel each other in some places and reinforce in others.

03The ears that never leave

Look at the edges of the jump. That overshoot is not a flaw in the animation nor a rounding error: it is the Gibbs phenomenon.

And the remarkable part is that it does not shrink. However many terms you add, the overshoot stays at around 9 % of the jump; all that happens is that it gets narrower.

Put precisely: the series converges to the square wave at every point, but never uniformly. It is the kind of detail that sounds pedantic until it bites you in a real digital filter.

(4/π) · Σ sin(k x) / k, k oddThe square wave as an infinite sum of odd harmonics

Where this is used

The JPEG in your photos

It breaks each block of the image into frequencies and throws away the ones the eye will not miss. Compression is, literally, deciding which harmonics you can lose.

MP3 and all digital audio

Same principle with sound. And the equaliser in your music app moves exactly these components: boosting the bass means amplifying certain terms of the sum.

An MRI scan

The machine does not measure an image: it measures frequencies. The picture the doctor sees is a Fourier transform applied to what the antennas recorded.

A guitar tuner

To know which note you played it has to split the sound into its frequencies and keep the dominant one. It does this a thousand times a second, on your phone.

Explaining it to a child

The idea, in plain wordsMany round, smooth things added together carefully can build something with sharp points. Like when many different voices sing together and a sound appears that none of them made alone.

Try it together
  1. Have them draw a gentle wavy line on paper, like rolling hills. Then a smaller, tighter one on top of the first.
  2. Have them add the two heights at each point and draw the result. It will be more angular than either one.
  3. With a guitar or a piano: play a single string, then several together. The sound of several is like none of them, yet it is the sum of them all.

The question to leave them withIf adding curves can make a sharp point, could you draw anything at all by adding enough curves?

For the classroom

Ten minutes with the animation, ready to take into a room. Free under CC BY 4.0, like everything else here.

Who it is for

From age 16. Needs prior work on waves; it is the natural ending of that unit.

What they will be able to do afterwards

The student explains what decomposing a signal means, and why that makes compression possible.

The activity
  1. Play two different notes at once on any keyboard or tone app. The class hears ONE thing.
  2. Ask: "how many sounds are there?" Argue about it. The air carries a single wave; the ear separates two.
  3. Play the animation: it is that separation, made explicit. Each component with its frequency and its weight.
  4. Close with the leap: if you know how much each component weighs, you can throw away the ones that barely weigh anything. That is an MP3 and that is a JPEG.
Exit questions
  1. What is an MP3 throwing away when it compresses?

    Answer: The components the ear will not miss: the very high ones, and those masked by louder neighbours. It does not trim the file at random; it trims in frequency space.

  2. Why does a heavily compressed image look "blocky"?

    Answer: Because a JPEG decomposes the image into blocks and discards each one's fine-detail components. Discard too many and what is left is the block.

  3. An MRI does not measure an image: it measures frequencies. So how does the image appear?

    Answer: It is reconstructed by running the operation backwards: from the measured frequencies you build the spatial map. The machine never "sees" anything, it computes.

Watch out for this

It is hard to accept that two simultaneous notes are a single wave in the air. If someone resists, show them the graph of the summed signal: it is one curve, and yet the ear pulls two out of it. That is when decomposition stops being a metaphor.

FísicaEterna classroom guide · CC BY 4.0 · fisicaeterna.cl

Take it with you

The animation is yours to use: in a class, in a video, in a course. Just credit the source.

Embed it on your site

Copy this code and paste it wherever you want it to appear.

The code behind it

It is written in Remotion, which renders video by writing React. The bar and the number are not drawn next to the figure: they come out of the calculation on the same geometry you are watching. If the drawing lies, the number lies with it.

Fourier.tsx · Remotion

Licence

This animation is under CC BY 4.0: you may copy, redistribute, adapt and use it commercially, as long as you credit the source.

Suggested attributionFourier: a corner built from nothing but curves — FísicaEterna (fisicaeterna.cl), CC BY 4.0

CC BY 4.0