Fourier Series: Circles That Draw Anything
Two hundred spinning circles, each riding on the rim of the one before, draw π. We build up to it from a single circle (two sine waves at once), Ptolemy's epicycles, the square wave made from odd harmonics, Joseph Fourier's bold claim, and the overshoot that never goes away at a jump (the Gibbs phenomenon). Then the averaging trick that finds the circles for any drawing, how you can hear them as harmonics, why last episode's Lissajous curve needs exactly four, and where the same idea lives in JPEG photos, MP3 music and MRI scans.
Chapters
- 0:00 Intro
- 0:40 One circle, two waves
- 1:18 Circles on circles
- 1:59 Adding waves
- 2:38 Fourier's bold claim
- 3:16 What can go wrong: the overshoot
- 3:50 From waves to drawings
- 4:22 Finding the circles
- 4:57 Building π
- 5:25 Hearing the circles
- 6:09 Last episode, in circles
- 6:32 Where you'll meet it
- 7:01 Draw it yourself
- 7:32 Recap and next
Cheat sheet
- A circle at steady speed = a sine wave (height) and a cosine (sideways), a quarter turn out of step
- Square wave = (4/π)(sin t + sin 3t/3 + sin 5t/5 + …): odd harmonics only
- At a jump, the sum overshoots by about 9% of the jump, however many terms (Gibbs)
- A closed drawing = a sum of spinning arrows z(t) = Σ c_k e^(ikt), speeds k = …, −2, −1, 0, 1, 2, …
- Find c_k: turn the drawing back k times per lap and average (a Fourier transform)
- x = sin 3t, y = sin 2t: exactly 4 circles, all radius 0.5, speeds ±2 and ±3
Sources
- Fourier, MacTutor
- Gibbs phenomenon
- Ptolemy, MacTutor
- How we hear, NIDCD
- JPEG standard (ITU-T T.81)
- MDCT (MP3, AAC)
- MRI k-space
Transcript
This drawing is made of nothing but spinning circles. Each one turns at its own steady speed, and each one rides on the rim of the one before. Two hundred of them, added together, draw π. And last episode's curve? It takes exactly four.
By the end of this video, you'll know how to find the circles for any drawing, and why the same idea is at work every time you open a JPEG photo or play an MP3.
This is Just Known. From unknown, to known. Beauty of Math, episode two: Fourier series, circles that draw anything. Start with one circle, and a point going round it at a steady speed. Watch its height: up, down, and up again.
Plot that height over time, and you get a sine wave, the pure tone from the last episode. Its sideways position does the same thing, just a quarter of a turn out of step: a cosine. So a spinning circle is really two sine waves at once, one for each direction. It's the simplest thing that repeats. A bigger circle makes a taller wave, and a faster circle makes a faster one.
Size, speed, and where it starts: that's all a circle has. Now put a second, smaller circle on the rim of the first, spinning faster, and follow a point on the small one. The path loops and curls. Add a third, and it gets stranger still. Circles riding on circles are called epicycles, and they're ancient.
Around the year one hundred and fifty, the astronomer Ptolemy used them to predict the paths of the planets across the sky, including the weeks or months when a planet seems to drift backwards. His model put the Earth at the center, which was wrong, but its circles were used for well over a thousand years. Even Copernicus, whose book put the Sun in the middle in fifteen forty-three, still needed circles riding on circles to make his predictions work. Here's the key idea, in one direction first. Take a sine wave.
Add another one, a third as tall and three times as fast. Then one a fifth as tall, five times as fast. Keep going with the odd numbers, and the sum gets flatter on top and steeper at the sides, until it looks like a square wave: on, off, on, off. Smooth curves, added together, building something with sharp corners. Why only the odd ones?
A square wave looks exactly the same if you shift it by half a cycle and flip it upside down. The odd waves share that symmetry, and the even ones don't, so the even ones always come out zero. In eighteen oh seven, the French mathematician Joseph Fourier made a bold claim while studying how heat spreads through solid objects: almost any repeating shape can be built from sine waves, if you pick the right sizes, speeds and starting points. Some of the greatest mathematicians of his day, including Lagrange, doubted it. It took over twenty years for the first proof, for well-behaved shapes.
The ones we draw are well-behaved, so it works. A recipe of waves like this is called a Fourier series. His book on it, The Analytical Theory of Heat, came out in eighteen twenty-two, and the idea has spread through physics and engineering ever since. But look closely at the jumps. However many waves you add, the sum overshoots right next to each jump, by about nine percent of the jump.
More waves make the overshoot narrower, but it never shrinks below that. It's called the Gibbs phenomenon, after the American physicist Josiah Willard Gibbs, who described it in eighteen ninety-nine, although an English mathematician, Henry Wilbraham, had spotted it fifty years earlier. Drawings get ripples too, near sharp turns. But a pen never jumps, so there, the ripples do fade as you add more circles. Now back to the circles.
A drawing is a point moving around a closed path, sideways and up and down at once. So instead of waves that only go up and down, we use whole circles: arrows that spin. Each arrow has a size, a starting angle, and a speed: one turn per lap, two turns, three, and the same speeds spinning backwards. Put them end to end, and the tip of the last arrow traces the drawing. And speed zero, an arrow that never turns, simply says where the drawing sits.
How do you find the right circles? For each speed, watch the drawing while spinning yourself backwards at that same speed, and average where the pen is. Everything that doesn't match your speed keeps going round, and averages out to nothing. What survives is exactly the circle for that speed: its size, and its starting angle. That averaging is a Fourier transform.
In symbols: multiply every point by a backwards turn, e to the minus i k t, and take the average. Do it for every speed, sort the circles from biggest to smallest, and start adding them up. Here's π, sampled as a thousand and twenty-four points along one pen stroke. One circle gives a plain circle. Three circles: a lumpy loop.
Eight, and you can almost guess it. Twenty: it's π. And with two hundred, every curl is there. The biggest circles carry the overall shape. The tiny, fast ones add the fine detail and the sharp turns.
You can even hear these circles. Trace the π drawing two hundred and twenty times a second, and send its sideways motion to your left speaker and its up and down motion to your right. One circle sounds like a pure tone. Every circle you add plays at a whole-number multiple of that first frequency, a harmonic, and the sound grows richer. That's this episode's Short.
It's also a big part of why a violin and a flute playing the same note sound different: same first frequency, different recipe of harmonics. And your ear does a rough version of this sorting all by itself. Inside the cochlea, different spots respond to different pitches, so by the time a sound reaches your brain, it's already roughly sorted by frequency. And last episode's Lissajous curve? Sideways, sine of three t.
Up and down, sine of two t. Run it through the same averaging, and only four circles come out, all exactly the same size: two spinning at speed three, one each way, and two at speed two. Every other circle is exactly zero. Smooth, simple shapes need few circles. Sharp corners need many.
Your phone does this all day. A JPEG photo is cut into eight by eight blocks, and each block is stored as a recipe of cosine waves, a close cousin of Fourier's sines. The fine details your eye barely notices get rounded away, and the file shrinks. MP3 and AAC music do much the same with sound. And an MRI scanner never takes a picture at all.
It measures the waves that make up a slice of your body, and a computer adds them back up into an image. Here's the whole idea in about a dozen lines of code. For each speed k, go through the points in order. Turn each one backwards, a little more each time, so the whole lap turns back k times. Then take the average.
The length of the result is the circle's size, and its angle is where the circle starts. Then sort the circles by size. To draw, add up the arrows at each moment, and follow the last tip. Try it with your own drawing: trace any closed shape as a list of points, and watch the circles find it. The code is in the description.
Let's recap. A spinning circle is two sine waves at once. Put circles on circles, and their tip can trace almost any closed drawing. The right circles exist, as Fourier claimed, and a simple averaging trick finds them. Smooth shapes need few circles, and sharp corners need many.
And wherever there's a sudden jump, a little overshoot never quite goes away. Next time, we stay on the circle. Write the numbers around it, join each one to its double, and a heart appears out of nowhere. This is Just Known. From unknown, to known.
Note: every curve on screen is computed from its math. Pictures marked "illustration" (Ptolemy's planets, the heat plate, the violin and flute spectra, the cochlea, the MP3 and MRI panels) are schematic.
Narration voice generated with Google Gemini text-to-speech.
