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:

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.

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.

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.