Skip to content

Appendix B · optional

The un-adding machine

Chapter 16 promised that every wave is secretly a stack of sines. This is the machinery that un-stacks one: the Fourier transform, told in pictures. Safe to skip; come back the day you wonder how the spectrogram knew.

Chapter 16 made a bold promise: every repeating wave, no matter how lumpy, is a stack of plain sine waves. Then it quietly skipped the best part. It showed you recipe cards without ever saying how anyone reads one off a wave. The spectrogram filmed recipes as if that were nothing. A later chapter confessed that a Wi-Fi chip runs "the recipe math backward" tens of thousands of times a second. And your own ear splits a chord into notes every waking moment. All of it hangs on one question this appendix finally answers: how do you un-add a wave?

Adding was the easy direction; heights simply add, and chapter 4 was done in an afternoon. But un-adding looks impossible on its face. Once the ingredients have melted into one lumpy line, there is nothing left to grab: no seams, no labels, just wiggle. And yet the machine exists, and its whole secret fits in a sentence. To find out whether a wave contains an ingredient, multiply the wave by a clean copy of that ingredient, and take the average. That sentence is the Fourier transform. The rest of this appendix is just watching it work. (The bare act of multiplying two waves is a small marvel in itself, with a playground of its own in Appendix C.)

As always in the appendices: pictures only, nothing to memorize, and nothing later in the book leans on it. It does borrow one friend, though. The second half is sweeter if you've met Appendix A's spinning arrow; the first half needs nothing at all.

A detector for one ingredient#

Suppose you're handed a mystery wave and you suspect it contains a sine that wiggles, say, two times across the window. Here is the whole of it. Make your own clean sine at exactly that speed; call it the probe. Multiply the mystery wave by the probe, point by point, moment by moment. Then average everything you got.

Why would that find anything? Watch what multiplying does. Wherever the mystery wave and the probe are both up, up times up is up: the product is positive. Wherever both are down, a negative times a negative is positive again. So if the probe is in step with a real ingredient, they agree everywhere, the product spends its life above the line, and the average comes out big. But if the wave holds nothing at the probe's speed, the two drift in and out of step, the product flips above and below the line in equal measure, and the average washes out to nothing.

You have met this shape of idea before, wearing overalls. Chapter 14's tuner was a swing that gathers energy only from pushes at its own rhythm; every other rhythm cancels itself out. Multiply-and-average is that same resonance, performed with arithmetic instead of a playground swing. Try it: sweep the probe below and hunt for the mystery wave's ingredients.

the mystery wave (ink) · your clean probe sine (blue)multiply them, point by point: agreement above the line, disagreement belowthe average, at every probe speed: the detector’s dial1234567probe speed (wiggles per window) →
Probe speed 3.50 wiggles

No ingredient at this speed. The product spends as much time below the line as above it, and the average washes out.

A wave with a secret recipe, probed one speed at a time. Where the probe matches nothing, the amber product balances and the average reads zero. Slide it to two wiggles per window, then five: the dial spikes, and the secret is out.

Notice what the detector reads when it does find something. The spike at two is tall; the spike at five is smaller. That is not just "yes and yes"; it is this much and that much. The detector doesn't merely find an ingredient, it measures it. And that means the bottom panel, the dial swept across every speed, is something you've seen before: chapter 16's recipe card, being read straight off the wave.

The wrinkle: a wave that slipped#

Time to confess a flaw. It worked because the probe's peaks landed on the ingredient's peaks. But who promised they would? An ingredient can wiggle at exactly the probe's speed and still start a little late, chapter 1's third knob, the phase. Slide it a quarter-wiggle and its peaks land on the probe's zero-crossings; multiply and average, and you get exactly nothing. The ingredient is right there, plain as day, and our sine probe is blind to it.

Appendix A left the fix sitting on the table. A sine, it said, is one shadow of a spinning arrow, and a probe that is only a shadow can be fooled by a wave that slipped sideways. So probe with the whole spinning arrow instead. The picture for it is lovely. Take the flat wave and wind it around a circle, one lap of the circle for every wiggle of the probe: where the wave is tall, draw far from the center; where it dips, draw close in. The wound-up curve is the wave as a spinning arrow sees it.

Now watch the middle of the picture. Wind at the wrong pace and the wave's crests land all around the circle, a tidy flower, perfectly balanced, so the curve's center of mass sits at home in the middle. Wind at exactly the ingredient's pace and every crest comes around to the same side. The flower goes lopsided, and the center of mass is dragged off center. And this detector cannot be fooled: slide the wave and the bulge simply rotates around the circle, dragging the dot with it. Its distance from center still says how much of the ingredient is there. Its direction now says where the wave starts. One probe, and it reads both knobs at once.

the wave, wound around a circlethe same wave, laid out flat (the gray dot is its first moment)what the amber dot reads:amount ≈ 1.00 · start ≈ 0°
Winding pace 3.00 turns
Slide the wave (its start)

Wound at the wave’s own pace, every crest lands on the same side of the circle. The dot is dragged off center: its distance is the amount, its direction is the start.

The spinning-arrow probe. Wind at the wave's own pace (three turns) and the amber dot is dragged off center: its distance is the amount, its direction is the start. Now slide the wave. The plain probe above would have gone blind; the dot just swings around, still reading both numbers.

Every speed, one machine#

That's the whole machine. Now run it at every speed: wind at half a turn per window, one turn, one and a half, two, on and up, and at each pace write down the arrow the dot hands you, a length and an angle. When you're done, that list of arrows is the recipe: which sines, how much of each, each one starting where. Add those ingredients back up and the original wave reappears, exact, any time you like. This list-making is what mathematicians call the Fourier transform: transform because it turns a wave into its recipe, and, run the other way, a recipe back into its wave.

And it has been hiding all through this book. The spectrogram of chapter 16 is this machine run on a short slice of sound, over and over, each slice painting one thin column of the film. The mixer inside chapter 14's receiver is this same move with a single probe: multiply the crowded air by one clean wave the radio makes itself, and one chosen station steps forward. Even your ear belongs to the family, though it refuses to do arithmetic: the cochlea is a ribbon of thousands of tiny resonators, a bank of littler and littler swings, each catching its own sliver of the recipe. Chips un-add with multiplication; your head un-adds with hardware.

The fast recipe#

One honest worry before we close: count the work. A thousand probe speeds against a thousand points of wave is a million multiplications, for one recipe card, and a spectrogram wants dozens of cards a second. For a long time that bill kept this beautiful idea mostly in textbooks. Then, in 1965, two mathematicians named Cooley and Tukey (retracing steps Gauss had penciled in a notebook 160 years earlier) noticed that the probes keep redoing each other's work. Wind a wave two turns and you have already done half the pointing you'd need for four turns; the laps overlap, and overlapping work can be shared. The bookkeeping that shares it is called the fast Fourier transform, the FFT, and it collapses the million-step job into a few thousand steps.

That shortcut is why the un-adding machine could leave the textbooks and move into your pocket. When "An orchestra of carriers" confessed that a single chip cooks up thousands of subcarriers by running the recipe math backward, tens of thousands of times every second, this is how it affords to. One elderly method, made suddenly cheap, quietly holding up Wi-Fi, phone calls, weather radar, and the waterfall display waiting for you in the epilogue.

The one thing to remember#

You never tear a wave apart. You ask it questions, one pure speed at a time: multiply, average. A miss reads zero. A hit drags the dot off center, and the dot's distance is the amount, its direction the start. Ask at every speed and the wave hands over its whole recipe. That is the Fourier transform: the un-adding machine, and the reason the spectrogram, the mixer, and the router's choir of carriers were never magic at all.