This is the Fourier Transform. You can thank it for providing the music you stream every day, squeezing down the images you see on the Internet into tiny little JPG files, and even powering your noise-canceling headphones. Hereās how it works.

The equation owes its power to the way that it lets mathematicians quickly understand the frequency content of any kind of signal. Itās quite a feat. But donāt just take my word for itāin 1867, the physicist Lord Kelvin expressed his undying love for this fine piece of mathematics, too. He wrote, āFourierās theorem is not only one of the most beautiful results of modern analysis, but it may be said to furnish an indispensable instrument in the treatment of nearly every recondite question in modern physics.ā And so it remains.

### Math Will Tear Us Apart

The Fourier transform wasāperhaps unsurprisinglyādeveloped by the mathematician Baron Jean-Baptiste-Joseph Fourier and published in his 1822 book, *The Analytical Theory of Heat*. The Baron was interested in the way heat flowed inside and around materials, and in the process of studying this phenomenon he derived his transform. At the time, he wouldnāt have realized just how important a contribution he was makingānot just to math and physics, but science, engineering and technology as a whole.

His major breakthrough was realizing that complicated signals could be represented by simply adding up a series of far simpler ones. He chose to do it by adding together sinusoidsāthose oscillating waves you learned about in high school that wander between peak and trough with predictable regularity. Say you strike a chord on a piano, pressing three keys. You produce three different notes, all with well defined frequenciesāreferred to as pitches when weāre talking about audioāthat look like nice, friendly sine waves:

Advertisement

But add them together, and that pleasant sounding chord actually looks altogether more messy, like this:

It looks complicated, but we know that fundamentally itās just three plain sine waves staggered in time and added together. Fourierās brain wave was to realize that however complicated the final waveform is, it can always be represented as a combination of sinusoidsāeven if it means using an infinite number. The real genius of this realization for me is that if you can work out which sinusoids need to be added together to create the final waveform, you known exactly which frequencies of waves need to be added togetherāand in which quantitiesāto represent the signal. With that knowledge, you know the exact frequency content of your final signal.

Advertisement

Thatās what the equation at the top of the page does in one fell swoop. The *x(t)* term represents the big, complicated signal youāre trying to represent by simpler ones. The *e ^{ājĻ2ft}* term looks a little terrifying, but itās actually just shorthand that mathematicians use to represent those sinusoids weāve been talking about. The neat bit is that multiplying the two together and then wrapping them in an integralāthat curly line at the front and

*dt*term at the endāallows the equation to pick out each and every frequency component of sinuoids that are required to represent the signal. So the result of the equation,

*X(f),*provides the magnitude and time delay of each

*of the simple signals you need to add together.*

That is the Fourier transform: a function that explains exactly what frequencies lie in the original signal. That may sound trivial. It isnāt

### Transmission

Imagine youāre in the business of sending audio files over the Internet. You could just send the whole song down the pipe in the way the music label initially records themābut theyāre rather large that way. The reason for their size is that theyāre a full, loss-less recording: each and every frequency is preserved from recording, through mixing, to the final track. Take a Fourier Transform of a tiny snippet of a track, though, and youāll find that there are some frequency components that are incredibly dominant and others that barely register.

Advertisement

The MP3 file format does exactly thisābut it tosses to one side the barely perceptible frequency components to save space, as well as some of the ones at the upper end of our hearing range because we find it difficult to distinguish between them anyway. It does that all the way through the song, chopping it into millions of sections, determining the important frequency components, junking those that are unimportant, until itās done. Whatās left are just the most important frequenciesāor notesāthat can be played into your ears to (pretty accurately) represent the original track. Oh, and a file thatās less than a tenth of the size, too.

Itās also very similar to how Ogg Vorbis, the file type used by Spotify for the desktop client, works (actually, Vorbis uses a fast-as-lightning computational version of the Fourier transform called a discrete cosine transform, but itās broadly speaking the same idea.) Incidentally, Shazam uses these same transforms tooāit has a database of distinctive frequency content in songs that it pairs with what you play to it, because thatās more reliable than matching the actual audio recording to another. And while weāre talking about audio, your noise-cancelling headphones use Fourier transforms, too: a microphone records the ambient noise around you, measures the frequency content across the entire spectrum, and then flips the content to add sound into your audio mix that will cancel out the crying babies and road noise that surround you.

But Fourierās equation is not a one trick pony. So far Iāve only talked about time signals like audioābut he developed it in the first instance to help him solve problems relating to the flow of heat through materials. That means it also works in problems that are spatial. For Forueir that meant adding together simple types of 2D heat flows to represent far more complex ones. But in much the same way the Fourier transform can be used to build up digital images more efficiently than doing it pixel-by-pixel.

Advertisement

Loss-less image files have the color of each and every pixel defined separately. When you save one as a JPG, the entire image is split up into smaller chunks and the 2D Fourier transform of the block taken. That provides a description of the spatial frequencies of how color and brightness changes over this small patch of the image. Just like in the case of MP3, a JPG tosses aside some of the high-frequency components, which in the case of an image provide the sharp, crisp detail. For most of us, our eyes canāt really spot subtle differences in color anyway, so binning the frequency components that provide pixel-to-pixel variation barely even shows anyway. Obviously if you crank the compression up you start throwing lower and lower frequencies out, tooāand thatās when things can start to look a little blocky, as the color variations between the sub-blocks become more apparent.

For all but the best-trained eyes and ears, compression systems like MP3 and JPG are barely perceptible most of the timeāthey look and sound great, but manage to take up a fraction of the space that their loss-less siblings demand. In other words, they make digital images and music practical, allowing us to share them easilyāan utterly amazing feat for a single equation. No doubt Fourier, practical enough to write a book about heat flow, would approve.

*This article was originally published on May 4th 2015.*

*Body images by Christine Daniloff/MIT.*

Advertisement