Transcript Chapter 4

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 )
T:sample 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
tt/T=n


 (t  nT )
n  
Figure 4.2(a) mathematic model for ideal C/D
Figure 4.3
frequency spectrum
change of ideal sample
s   N   N
X s ( j) 
1
T

X
c(
j (  k s ))
k  
No aliasing
s   N   N
aliasing
X (e
s / 2
aliasing frequency
2

  T

1
T
j
)  X s ( j) |  / T

X
k  
c(
j (  k 2 ) / T )
Period =2πin time domain:
w=2.1πand w=0.1πare the same
trigonometric function property
cos(2.1n)  cos(0.1n)
high frequency is changed into low frequency in time domain:
w=1.1π and w=0.9πare the same
trigonometric function property
cos(1.1n)  cos(0.9n)
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
s  0
Take sinusoidal signal for example to
understand aliasing from frequency domain
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
H r ( j )  
0
|  |  c
|  |  c
X r ( j )  X s ( j ) H r ( j )
hr (t )  IFT {H r ( j)} 

sin(  c t )
t / T

1
2



H r ( j ) e
jt
C
Te
jt
d
t / T
 xr (t )  xs (t )  hr (t )  [  x[n] (t  nT )] 
n  

 x[n][ (t  nT ) 
n  
sin c( x) 
2

C
sin( t / T )


d 
1
sin( t / T )
t / T

]

n  
x[n]
sin( t / T )
t / T
sin[  (t  nT ) / T ]
 (t  nT ) / T
sin( x)
x
sin c( x)
ideal reconstruction in
time domain
EXAMPLE
Figure 4.9
EXAMPLE
understand aliasing from timedomain interpolation
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
( s 
2
T
)  2 N , or ( f s 
 s / 2 : nyquist
frequency
2 N : nyquist rate
 s  2 N : oversampling
 s  2 N : undersampling
1
T
)  2 fN
Haa ( j)
c  s / 2
Figure 4.41 Digital processing of analog signals
examples of sampling theorem(1)
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 theorem(2)
according to what you know about the sampling rate of MP3
file,judge the sound we can feel
frequency range(
(A)20~44.1kHz
(C)20~4kHz
B )
(B)20~20kHz
(D)20~8kHz
EXAMPLE
Matlab codes to realize
interpolation
xa (t )  cos(10t ),0  t  1, f  5 Hz
f  10 Hz(T  0.1s )
s
draw x[n]  xa (nT )  cos(10nT )  cos(n)
draw reconstruction signal :

y (t ) 

n  
x[n]
sin[ (t  nT ) / T ]
 (t  nT ) / T
T=0.1;
n=0:10;
dt=0.001;
y=x*sinc((t-n*T)/T);
x=cos(10*pi*n*T);
t=ones(11,1)* [0:dt:1];
hold on;
stem(n,x);
n=n'*ones(1,1/dt+1);
plot(t/T,y,'r')
Supplement: band-pass sampling theorem:
f s  2( f H  f L )(1  M / N )


fH

N  int 
 f  f 
L 
 H


fH
 N
M 
 f  f 
L 
 H
f H  5B
4 B  f H  5B
4fs
Nf s  2 f H
f s  2 f H / N  2B
fH / B
N
 2B
(M  N )
N
 2 B(1  M / 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 s ( j) 
X (e
j
)
1
T
1
T

X
c(
j (  k s ))
c(
j (  k 2 ) / T )
k  

X
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 eff
jT

 H (e
)
( j)  

 0
|  |  / T
|  |  / T
conditions:LTI;no 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 )
c
Figure 4.12
for |  | 
EXAMPLE
Ideal delay system:noninteger 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 : bit numbers
B
SNR  6 B  1.25( dB)
Figure 4.51
quantization
error of 3BIT
quantization
error of 8BIT
nonuniform quantization
量化后的电平
0
量化前的电平
vector quantization
一维信号例子:
index0
x
4
4
3
3
3
2
3
3
2
1
codeword
1
1
c0
c1
d(x,c1)=11
d(x,c2)=8
3
3
2
codeword
d(x,c0)=5
4
4
x
codeword
1
c2
2
1
d(x,c3)=8
codeword
c3
码书
vector quantization
 Example: image coding
Initial image block(4 gray-levels,dimentions k=4×4=16)
x
0
Code book C ={y0, y1 , y2, y3}
1
2
3
d(x,y0)=25
d(x,y1)=5
d(x,y2)=25
d(x,y3)=46
y0
y1
y2
y3
codeword y1 is the most adjacent to x,so 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 data,reduce the sampling rate
M=2,fs’=fs/M,T’=MT
frequency-domain of downsampling :take aliasing into consideration

Xd e
j (  2i ) / M

1
M
M 1

X e
i 0
j (  2i ) / M

EXAMPLE
X d (e
M=2
j
)

1
2
X e
j / 2
  X e
j (  2 ) / 2 )
j
X (e )
 2
0
j
X d (e )
2
1/ 2
 2
0
Figure 4.21(c)(d)
2

EXAMPLE
X d (e
j
)
M=3

1
3
X e
j / 3
  X e
j (  2 ) / 3)

X (e j )
 2
0
 2
0
j
X d (e )
2
2
  X e
j (  4 ) / 3)

EXAMPLE
M=3,aliasing
Figure 4.22(b)(c)
frequency spectrum after decimation:period=2π,
M times wider,1/M times higher
Condition to avoid aliasing: N   / M
Total downsampling system:Total system
Figure 4.23
4.5.2 increasing the sampling rate by an integer factor
(upsampling, interpolation)
 x[ n / L]
xe [ n]  
0
n  0, L,2 L    
other

or , xe [ n] 
 x[k ] [n  kL]
k  
a sampling rate exp ander :
x[n]
L
x e [n ]
time-domain of upsampling :increase the data,raise the sampling rate
L=2,fs’=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:

L


L
/T'

T
 N
frequency domain of
reverse mirror-image filter
transverse axis is 1/L timer shorter,magnitude has no change. L mirror images in a
period. Period=2π,also period =2 π /L
total upsampling system:total system
Figure 4.24
time-domain explanation of reverse mirror-image filter :slowly-changed signal by interpolation
 ]  L sin n / L 
hi [ n]  IFT [ H e
j
n

xi [ n]  xe [n]  hi [ n]  (  x[k ] [ n  kL])  hi [ n]
k  


 x[k ]( [n  kL]  h [n])
i
k  
  ( n  kL) 
sin




L


  x[ k ]hi [ n  kL]   x[ k ]
 ( n  kL)
k  
k  
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
fs '  fs
Figure 4.28
L
M
EXAMPLE
change 400 Hz' s signal to 300 Hz
L  3, M  4
X (e
 2
j
0
X (e
e
 2
j
), X (e
i
0 / 4
Y (e
 2
)
0
j
2
)
2
j
)
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 system:replace 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 highpowered analog filter to the design of high-powered digital filter.
Figure 4.43
FIGURE 4.44
2.reconstruction system:replace high-powered analog reconstructing filter with
interpolation, high-powered digital reverse mirror-image filter and low-powered
analog analog reconstructing filter.
xe[n]
x[n]
↑L
反镜像滤波
xi[n]
零 阶 保 持
h1(t)
模拟重构滤波
x(t)
3. filter bank
x[n]
analysis and synthesis of
sub band
h0 [n]
h1 [ n ]
M
M
y 0 [ n]
y1 [ n ]
M
M
h0 [n]
h1 [ n ]
..........
..........
..........
..........
.
y N [n]
hN [n]
M
M
hN [n]
x[n]
In MP3, M=32,sub-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.
example:compression for M=2
X (e
0
'
Y0 (e
j
2
'
2
2
j
''
Y1 (e

'
2
'
j
Y1 (e

2
0
j
2
)
j
0
Y0 (e )
0
j
0
Y0 (e )
0
)

Y1 (e

j
0
)
0
''

Y1 (e

j
)
)
0
Y0 (e
j

2

2
)
)

2
bit rate before compressio n:
16bit  f s
bit rate after compressio n:
16bit  fs / 2  8bit  fs / 2  12bit  fs
4.pitch scale:decimation 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