DFT, IDFT, and the FFT
Discrete Fourier Transform
Section titled “Discrete Fourier Transform”The discrete Fourier transform (DFT) converts a finite-length discrete-time sequence into a finite set of equally spaced frequency samples. For an -point sequence ,
The DFT treats the listed samples as one period of a sequence that repeats with period . This periodic-extension assumption is what later makes multiplication of DFTs correspond to circular rather than ordinary linear convolution.
Meaning of the Frequency Index
Section titled “Meaning of the Frequency Index”If the time samples were obtained at sampling frequency , adjacent DFT bins are separated by
Equivalently, bin samples normalized angular frequency
Discrete-time frequency is periodic with period , so the upper DFT bins represent negative frequencies. In signed-frequency order,
Thus is DC, the lower nonzero bins represent positive frequencies, and the upper bins wrap around to negative frequencies. For even , bin is the Nyquist-frequency bin at , equivalently ; those two endpoints denote the same discrete-time frequency.
A centred or fftshift display merely rearranges the bins so that negative frequencies appear before DC and positive frequencies; it changes neither their values nor their physical interpretation. Also distinguish the grid spacing from resolving power: the former is set by transform length, whereas separation of nearby tones is governed by the nonzero record duration and its window.
Twiddle Factor and Matrix View
Section titled “Twiddle Factor and Matrix View”Define the th-root-of-unity, or twiddle, factor
The transform can then be written as the matrix product
The rows of the DFT matrix are sampled complex sinusoids. Each row correlates the input samples with one frequency bin.
Let . Distinct basis sinusoids are orthogonal because
Thus the rows and columns have norm and are mutually orthogonal. The normalized matrix is unitary. This identity both explains the IDFT and supplies the short proof of Parseval’s theorem in the section.
Inverse Discrete Fourier Transform
Section titled “Inverse Discrete Fourier Transform”The inverse DFT (IDFT) reconstructs the time-domain samples from the DFT coefficients:
The forward and inverse equations form the transform pair
They differ in the sign of the exponential and in the factor assigned to the inverse transform.
Important DFT Properties
Section titled “Important DFT Properties”Let mean reduced modulo , and suppose .
- Linearity: For constants and ,
The spectrum of a weighted sum is the same weighted sum of the individual spectra.
- Periodicity: The frequency-domain sequence obeys
Both the finite time sequence and its DFT are treated as one period of periodic sequences.
- Circular time shift: A shift by samples changes only spectral phase:
- Frequency shift: Multiplication by a DFT-bin complex exponential shifts the spectrum circularly by bins:
- Circular convolution: For an -point circular convolution,
This identity is the basis of fast convolution using the DFT or FFT.
- Conjugate symmetry: If is real, then
Consequently, the negative-frequency half is the complex conjugate of the positive-frequency half.
For a real input, is real and, when is even, is also real. Hence only bins are independent. Magnitude is circularly even and phase is circularly odd wherever the spectrum is nonzero. A real circularly even sequence has a real DFT; a real circularly odd sequence has a purely imaginary DFT, with zero DC and zero Nyquist value when the latter bin exists.
Complete DFT Examples
Section titled “Complete DFT Examples”DFT pair for a constant four-sample sequence. Equal time samples produce a single nonzero DC coefficient; all nonzero-frequency roots of unity cancel.
Fast Fourier Transform
Section titled “Fast Fourier Transform”The fast Fourier transform (FFT) is an efficient algorithm for computing a DFT. It is not a different transform: its output is the same defined by the DFT equation, obtained by exploiting root-of-unity symmetries and repeated smaller transforms.
| Method | Complex multiplications | Complexity |
|---|---|---|
| Direct DFT | approximately | |
| Radix-2 FFT | approximately |
Direct DFT and radix-2 FFT computational costs.
For large , the reduction from quadratic to nearly linear-logarithmic growth is substantial.
Radix-2 Decimation Derivation
Section titled “Radix-2 Decimation Derivation”When is a power of two, divide the input into its even- and odd-indexed samples,
Let and be the -point DFTs of these two subsequences. Splitting the original DFT sum yields
Because and are periodic with period and , the second half of the transform is available from the same pair of smaller DFTs:
These sum-and-difference equations form one radix-2 butterfly.
Two common radix-2 organizations are decimation in time (DIT), which recursively splits the input samples, and decimation in frequency (DIF), which recursively splits the output-frequency bins. Both compute the same DFT and use the same basic butterfly arithmetic.
Radix-2 butterfly. One twiddle multiplication and a shared sum–difference pair produce two DFT outputs.
Each butterfly performs one complex multiplication by a twiddle factor, one addition, and one subtraction. A radix-2 FFT has stages and butterflies per stage, giving approximately
This replaces the approximately operations needed by direct DFT evaluation.
In a common in-place DIT implementation, the inputs are arranged in bit-reversed order and the outputs emerge in natural order. Bit reversal is an implementation arrangement, not a requirement of every FFT program; other memory layouts and DIF implementations place the permutation elsewhere.
For the four-point flow graph, reversing the two binary index bits gives
| Natural index | Binary index | Reversed index |
|---|---|---|
so natural order becomes the input order . In general, an radix-2 transform reverses binary index bits.
Two-stage four-point decimation-in-time FFT. Bit-reversed inputs pass through two butterflies per stage and produce in natural order.
Spectral Leakage and Windowing
Section titled “Spectral Leakage and Windowing”The DFT sees only a finite observation. If a conceptually longer sequence is observed through a length- window , the analysed record is
Time-domain multiplication convolves the original spectrum with the window spectrum. For the rectangular window , , its DTFT is
with limiting value at . The main lobe and sidelobes of this Dirichlet kernel spread a sinusoid into neighbouring DFT bins whenever its frequency is not exactly on the DFT grid. This spreading is spectral leakage; it is not frequency aliasing.
-
Coherent record: A bin-centred sinusoid completes an integer number of cycles in the record. With a rectangular window, its ideal spectrum falls on the corresponding conjugate bin pair.
-
Tapered windows: Hann, Hamming, and Blackman windows suppress sidelobes and help expose a weak tone near a strong one.
-
Resolution trade-off: Sidelobe suppression widens the main lobe. A window cannot simultaneously give the narrowest main lobe and the lowest leakage; a longer nonzero record is needed for better physical resolution.
-
Amplitude and noise scaling: A window changes tone amplitude and equivalent noise bandwidth. Correct a coherent tone by , while PSD normalization depends on .
Zero Padding and Frequency Resolution
Section titled “Zero Padding and Frequency Resolution”Appending zeros to the measured samples and taking an -point DFT, , samples the same windowed-record DTFT on the denser grid . This produces a smoother spectrum, facilitates peak interpolation, permits an efficient FFT length, and supplies the length needed for linear convolution.
Applications and Quick Review
Section titled “Applications and Quick Review”FFT computation is central to spectrum analysis, OFDM communication systems, fast convolution, and audio and image processing.