Chapter 4 sampling of continous-time signals 4.5 changing the sampling rate using discrete-time...

77
Chapter 4 sampling of continous-time signals changing the sampling rate using discrete-time pro 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

Transcript of Chapter 4 sampling of continous-time signals 4.5 changing the sampling rate using discrete-time...

Page 1: Chapter 4 sampling of continous-time signals 4.5 changing the sampling rate using discrete-time processing 4.1 periodic sampling 4.2 discrete-time processing.

Chapter 4 sampling of continous-time signals

4.5 changing the sampling rate using discrete-time processing

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

Page 2: Chapter 4 sampling of continous-time signals 4.5 changing the sampling rate using discrete-time processing 4.1 periodic sampling 4.2 discrete-time processing.

4.1 periodic sampling

1.ideal sample

) ( | ) ( ] [nT x t x n xc nT t c

T : sample periodfs=1/T:sample rateΩs=2π/T:sample rate

Page 3: Chapter 4 sampling of continous-time signals 4.5 changing the sampling rate using discrete-time processing 4.1 periodic sampling 4.2 discrete-time processing.

Figure 4.1 ideal continous-time-to-discrete-time(C/D)converter

Page 4: Chapter 4 sampling of continous-time signals 4.5 changing the sampling rate using discrete-time processing 4.1 periodic sampling 4.2 discrete-time processing.

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

n

nTt )(

time normalization tt/T=n

Page 5: Chapter 4 sampling of continous-time signals 4.5 changing the sampling rate using discrete-time processing 4.1 periodic sampling 4.2 discrete-time processing.

Figure 4.3

NNs

frequency spectrum change of ideal sample

NNs

aliasing frequency

No aliasing

aliasing

k

scs kjXT

jX ))((1

)(

T

k

c

Tsj

TkjXT

jXeX

)/)2((1

|)()( /

2/s

2

Page 6: Chapter 4 sampling of continous-time signals 4.5 changing the sampling rate using discrete-time processing 4.1 periodic sampling 4.2 discrete-time processing.

) 1. 0 cos( ) 1. 2 cos(n n Period =2πin time domain :

w=2.1πand w=0.1πare the same

trigonometric function property

Page 7: Chapter 4 sampling of continous-time signals 4.5 changing the sampling rate using discrete-time processing 4.1 periodic sampling 4.2 discrete-time processing.

) 9. 0 cos( ) 1. 1 cos(n n high frequency is changed into low frequency in time domain :

w=1.1π and w=0.9πare the same

trigonometric function property

Page 8: Chapter 4 sampling of continous-time signals 4.5 changing the sampling rate using discrete-time processing 4.1 periodic sampling 4.2 discrete-time processing.

2.ideal reconstruction

Figure 4.10(b) ideal D/C converter

Page 9: Chapter 4 sampling of continous-time signals 4.5 changing the sampling rate using discrete-time processing 4.1 periodic sampling 4.2 discrete-time processing.

Figure 4.4

ideal reconstruction in frequency domain

2/ s

Page 10: Chapter 4 sampling of continous-time signals 4.5 changing the sampling rate using discrete-time processing 4.1 periodic sampling 4.2 discrete-time processing.

Figure 4.5EXAMPLE Take sinusoidal signal for example to understand aliasing from frequency domain

0 s

Page 11: Chapter 4 sampling of continous-time signals 4.5 changing the sampling rate using discrete-time processing 4.1 periodic sampling 4.2 discrete-time processing.

Hzftttxa 5,10),52cos()(

Hzf 358'

Reconstruct frequency:

EXAMPLE

Sampling frequency:8Hz

Page 12: Chapter 4 sampling of continous-time signals 4.5 changing the sampling rate using discrete-time processing 4.1 periodic sampling 4.2 discrete-time processing.

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

c

cr

crsr

TjH

jXjHjXjX

||

||

0)(

)()()()(

Page 13: Chapter 4 sampling of continous-time signals 4.5 changing the sampling rate using discrete-time processing 4.1 periodic sampling 4.2 discrete-time processing.

ideal reconstruction in time domain

)(sin xc

Tt

Tt

Tt

t

dTedejHjHIFTth

jHjXjX

c

tjtjrrr

rsr

C

C

/

)/sin(

/

)sin(2

1)(

2

1)}({)(

)()()(

x

xxc

TnTt

TnTtnx

Tt

TtnTtnx

Tt

TtnTtnxthtxtx

nn

nrsr

)sin()(sin

/)(

]/)(sin[][]

/

)/sin()(][[

/

)/sin(])(][[)()()(

Page 14: Chapter 4 sampling of continous-time signals 4.5 changing the sampling rate using discrete-time processing 4.1 periodic sampling 4.2 discrete-time processing.

Figure 4.9

EXAMPLE

Page 15: Chapter 4 sampling of continous-time signals 4.5 changing the sampling rate using discrete-time processing 4.1 periodic sampling 4.2 discrete-time processing.

EXAMPLE

understand aliasing from time-domain interpolation

Page 16: Chapter 4 sampling of continous-time signals 4.5 changing the sampling rate using discrete-time processing 4.1 periodic sampling 4.2 discrete-time processing.

3.Nyquist sampling theorems

NNs

NNs

Page 17: Chapter 4 sampling of continous-time signals 4.5 changing the sampling rate using discrete-time processing 4.1 periodic sampling 4.2 discrete-time processing.

Nc

c

jX

withsignalitedbandabetxlet

||,0)(

lim)(

ingundersampl

ngoversampli

ratenyquist

frequencynyquist

Ns

Ns

N

s

:2

:2

:2

:2/

,2,1,0),(][

mindet)(

nnTxnx

samplesitsbyederuniquelyistxthen

c

c

NsNs

NNs

fT

forT

isthatif

2)1

(,2)2

(

,

Nyquist sampling theorems:

Page 18: Chapter 4 sampling of continous-time signals 4.5 changing the sampling rate using discrete-time processing 4.1 periodic sampling 4.2 discrete-time processing.

Figure 4.41 Digital processing of analog signals

2/sc

)( jHaa

Page 19: Chapter 4 sampling of continous-time signals 4.5 changing the sampling rate using discrete-time processing 4.1 periodic sampling 4.2 discrete-time processing.

examples of sampling theorem( 1 )

8kHz

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

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

Page 20: Chapter 4 sampling of continous-time signals 4.5 changing the sampling rate using discrete-time processing 4.1 periodic sampling 4.2 discrete-time processing.
Page 21: Chapter 4 sampling of continous-time signals 4.5 changing the sampling rate using discrete-time processing 4.1 periodic sampling 4.2 discrete-time processing.

according to what you know about the sampling rate of MP3 file , judge the sound we can feel

frequency range ( )

( A ) 20~44.1kHz ( B ) 20~20kHz ( C ) 20~4kHz ( D ) 20~8kHz

B

examples of sampling theorem( 2 )

Page 22: Chapter 4 sampling of continous-time signals 4.5 changing the sampling rate using discrete-time processing 4.1 periodic sampling 4.2 discrete-time processing.

:

)cos()10cos()(][

)1.0(10

5,10),10cos()(

signaltionreconstrucdraw

nnTnTxnxdraw

sTHzf

Hzftttx

a

a

s

n TnTt

TnTtnxty

/)(

]/)(sin[][)(

EXAMPLE Matlab codes to realize interpolation

Page 23: Chapter 4 sampling of continous-time signals 4.5 changing the sampling rate using discrete-time processing 4.1 periodic sampling 4.2 discrete-time processing.

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')

Page 24: Chapter 4 sampling of continous-time signals 4.5 changing the sampling rate using discrete-time processing 4.1 periodic sampling 4.2 discrete-time processing.

Supplement: band-pass sampling theorem :

Nff

fM

ff

fN

NMfff

LH

H

LH

H

LHs

int

)/1)((2

Page 25: Chapter 4 sampling of continous-time signals 4.5 changing the sampling rate using discrete-time processing 4.1 periodic sampling 4.2 discrete-time processing.

BfH 5

Page 26: Chapter 4 sampling of continous-time signals 4.5 changing the sampling rate using discrete-time processing 4.1 periodic sampling 4.2 discrete-time processing.

4fs

BfB H 54

)/1(2)(

2/

2/2

2

NMBN

NMB

N

BfBNff

fNf

HHs

Hs

Page 27: Chapter 4 sampling of continous-time signals 4.5 changing the sampling rate using discrete-time processing 4.1 periodic sampling 4.2 discrete-time processing.

4.1 summary

1.representation in time domain of sampling

) ( | ) ( ] [nT x t x n xc nT t c

Page 28: Chapter 4 sampling of continous-time signals 4.5 changing the sampling rate using discrete-time processing 4.1 periodic sampling 4.2 discrete-time processing.

2.changes in frequency domain caused by sampling

k

cj

k

scs

TkjXT

eX

kjXT

jX

)/)2((1

)(

))((1

)(

Page 29: Chapter 4 sampling of continous-time signals 4.5 changing the sampling rate using discrete-time processing 4.1 periodic sampling 4.2 discrete-time processing.

3. understand reconstruction in frequency domain

Page 30: Chapter 4 sampling of continous-time signals 4.5 changing the sampling rate using discrete-time processing 4.1 periodic sampling 4.2 discrete-time processing.

4. understand reconstruction in time domain

Page 31: Chapter 4 sampling of continous-time signals 4.5 changing the sampling rate using discrete-time processing 4.1 periodic sampling 4.2 discrete-time processing.

5. sampling theorem

NNs

NNs

Page 32: Chapter 4 sampling of continous-time signals 4.5 changing the sampling rate using discrete-time processing 4.1 periodic sampling 4.2 discrete-time processing.

Requirements and difficulties :frequency spectrum chart of sampling and reconstructioncomprehension and application of sampling theorem

Page 33: Chapter 4 sampling of continous-time signals 4.5 changing the sampling rate using discrete-time processing 4.1 periodic sampling 4.2 discrete-time processing.

4.2 discrete-time processing of continuous-time signals

Figure 4.11

Page 34: Chapter 4 sampling of continous-time signals 4.5 changing the sampling rate using discrete-time processing 4.1 periodic sampling 4.2 discrete-time processing.

Figure 4.12

EXAMPLE

T

TeHjHTj

eff/||0

/||)()(

conditions : LTI ; no aliasing or aliasing occurred outside the pass band of filters

Page 35: Chapter 4 sampling of continous-time signals 4.5 changing the sampling rate using discrete-time processing 4.1 periodic sampling 4.2 discrete-time processing.

Figure 4.13

EXAMPLE

aliasing occurred outside the pass band of digital

filters satisfies the equivalent relation of frequency response mentioned before.

Page 36: Chapter 4 sampling of continous-time signals 4.5 changing the sampling rate using discrete-time processing 4.1 periodic sampling 4.2 discrete-time processing.

4.3 continuous-time processing of discrete-time signal

Figure 4.16

Page 37: Chapter 4 sampling of continous-time signals 4.5 changing the sampling rate using discrete-time processing 4.1 periodic sampling 4.2 discrete-time processing.

||)/()( forTjHeH cj

Figure 4.12

c

Page 38: Chapter 4 sampling of continous-time signals 4.5 changing the sampling rate using discrete-time processing 4.1 periodic sampling 4.2 discrete-time processing.

jj eeH )(

EXAMPLE Ideal delay system : noninteger delay

Page 39: Chapter 4 sampling of continous-time signals 4.5 changing the sampling rate using discrete-time processing 4.1 periodic sampling 4.2 discrete-time processing.

4.4 digital processing of analog signals

Figure 4.41

quantization and coding

Page 40: Chapter 4 sampling of continous-time signals 4.5 changing the sampling rate using discrete-time processing 4.1 periodic sampling 4.2 discrete-time processing.

Figure 4.46(b)

Sampling and holding

Page 41: Chapter 4 sampling of continous-time signals 4.5 changing the sampling rate using discrete-time processing 4.1 periodic sampling 4.2 discrete-time processing.

Figure 4.48

uniform quantization and

coding

)(25.16

numbersbit :,2/2

dBBSNR

BX Bm

Page 42: Chapter 4 sampling of continous-time signals 4.5 changing the sampling rate using discrete-time processing 4.1 periodic sampling 4.2 discrete-time processing.

Figure 4.51

quantization error of 3BIT

quantization error of 8BIT

Page 43: Chapter 4 sampling of continous-time signals 4.5 changing the sampling rate using discrete-time processing 4.1 periodic sampling 4.2 discrete-time processing.

0 量化前的电平

量化后的电平

nonuniform quantization

Page 44: Chapter 4 sampling of continous-time signals 4.5 changing the sampling rate using discrete-time processing 4.1 periodic sampling 4.2 discrete-time processing.

x4

3 32

3

1

32

2 21

34

34

1

1 1

3

4

码书

codeword

c0

codeword c1

codeword c2

codeword c3

index0

d(x,c0)=5

d(x,c1)=11

d(x,c2)=8

d(x,c3)=8

一维信号例子:

x

vector quantization

Page 45: Chapter 4 sampling of continous-time signals 4.5 changing the sampling rate using discrete-time processing 4.1 periodic sampling 4.2 discrete-time processing.

Example: image coding

Initial image block( 4 gray-levels, dimentions k=4×4=16)

x 0 1 2 3

Code book C ={ y0, y1 , y2, y3}

y0 y1 y2 y3

codeword y1 is the most adjacent to x, so it is coded by the index “01”.

d(x,y0)=25

d(x,y1)=5

d(x,y2)=25

d(x,y3)=46

vector quantization

Page 46: Chapter 4 sampling of continous-time signals 4.5 changing the sampling rate using discrete-time processing 4.1 periodic sampling 4.2 discrete-time processing.

Figure 4.53 D/A 过程

)()( tRth N

reconstruction

Page 47: Chapter 4 sampling of continous-time signals 4.5 changing the sampling rate using discrete-time processing 4.1 periodic sampling 4.2 discrete-time processing.

Figure 4.5

Page 48: Chapter 4 sampling of continous-time signals 4.5 changing the sampling rate using discrete-time processing 4.1 periodic sampling 4.2 discrete-time processing.

record the digital sound

Page 49: Chapter 4 sampling of continous-time signals 4.5 changing the sampling rate using discrete-time processing 4.1 periodic sampling 4.2 discrete-time processing.

Influence caused by sampling rate and quantizing bits

Page 50: Chapter 4 sampling of continous-time signals 4.5 changing the sampling rate using discrete-time processing 4.1 periodic sampling 4.2 discrete-time processing.

Different tones require different sampling

rates.

Page 51: Chapter 4 sampling of continous-time signals 4.5 changing the sampling rate using discrete-time processing 4.1 periodic sampling 4.2 discrete-time processing.

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

Page 52: Chapter 4 sampling of continous-time signals 4.5 changing the sampling rate using discrete-time processing 4.1 periodic sampling 4.2 discrete-time processing.

Requirements and difficulties :sampling processing in time and frequency domain , freq

uency spectrum chart;comprehension and application of sampling theorem;frequency response in discrete-time processing system of c

ontinuous-time signals;

Page 53: Chapter 4 sampling of continous-time signals 4.5 changing the sampling rate using discrete-time processing 4.1 periodic sampling 4.2 discrete-time processing.

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

Page 54: Chapter 4 sampling of continous-time signals 4.5 changing the sampling rate using discrete-time processing 4.1 periodic sampling 4.2 discrete-time processing.

4.5.1 sampling rate reduction by an integer factor(downsampling, decimation)

:

][][

compressorratesamplinga

nMxnxd

Figure 4.20

Page 55: Chapter 4 sampling of continous-time signals 4.5 changing the sampling rate using discrete-time processing 4.1 periodic sampling 4.2 discrete-time processing.

time-domain of downsampling : decrease the data , reduce the sampling rate

frequency-domain of downsampling : take aliasing into consideration

1

0

/)2(/)2( 1 M

i

MijMijd eX

MeX

M=2 , fs’=fs/M,T’=MT

Page 56: Chapter 4 sampling of continous-time signals 4.5 changing the sampling rate using discrete-time processing 4.1 periodic sampling 4.2 discrete-time processing.

)2/)2(2/

2

1)( jjj

d eXeXeX

)( jdeX

)( jeX

202

202

2/1

Figure 4.21(c)(d)

EXAMPLE M=2

Page 57: Chapter 4 sampling of continous-time signals 4.5 changing the sampling rate using discrete-time processing 4.1 periodic sampling 4.2 discrete-time processing.

)3/)4()3/)2(3/

3

1)( jjjj

d eXeXeXeX

)(jeX

)(j

d eX 202

202

EXAMPLE M=3

Page 58: Chapter 4 sampling of continous-time signals 4.5 changing the sampling rate using discrete-time processing 4.1 periodic sampling 4.2 discrete-time processing.

Figure 4.22(b)(c)

EXAMPLE M=3 , aliasing

frequency spectrum after decimation : period=2π ,M times wider , 1/M times higher

Page 59: Chapter 4 sampling of continous-time signals 4.5 changing the sampling rate using discrete-time processing 4.1 periodic sampling 4.2 discrete-time processing.

Figure 4.23

MN / Condition to avoid aliasing :

Total downsampling system : Total system

Page 60: Chapter 4 sampling of continous-time signals 4.5 changing the sampling rate using discrete-time processing 4.1 periodic sampling 4.2 discrete-time processing.

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

:exp

][][][,

2,,0

0

]/[][

anderratesamplinga

kLnkxnxor

other

LLnLnxnx

k

e

e

][nxe][nx L

Page 61: Chapter 4 sampling of continous-time signals 4.5 changing the sampling rate using discrete-time processing 4.1 periodic sampling 4.2 discrete-time processing.

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

time-domain of upsampling : increase the data , raise the sampling rate

frequency-domain of upsampling : need not take aliasing into consideration

)()( jLje eXeX

Page 62: Chapter 4 sampling of continous-time signals 4.5 changing the sampling rate using discrete-time processing 4.1 periodic sampling 4.2 discrete-time processing.

Figure 4.25

EXAMPLE

L=2

transverse axis is 1/L timer shorter , magnitude has no change. L mirror images in a period. Period=2π , also period =2 π /L

Take T’=T/L as D/C:

NTT

LL

'/

frequency domain of reverse mirror-image filter

Page 63: Chapter 4 sampling of continous-time signals 4.5 changing the sampling rate using discrete-time processing 4.1 periodic sampling 4.2 discrete-time processing.

total upsampling system : total system

Figure 4.24

kki

ik

ik

iei

ji

LkLnL

kLn

kxkLnhkx

nhkLnkx

nhkLnkxnhnxnx

n

LnLeHIFTnh

)(

)(sin

][][][

])[][]([

][)][][(][][][

/sin][][

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

Page 64: Chapter 4 sampling of continous-time signals 4.5 changing the sampling rate using discrete-time processing 4.1 periodic sampling 4.2 discrete-time processing.

EXAMPLEtime-domain process of

mirror-image filter

Page 65: Chapter 4 sampling of continous-time signals 4.5 changing the sampling rate using discrete-time processing 4.1 periodic sampling 4.2 discrete-time processing.

Figure 4.27

Use linear interpolation actually

Page 66: Chapter 4 sampling of continous-time signals 4.5 changing the sampling rate using discrete-time processing 4.1 periodic sampling 4.2 discrete-time processing.

4.5.3 changing the sampling rate by a noninteger factor

Figure 4.28

M

Lff ss '

Page 67: Chapter 4 sampling of continous-time signals 4.5 changing the sampling rate using discrete-time processing 4.1 periodic sampling 4.2 discrete-time processing.

4,3

300'400

ML

HztosignalsHzchangeEXAMPLE

Page 68: Chapter 4 sampling of continous-time signals 4.5 changing the sampling rate using discrete-time processing 4.1 periodic sampling 4.2 discrete-time processing.

)( jeX

202)(),( jeiXjeeX

24/02

202

)( jeY

Advantages of decimation after interpolation :1.Combine antialiasing and reverse mirror-image filter2.Lossless information for upsampling

Page 69: Chapter 4 sampling of continous-time signals 4.5 changing the sampling rate using discrete-time processing 4.1 periodic sampling 4.2 discrete-time processing.

4.5.4 application of multirate signal processing

Figure 4.43

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 high-powered analog filter to the design of high-powered digital filter.

Page 70: Chapter 4 sampling of continous-time signals 4.5 changing the sampling rate using discrete-time processing 4.1 periodic sampling 4.2 discrete-time processing.

FIGURE 4.44

Page 71: Chapter 4 sampling of continous-time signals 4.5 changing the sampling rate using discrete-time processing 4.1 periodic sampling 4.2 discrete-time processing.

x(t) 模拟重构滤波 x[n] 反镜像滤波 零 阶 保 持h1(t)

↑ L

xe[n] xi[n]

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.

Page 72: Chapter 4 sampling of continous-time signals 4.5 changing the sampling rate using discrete-time processing 4.1 periodic sampling 4.2 discrete-time processing.

][0 ny][ nx ][0 nh

][1 nh

][ nh N ][ nh N

][0 nh

][1 nh

M

M

M M

M

M ][ nx

][1 ny

][ ny N

.........................................

analysis and synthesis of sub band

3. filter bank

Page 73: Chapter 4 sampling of continous-time signals 4.5 changing the sampling rate using discrete-time processing 4.1 periodic sampling 4.2 discrete-time processing.

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.

Page 74: Chapter 4 sampling of continous-time signals 4.5 changing the sampling rate using discrete-time processing 4.1 periodic sampling 4.2 discrete-time processing.

20

)(1jeY

20

)( jeX

20

)('0jeY

20

)('1jeY

20

)(0jeY

20

)(''0jeY

20

)(''1jeY

20

)('0jeY

20

)('1jeY

example : compression for M=2

fsbitfsbitfsbit

fbit s

122/82/16ncompressioafter ratebit

16ncompressio before ratebit

::

Page 75: Chapter 4 sampling of continous-time signals 4.5 changing the sampling rate using discrete-time processing 4.1 periodic sampling 4.2 discrete-time processing.

decimation an d interpolation to realize pitch scale

4.pitch scale : decimation or interpolation , sampling rate of reconstruction is not changed.

Page 76: Chapter 4 sampling of continous-time signals 4.5 changing the sampling rate using discrete-time processing 4.1 periodic sampling 4.2 discrete-time processing.

4.5 summary

requirement :frequency spectrum chart of interpolation and decimation

4.5.1 sampling rate reduction by an integer factor4.5.2 increasing the sampling rate by an integer factor4.5.3 changing the sampling rate by a noninteger fact

4.5.4 application of multirate signal processing

Page 77: Chapter 4 sampling of continous-time signals 4.5 changing the sampling rate using discrete-time processing 4.1 periodic sampling 4.2 discrete-time processing.

exercises

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