SIGNALS AND SYSTEMS USING MATLAB
Chapter 8 Sampling Theory
Luis F. Chaparro
Uniform sampling
x(t)
xs (t)
Ts (t)
Ts 0 Ts 2Ts
Ts (t) =
Ts 2Ts
(t nTs )
1 X
xs (t) = x(t)Ts (t) =
x(t)e jks t
Ts
k=
2 / 14
Modulation
Ts (t), periodic, s = 2/Ts ,
Ts (t) =
Dk e jks t
k=
Dk =
1
,
Ts
xs (t) = x(t)Ts (t) =
1
Ts
X
k=
1 X
Xs () =
X ( ks )
Ts
k=
Discretetime Fourier transform
xs (t) =
x(nTs )(t nTs )
n=
Xs () =
x(nTs )e jTs n
n=
3 / 14
x(t)e jks t
X()
(a)
max
max
Xs ()
1/Ts
(b)
max
Xs ()
1/Ts
no aliasing
s max
s < 2 max
(c)
s 2 max
s = max
aliasing
(a) Spectrum of bandlimited signal, (b) spectrum of sampled signal when satisfying the Nyquist
sampling rate condition, (c) spectrum of sampled signal with aliasing (superposition of spectra, shown
in dashed lines, gives a constant shown by continuous line)
4 / 14
Bandlimited signals and Nyquist condition
A signal x(t) is bandlimited if its lowpass spectrum X () is such that
|X ()| = 0 for || > max ,
max : max frequency in x(t)
can be sampled uniformly and without frequency aliasing using a sampling frequency
s =
2
2max
Ts
Nyquist sampling rate condition
Example: x(t) = 2 cos(2t + /4), < t < , bandlimited
Ts = 0.4, s = 2/Ts = 5 > 2max = 4, satisfy Nyquist
4
x(nTs ) = 2 cos(2 0.4n + /4) = 2 cos
n+
<n <
5
4
5 / 14
Ts = 1, s = 2 < 2max = 4 aliasing
x(nTs ) = 2 cos(2n + /4) = 2 cos(/4) = 2.
(b)
2
x(t), x(0.4n)
x(t), x(0.2n)
(a)
2
0
1
2
0
1
2
(d)
x(t), x(n)
x(t), x(0.5n)
(c)
0
1
0
1
2
0
Sampling of x(t) = 2 cos(2t + /4): (a) Ts = 0.2, (b) Ts = 0.4, (c) Ts = 0.5 and (d) Ts = 1
sec/sample
6 / 14
Example: Causal exponential x(t) = e t u(t) is not bandlimited
X () =
1
1 + j
so that
|X ()| =
1
1 + 2
Frequency M so that 99% of the energy is in M M :
Z M
Z
1
0.99
|X ()|2d
|X ()|2d =
2 M
2
2 tan1()|0 M = 2 0.99 tan1()|
0
M = tan
0.99
2
= 63.66 rad/sec
Choose s = 2/Ts = 5M or Ts = 2/(5 63.66) 0.02 sec/sample
7 / 14
NyquistShannon sampling theorem
Lowpass signal x(t) is bandlimited (i.e., X () = 0 for || > max )
Information in x(t) preserved by sampled signal xs (t), with samples
x(nTs ) = x(t)|t=nTs , n = 0, 1, 2, , provided
sampling frequency s 2max (Nyquist sampling rate condition), or
sampling rate fs (samples/sec) or sampling periodTs (sec/sample) are
1
max
fs =
Ts
When Nyquist condition is satisfied, x(t) can be reconstructed by ideal lowpass
filtering xs (t):
frequency response ideal LPF H(j) =
Ts s /2 < < s /2
0
otherwise
Reconstructed (sinc interpolation)
xr (t) =
X
n=
x(nTs )
sin((t nTs )/Ts )
(t nTs )/Ts
8 / 14
Antialiasing filtering
For signals that do not satisfy the bandlimitedness condition
Xa ()
X()
c
H(s)
1
H(j)
Antialiasing filtering of non bandlimited signal
9 / 14
Example: Aliasing effects
x1(t) = cos(0t), x2(t) = cos((0 + 1)t) 1 > 20
sampling signals with Ts = 2/1
x1(nTs ) = cos(0nTs ), x2(nTs ) = cos((0 + 1)nTs ) = cos(0Ts n) = x1(nTs )
No frequency aliasing in x1(nTs ), frequency aliasing in x2(nTs )
x1(t)
x2(t)
x1(t),x2(t),x1(nTs)
x1(nTs)
0.5
0.5
1
0
Sampling sinusoids of frequencies 0 = 1 and 0 + 1 = 8 with Ts = 2/1 . The higher frequency
signal is undersampled, causing aliasing and making the two sampled signals coincide
10 / 14
Practical aspects of sampling Sampleandhold sampling
xs (t)
x(t)
ys (t)
h(t)
h(t)
1
Ts (t)
ys (t)
x(t)
xs (t)
Ts
Ts
Sampleandhold sampling system for = Ts ; ys (t) multilevel signal
"
#
X
1
sin(/2) j/2
ys (t) = (xs h)(t) Ys () =
X ( ks )
e
Ts
/2
k
11 / 14
Practical aspects of sampling Quantization and coding
x
(nTs )
01
00
11
10
x(nTs )
Fourlevel quantizer and coder.
Sampled signal x(nTs ) = x(t)|t=nTS
fourlevel quantizer: k x(nTs ) < (k + 1) x(nTs ) = k, k = 2, 1, 0, 1
coder assigns binary number to each output level of quantizer
12 / 14
Application to digital communications
PCM transmitter
m(t)
Sample
and hold
LPF
Quantizer
and coder
1011100
Channel
1011100
Repeater
Repeater
Repeater
PCM receiver
1011100
LPF
Decoder
PCM system: transmitter, channel and receiver.
13 / 14
m(t)
1011100
m
1 (t)
m1 (t)
m2 (t)
Quantizer
& encoder
m3 (t)
Channel
Decoder
m
2 (t)
m
3 (t)
Commutator
Decommutator
Time Division Multiplexin (TDM) system: transmitter, channel and receiver
14 / 14