Waves & Oscillations · Simulation
7 April 2026 · Updated 15 November 2026 · on the concept map
How Does the Fourier Transform Pull a Signal Out of Noise?
Every sound you hear, every photo you take, every Wi-Fi packet your phone receives arrives mixed with noise. Often the noise is as loud as the thing you want, and sometimes it is louder. Yet your phone still hears your voice on a windy street, and a radio still decodes a packet through the hiss. The tool doing most of that work is the Fourier transform, and the algorithm that makes it quick enough to run live is the Fast Fourier Transform (FFT).
This page builds the idea up in plain language first: how the transform finds a frequency, why noise smears itself across all of them, and why listening longer makes the truth louder. Then come the denoising recipe, a Morse message rescued from static, phones, speed and everyday uses, and finally the maths.
What Is Frequency, and What Does a Spectrum Show?
Pluck a guitar string and it vibrates back and forth. The tighter the string, the faster it vibrates. That rate of vibration is its frequency, measured in cycles per second, or hertz (Hz).
Musical notes are frequencies with names. The A above middle C, the note orchestras tune to, is defined as exactly 440 Hz (some orchestras tune a touch higher). The A one octave higher vibrates at 880 Hz, twice as fast. Every key on a piano is a specific frequency.
| Note | Frequency |
|---|---|
| A3 | 220 Hz |
| C4 (middle C) | 262 Hz |
| A4 (concert A) | 440 Hz |
| A5 | 880 Hz |
A spectrum is a bar chart of a sound: frequency along the bottom, how much of each frequency is present going up. A tuning fork rings at one pitch, so its spectrum is a single needle. A chord of three notes is three needles. A room full of people talking at once is a carpet, roughly level from end to end. A struck glass or a plucked string rings with a few clean needles, its natural frequencies (see standing waves and resonance).
The surprising part, which Joseph Fourier argued for in the early 1800s, is that any repeating signal, however jagged, can be rebuilt by adding up sine waves of the right sizes. You can watch a square wave assemble itself from sines in Fourier synthesis: building waves from harmonics. The Fourier transform runs that process in reverse: hand it a messy signal and it tells you which sines went into it.
How Does the Fourier Transform Find a Frequency?
Suppose you want to know whether a signal contains a 3 Hz tone. Here is the trick. Make a clean 3 Hz sine wave of your own, a probe, and multiply it by the signal, moment by moment. Then average the result over the whole recording.
If the signal contains 3 Hz, the two rise and fall together. Positive times positive is positive, and negative times negative is positive too, so the product stays mostly above zero and the average comes out large. If it does not, the two drift in and out of step, the positive and negative stretches cancel, and the average comes out close to zero.
Slide the probe across every frequency, repeat, and plot the averages: that is the spectrum. The Fourier transform asks every frequency in turn "are you in there?" and records how strongly each one answers.
The signal below is a 3 Hz tone of amplitude 1 plus a 7 Hz tone of amplitude 0.6, recorded for 2 seconds. The top panel draws it with your dotted probe sine on top. The middle panel is their product, with the part above zero filled solid yellow and the part below zero hatched, so you can see how much cancels. The bottom panel traces the match score for every probe frequency you have visited so far.
Things to try:
- Start where it opens, at 1.5 Hz. The match score reads 0.00. The yellow and hatched areas are equal, so they cancel exactly.
- Slide slowly up to 3 Hz. The score climbs to 1.00, the amplitude of the 3 Hz tone. Almost all of the product now sits above zero.
- Keep going to 5 Hz. The score falls back to 0.00. There is nothing at 5 Hz.
- Stop at 7 Hz. The score reads 0.60, the amplitude of the second tone. The probe has measured both ingredients, and how much of each there is.
- Try 3.25 Hz. The score is about 0.58, not zero. The peak has a width: it only falls back to zero at 3.5 Hz. Hold that thought; it comes back in the time–frequency trade-off below.
- Sweep the whole range, 0.5 to 12 Hz. The bottom panel draws the full spectrum: two tall needles, at 3 and 7 Hz, with only low ripples beside them (the leakage of a 2-second record).
Why does a mismatched probe always average to zero?
Two sine waves at different frequencies slip past each other at a steady rate. When each fits a whole number of cycles into the recording, they spend exactly as long agreeing as disagreeing, so their product averages to exactly zero; otherwise it averages to nearly zero. Mathematicians call such waves orthogonal, the same word used for perpendicular arrows, and for the same reason: neither has any component along the other.
That one fact is why the transform can pull each frequency out on its own: the 7 Hz tone is invisible to a 3 Hz probe, and the 3 Hz tone is invisible to a 7 Hz probe.
Why does the transform use a cosine probe as well?
A sine probe only scores well if the tone starts in step with it; a tone shifted by a quarter cycle would score zero. So the transform uses a sine and a cosine probe at each frequency and combines their scores. Between them they catch the tone whatever its phase, and the pair of numbers also records that phase, which you need to rebuild the signal later.
Why Does Noise Spread Across Every Frequency?
Random noise, the hiss of a radio between stations, is a signal in which each moment has almost nothing to do with the one before. Nothing in it repeats on a schedule. So a probe at any frequency gets a jumble of positive and negative products that mostly cancels, leaving a small, random leftover. No frequency is preferred, so every probe gets a similar small answer, and together they make the carpet. Noise with a level carpet is called white noise, by analogy with white light containing every colour.
Why is a tone a needle but noise a carpet?
The difference is where the energy goes. A pure tone puts all of its energy into one frequency. White noise may have more energy than the tone, but it shares it evenly among every frequency, so each one gets only a sliver.
That is the whole basis of FFT denoising. In the raw waveform the tone and the noise are tangled together. In the spectrum they look completely different:
Signal → sharp needle. Noise → flat carpet. That difference is everything.
Real noise is not always perfectly white: mains hum is a needle of its own, at 50 Hz in Europe and 60 Hz in North America, and wind noise is strongest at low frequencies. But whatever is concentrated stands out, and whatever is spread thin can be pushed down.
Why Does Listening Longer Beat Noise?
Here is the part that surprises people. Make the noise as loud as the tone, or louder, so the waveform is pure static. Now record for longer. The waveform looks no better, but in the spectrum the needle grows taller and the carpet does not.
The longer you listen, the more cycles of the tone the probe multiplies against, and every one adds to the score in the same direction, while the noise adds in random directions that keep cancelling. A longer recording also tells more frequencies apart, so the noise is shared among more slots: each slot's share stays the same while the tone's slot keeps filling up.
The simulation below plays a 50 Hz tone buried in noise whose spread (standard deviation) equals the tone's amplitude. The top panel is what you would hear. The bottom panel is the spectrum in decibels: the tone's frequency slot as a blue needle, every other slot as the yellow carpet, and the noise floor (the middle value of the carpet) as a dotted line. Lengthen the listening time and watch the needle climb out of the carpet.
Things to try:
- Start where it opens: a quarter of a second, noise at 1. The trace is static. The banner says the tone stands about 18.8 dB above the noise anyway.
- Drag the listening time down to its shortest, 64 samples (about a sixteenth of a second). The lead shrinks to about 9.2 dB. Now step back up one notch at a time. Each notch doubles the listening time and adds roughly 3 dB, with some wobble because the noise is random.
- Go all the way to 16 seconds. The tone stands about 37.9 dB above the noise, more than six thousand times the floor's power, from a signal you could not see in the trace.
- Watch the dotted noise floor as you do it. It hardly moves. Only the needle climbs.
- Turn the noise up to 4, four times the tone's amplitude. At the shortest time the tone sits about 7.8 dB below the noise and vanishes into the carpet. Slide to 16 seconds and it stands about 26 dB above it. Noise far louder than the signal still loses, if you listen long enough.
How much does the tone gain each time you double the listening time?
About 3 decibels. Decibels count ratios of power: 3 dB is twice the power, 10 dB ten times, 20 dB a hundred times. Listen 256 times longer, which is 8 doublings, and the lead grows by about 24 dB, roughly 250 times. The sim wobbles around this rule because noise is random, but the trend is unmistakable. Engineers call it processing gain, and it is why a GPS receiver can lock onto satellite signals weaker than the background noise. The plain version: the longer you listen, the louder the truth gets.
The Four-Step Recipe for FFT Denoising
Once the signal is a set of needles standing on a carpet, cleaning it up takes four steps:
- Record the noisy signal
- Transform it: run the FFT to get a spectrum showing the power at each frequency
- Filter: set a threshold and zero out every frequency below it (noise); keep only the peaks (signal)
- Recover: run the inverse FFT to turn the filtered spectrum back into a clean signal
The inverse transform adds the surviving sines back together, with their sizes and phases. The noise slots were set to zero, so most of the noise is simply left out of the sum.
Try it: a chord buried in noise
Pick musical notes for each of the three slots, add noise, then raise the threshold until the power spectrum shows clean peaks and the recovered signal matches the original. Hit the audio buttons to hear the difference with your ears.
Signal components
Noise & filter
Audio preview
Things to try:
- Start where it opens: A4 (440 Hz) at amplitude 1 and E4 (330 Hz) at 0.7, noise 1.5, threshold 50. Two peaks clear the threshold, at 330 and 440 Hz, and the recovered signal is built from those two alone.
- Two notes an octave apart: pick A3 and A4. Two distinct peaks appear at 220 Hz and 440 Hz.
- Crank the noise to 3.0. The waveform becomes unrecognisable, but the frequency peaks still stand out. With the opening notes, a couple of stray noise bins now sneak past a threshold of 50; raise it to about 80 and they are gone.
- Raise the threshold to 250 with the opening notes and noise. The quieter E4 peak drops below it and only A4 survives. A threshold that is too high throws away signal, not just noise.
- C major chord: pick C4, E4, G4. The FFT separates all three frequencies cleanly.
- Switch a note off by setting its slot to off and watch its peak disappear from the spectrum instantly.
How do you choose the threshold?
Put it above the tallest blade of the carpet and below the shortest needle you care about. If the noise is so loud that the carpet reaches the quieter notes, no threshold can save them, and the cure is the previous section: listen for longer, so the needles grow while the carpet stays put.
Can the FFT Recover Morse Code Through Static?
Before digital radio, operators sent messages as bursts of a single carrier tone, long bursts for dashes and short bursts for dots. Atmospheric noise made the signal nearly inaudible.
Watch what the FFT does to it. The threshold line sweeps upward until only the spike at the carrier stands above it, and the filter zeroes everything except a narrow band around that spike. Switching the tone on and off spreads it a few hertz either side of the carrier, and that band is where the dots and dashes live. The static melts away. The Morse pattern emerges.
The message is SOS (· · · — — — · · ·). The noise is as strong as the signal itself, enough to all but hide the message in the raw trace, yet the FFT digs it back out.
Notice what the filter keeps. Switching the tone on and off smears it into a narrow band of neighbouring frequencies, so keeping only the centre needle would give a steady hum with no message. Keep the band, here about 8 Hz either side of the 600 Hz carrier, and the dots and dashes come back. It is the same lesson as a low-pass or band-pass filter: just wide enough for the information, and no wider.
How Do Phones and Laptops Remove Background Noise?
A phone call is the hardest case: speech and noise both change every few tens of milliseconds, and the cleaning has to happen live.
So call noise suppression works on short, overlapping windows of sound, each a few tens of milliseconds long. Each window gets its own FFT. Lay those spectra side by side and you have a spectrogram, a picture of which frequencies are present at each moment. The software estimates the background noise in each frequency (often from the gaps between words), turns each frequency of each window down by an amount set by how much of it is likely to be noise, using spectral subtraction or Wiener-style gains, then transforms each window back and blends them into continuous sound.
That is our four-step recipe, applied many times a second: the core of the method, not all of it. Most phones and laptops also combine two or more microphones to favour sound from your mouth's direction (beamforming), and increasingly a small neural network predicts how much to turn each frequency down.
Active noise-cancelling headphones are a different trick. They play an inverted copy of the incoming noise so the two cancel in your ear, and that loop runs mostly in the time domain, not through the transform-cut-and-invert recipe on this page.
Why do phones use short windows instead of long ones?
Because of a trade-off you met in the probe simulation. A long recording pins frequencies down precisely: the 2-second probe signal gave peaks half a hertz wide. But a long window blurs time, smearing a word into the silence around it. A short window follows time but blurs frequency: a window a twentieth of a second long only separates frequencies about 20 Hz apart. Phone software picks a compromise, because no window is sharp in both.
Why Is the FFT So Fast?
Done the straightforward way, a spectrum of samples means probe frequencies, each multiplied against all samples: multiplications. For one second of CD audio, 44,100 samples, that is nearly 2 billion; for a million samples, a trillion. The Fast Fourier Transform gets exactly the same answer in about steps: for a million samples, about 20 million, roughly fifty thousand times less work (counting only the multiplications, as in the maths section, the saving is closer to a hundred thousand).
Why does splitting into evens and odds save so much work?
Split the samples into the even-numbered ones and the odd-numbered ones and transform each half separately. Because the cost grows as the square of the size, two half-size transforms cost half as much as one full-size one, and a cheap final step stitches the two half-spectra together. Repeat the split on each half, then each quarter, down to pairs of samples. Each level costs about steps and there are levels, so the total is about .
The history is a good story. Carl Friedrich Gauss worked out the same idea around 1805, while calculating the orbits of the asteroids Pallas and Juno, before Fourier had published his own work. Gauss never published it in his lifetime, and it went unnoticed for over a century. James Cooley and John Tukey rediscovered it in 1965, partly motivated by a Cold War problem: detecting underground nuclear tests from seismometer records. Their paper made the FFT famous.
Where Is the FFT Used in Everyday Life?
In most other uses the FFT is not cleaning anything up; it is the language the device thinks in.
How does Wi-Fi use the FFT?
Wi-Fi splits its data across dozens to thousands of closely spaced subcarriers, each a slow stream on its own frequency. This is OFDM (orthogonal frequency-division multiplexing), and the subcarriers are orthogonal in exactly the probe simulation's sense. The transmitter builds each burst, called a symbol, with an inverse FFT, and your phone takes it apart with an FFT, on every symbol of every OFDM packet (only the oldest 802.11b rates use a different scheme). In the original 802.11a/g Wi-Fi each symbol lasts 4 microseconds, so a receiver working flat out runs a 64-point FFT about 250,000 times a second. Newer Wi-Fi uses longer symbols and bigger FFTs, and 4G and 5G mobile networks are built on OFDM too.
How does an MRI scanner use the Fourier transform?
In a strong magnetic field, hydrogen nuclei in your body resonate at a radio frequency. Magnetic gradients make that frequency and phase depend on position, so the scanner records spatial frequencies, called k-space, rather than a picture. The image is built from it with an inverse Fourier transform.
Is JPEG compression a Fourier transform?
Nearly. JPEG cuts a photo into 8 × 8 blocks of pixels and runs each through the discrete cosine transform, a close cousin of the Fourier transform that uses only cosines. Fine detail lives in the high-frequency coefficients, which the eye notices least, so JPEG stores them coarsely and many end up as zero. That is most of the file-size saving, and why an over-compressed photo looks blocky.
How do music recognition apps identify a song?
They work from the spectrogram. The app takes short-window FFTs of a few seconds of audio, picks out the strongest peaks in time and frequency, and turns their pattern into a compact fingerprint to look up in a database. The loudest peaks of the music tend to survive the chatter of a café.
How did LIGO find gravitational waves in noise?
LIGO measures changes in length far smaller than a proton, buried in noise. Two black holes merging send a short chirp, rising in frequency over a fraction of a second. The data is compared against a bank of predicted chirps by matched filtering, the probe idea with a whole chirp as the probe. It is done in the frequency domain, where each frequency can be weighted by how noisy the detector is there. Searches of this kind were among those that picked out the first detection, in September 2015.
Where else does the Fourier transform turn up?
Audio editors' noise-reduction tools learn a noise profile from a quiet stretch of a recording and turn those frequencies down everywhere, our recipe with a smarter threshold. And an X-ray diffraction pattern records the strength of each spatial frequency in a crystal's electron density, which is how the structures of DNA and countless proteins were worked out (diffraction patterns are explored in interference and diffraction).
The Math Behind FFT Denoising
The intuition above is enough to use the FFT effectively. This section has the mathematics, at university level.
The continuous Fourier transform
Joseph Fourier proposed in 1807 that a periodic function can be written as a sum of sines and cosines (the series form is in Fourier synthesis). The continuous Fourier transform maps a function to its frequency-domain representation :
Since , this is exactly the probe procedure: multiply by a cosine and a sine probe at frequency and integrate. The real and imaginary parts are the two probe scores, and combines them independently of phase.
The discrete Fourier transform
Real instruments sample signals at discrete times. Given samples taken at a sampling rate , the discrete Fourier transform (DFT) is:
Each output gives the amplitude and phase at frequency . A tone of amplitude that lands exactly on bin gives , so recovers . That is the normalisation behind the probe simulation's match score, which is why the 3 Hz tone scores 1.00 and the 7 Hz tone 0.60.
The Nyquist limit says frequencies above cannot be represented; they fold back into lower frequencies (aliasing). Audio CDs are sampled at 44,100 Hz to capture up to 22,050 Hz, just above the limit of human hearing.
Orthogonality: why each frequency comes out on its own
The complex exponentials used as probes satisfy
for whole-number and between and . In continuous form, two different sinusoids whose frequencies are both whole multiples of integrate to zero over a record of length . In the probe simulation s, so every probe at a multiple of 0.5 Hz other than 3 or 7 Hz scores exactly zero, and probes in between leak a little. Orthogonality means the DFT is a change of basis onto perpendicular axes, which is why it can be undone exactly by the inverse transform:
Processing gain: why noise loses by a factor of N/2
Define the power in bin as . For a tone on bin , , so
For white Gaussian noise of standard deviation , each is a sum of independent terms, so and
independent of . The ratio in the tone's bin is
So the FFT multiplies the time-domain signal-to-noise ratio by , a processing gain of dB, which grows by dB per doubling of .
In the listening simulation, and : the tone's power is half the noise power, a time-domain SNR of about −3 dB. At the opening the formula gives , or 18.1 dB; the sim reports about 18.8 dB, partly because it measures the floor as the median bin. Each bin's noise power follows an exponential distribution, whose median is times its mean, about 1.6 dB lower; the rest of the gap is the noise landing in the tone's own bin. At the formula gives 36.1 dB and the sim about 37.9 dB. The sim places the tone on the nearest bin to 50 Hz at each length (48 Hz at 64 samples, 52 Hz at 256), the on-bin case the formula describes.
The time–frequency trade-off
The bins of an -point DFT are spaced
where is the length of the record. A 2-second record resolves 0.5 Hz, the width of the peaks in the probe simulation. In the listening simulation, sampled at 1024 Hz, 64 samples give bins 16 Hz wide and 16,384 samples give bins 0.0625 Hz wide. A 20 ms window, a common length in speech processing, resolves only about 50 Hz.
More generally, a signal confined to a duration has a spectrum at least about wide: roughly , with the exact constant depending on how the widths are defined. This is the same mathematics as Heisenberg's uncertainty principle, where position and momentum play the roles of time and frequency (see wave packets).
The fast Fourier transform: N log N instead of N²
The radix-2 Cooley–Tukey FFT splits an -point DFT (with a power of two) into two -point DFTs, one over the even-indexed samples and one over the odd-indexed samples, and combines them with twiddle factors:
for , where and are the DFTs of the even and odd sub-sequences. Each pair of outputs costs one complex multiplication, a "butterfly". Applying the split recursively gives stages of butterflies, so complex multiplications and work in total.
For , the size used in the tone-and-chord simulation: the direct DFT needs million complex multiplications. The FFT needs , about 370 times fewer. The advantage grows with : at (about a million samples) the ratio is roughly 100,000.
Power spectrum and threshold filtering
The power spectrum is . Parseval's theorem guarantees that total energy is the same in both domains,
so a tone's energy is concentrated in one bin while the noise's is spread across all .
Threshold filtering keeps bins where and zeros the rest before inverting. For a real signal, is the complex conjugate of , so each kept bin's mirror is kept too and the result stays real. In the tone-and-chord simulation (, 1 Hz bins), an amplitude-1 tone ideally gives , while noise of gives bins averaging , the largest of about a thousand typically near . The default threshold of 50 sits comfortably between. At the mean is 9 and the largest bins reach about 60 to 75, which is why a couple slip past 50.
A hard threshold is the simplest choice, not the best. Wiener filtering scales each bin by , where and are the expected signal and noise powers, which minimises mean-squared error. Spectral subtraction removes an estimated noise power from each bin. Wavelet denoising works in a basis local in both time and frequency, which handles sudden transients better than the pure FFT.
Frequently Asked Questions
Frequently Asked Questions
Further Reading
Books
-
The Scientist and Engineer's Guide to Digital Signal Processing — Steven W. Smith. Free at dspguide.com. Extremely accessible, starts from first principles.
-
Numerical Recipes — Press, Teukolsky, Vetterling & Flannery. Chapter 12 covers FFT theory and practical implementation in detail.
-
Introduction to Signal Processing — Sophocles J. Orfanidis. Free PDF at ece.rutgers.edu/~orfanidi/intro2sp. Rigorous and comprehensive.
Foundational papers
-
Cooley, J.W. & Tukey, J.W. "An Algorithm for the Machine Calculation of Complex Fourier Series." Mathematics of Computation, 19(90), pp. 297–301, 1965. The original FFT paper.
-
Shannon, C.E. "Communication in the Presence of Noise." Proceedings of the IRE, 37(1), pp. 10–21, 1949. Foundation of sampling theory and the Nyquist theorem.
Online
-
3Blue1Brown — "But what is the Fourier Transform? A visual introduction." (YouTube). The best visual intuition for the transform available anywhere.
-
3Blue1Brown — "But what is the Fourier Series? From heat flow to drawing with circles." (YouTube). Builds the continuous case from scratch with animations.
-
Reducible — "The Fast Fourier Transform (FFT) Explained." (YouTube). Clear step-by-step walkthrough of the Cooley–Tukey algorithm.
-
NumPy FFT documentation at numpy.org — for hands-on experimentation in Python.
Explore more simulations
Every concept on PhysicStuff has an interactive simulation. No login, no setup required.
Keep going.
Related concepts
- Fourier Series: How Sine Waves Build Any ShapeBuilding a signal from sine waves — the forward direction of the same transform.builds on
- How Do Filters Work? Low-Pass and High-Pass Filters ExplainedFrequency-selective filtering, implemented in hardware rather than software.related
See how every topic connects on the concept map.
More interactive simulations
- Standing Waves and Resonance: Why Everything Has a Natural Frequency
- How Do Filters Work? Low-Pass and High-Pass Filters Explained
- Wave Speed Calculator — Frequency, Wavelength and the Wave Equation
- The Doppler Effect
- Fourier Series: How Sine Waves Build Any Shape
- Wave Packets
- Lissajous Figures
Browse every simulation in the PhysicsLab.