Home/Chapter 10

The Sampling Theorem

Sampling of continuous-time and discrete-time signals. The Nyquist-Shannon sampling theorem and reconstruction from samples.

One important requirement for signal transmission and storage is the need for discretization of the signal, both in time-index sets and in signal-range sets. The former is called sampling; the latter is called quantization. In the following, we discuss sampling.

The Sampling Theorem

Samplers perform the discretization in the time-index. We discuss a very important theorem in the following.

Sampling of a Continuous-Time (CT) Signal

TheoremShannon-Nyquist Sampling Theorem

Let {x(t),  tR}\{x(t), \; t \in \mathbb{R}\} be a CT signal in L2(R;R)L_2(\mathbb{R};\mathbb{R}) and let x^=FCC(x)\hat{x} = \mathcal{F}_{CC}(x). If this signal has a finite bandwidth BB, that is if

x^(f)=0,f>B,\hat{x}(f) = 0, \quad |f| > B,

(that is, the support of x^\hat{x} is contained in [B,B][-B, B]) then it is possible to reconstruct this signal by samples of this signal (with arbitrarily small error in the L2(R;R)L_2(\mathbb{R};\mathbb{R}) sense, i.e., in the 2\|\cdot\|_2 norm), where the sampling period TT that allows this satisfies

12T>B.\frac{1}{2T} > B.

If this condition holds, the recovery is satisfied by the relation

x~(t)=nZx(nT)sin(πtnTT)πtnTT,\tilde{x}(t) = \sum_{n \in \mathbb{Z}} x(nT)\frac{\sin(\pi\frac{t-nT}{T})}{\pi\frac{t-nT}{T}},

where {x(nT),nZ}\{x(nT), n \in \mathbb{Z}\} denotes the samples of the signal xx.

Remark.

Intuition: The sampling theorem says you need at least 2 samples per cycle of the highest frequency in your signal to reconstruct it perfectly. This is why CD audio uses 44.1 kHz sampling -- human hearing tops out at ~20 kHz, so 44.1 kHz (more than 2×202 \times 20 kHz) captures everything we can hear. Sample too slowly and high frequencies disguise themselves as low ones, a phenomenon called aliasing. The reconstruction works by placing a sinc function at each sample point and summing them up -- the sinc functions fill in the gaps between samples exactly.

This is a remarkable result which paves the way to communications, signal processing, and digital control technologies, which are ubiquitous in our daily lives. For example, human voice range is typically about 20 Hz to 20 kHz (female voice typically has a higher frequency band than male voice), but primarily most of the content is between 2 to 4 KHz. The bandwidth allocated for a telephone transmission channel is about 4 kHz. These suggest that one can recover human voice quite well with large enough samples taken: T=18000T = \frac{1}{8000} seconds.

The frequency 12T\frac{1}{2T} is called the Nyquist frequency (or Nyquist rate). The theorem says: to perfectly reconstruct a band-limited signal, you must sample at more than twice its highest frequency component. The reconstruction formula is a sinc interpolation -- each sample is "smeared" by a sinc function, and the sum of all these sinc functions recovers the original signal exactly.

Sketch of proof. We now present a sketch of the proof of the result above. Let xSx \in \mathcal{S}: We know that, by Theorem, any xL2(R;R)x \in L_2(\mathbb{R};\mathbb{R}) can be approximated arbitrarily well by a signal in S\mathcal{S} and therefore, in the following, we can assume that xSx \in \mathcal{S} (with an arbitrarily small approximation error in the 2\|\cdot\|_2 norm).

Consider the sampled signal

xp(t)=x(t)kZδ(tkT),  tR,x_p(t) = \int x(t)\sum_{k \in \mathbb{Z}}\delta(t - kT), \; t \in \mathbb{R},

where kZδ(tkT)\sum_{k \in \mathbb{Z}}\delta(t - kT) is called an impulse train. Observe that, the impulse train is a distribution, and recall from the relevant section that the CCFT of a distribution is itself a distribution. We will consider x^p(f)\hat{x}_p(f), which denotes the CCFT of the sampled signal, which now needs to be viewed as a distribution.

Now let us discuss what the CCFT for the impulse train kZδ(tkT)\sum_{k \in \mathbb{Z}}\delta(t - kT) should be.

Remark.

As observed earlier and above, the sequence of partial sums (k=NNei2πkPt)\left(\sum_{k=-N}^{N} e^{-i2\pi kPt}\right) converges to a periodic Dirac delta function as a distribution (see also Theorem). This sequence is known as the Dirichlet kernel sequence.

It then follows that, the FCC\mathcal{F}_{CC} of kZδ(tkT)\sum_{k\in\mathbb{Z}}\delta(t - kT) is another impulse train given as:

I^(f)=1Tkδ(fkT).\hat{I}(f) = \frac{1}{T}\sum_k \delta(f - \frac{k}{T}).

This result is in agreement with an engineering intuition that if one considers II as a periodic signal, and computes its FCD\mathcal{F}_{CD}, I^(kT)=1T1\hat{I}(\frac{k}{T}) = \frac{1}{\sqrt{T}}1 for all kZk \in \mathbb{Z}, this leads to

I(t)=k1T(1T)ei2πkTtI(t) = \sum_k \frac{1}{\sqrt{T}}(\frac{1}{\sqrt{T}})e^{i2\pi\frac{k}{T}t}

The FCC\mathcal{F}_{CC} of xp(t)x_p(t) then satisfies, by the properties of convolution in frequency domain corresponding to a time-wise product in time domain, the following:

x^p(f)=(I^x^)(f).\hat{x}_p(f) = (\hat{I} * \hat{x})(f).

It follows after some analysis the following relation holds

x^p(f)=1TmZx^(fm1T),\hat{x}_p(f) = \frac{1}{T}\sum_{m \in \mathbb{Z}} \hat{x}(f - m\frac{1}{T}),

which is an addition of shifted versions of x^\hat{x}.

If TT is small enough, then the signal

x~^(f)=T1(f<12T)x^p(f),\hat{\tilde{x}}(f) = T1_{(|f|< \frac{1}{2T})}\hat{x}_p(f),

is exactly equal to the FCC\mathcal{F}_{CC} of the original signal. Hence, a low-pass filter which takes out the repetitions of the frequency shifted due to the convolution with the impulse sequence, except for the primary component, leads to the reconstruction of the original signal.

Since the rectangular low-pass filter T1(f<12T)T1_{(|f|<\frac{1}{2T})} corresponds to

h(t)=sin(πtT)πtT,h(t) = \frac{\sin(\pi\frac{t}{T})}{\pi\frac{t}{T}},

the reconstruction can then be written as:

x~(t)=nZx^p(nT)sin(πtnTT)πtnTT.\tilde{x}(t) = \sum_{n \in \mathbb{Z}} \hat{x}_p(nT)\frac{\sin(\pi\frac{t-nT}{T})}{\pi\frac{t-nT}{T}}.

It also follows that if T>12BT > \frac{1}{2B}, the exact reconstruction will not be possible since the shifted frequency components will overlap with each other. This is known as aliasing. When there is aliasing, one can compute the error in the reconstruction via Parseval's theorem (see Theorem).

Remark.

To see that the informational content of a finite bandwidth signal is captured by sampling, consider the following (Shannon's argument): Since x^\hat{x} has bounded support [B,B][-B, B], x(k2B)=x^(f^)12Bei2π2Bfdfx(\frac{k}{2B}) = \int \hat{x}(\hat{f})\frac{1}{\sqrt{2B}}e^{-i\frac{2\pi}{2B}f}df can be viewed to be the FCD\mathcal{F}_{CD} of f^\hat{f}, but now in time domain. Having access to x(k2B),kZx(\frac{k}{2B}), k \in \mathbb{Z} then is sufficient to recover x^\hat{x} which can then be used to recover the original signal. The more detailed analysis above also provides an explicit construction, and also further insight on the approximation error when there is aliasing. The same analysis applies for the discrete-time setting to be discussed next.

Sampling of a Discrete-Time (DT) Signal

A similar discussion applies to DT signals. Let {x(n)}\{x(n)\} be a DT signal. If this signal has a finite bandwidth as BB, that is if

x^(f)=0,f>B,f[0,1),\hat{x}(f) = 0, \quad |f| > B, \quad f \in [0, 1),

then it is possible to reconstruct exactly this signal by samples of this signal, where the sampling period NN that allows this satisfies:

12N>B\frac{1}{2N} > B

As in the CT-case, the function that we use for sampling is the discrete-time impulse train given by.

wN(n)=kZδ(nkN)w_N(n) = \sum_{k \in \mathbb{Z}}\delta(n - kN)

We can take the truncated sum

wN(M)(n):=k=MMδ(nkN)w_N^{(M)}(n) := \sum_{k=-M}^{M}\delta(n - kN)

and work with this signal instead of the impulse train, which is in l2(Z;R)l_2(\mathbb{Z};\mathbb{R}) and construct an approximate signal (via Parseval's theorem after reconstruction of the signal via the low-pass filter) and then take MM \to \infty.

This will give rise to the idealized analysis noted in the following: As earlier, using the fact that MMei2πfkN\sum_{-M}^{M}e^{-i2\pi fkN}, converges as a distribution, as MM \to \infty, to an impulse train; the DCFT of wNw_N is equal to the distribution represented by:

w^N(f)=1NkZδ(fkN)\hat{w}_N(f) = \frac{1}{N}\sum_{k \in \mathbb{Z}}\delta(f - \frac{k}{N})

Therefore, let xN(n)=x(n)×wN(n)x_N(n) = x(n) \times w_N(n). It follows that

x^N(f)=1NkZx^(fkN)\hat{x}_N(f) = \frac{1}{N}\sum_{k \in \mathbb{Z}} \hat{x}(f - \frac{k}{N})

Thus, the same discussion we had above for the CT case applies here also.

Applying a low-pass filter with Fourier transform given by N1(f<12N)N1_{(|f|<\frac{1}{2N})}, whose inverse Fourier is the kernel

h(n)=sin(πnN)πnNh(n) = \frac{\sin(\frac{\pi n}{N})}{\frac{\pi n}{N}}

leads to the reconstruction to be written as:

x~(n)=kZx(kN)sin(πnkNN)πnkNN.\tilde{x}(n) = \sum_{k \in \mathbb{Z}} x(kN)\frac{\sin(\pi\frac{n-kN}{N})}{\pi\frac{n-kN}{N}}.

One further remark follows: When a signal is sampled, the unsampled components become zero. Since it is already known that these values are zero, they can be taken out. This is known as decimation. Decimation has the effect of enlarging the bandwidth of the sampled signal, but it does not lead to an information loss. That is, let xd(n)=xN(nN)=x(nN)x_d(n) = x_N(nN) = x(nN) for all NN where xx satisfies the conditions noted above to allow for recovery from its samples. Then, we have

x~(n)=kZxd(k)sin(πnkNN)πnkNN.\tilde{x}(n) = \sum_{k \in \mathbb{Z}} x_d(k)\frac{\sin(\pi\frac{n-kN}{N})}{\pi\frac{n-kN}{N}}.

Furthermore, we have that

x^d(f)=nZxd(n)ei2πfn=nZxN(nN)ei2πfn=kZxN(k)ei2πfNk=x^N(fN),\hat{x}_d(f) = \sum_{n \in \mathbb{Z}} x_d(n)e^{-i2\pi fn} = \sum_{n \in \mathbb{Z}} x_N(nN)e^{-i2\pi fn} = \sum_{k \in \mathbb{Z}} x_N(k)e^{-i2\pi\frac{f}{N}k} = \hat{x}_N(\frac{f}{N}),

since xN(k)=0x_N(k) = 0 for kk not divisible by NN.


Exercises

ExampleReconstruction of a Box Signal

Suppose that we have a continuous time signal xL2(R;R)x \in L_2(\mathbb{R};\mathbb{R}) given by:

x(t)=m1{t1n},x(t) = m1_{\{|t| \leq \frac{1}{n}\}},

where mR+m \in \mathbb{R}_+ is a constant. Note that this signal has a bounded support.

Suppose that we sample this signal with a period TT. Our goal is to try to reconstruct this signal from its samples after passing the sampled signal through a low-pass filter with a frequency response

h^(f)=T1{f12T}\hat{h}(f) = T1_{\{|f| \leq \frac{1}{2T}\}}

Let x~\tilde{x} denote the reconstructed signal.

a) Given mm and TT, is perfect reconstruction possible (in the L2(R;R)L_2(\mathbb{R};\mathbb{R}) sense)? For what values of m,Tm, T?

b) Given an arbitrary mm and TT, find an upper bound on

Rx(t)x~(t)2dt\int_{\mathbb{R}} |x(t) - \tilde{x}(t)|^2 dt

as a function of the FCC\mathcal{F}_{CC} of xx.

Hint: For part b, you may use Parseval's Theorem. One may expect that if the energy of the signal frequencies outside [1/2T,1/2T][-1/2T, 1/2T] band is small, the reconstruction error may also be small.

ExampleDT Signal Sampling and Recovery

a) Consider a discrete-time signal {x(n)}\{x(n)\} with a bandwidth BB. A discrete-time sampler samples this signal with a period NN such that the sampled signal satisfies

xp(n)={x(n)if 0nmodN,0else.x_p(n) = \begin{cases} x(n) & \text{if } 0 \equiv n \mod N, \\ 0 & \text{else.} \end{cases}

Following this, a decimator is applied to the system to obtain the signal:

xd(n)=xp(nN).x_d(n) = x_p(nN).

This new signal is stored in a storage device such as a recorder. Later, the original signal is attempted to be recovered from the storage device. What should the relation between BB and NN be such that, such a recovery is perfect, that is

supnx(n)x~(n)=0,\sup_n |x(n) - \tilde{x}(n)| = 0,

where {x~(n)}\{\tilde{x}(n)\} denotes the reconstructed signal.

Identify the steps such that {x~(n)}\{\tilde{x}(n)\} is recovered from {xd(n)}\{x_d(n)\}.

b) Typically human voice has a bandwidth of 4kHz. Suppose we wish to store a speech signal with bandwidth equal to 4kHz with a recorder. Since the recorder has finite memory, one needs to sample the signal. What is the maximum sampling period (in seconds) to be able to reconstruct this signal with no error?

ExampleImpulse Train is a Distribution and its CCFT

Consider an impulse train defined by:

wP(t)=nZδ(t+nP)w_P(t) = \sum_{n \in \mathbb{Z}} \delta(t + nP)

so that the distribution that we can associate with this impulse train would be defined by:

wP(ϕ)=nZϕ(nP)=limNn=NNϕ(nP),\overline{w_P}(\phi) = \sum_{n \in \mathbb{Z}} \phi(nP) = \lim_{N \to \infty} \sum_{n=-N}^{N} \phi(nP),

for ϕS\phi \in \mathcal{S}.

a) Show that wP\overline{w_P} is a distribution.

b) Show that

wP^(ϕ)=1Pw1P(t)ϕ(t)dt,\hat{\overline{w_P}}(\phi) = \int \frac{1}{P} w_{\frac{1}{P}}(t) \phi(t) dt,

that is, the FCC\mathcal{F}_{CC} of this impulse train is another impulse train.

Solution. a) Let ϕn0\phi_n \to 0 in S\mathcal{S}. Then, since suptϕn(t)(1+t2)0\sup_t |\phi_n(t)(1 + t^2)| \to 0,

wP(ϕ)=kZϕn(kP)=kZ11+k2P2(ϕn(kP)(1+k2P2))kZ11+k2P2supkZ(ϕn(kP)(1+k2P2))0|\overline{w_P}(\phi)| = |\sum_{k \in \mathbb{Z}} \phi_n(kP)| = |\sum_{k \in \mathbb{Z}} \frac{1}{1 + k^2 P^2}\left(\phi_n(kP)(1 + k^2 P^2)\right)| \leq \sum_{k \in \mathbb{Z}} \frac{1}{1 + k^2 P^2} \sup_{k \in \mathbb{Z}} \left(\phi_n(kP)(1 + k^2 P^2)\right) \to 0

Thus, wP\overline{w_P} is continuous on S\mathcal{S}. Furthermore, wP\overline{w_P} is linear on S\mathcal{S} since for any real α,β\alpha, \beta and ϕ1,ϕ2S\phi_1, \phi_2 \in \mathcal{S},

wP(αϕ1+βϕ2)=αwP(ϕ1)+βwP(ϕ2).\overline{w_P}(\alpha\phi_1 + \beta\phi_2) = \alpha\overline{w_P}(\phi_1) + \beta\overline{w_P}(\phi_2).

Thus, wP\overline{w_P} is a distribution.

b) By the relevant section, we have that wP^(ϕ)=wP(ϕ^)\hat{\overline{w_P}}(\phi) = \overline{w_P}(\hat{\phi}). Then,

wP^(ϕ)=wP(ϕ^)=limNk=NNϕ^(kP)=limNk=NN(ϕ(t)ei2πkPtdt)\hat{\overline{w_P}}(\phi) = \overline{w_P}(\hat{\phi}) = \lim_{N \to \infty} \sum_{k=-N}^{N} \hat{\phi}(kP) = \lim_{N \to \infty} \sum_{k=-N}^{N} \left(\int \phi(t) e^{-i2\pi k P t} dt\right)

=limNϕ(t)(k=NNei2πkPt)dt= \lim_{N \to \infty} \int \phi(t) \left(\sum_{k=-N}^{N} e^{-i2\pi k P t}\right) dt

Using the geometric series formula and the fact that sin(2π(N+1/2)Pt)sin(πPt)\frac{\sin(2\pi(N+1/2)Pt)}{\sin(\pi Pt)} is periodic with period 1/P1/P, and for t[12P,12P]t \in [-\frac{1}{2P}, \frac{1}{2P}] this function converges (as a distribution) to a delta function (see Theorem), the result follows:

wP^(ϕ)=limNk=NN1Pϕ(kP)=1Pw1P(t)ϕ(t)dt\hat{\overline{w_P}}(\phi) = \lim_{N \to \infty} \sum_{k=-N}^{N} \frac{1}{P}\phi(\frac{k}{P}) = \int \frac{1}{P} w_{\frac{1}{P}}(t)\phi(t) dt

ExampleDCFT of Downsampled Signal

Consider a discrete-time signal {h(n)}\{h(n)\} with DCFT as:

h^(f)=1(f([0,18](78,1)))f[0,1).\hat{h}(f) = 1_{(f \in ([0,\frac{1}{8}] \cup (\frac{7}{8},1)))} \quad f \in [0, 1).

Determine the DCFT of the signal g(n)=h(2n),nZg(n) = h(2n), n \in \mathbb{Z}.

ExampleHilbert Transform and Modulation

a) Let m(t)m(t) be a real-valued signal with a bandwidth BB. One can use a transformation, known as the Hilbert transform, to further compress the signal. This transform makes use of the fact that, the Fourier transform of a real signal is conjugate symmetric.

Let xˉ\bar{x} denote the Hilbert transform of a signal xx in L2L_2, the space of square integrable functions with the usual inner product. The CCFT of the Hilbert transform of a signal is given by:

xˉ^(f)=isign(f)x^(f).\hat{\bar{x}}(f) = -i\text{sign}(f)\hat{x}(f).

Using this relation, prove that the Hilbert transform of a signal is orthogonal to the signal itself.

b) Briefly describe the (double-sideband) Amplitude Modulation (AM) and the Frequency Modulation (FM) techniques for radio communications.

Using the result in part a), one can further suppress the bandwidth requirement for the double-sideband Amplitude Modulation (AM) technique, leading to a single-sideband AM signal.

ExampleBounded Support and Bounded Bandwidth

Consider a square-integrable signal with non-zero L2L_2 norm, with bounded support. That is, there exists a compact set, outside of which this signal is identically zero. Can the CCFT of such a signal, with a bounded support in time-domain, also have bounded support in frequency domain?

You may use any method you wish to use to answer this question.