FFT Spectrum Analyzer: See Frequencies in Real Time

simulator intermediate ~10 min
Loading simulation...
3 spectral peaks — FFT resolves each component

The FFT decomposes the composite signal into three distinct spectral peaks at 5 Hz, 12 Hz, and 25 Hz matching the input frequencies exactly.

Formula

X[k] = Σ x[n] · e^(−j2πkn/N) for n = 0 to N−1
FFT complexity: O(N log N) vs DFT O(N²)
|X[k]|² = Re(X[k])² + Im(X[k])² (power spectrum)

Seeing Sound in Frequency Space

Every complex signal — a musical chord, a radio transmission, or an earthquake rumble — is actually a sum of simple sine waves at different frequencies. The Fast Fourier Transform is the mathematical microscope that lets us peer into this hidden frequency world. Developed by Cooley and Tukey in 1965, the FFT is one of the most important algorithms in the history of computing.

How the Spectrum Analyzer Works

This simulator builds a composite signal from up to three sine wave components, each with adjustable frequency and amplitude. The FFT then decomposes this signal back into its constituent frequencies, displaying the power spectrum as a bar chart. Watch how peaks appear at exactly the input frequencies — the FFT is invertible and lossless.

From Time Domain to Frequency Domain

In the time domain (top waveform), overlapping sinusoids create a complex-looking wave. In the frequency domain (bottom spectrum), the same information appears as clean, separated peaks. This dual representation is the foundation of modern signal processing — some operations are trivial in one domain but nearly impossible in the other.

Applications Everywhere

The FFT powers audio equalizers, MRI scanners, radar systems, speech recognition, and data compression. Every time you stream music, make a phone call, or use Wi-Fi, the FFT is working behind the scenes to analyze and manipulate the frequency content of signals traveling at the speed of light.

FAQ

What does the Fast Fourier Transform do?

The FFT converts a time-domain signal into its frequency-domain representation. It reveals which frequencies are present in a signal and their relative amplitudes, enabling spectral analysis of audio, vibrations, communications, and more.

Why is the FFT so fast compared to the regular DFT?

The Cooley-Tukey FFT algorithm reduces the complexity from O(N²) to O(N log N) by recursively breaking the DFT into smaller sub-problems. For 1024 samples, that is roughly 100× faster than the naive approach.

What is frequency resolution in an FFT?

Frequency resolution equals the sampling rate divided by the number of FFT points (Δf = fs/N). More samples or a lower sampling rate give finer resolution, but there is a fundamental trade-off between time and frequency resolution (the uncertainty principle).

Can the FFT analyze non-periodic signals?

Yes, but non-periodic signals produce a continuous spectrum rather than sharp peaks. Windowing functions (Hanning, Hamming) reduce spectral leakage that occurs when the signal is not perfectly periodic within the analysis window.

Sources

Embed

<iframe src="https://homo-deus.com/lab/signal-processing/fft-spectrum/embed" width="100%" height="400" frameborder="0"></iframe>
View source on GitHub