Download as pdf or txt
Download as pdf or txt
You are on page 1of 20

Sampling and the Sampling Theorem

Sampling and the Sampling Theorem

Andrew W. H. House

11 May 2004

1 Review of the Sampling Theorem


We previously stated the sampling theorem, which allows us to reconstruct a continuous-time
signal from its discrete-time samples under certain conditions.
The Sampling Theorem states that, for a continuous-time (CT) signal xc (t) with CT Fourier
transform Xc (ω), if Xc (ω) = 0 for |ω| > ωm and ωs > 2ωm then
xd (n) = xc (nTs ) = xc (t)|t=nTs , n ∈ Z
completely represents xc (t) and xc (t) can be reconstructed from xd (n).
In other words, we need to sample fast enough to get more than 2 samples in each cycle of
xc (t)’s highest frequency. So, if Ts < 21 Tm , then xc (nTs ) represents xc (t).

2 The Sampling Theorem in Action


Let’s thing about applying the sampling theorem. Consider xc (t) = cos ωm t which has
fundamental period Tm .

ENGI 7824 – Discrete-Time Systems and Signals 1


Sampling and the Sampling Theorem

Recall that the Fourier transform of Xc (ω) = F{xc (t)} = F{cos ωm t} so

Xc (ω) = πδ(ω − ωm ) + πδ(ω + ωm ) .

Obviously in this case, Xc (ω) = 0 for |ω| > ωm , so the signal xc (t) is band-limited.
Let’s choose a value for ωs so that ωs > 2ωm and therefore
2π 2π
>2·
Ts Tm

or in other words Tm > 2Ts or Ts < 12 Tm and then we can plot as below.

We can kind of see how the samples represent xc (t).


Now consider the plot below.

ENGI 7824 – Discrete-Time Systems and Signals 2


Sampling and the Sampling Theorem

ox o x o
ox ox xo ox o x o xo
ox o x ox x ox
ox xo
ox xo xo x o x ox o
xo
x x
o
x o
o x ox
o
o
x x ox
x
o
o
xo o x ox
x xo x ox

Let’s assume that there are two sets of samples take, those marked with ‘x’, and those
marked with ‘o’. We will also assume that in each case, ωs > 2ωm so our sampling rate is
high enough.
Clearly, each set of samples will have different numerical values, since they record different
points on the original CT signal. Yet the sampling theorem suggests that the CT signal can
be reconstructed from either of the sets of samples.
How can this be? It seems counter-intuitive that different sets of samples will reproduce the
same signal. But that is what happens because the samples are used to recover the lowest
frequency signal. That basically means that there is only one possible signal that could have
produced a given set of samples, so long as the assumptions of the sampling theorem were
true.

3 Sampling Processes
We have seen, at least in a qualitative sense, how samples can represent a CT signal provided
that we follow the rules of the sampling theorem. At this point, we should consider how we
can get samples – after wall, without being able to sample real-world CT signals, there’s not
much point to this course. That is, we need to know how to get samples from a CT signal.

xc(t)
? xd(n)

ENGI 7824 – Discrete-Time Systems and Signals 3


Sampling and the Sampling Theorem

There are many methods to get samples, some of which are covered in the following subsec-
tions.

3.1 Sample-and-Hold Circuit

The sample-and-hold circuit (sometimes called zero-order hold) converts the held analog
values to digital values during the hold interval Ts , as show in the following diagram.

Essentially the circuit latches values of the analog signal during the hold intervals, producing
a series of stepped samples.

3.2 Pulse Amplitude Modulation (PAM) Sampling

This type of sampling multiplies a CT signal xc (t) with a pulse signal p(t) to get a series of
pulses that map certain portions of the original CT signal.

ENGI 7824 – Discrete-Time Systems and Signals 4


Sampling and the Sampling Theorem

In the pulse train, note that the area of each pulse is 1 – that is, its height can be considered
to be ∆, and its width 1/∆.
When the signal is modulated (multiplied) with the pulses, we get xp (t) = xc (t) · p(t) shown
below.

Each pulse of the modulated signal has an area that is approximately equal to the value of
the original signal at the middle of the pulse width, which is also the value of the DT sample
we would ideally have. This is illustrated in the above diagram.

ENGI 7824 – Discrete-Time Systems and Signals 5


Sampling and the Sampling Theorem

Each modulated pulse above can be integrated to get its area, as follows.
Z nTs +δ
xd (n) = xp (t)dt ≈ xc (nTs )
nTs −δ

Thus, the area of each modulated pulse is roughly the value of the sample. So this is a good
approximation, but is not exactly what we want.
But, what happens when the width of the pulse narrows, as ∆1 → 0? Our pulse train
p(t) becomes an impulse train, with each pulse being a Dirac delta, δ(t). This suggests a
theoretical approach to sampling, which we explore in the next section.

4 Ideal Impulse Train Sampling


Consider our pulse train p(t) from the previous section, with the width of the pulse going to
0 (and thus the height going to infinity).
1
As → 0, pulse train → impulse train.

So the impulse train is written as

X
p(t) = δ(t − nTs )
n=−∞

which is a series of shifted deltas.

So, using this p(t), what is xp (t) = xc (t) · p(t) now?


If we recall that Z +Ts /2 Z +Ts /2
p(t)dt = δ(t)dt = 1
−Ts /2 −Ts /2

then we get the following.


If our original CT signal is

ENGI 7824 – Discrete-Time Systems and Signals 6


Sampling and the Sampling Theorem

and our impulse train is

then we get a set of samples shown below.

So now Z nTs + T2s


xd (n) = xp (t)dt = xc (nTs )
nTs − T2s

a.k.a. train to samples. Note that the above is exactly equal, not approximately as with
PAM sampling before.

ENGI 7824 – Discrete-Time Systems and Signals 7


Sampling and the Sampling Theorem

Therefore, this is our model of ideal sampling, which is the kind of sampling that the sampling
theorem means.

Model:
xc(t) xp(t) Convert impulse xd(n)
train to samples

p(t)

This model above represents the basic concept of a C/D converter, illustrated below.

xc(t) C/D xd(n)

Ts

Example 4.1: Basic Sampling Theorem Exercises


Consider a CT signal xc (t) with a Fourier transform Xc (ω) that is sampled with
ideal sampling, with Ts = 10−4 seconds. For each of the following scenarios,
determine whether the sampling theorem guarantees that xc (t) can be recovered
from its samples.
1. What if Xc (ω) = 0 for |ω| > 5000π?
Since Ts = 10−4 seconds, ωs = 2π/Ts = 2π/10−4 = 20000π or fs = 1/Ts =
10000 Hz. In this scenario, ωm = 5000π = 2π · (2500).
Is (ωs = 20000π) > (2ωm = 10000π)?
Yes! Therefore, we can guarantee recovery of xc (t).
2. What if Xc (ω) = 0 for |ω| > 10000π?
In this case, ωm = 10000π.
Is (ωs = 20000π) > (2ωm = 20000π)?

ENGI 7824 – Discrete-Time Systems and Signals 8


Sampling and the Sampling Theorem

Obviously not. In this case, ωs = 2ωm which does not satisfy the require-
ments of the sampling theorem, which requires strictly greater than, not
greater than or equal. Therefore, we cannot guarantee recovery of xc (t).
3. What if Xc (ω) = 0 for |ω| > 15000π?
Here, ωm = 15000π.
Is (ωs = 20000π) > (2ωm = 30000π)?
Obviously not. Therefore, we cannot guarantee recovery of xc (t).
4. What if |Xc (ω)| = 0 for |ω| > 5000π?
This question isn’t quite so obvious. Can we figure out, from the given
information, whether the signal is band-limited? And if so, can we figure
out whether the sampling was fast enough?
Consider that since Xc (ω) = |Xc (ω)| ejΘ(ω) , we can be sure that Xc (ω) = 0
for |ω| > 5000π since in that range, Xc (ω) = 0 · ejΘ(ω) = 0.
So signal is band-limited, and ωm = 5000π.
Is (ωs = 20000π) > (2ωm = 10000π)?
Yes. Therefore, we can guarantee recovery of xc (t).
5. What if <e{Xc (ω)} = 0 for |ω| > 5000π?
Again, this is not an obvious question. Consider this representation of
Xc (ω).
Xc (ω) = <e{Xc (ω)} + j=m{Xc (ω)}

Here, we know that the real part is zero outside of the giving band limits
but we know nothing about the imaginary part. Thus, we can’t say for sure
whether it will be zero or non-zero.
Since we don’t know for sure whether Xc (ω) = 0 for |ω| > 5000π, we cannot
guarantee recovery.
6. What if Xc (ω) ∗ Xc (ω) = 0 for |ω| > 15000π?
This is another tricky situation. What can we figure out about Xc (ω)?
Thinking back to previous signals courses, recall that

Xc (ω) ∗ Xc (ω)
l Fourier Transform
2πxc (t)xc (t)

and we can illustrate what happens in this scenario.

ENGI 7824 – Discrete-Time Systems and Signals 9


Sampling and the Sampling Theorem

In this case, the band limits of the convolved transforms of Xc (ω) are twice
those of Xc (ω) itself.
So Xc (ω) = 0 for |ω| > 7500π, so ωm = 7500π.
Is (ωs = 20000π) > (2ωm = 15000π)?
Yes. Therefore, we can guarantee recovery of xc (t).
Additionally, for self-practice, you could identify the range of values of ωs for
each scenario that would allow the signal to be recovered.

5 Analysis of Ideal Sampling


In the preceding sections, we have shown our model of ideal sampling, in which the CT signal
xc (t) is modulated by an impulse train p(t) to produce xp (t). Naturally, we want to know
whether xp (t) really represents xc (t) uniquely and completely.
Since the sampling theorem talks about band-limited signals, it makes sense to do some
frequency analysis. First, we’ll do a quick review of the Fourier transform.

Aside: Review of Fourier Transform


Recall the Fourier transform Xc (ω) of CT signal xc (t) is given by:
Z +∞
Xc (ω) = F{xc (t)} = xc (t)e−jωt dt, ω ∈ R
−∞

This has the inverse transform given by:


Z +∞
−1 1
xc (t) = F {Xc (ω)} = Xc (ω)ejωt dω
2π −∞

ENGI 7824 – Discrete-Time Systems and Signals 10


Sampling and the Sampling Theorem

The above is true provided that xc (t) satisfies some conditions (such as being
finite energy) or if xc (t) is periodic with a non-standard Fourier transform.

So, for our frequency analysis, let us assume our sampling function is
+∞
X
p(t) = δ(t − nTs )
n=−∞

and that xc (t) is any CT signal that has a CT Fourier transform.


Consider xp (t), which is still a CT signal as well.

xp (t) = xc (t) · p(t)


" +∞ #
X
= xc (t) · δ(t − nTs ) , n ∈ Z
n=−∞
" +∞
#
X
= xc (t)δ(t − nTs ) , n ∈ Z
n=−∞
" +∞
#
X
= xc (nTs )δ(t − nTs ) , n ∈ Z
n=−∞

Note that the values of xc (nTs ) are the samples.


Now we analyze in the frequency domain. Recall that,

x(t) · y(t)
l Fourier Transform
1

X(ω) ∗ Y (ω)

so

Xp (ω) = F{xc (t) · p(t)}


1
= Xc (ω) ∗ P (ω)

but that leads to the question, “What is P (ω)?” That is, what is the Fourier transform of
P (ω)? ( )
X
P (ω) = F δ(t − nTs )
n

We know that p(t) is periodic, with period Ts , so P (ω) is a non-standard transform based
on its Fourier series.

ENGI 7824 – Discrete-Time Systems and Signals 11


Sampling and the Sampling Theorem

Aside: Fourier Series


For a periodic signal x(t) with period To , there is a Fourier series with coefficients
Z
1 2π
ak = x(t)ejkωo t dt with ωo =
To To To

and therefore a non-standard Fourier transform, shown here.


+∞
X
X(ω) = 2π ak δ(ω − kωo )
k=−∞

So, based on our knowledge of p(t) and Fourier transforms and series,
+∞
X 2π
P (ω) = 2π ak δ(ω − kωs ) where ωs =
k=−∞
Ts

where the values of ak are determined by


Z Ts
1 2
ak = p(t)e−jkωs t dt
Ts −Ts
2
Z Ts
1 2
= δ(t)e−jkωs t dt
Ts −Ts
2

1 −jkωs t
= e
Ts
t=0
1
=
Ts
which gives us a final expression for P (ω), shown and illustrated below.
+∞
2π X 2π
P (ω) = δ(ω − kωs ) with ωs =
Ts k=−∞ Ts

ENGI 7824 – Discrete-Time Systems and Signals 12


Sampling and the Sampling Theorem

Now that we know P (ω), we know


1
Xp (ω) = Xc (ω) ∗ P (ω)

+∞
1 2π X
= Xc (ω) ∗ δ(ω − kωs )
2π Ts k=−∞
+∞
1 X
= Xc (ω) ∗ δ(ω − kωs )
Ts k=−∞

which gives
+∞
1 X
Xp (ω) = Xc (ω − kωs )
Ts k=−∞

since x(t) ∗ δ(t − to ) = x(t − to ).


So Xp (ω) is a summation of scaled and shifted versions of Xc (ω). This is an important result.
Now, let’s consider an xc (t) and assume the sampling theorem conditions are met, so that
Xc (ω) = 0 for |ω| > ωm and ωs > 2ωm .

anything |ω| < ωm
So Xc (ω) =
0 |ω| > ωm

An example of a possible Xc (ω) is shown in the following figure.

With the Xc (ω) shown above, Xp (ω) would be as illustrated below, since it is made of shifted
and scaled replicas of Xc (ω):
1 1 1 1 1
Xp (ω) = . . .+ Xc (ω +2ωs )+ Xc (ω +ωs )+ Xc (ω)+ Xc (ω −ωs )+ Xc (ω −2ωs )+. . .
Ts Ts Ts Ts Ts

ENGI 7824 – Discrete-Time Systems and Signals 13


Sampling and the Sampling Theorem

We have non-overlapping replicas of Xc (ω) so that we can recover Xc (ω) from Xp (ω) by
defining a reconstruction filter, Hr (ω), defined and illustrated as follows.

−ωs ωs

Ts 2
<ω< 2
Hr (ω) =
0 |ω| > ω2s

Then, if the recovered signal Xr (ω) = Xp (ω) · Hr (ω) then Xr (ω) = Xc (ω) and therefore
xr (t) = xc (t). Thus xc (t) is recovered from its samples!

ENGI 7824 – Discrete-Time Systems and Signals 14


Sampling and the Sampling Theorem

The reconstruction occurs because it ignores all but one of the replicas (the lowest frequency
one) and undoes the scaling of Xc (ω) that occurs in Xp (ω) for that replica.
So this is how the reconstruction works when the sampling theorem conditions are met.
What happens if the conditions aren’t met? We’ll do two examples to explore that scenario.

Example 5.1: xc (t) is band-limited but undersampled


Suppose we have a CT signal xc (t) with Fourier transform Xc (ω), that is band-
limited. However, suppose we sample at less than the Nyquist rate. That is, let
ωs 6> 2ωm .
Let Xc (ω) be defined as in the figure below.

Also, recall the value of Xp (ω).


+∞
1 X
Xp (ω) = Xc (ω − kωs )
Ts k=−∞

With ωs 6> 2ωm , Xp (ω) would be as shown below. Note that the replicas overlap,
and thus add, in places. The added version is shown by a dotted line where it
differs from the non-adding parts.

ENGI 7824 – Discrete-Time Systems and Signals 15


Sampling and the Sampling Theorem

Let’s try to recover Xc (ω) using Hr (ω) by applying it to Xp (ω).

Ts |ω| < ω2s



Hr (ω) =
0 |ω| > ω2s

So now Xr (ω) = Hr (ω) · Xp (ω).

The above Xr (ω) is clearly not the same as Xc (ω), and so xr (t) 6= xc (t) and the
original signal is not recovered. This is called aliasing due to undersampling.
Also, as an item of note, in this case, if ωs = 2ωm exactly, we still would have
been able to recover Xc (ω). But that is only because, in this case, Xc (ω) = 0
at the band-limits, and thus there is no interference. That’s why the sampling
theorem can only guarantee recovery for ωs > 2ωm , since ωs = 2ωm depends on
the values of Xc (ω).

In the prior example, since the sampling rate was too low to meet the conditions of the
sampling theorem, we had overlapping replicas which added together and thus obscured the
original value. This is called aliasing.

ENGI 7824 – Discrete-Time Systems and Signals 16


Sampling and the Sampling Theorem

Example 5.2: sin function


Let xc (t) = sin ωo t and thus
π π
Xc (ω) = δ(ω − ωo ) − δ(ω + ωo )
j j

It is clear that Xc (ω) is band-limited to ωm = ωo .


Let us consider the possible scenarios for the sampling theorem.
1. When ωs > 2ωm ,

We have non-overlapping replicas, and a simple reconstruction filter Hr (ω)


as seen previously can reconstruct. This is not surprising, since we have
obeyed the rules of the sampling theorem.

ENGI 7824 – Discrete-Time Systems and Signals 17


Sampling and the Sampling Theorem

2. When ωs < 2ωm ,

Here, our replicas overlap. When we apply the reconstruction filter, we do


not recover the same signal. In fact, in this case, xr (t) = sin −(ωs − ωo )t =
− sin (ωs − ωo )t which is quite different from xc (t) = sin ωo t. Under this
sampling scheme, xr (t) is an alias of xc (t).
3. When ωs = 2ωm ,

In this case, even if weird stuff didn’t happen due to the undefined boundary
of the reconstruction filter, the replicas clearly cancel each other out. Thus,
the recovered signal will have no frequency components. xr (t) will be a DC
signal, which is clearly wrong.
We see aliasing again in this example. Aliasing can be avoided by following the
requirements of the sampling theorem.

Signals and Systems, 2E: Chapter 7.0 to 7.3, page(s) 514–534.


Signal Processing First: Chapter 4-1, 4-5, page(s) 71–79, 93–94.

We’ll conclude with an example covering ideal sampling, before looking at the concept of
aliasing in a bit more detail.

ENGI 7824 – Discrete-Time Systems and Signals 18


Sampling and the Sampling Theorem

Example 5.3: Ideal Sampling


Given that ∞
X 1
p(t) = δ (t − nTs ) and Ts = ,
n=−∞
6000

for each of the following signals, plot Xp (ω) which is the Fourier transform of
xp (t) = xc (t)·p(t), then determine what happens when that signal is reconstructed
by the ideal reconstruction filter Hr (ω) with cut-off frequency ωs /2, as defined
below.
Ts |ω| < ω2s

Hr (ω) =
0 |ω| > ω2s
sin 4000πt
1. Case 1: xc (t) = πt

Here, we can use the CT Fourier Transform tables in the textbooks to figure
out what Xc (ω) will be.

sin 4000πt
xc (t) = πt
l Fourier Transform

1 |ω| < 4000π
Xc (ω) =
0 |ω| > 4000π

This is clearly band-limited, with ωm = 4000π = 2π · 2000 and Tm =


1/2000. Since (ωs = 2π/Ts = 12000π) > (2ωm = 8000π), this meets the
requirements of the sampling theorem, and so no aliasing should occur.
Therefore, Xp (ω) is simply a set of shifted, scaled replicas of Xc (ω), as
shown below.
+∞
1 X
Xp (ω) = Xc (ω − kωs )
Ts k=−∞

This means that the ideal reconstruction filter will successfully recover the
original signal. In other words, Xr (ω) = Xp (ω) · Hr (ω) = Xc (ω).

ENGI 7824 – Discrete-Time Systems and Signals 19


Sampling and the Sampling Theorem

2. Case 2: xc (t) = 1 + cos 2000πt + sin 4000πt


Here, we can use the CT Fourier Transform tables in the textbooks to figure
out what Xc (ω) will be.

xc (t) = 1 + cos 2000πt + sin 4000πt


l Fourier Transform
Xc (ω) = 2πδ(ω) + πδ(ω − 2000π) + πδ(ω + 2000π)
π π
+ δ(ω − 4000π) − δ(ω + 4000π)
j j

This is also clearly band-limited, with ωm = 4000π = 2π · 2000 and Tm =


1/2000. Since (ωs = 2π/Ts = 12000π) > (2ωm = 8000π), this meets the
requirements of the sampling theorem, and so no aliasing should occur.
Therefore, Xp (ω) is simply a set of shifted, scaled replicas of Xc (ω), as
shown below.
+∞
1 X
Xp (ω) = Xc (ω − kωs )
Ts k=−∞

This means that the ideal reconstruction filter will successfully recover the
original signal. In other words, Xr (ω) = Xp (ω) · Hr (ω) = Xc (ω).
More examples involving aliasing will follow in the next section.

ENGI 7824 – Discrete-Time Systems and Signals 20

You might also like