Side-by-side comparison
| Parameter | DTFT | DFT |
|---|---|---|
| Input length | Infinite (or finite) sequence x[n], n = −∞ to ∞ | Finite-length sequence x[n], n = 0 to N−1 |
| Output | Continuous function X(e^{jω}) defined for all ω | N discrete frequency samples X[k], k = 0 to N−1 |
| Frequency resolution | Continuous; infinite resolution | Δf = fs/N; for N = 256, fs = 8 kHz → Δf = 31.25 Hz |
| Periodicity in frequency | Periodic with period 2π | Also periodic with period N in both time and frequency |
| Periodicity in time | Not required | DFT implicitly assumes x[n] is periodic with period N |
| Relation | DTFT is continuous; DFT samples DTFT at ω = 2πk/N | X[k] = X(e^{jω})|_{ω = 2πk/N} |
| Computational complexity | Cannot be directly computed; analytical only | O(N²) for DFT; O(N log N) for FFT (Cooley-Tukey) |
| Spectral leakage | No leakage for truly infinite sequences | Leakage occurs when signal is not periodic in N samples |
| Window functions | Not required | Hamming, Hanning, Blackman windows reduce leakage |
| MATLAB function | freqz() for filter analysis | fft(x, N) computes N-point DFT efficiently |
Key differences
The DTFT of x[n] is a continuous function of ω; you cannot store it on a computer. The DFT takes N samples of that continuous spectrum at equally spaced frequencies ωk = 2πk/N, producing N complex numbers. This sampling in frequency corresponds to time-domain periodisation — the DFT always treats the input as one period of a periodic signal. So circular convolution in DFT corresponds to linear convolution only when zero-padding is used. A 256-point FFT (Cooley-Tukey) runs in 256·log2(256) = 2048 operations instead of 65,536.
When to use DTFT
Use the DTFT when you need the exact continuous-frequency response of a filter — for example, analytically deriving the stopband attenuation of a 5-tap FIR filter with coefficients [0.1, 0.2, 0.4, 0.2, 0.1].
When to use DFT
Use the DFT (via FFT) when you need to compute the spectrum of a recorded signal on hardware — for example, running a 1024-point FFT on an STM32F4 to detect the dominant frequency in a vibration sensor signal sampled at 10 kHz.
Recommendation
For GATE and placements, choose DFT/FFT whenever "computation" or "hardware" appears in the problem. Know the relation X[k] = X(e^{j2πk/N}) and the circular convolution property of DFT — these appear every year. For frequency resolution questions, always use Δf = fs/N.
Exam tip: GATE asks to compute the 4-point DFT of x[n] = {1, 1, 0, 0} using the DFT formula — show all four X[k] values with magnitude and phase; also know that X[0] is always the sum of all x[n].
Interview tip: Interviewers ask what happens when you use DFT-based convolution without zero-padding — explain that you get circular (not linear) convolution, which causes time-domain aliasing; zero-pad to length ≥ L + M − 1 to avoid it.