You are on page 1of 77

Chapter 4 sampling of

continous-time signals

4.1 periodic sampling

4.2 discrete-time processing of continuous-time signals

4.3 continuous-time processing of discrete-time signal


4.4 digital processing of analog signals

4.5 changing the sampling rate using discrete-time processing


4.1 periodic sampling

1.ideal sample
x[n] xc (t ) |t nT xc (nT ) Tsample period
fs=1/T:sample rate
s=2/T:sample rate
Figure 4.1 ideal continous-time-to-discrete-time(C/D)converter
time normalization
tt/T=n


(t nT )
n

Figure 4.2(a) mathematic model for ideal C/D


Figure 4.3

frequency spectrum
change of ideal sample

X ( j( k ))
1
X s ( j)
s N N T
c s
k
No aliasing

s N N

aliasing
X (e j ) X s ( j) | / T
s / 2

2
X ( j( k 2 ) / T )
1

aliasing frequency T T
c
k
Period =2in time domain
w=2.1and w=0.1are the same

cos(2.1n) cos(0.1n)
trigonometric function property
high frequency is changed into low frequency in time domain
w=1.1 and w=0.9are the same

cos(1.1n) cos(0.9n)
trigonometric function property
2.ideal reconstruction

Figure 4.10(b) ideal D/C converter


ideal reconstruction in frequency domain

Figure 4.4
s / 2
EXAMPLE Figure 4.5 Take sinusoidal signal for example to
understand aliasing from frequency domain

s 0
EXAMPLE

xa (t ) cos(2 5t ),0 t 1, f 5Hz


Sampling frequency:8Hz

Reconstruct frequency:

f ' 8 5 3Hz
Figure 4.10(a) mathematic model for ideal D/C

X r ( j) X s ( j) H r ( j) X c ( j)
T | | c
H r ( j)
0 | | c
X r ( j ) X s ( j ) H r ( j )
1 1 C

jt
hr (t ) IFT {H r ( j)} H r ( j ) e d Te jt d
2 2 C

sin( c t ) sin( t / T )

t / T t / T

sin( t / T )
xr (t ) xs (t ) hr (t ) [ x[n] (t nT )]
n t / T

sin( t / T )
sin[ (t nT ) / T ]
x[n][ (t nT ) ] x[n] ideal reconstruction in
n t / T n (t nT ) / T time domain
sin( x)
sin c( x)
x
sin c( x)
EXAMPLE

Figure 4.9
understand aliasing from time-
domain interpolation
EXAMPLE
3.Nyquist sampling theorems

s N N

s N N
Nyquist sampling theorems:

let xc (t ) be a band lim ited signal with


X c ( j) 0, | | N
then xc (t ) is uniquely det er min ed by its samples
x[n] xc (nT ), n 0,1,2,
if s N N , that is
2 1
( s ) 2 N , or ( f s ) 2 f N
T T
s / 2 : nyquist frequency
2 N : nyquist rate
s 2 N : oversampling
s 2 N : undersampling
Haa ( j)

c s / 2

Figure 4.41 Digital processing of analog signals


examples of sampling theorem1

The highest frequency of analog signal ,which wav file with sampling rate
16kHz can show is

8kHz

The higher sampling rate of audio files, the better fidelity.


examples of sampling theorem2

according to what you know about the sampling rate of MP3


filejudge the sound we can feel

frequency range B
A20~44.1kHz B20~20kHz
C20~4kHz D20~8kHz
EXAMPLE Matlab codes to realize
interpolation

xa (t ) cos(10t ),0 t 1, f 5Hz


f s 10 Hz(T 0.1s )
draw x[n] xa (nT ) cos(10nT ) cos(n)
draw reconstruction signal :

sin[ (t nT ) / T ]
y (t )
n
x[n]
(t nT ) / T
T=0.1;
n=0:10; x=cos(10*pi*n*T); stem(n,x);
dt=0.001; t=ones(11,1)* [0:dt:1]; n=n'*ones(1,1/dt+1);
y=x*sinc((t-n*T)/T); hold on; plot(t/T,y,'r')
Supplement: band-pass sampling theorem

f s 2( f H f L )(1 M / N )
fH
N int
fH fL
fH
M N
fH fL
f H 5B
4 B f H 5B

4fs
Nf s 2 f H
fH / B (M N )
f s 2 f H / N 2B 2B 2 B(1 M / N )
N N
4.1 summary

1.representation in time domain of sampling

x[n] xc (t ) |t nT xc (nT )
2.changes in frequency domain caused by sampling

X ( j( k ))
1
X s ( j) c s
T
k

X ( j( k 2 ) / T )
1
X ( e j ) c
T
k
3. understand reconstruction in frequency domain
4. understand reconstruction in time domain
5. sampling theorem

s N N

s N N
Requirements and difficulties
frequency spectrum chart of sampling and reconstruction
comprehension and application of sampling theorem
4.2 discrete-time processing of
continuous-time signals

Figure 4.11
H (e jT ) | | / T
H eff ( j)
0 | | / T
conditionsLTIno aliasing or aliasing occurred outside the pass band of filters

EXAMPLE

Figure 4.12
EXAMPLE

aliasing occurred outside


the pass band of digital
filters satisfies the
equivalent relation of
frequency response
mentioned before.

Figure 4.13
4.3 continuous-time processing of discrete-time signal

Figure 4.16
H (e j ) Hc ( j / T ) for | |

Figure 4.12
EXAMPLE Ideal delay systemnoninteger delay

H (e j ) e j
4.4 digital processing of analog signals

quantization and coding

Figure 4.41
Sampling and holding

Figure 4.46(b)
uniform
quantization and
coding

Figure 4.48 2 X m / 2 B , B : bit numbers


SNR 6 B 1.25(dB)
Figure 4.51

quantization
error of 3BIT

quantization
error of 8BIT
nonuniform quantization

0
vector quantization

x index0
4
4
3 3 3
3 3
2
2 1 1
codeword 1 codeword d(x,c0)=5
c0
c1 d(x,c1)=11
x 4 4 d(x,c2)=8
3 3
2 2
1
d(x,c3)=8
codeword 1 codeword
c2 c3

vector quantization
Example: image coding
Initial image block4 gray-levelsdimentions k=44=16

x 0 1 2 3
d(x,y0)=25
Code book C y0, y1 , y2, y3
d(x,y1)=5
d(x,y2)=25
d(x,y3)=46
y0 y1 y2 y3
codeword y1 is the most adjacent to xso it is coded by
the index 01.
reconstruction

Figure 4.53 D/A

h(t ) RN (t )
Figure 4.5
record the digital sound
Influence caused by sampling rate
and quantizing bits
Different tones require
different sampling rates.
4.1~4.4 summary

1. representation in time domain and changes in


frequency domain of sampling and reconstruction.
sampling theorem educed from aliasing in
frequency domain
2. analog signal processing in digital system or digital
signal in analog system , to explain some digital
systems their frequency responses are linear in
dominant period
3. steps in A/D conversion
Requirements and difficulties
sampling processing in time and frequency domain
frequency spectrum chart;
comprehension and application of sampling theorem;
frequency response in discrete-time processing system of
continuous-time signals;
4.5 changing the sampling rate using
discrete-time processing

4.5.1 sampling rate reduction by an integer factor


(downsampling, decimation)
4.5.2 increasing the sampling rate by an integer factor
(upsampling, interpolation)
4.5.3 changing the sampling rate by a noninteger fact
4.5.4 application of multirate signal processing
4.5.1 sampling rate reduction by an integer factor
(downsampling, decimation)

xd [n] x[nM ]
a sampling rate compressor :

Figure 4.20
time-domain of downsampling decrease the datareduce the sampling rate
M=2fs=fs/M,T=MT

frequency-domain of downsampling take aliasing into consideration

X d e M
M 1
1
j ( 2i ) / M
X
i 0
e j ( 2i ) / M
EXAMPLE M=2

j 1

X d (e ) X e j / 2 X e j ( 2 ) / 2)
2

X (e j )

2 0 2
X d ( e j )
1/ 2

2 0 2

Figure 4.21(c)(d)
EXAMPLE M=3

j 1

X d (e ) X e j / 3 X e j ( 2 ) / 3) X e j ( 4 ) / 3)
3


X (e j )

2 0 j 2
X d (e )

2 0 2
EXAMPLE M=3aliasing

Figure 4.22(b)(c)

frequency spectrum after decimationperiod=2


M times wider1/M times higher
Condition to avoid aliasing N / M

Total downsampling systemTotal system

Figure 4.23
4.5.2 increasing the sampling rate by an integer factor
(upsampling, interpolation)

x[n / L] n 0, L,2 L
xe [n]
0 other

or , xe [n] x[k ] [n kL]
k
a sampling rate exp ander :

x e [n]
x[n] L
time-domain of upsampling increase the dataraise the sampling rate

L=2fs=Lfs,T=T/L

frequency-domain of upsampling need not take aliasing into consideration

X e (e j ) X (e jL )
EXAMPLE

Figure 4.25

L=2

Take T=T/L as D/C:



/T' N
L L T

frequency domain of
reverse mirror-image filter

transverse axis is 1/L timer shortermagnitude has no change. L mirror images in a


period. Period=2also period =2 /L
total upsampling systemtotal system

Figure 4.24

time-domain explanation of reverse mirror-image filter :slowly-changed signal by interpolation


sin n / L

hi [n] IFT [ H e j ] L
n

xi [n] xe [n] hi [n] ( x[k ] [n kL]) hi [n]
k

x[k ]( [n kL] h [n])
k
i

(n kL)

sin
x[k ]hi [n kL] x[k ]
L
k k
(n kL)
L
EXAMPLE
time-domain process of
mirror-image filter
Use linear interpolation actually

Figure 4.27
4.5.3 changing the sampling rate by a noninteger factor

L
fs ' fs
M

Figure 4.28
EXAMPLE change 400 Hz' s signal to 300 Hz
L 3, M 4
X (e j )

2 0 2
X e (e j ), X i (e j )

2 0 / 4 2

Y ( e j )

2 0 2

Advantages of decimation after interpolation


1.Combine antialiasing and reverse mirror-image filter
2.Lossless information for upsampling
4.5.4 application of multirate signal processing

1.Sampling systemreplace high-powered analog antialiasing filter and low sampling


rate with low-powered analog antialiasing filter , oversampling and high-powered
digital antialiasing filter, decimation. Transfer the difficulty of the realization of high-
powered analog filter to the design of high-powered digital filter.

Figure 4.43
FIGURE 4.44
2.reconstruction systemreplace high-powered analog reconstructing filter with
interpolation, high-powered digital reverse mirror-image filter and low-powered
analog analog reconstructing filter.
xe[n] xi[n]
x[n] L x(t)
h1(t)
3. filter bank
analysis and synthesis of
sub band

y 0 [ n]
x[n] h0 [n] M M h0 [n] x[n]
y1 [ n]
h1 [ n ] M M h1 [ n ]
..........
..........
..........
..........
.

y N [n]
hN [n] M M hN [n]
In MP3, M=32sub-band analysis filter bank is 32 equi-band filters with center
frequency uniformly distributed from 0 to

MP3 coders use different quantization to realize compression for signals yi[n] in
different sub-bands.
examplecompression for M=2
X (e j )

0 2
Y0 (e j ) Y1 (e j )
' '

0 2
0 2

Y0 (e j ) Y1 (e j )

0 2
0 2

Y0 (e j ) Y1 (e j )
'' ''

0 2 0 2

Y1 (e j )
'
Y0 (e j )
'

0 2 0 2

16bit f s
bit rate before compressio n
16bit fs / 2 8bit fs / 2 12bit fs
bit rate after compressio n
4.pitch scaledecimation or interpolation sampling rate of reconstruction is
not changed.
decimation an d interpolation to
realize pitch scale
4.5 summary

4.5.1 sampling rate reduction by an integer factor


4.5.2 increasing the sampling rate by an integer factor
4.5.3 changing the sampling rate by a noninteger fact
4.5.4 application of multirate signal processing

requirement
frequency spectrum chart of interpolation and decimation
exercises

4.15 (b)(c)
4.24(a)(b)
4.26 only for h= /4