7.1 The Nyquist-Shannon sampling theorem

7.1 The Nyquist-Shannon sampling theorem#

The conditions for perfect reconstruction are captured by one of the most important results in all of digital signal processing.

Theorem 1 (Nyquist-Shannon sampling theorem)

If a signal \(x(t)\) contains no frequency content above \(f_{\max}\) Hz, then it can be perfectly reconstructed from its samples \(x[n] = x(n/f_s)\), provided that

\[f_s > 2 f_{\max}.\]

Once we fix a sampling rate \(f_s\), the theorem gives special significance to the frequency \(f_s / 2\). We call it the Nyquist frequency: the highest frequency that can be unambiguously represented in a signal sampled at \(f_s\).

We can build intuition for the theorem directly from the copied-spectrum picture. Suppose \(x(t)\) is bandlimited, containing no frequencies above \(f_{\max}\), so its spectrum occupies the band \([-f_{\max}, f_{\max}]\). We call this central, un-shifted copy of the spectrum the baseband. Remember from Chapter 6 that a real signal’s spectrum is symmetric, so the baseband includes both positive frequencies up to \(f_{\max}\) and their negative-frequency mirror images down to \(-f_{\max}\). Sampling copies this baseband around every multiple of \(f_s\), and whether the copies stay out of each other’s way depends entirely on \(f_s\):

Two stacked frequency-domain plots, each with a richly-shaped central baseband spectrum from minus f-max to f-max and red vertical lines marking plus and minus f_s. Top: copies centered at plus and minus f_s sit clear of the baseband, since f_s is greater than twice f-max. Bottom: the copies are spaced too closely and overlap the baseband, since f_s is less than twice f-max.

Fig. 36 Why the factor of two. Top: when \(f_s > 2f_{\max}\), the shifted copies stay clear of the baseband, which can then be cleanly isolated and the signal perfectly reconstructed. Bottom: when \(f_s < 2f_{\max}\), adjacent copies overlap the baseband, corrupting it.#

The factor of two comes directly from those negative frequencies. Each copy occupies a full bandwidth of \(f_s\), spanning \([-f_s/2, f_s/2]\), because it has to hold the baseband’s positive content and its negative-frequency mirror. For neighboring copies not to overlap, that entire width must fit, which requires \(f_{\max} < f_s/2\), or equivalently \(f_s > 2f_{\max}\). When this holds, there is a gap between the baseband and its neighbors. A digital-to-analog converter can then isolate the baseband with a filter, discard the copies, and recover \(x(t)\) exactly. But when \(f_s < 2 f_{\max}\), the copies overlap and bleed into the baseband. The original spectrum is now contaminated by intruding copies, and it can no longer be separated out. This overlap is the source of the distortion we turn to next.

The practical implication of Nyquist-Shannon is wonderfully convenient for digital audio: sampling does not degrade the sound in any way, as long as we sample fast enough (\(f_s > 2 f_{\max}\)). All of the “gaps” between samples are, in a precise sense, redundant.