Comparison

DTFT vs DFT

The DTFT of an infinite discrete sequence gives a smooth, continuous frequency curve you can write on paper but cannot compute on a processor. When your STM32 must compute the spectrum of a 256-sample audio frame in real time, you use the DFT — a sampled, finite version of the DTFT that FFT algorithms can execute in microseconds.

ECE, EI

Side-by-side comparison

ParameterDTFTDFT
Input lengthInfinite (or finite) sequence x[n], n = −∞ to ∞Finite-length sequence x[n], n = 0 to N−1
OutputContinuous function X(e^{jω}) defined for all ωN discrete frequency samples X[k], k = 0 to N−1
Frequency resolutionContinuous; infinite resolutionΔf = fs/N; for N = 256, fs = 8 kHz → Δf = 31.25 Hz
Periodicity in frequencyPeriodic with period 2πAlso periodic with period N in both time and frequency
Periodicity in timeNot requiredDFT implicitly assumes x[n] is periodic with period N
RelationDTFT is continuous; DFT samples DTFT at ω = 2πk/NX[k] = X(e^{jω})|_{ω = 2πk/N}
Computational complexityCannot be directly computed; analytical onlyO(N²) for DFT; O(N log N) for FFT (Cooley-Tukey)
Spectral leakageNo leakage for truly infinite sequencesLeakage occurs when signal is not periodic in N samples
Window functionsNot requiredHamming, Hanning, Blackman windows reduce leakage
MATLAB functionfreqz() for filter analysisfft(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.

More Signals Systems comparisons