Part 7 - Nyquist-Shannon sampling theorem

Introduction

In this part we’ll cover the important Nyquist-Shannon sampling theorem. This is a fundamental theorem within digital signal processing.

However, to understand the theorem, we firstly need to understand filters.

Transfer function

Say we have a system which can be modeled as:

y(t)=f(t)h(t)y(t) = f(t) * h(t)

The same system, but in the frequency domain is therefore:

Y(ω)=F(ω) H(ω)Y(\omega) = F(\omega)\ H(\omega)

Just as we call, h(t)h(t), the system response function, we call H(ω)H(\omega) for the spectral response of the system.

Since, in the most general case, we view our frequency functions as complex functions. We can say that

An input signals spectral component of frequency, ω\omega, is modified in amplitude by a factor of, H(ω)|H(\omega)| and shifted in phase by an angle of H(ω)\angle H(\omega)

However, since we modify the phase, this means that our output signal may have a different waveform than our input.

Distortionless transmission

Say we just want to amplify and shift a given signal, the output waveform should be a replica of the input waveform, only amplified and shifted.

y(t)=kf(ttd)y(t) = k f(t - t_d) Y(ω)=kF(ω)ejωtdY(\omega) = kF(\omega)e^{-j\omega t_d} Y(ω)=F(ω)H(ω)Y(\omega) = F(\omega) H(\omega) H(ω)=kejωtdH(\omega) = ke^{-j\omega t_d} H(ω)=k|H(\omega)| = k H(ω)=ωtd\angle H(\omega) = -\omega t_d td=ddωH(ω)t_d = - \dfrac{d}{d\omega} \angle H(\omega)

If the slope H(ω)\angle H(\omega) is constant, all frequency components are delayed by the same time delay, tdt_d. Meaning that we remain the original waveform.

If it is not constant, the time delay, tdt_d, will vary with frequency. Meaning that our components can get misaligned and, we do not preserve the original waveform.

Filters

The idea with filters are quite intuitive, we want to remove unwanted components from a signal.

An ideal filter would be:

  • Allows for distortionless transmission of a certain interval of frequency.

  • Suppresses all remaining, unwanted frequencies.

Since, in this series we won’t design filters, we won’t get that technical.

The most usual filters are high-pass and low-pass filters. In short, a high-pass filter allows signals with a frequency higher than a certain cutoff frequency and attenuates lower frequencies.

A low-pass filter allows signals with a frequency lower than our cutoff frequency and attenuates higher frequencies.

This is in the ideal case, in real systems these cutoffs can not be instantaneous of course, they gradually filter out the frequencies.

For a physically realizable system (which means casual):

h(t)=0  t<0h(t) = 0 \ | \ t < 0

In the frequency domain, we have the Paley-Wiener criterion:

lnH(ω)1+ω2+dω<\int_{-\infty}^{\infty} \dfrac{|ln |H(\omega)||}{1 + \omega^2}+ d\omega < \infty

So, what we usually need to do, is to cut the tail of h(t)h(t) for t<0t < 0:

h^=h(t)u(t)\hat{h} = h(t)u(t)

Sampling

Okay, now that we understand filters, let’s try to understand the approach to Nyquist-Shannon’s theorem.

In physical systems, signals are continuous-time signals, however, in our digital representations of signals we need to quantize.

We can sample the signal by taking the value, f(t)f(t) at specified instants of time.

This yields us a sequence of numbers, f(t1),f(t2),f(t3),f(t_1), f(t_2), f(t_3), \ldots where tit_i are the time instants we have sampled.

We take these samples at equal increments of time, we call this the sample period, TT. The inverse of the sample period is the sample frequency or sampling rate denoted by Fs\mathcal{F}_s.

The sampling frequency has to be sufficiently high so that we can recover our original continuous-time signal without (much) error.

Theorem 1 (Nyquist-Shannon sampling theorem)

A real signal whose bandwidth is limited to BB Hz can be reconstructed exactly from its samples if the sampling frequency is Fs>2B\mathcal{F}_s > 2B.

Proof

Let f(t)f(t) be a band-limited signal, meaning we have a non-infinite bandwidth, in other words F(ω)=0F(\omega) = 0 for ω>ωB|\omega| > \omega_B, where ωB=2πB\omega_B = 2\pi B.

Sampling f(t)f(t) at intervals of TT seconds (Fs=1T\mathcal{F}_s = \dfrac{1}{T}), is equivalent to multiplying f(t)f(t) with a sequence of delta functions.

Let’s denote this sequence as:

s(t)=n=δ(tnT)s(t) = \sum_{n = -\infty}^{\infty} \delta(t - nT)

Let fs(t)f_s(t) be our sampled signal, therefore:

fs(t)=f(t)s(t)f_s(t) = f(t) s(t)

In the frequency domain, this product will of course become a convolution.

Let fs(t)    F(ω)f_s(t) \iff F(\omega)

Let s(t)    S(ω)s(t) \iff S(\omega). The Fourier transform is a train of delta functions in the frequency domain, spaced ωs\omega_s apart, where ωs=2πFs\omega_s = 2\pi \mathcal{F}_s.

S(ω)=2πTn=δ(ωnωs)S(\omega) = \dfrac{2\pi}{T} \sum_{n = -\infty}^{\infty} \delta(\omega - n\omega_s)

The convolution:

Fs(ω)=12πF(ω)S(ω)Fs(ω)=1Tn=F(ωnωs)F_s(\omega) = \dfrac{1}{2\pi} F(\omega) * S(\omega) \newline F_s(\omega) = \dfrac{1}{T} \sum_{n = -\infty}^{\infty} F(\omega - n\omega_s)

This means we get replicas of our original signal, F(ω)F(\omega) centered around integer multiples of our sampling frequency, ωs\omega_s.

For perfect reconstruction, these replicas must not overlap. The first replica is centered around 0 Hz and has a bandwidth from ωB-\omega_B to ωB\omega_B. The next replica is centered around ωs\omega_s.

For no overlap, the start of the next replica at ωsωb\omega_s - \omega_b must be greater than the end of the first replica at ωb\omega_b, in other words:

ωsωb>ωbωs>2ωb\omega_s - \omega_b > \omega_b \newline \omega_s > 2 \omega_b \newline

Using that ωs=2πF\omega_s = 2\pi \mathcal{F} and ωb=2πB\omega_b = 2\pi B:

2πF>2(2πB)2πF>4πBF>2B2\pi \mathcal{F} > 2(2 \pi B) \newline 2\pi \mathcal{F} > 4 \pi B \newline \boxed{\mathcal{F} > 2B}