FFT Calculator – Fast Fourier Transform
Time → frequency domainPaste your time-domain samples and this tool computes their Fast Fourier Transform (FFT). You get complex FFT coefficients, magnitude and phase spectra, and frequency bins from your sampling rate – ideal for teaching, lab work, and quick signal-processing checks.
Signal input & FFT configuration
From time domain to frequency domain with FFT
In discrete-time signal processing, a real sequence \(x[n]\), \(n = 0, \dots, N-1\), is mapped to its discrete Fourier transform (DFT) \[ X[k] = \sum_{n=0}^{N-1} x[n]\; e^{-j 2\pi k n / N}, \quad k = 0, \dots, N-1. \] The DFT coefficients \(X[k]\) encode how much of each complex exponential of frequency \(2\pi k / N\) is present in the signal.
Computing this sum directly for every \(k\) requires \(O(N^2)\) operations. The Fast Fourier Transform (FFT) is a family of algorithms that exploit symmetry and periodicity in the complex exponentials to reduce the cost to \(O(N \log N)\).
Power-of-two Cooley–Tukey FFT (conceptual)
Even/odd decomposition
For \(N\) a power of two, the Cooley–Tukey algorithm expresses the DFT of length \(N\) in terms of two DFTs of length \(N/2\): one over the even samples and one over the odd samples: \[ X[k] = E[k] + W_N^k\, O[k], \] \[ X[k + N/2] = E[k] - W_N^k\, O[k], \] where \(E[k]\) and \(O[k]\) are the DFTs of even and odd subsequences, and \(W_N^k = e^{-j 2\pi k / N}\) are the so-called “twiddle factors”.
Recursively applying this decomposition produces the classic radix-2 FFT butterfly structure.
Frequency axis and Nyquist limit
If samples are acquired with sampling frequency \(f_s\) (Hz), the FFT bin \(k\) corresponds to the discrete-time frequency \[ f_k = \frac{k}{N} f_s. \] For real-valued signals, bins above the Nyquist frequency \(f_s/2\) mirror the lower part of the spectrum.
In practice, you usually examine only the half-spectrum \(0 \le f_k \le f_s/2\) when the input is real. This calculator offers a one-sided view by default for convenience.
Magnitude and phase
Each FFT coefficient \(X[k]\) is complex and can be written in polar form as \[ X[k] = |X[k]|\, e^{j \varphi_k}, \] where the magnitude \(|X[k]|\) indicates the amplitude of the \(k\)-th frequency component and the phase \(\varphi_k = \arg(X[k])\) indicates its phase shift, typically expressed in degrees.
- Magnitude spectrum: \(|X[k]|\) versus \(f_k\) (or bin index \(k\)).
- Phase spectrum: \(\varphi_k\) versus \(f_k\).
Typical applications of the FFT
- Vibration and modal analysis — detect resonant frequencies in mechanical structures.
- Audio and acoustics — visualise spectra, design equalizers and filters.
- Power quality — analyse harmonics in voltage and current waveforms.
- Biomedical signals — EEG, ECG and EMG spectral analysis.
- Digital communications — OFDM modulation, channel estimation and spectral shaping.
Good practices when using FFT in the lab
- Use an anti-aliasing filter before sampling to remove frequencies above \(f_s/2\).
- Apply window functions (Hann, Hamming, etc.) to reduce leakage when signals are not perfectly periodic in the acquisition window.
- Pay attention to amplitude scaling if you need physically meaningful units (for example, m/s², Pa, V).
- For long signals, use overlapping blocks and average spectra to estimate power spectral densities (PSD).
- Always document sampling frequency, window type, overlap and scaling when reporting spectral results.