Fast Fourier Transform (FFT)
Definition
Fast Fourier Transform (FFT)
The Fast Fourier Transform is an algorithm that converts a discrete time-domain signal into its frequency-domain representation, revealing the amplitude and phase of each frequency component. FFT reduces computational complexity from O(N²) to O(N log N), enabling real-time spectrum analysis. SonaVyx uses Rust WASM FFT for browser-based audio measurement.
X[k] = Σ x[n] × e^(-j2πkn/N), where N = FFT size, k = frequency bin index
How FFT Is Used in Audio Measurement
Audio data is captured as a stream of time-domain samples (typically 48,000 per second). The FFT processes blocks of N samples (commonly 1024, 2048, 4096, or 8192) and outputs N/2+1 complex frequency bins. Each bin represents a narrow frequency band with width equal to sample rate divided by FFT size. A window function (Hann, Blackman-Harris) is applied before the transform to reduce spectral leakage from the finite block length.
Practical Example
A sound engineer uses SonaVyx with a 4096-point FFT at 48 kHz to identify a resonance in a PA system. The frequency resolution is 48000/4096 = 11.7 Hz per bin, sufficient to pinpoint a narrow feedback peak at 3,150 Hz. Increasing to 8192 points doubles resolution to 5.9 Hz, enabling precise notch filter placement without affecting adjacent frequencies.
FFT Size and Resolution Trade-offs
Frequency resolution equals sample rate divided by FFT size. A 1024-point FFT at 48 kHz yields 46.9 Hz resolution — adequate for broadband analysis but too coarse for identifying narrow resonances. An 8192-point FFT achieves 5.9 Hz resolution but requires 170 milliseconds of data per block, introducing temporal latency. Choosing the right FFT size means balancing frequency detail against time responsiveness.
Window Functions
Because the FFT assumes periodic input, applying it to a finite audio block creates spectral leakage — energy from one frequency spreads into adjacent bins. Window functions taper the signal edges to reduce this artifact. The Hann window offers a good balance between main-lobe width and side-lobe suppression (-31 dB). The Blackman-Harris window achieves superior side-lobe suppression (-92 dB) at the cost of wider main-lobe bandwidth, making it ideal for identifying low-level signals near strong tones.
Overlap Processing
To improve time resolution without sacrificing frequency resolution, successive FFT blocks overlap — typically by 50% or 75%. With 50% overlap and a 4096-point FFT at 48 kHz, a new spectrum is computed every 2048 samples (42.7 ms). This technique is fundamental to real-time analyzers and Welch's method for averaged spectral estimation, as specified in the transfer function computation pipeline.
FFT in Transfer Function Measurement
Dual-channel FFT analysis computes the cross-spectral density between reference (output) and measurement (input) signals. The H1 transfer function estimator divides the cross-spectrum by the input auto-spectrum: H1(f) = Gxy(f) / Gxx(f). This technique, implemented in SonaVyx via Rust WASM, reveals the frequency response, phase response, and coherence of any audio system in real time.
SonaVyx FFT Implementation
SonaVyx performs FFT computation in a Rust WASM module running inside a Web Worker. This architecture ensures the DSP computation does not block the main browser thread, maintaining smooth UI rendering even at high FFT rates. The Rust implementation achieves near-native performance — a 4096-point complex FFT completes in under 50 microseconds on modern hardware, enabling real-time operation at full audio sample rates.
Try It Now
Run real-time FFT spectrum analysis — free in your browser with SonaVyx