chapter 2 - ustcstaff.ustc.edu.cn/~zhling/course_ssp/slides/chapter_02.pdfchapter 2 review of...

Post on 20-Jan-2021

3 Views

Category:

Documents

0 Downloads

Preview:

Click to see full reader

TRANSCRIPT

Chapter 2

Review of Fundamentals of Digital Signal Processing

数字信号处理基础回顾

1

Outline

• DSP and Discrete Signals• LTI Systems• z-Transform Representations• Discrete-Time Fourier Transform (DTFT)• Discrete Fourier Transform (DFT)• Digital Filtering• Sampling

2

DSP and Discrete Signals

3

What is DSP?

• Digital– Method to represent a quantity, a phenomenon or an event

• Signal– something (e.g., a sound, gesture, or object) that carries information– a detectable physical quantity (e.g., a voltage, current, or magnetic

field strength) by which messages or information can be transmitted• Processing

– Filtering/spectral analysis– Analysis, recognition, synthesis and coding of real world signals– Detection and estimation of signals in the presence of noise or

interference

4

Digital Processing of Analog Signals

• A-to-D conversion: bandwidth control, sampling and quantization

• Computational processing: implemented on computers or ASICs(专用集成电路) with finite-precision arithmetic– basic numerical processing: add, subtract, multiply (scaling,

amplification, attenuation), mute, …– algorithmic numerical processing: convolution or linear filtering,

non-linear filtering (e.g., median filtering), difference equations, DFT, inverse filtering, MAX/MIN, …

• D-to-A conversion: re-quantification and filtering (or interpolation) for reconstruction

5

Discrete-Time Signals

• A sequence of numbers• Mathematical representation

• Sampled from an analog signal, , at time

• is called the sampling period(采样周期), and its reciprocal is called the sampling frequency(采样频率)

6

[ ],x n n−∞ < < ∞( )ax t t nT=

[ ] ( ),ax n x nT n= −∞ < < ∞

T1/sF T=

8000Hz 1/ 8000 125 sec10000Hz 1/10000 100 sec16000Hz 1/16000 62.5 sec20000Hz 1/ 20000 50 sec

s

s

s

s

F TF TF TF T

µµµµ

= ↔ = == ↔ = == ↔ = == ↔ = =

Speech Waveform Display

7

Varying Sampling Rates

8

0 200 400 600 800 1000 1200 1400 1600-0.5

0

0.516kHz

0 100 200 300 400 500 600 700 800 900 1000-0.5

0

0.510kHz

0 100 200 300 400 500 600 700 800-0.5

0

0.58kHz

samples

Quantization

• Transforming a continuously valued input into a representation that assumes one out of a finite set of values

• The finite set of output values is indexed; e.g., the value 1.8 has an index of 6, or (110) in binary representation

• Storage or transmission uses binary representation; a quantization table is needed

9

Discrete Signals

10

Issues with Discrete Signals

• what sampling rate is appropriate – 6.4 kHz (telephone bandwidth), 8 kHz (extended

telephone BW), 10 kHz (extended bandwidth), 16 kHz (Hi-Fi speech)

• how many quantization levels are necessary at each bit rate (bits/sample)– 16, 12, 8, … => ultimately determines the S/N ratio of

the speech– speech coding is concerned with answering this

question in an optimal manner

11

The Sampling Theorem

• A bandlimited signal can be reconstructed exactly from samples taken with sampling frequency

12

max max1 22 or 2s sF fT T

π ω ω= ≥ = ≥

Demo Examples

• 5 kHz analog bandwidth – sampled at 10, 5, 2.5, 1.25 kHz (notice the aliasing

that arises when the sampling rate is below 10 kHz)

• quantization to various levels – 16,12,8, and 4 bit quantization (notice the

distortion introduced when the number of bits is too low)

13

Discrete-Time (DT) Signals are Sequences

• x[n] denotes the “sequence value at ‘time’ n”• Sources of sequences

– Sampling a continuous-time signal

– Mathematical formulas – generative system

14

[ ] ( ) ( )c c t NTx n x nT x t

== =

e.g., [ ] 0.3 [ 1] 1; [0] 40x n x n x= − − =

T

Impulse Representation of Sequences

15

A sequence,a function

Value of thefunction at k[ ] [ ] [ ]

kx n x k n kδ

=−∞

= −∑

3 1 2 7[ ] [ 3] [ 1] [ 2] [ 7]x n a n a n a n a nδ δ δ δ−= + + − + − + −

3 [ 3]a nδ− + 1 [ 1]a nδ −

2 [ 2]a nδ −7 [ 7]a nδ −

Some Useful Sequences

16

unit samplereal

exponential

unit step sine wave

1, 0[ ]

0, 0n

nn

δ=

= ≠[ ] nx n α=

1, 0[ ]

0, 0n

u nn≥

= <0[ ] cos( )x n A nω φ= +

Variants on Discrete-Time Step Function

signal flips around 0

17

[ ]u n 0[ ]u n n−

0[ ]u n n−

n n→− ⇔

LTI Systems

18

Signal Processing

• Transform digital signal into more desirable form

19

single input—single output single input—multiple output,e.g., filter bank analysis, etc.

LTI Discrete-Time Systems

• Linearity (superposition)

• Time-Invariance (shift-invariance)

• LTI implies discrete convolution

20

1 2 1 2T [ ] [ ] T [ ] T [ ]ax n bx n a x n b x n+ = +

1 1[ ] [ ] [ ] [ ]d dx n x n n y n y n n= − ⇒ = −

[ ] [ ] [ ] [ ] [ ] [ ] [ ]k

y n x k h n k x n h n h n x n∞

=−∞

= − = ∗ = ∗∑

LTI Discrete-Time Systems

21

ExampleIs system y[n] = x[n]+ 2x[n +1]+3 linear?

x1[n] → y1 [n] = x1 [n]+ 2x1 [n +1]+3

x2[n] → y2 [n] = x2 [n]+ 2x2 [n +1]+3x1 [n]+ x2 [n] →

y3[n] = x1 [n]+ x2 [n]+ 2x1 [n +1]+ 2x2 [n +1]+3≠y1[n]+ y2[n]⇒ Not a linear system!

Is system y[n] = x[n]+2x[n +1]+3 time/shift invariant?

y[n] = x[n]+ 2x[n +1]+3

y[n −n0] = x[n −n0]+ 2x[n −n0 +1]+3 ⇒ System is time invariant!

Is system y[n] = x[n]+2x[n +1]+3 causal?

y[n] depends on x[n +1] ⇒ System is not causal !

Convolution Example

22

1, 0 3[ ]

0, otherwisen

x n≤ ≤

=

1, 0 3[ ]

0, otherwisen

h n≤ ≤

=

What is y[n] for this system?

Solution

03

3

[ ] [ ] [ ] [ ] [ ]

1 1 1, 0 3

1 1 7 , 4 6

0, otherwise

m

n

m

m n

y n x n h n h m x n m

n n

n n

=−∞

=

= −

= ∗ = −

⋅ = + ≤ ≤

= ⋅ = − ≤ ≤

23

Convolution ExampleThe impulse response of an LTI system is of the form

and the input to the system is of the form

Determine the output of the system using the formula for discrete convolution.

Solution

24

[ ] [ ] 1,nx n b u n b b a= < ≠

[ ] [ ] 1nh n a u n a= <

0 0

1 1 1

[ ] [ ] [ ]

[ ] ( / ) [ ]

1 ( / ) [ ] [ ]1 ( / )

m n m

mn n

n m m n m

m m

n n nn

y n a u m b u n m

b a b u n b a b u n

a b b ab u n u na b b a

∞−

=−∞

= =

+ + +

= −

= =

− −= = − −

∑ ∑

Convolution ExampleConsider a digital system with input x[n] =1 for n=0,1,2,3 and 0 everywhere else, and with impulse responseDetermine the response y[n] of this linear system.

Solution• We recognize that x[n] can be written as the difference between two step

functions, i.e., x[n]= u[n]- u[n-4]. • Hence we can solve for y[n] as the difference between the output of the

linear system with a step input and the output of the linear system with a delayed step input.

• Thus we solve for the response to a unit step as:

25

[ ] [ ], 1nh n a u n a= <

1

1 1

1 1

[ ] [ ] [ ] [ ]1

[ ] [ ] [ 4]

nn m

m

a ay n u m a u n m u na

y n y n y n

−∞−

−=−∞

−= − = − = − −

Linear Time-Invariant Systems

• easiest to understand• easiest to manipulate• powerful processing capabilities• characterized completely by their response to unit sample,

h[n], via convolution relationship

• basis for linear filtering • used as models for speech production (source convolved with

system)

26

[ ] [ ] [ ] [ ] [ ] [ ] [ ] [ ] [ ]k k

y n x n h n x k h n k h k x n k h n x n∞ ∞

=−∞ =−∞

= ∗ = − = − = ∗∑ ∑

Signal Processing Operations

27

D is a delay of 1-sampleCan replace D with delay element z-1

Equivalent LTI Systems

28

More Complex Filter Interconnections

29

1 2 3 4

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

c

c

y n x n h nh n h n h n h n h n

= ∗= ∗ + +

Network View of Filtering (FIR Filter)

30

0 1 1[ ] [ ] [ 1] ... [ 1] [ ]M My n b x n b x n b x n M b x n M−= + − + + − + + −

Network View of Filtering (IIR Filter)

31

1 0 1[ ] [ 1] [ ] [ 1]y n a y n b x n b x n= − − + + −

z-Transform Representations

32

Transform Representations

• z-Transform

33

1

[ ] ( )

( ) [ ]

1[ ] ( )2

n

n

n

C

x n X z

X z x n z

x n X z z dzjπ

∞−

=−∞

=

=

Infinite power series in z-1, with x[n] as coefficients of term in z-n

• direct evaluation using residue theorem (留数定理)

• partial fraction expansion (部分分式展开)of X(z)

• long division (长除法)• power series expansion(幂级数展开)

Transform Representations

• X(z) converges (is finite) only for certain values of z– Sufficient condition for convergence

• region of convergence

34

[ ] n

nx n z

∞−

=−∞

< ∞∑

1 2R z R< <

Examples of Converge Regions

1. Delayed impulseconverges for

2. Box pulse

all finite length sequences converge in the region3.

all infinite duration sequences which are non-zero for n≥0 converge in the region

35

0[ ] [ ]x n n nδ= −0( ) nX z z−= 0 0 00, 0; , 0; , 0z n z n z n> > < ∞ < ∀ =

[ ] [ ] [ ]x n u n u n N= − −1

10

1( )1

NNn

n

zX z zz

−−−

−=

−= =

−∑ converges for 0 z< < ∞

0 z< < ∞

[ ] [ ] ( 1)nx n a u n a= <

10

1( )1

n n

nX z a z

az

∞−

−=

= =−∑ converges for z a>

1z R>

Examples of Converge Regions

4.

all infinite duration sequences which are non-zero for n<0 converge in the region

5. x[n] non-zero for -∞<n< ∞ can be viewed as a combination of 3 and 4, giving a convergence region of the form – sub-sequence for n≥0 ⇒– sub-sequence for n<0 ⇒– total sequence ⇒

36

[ ] [ 1]nx n b u n= − − −1

1

1( )1

n n

nX z b z

bz

−−

−=−∞

= − =−∑ converges for z b<

2z R<

1 2R z R< <

2z R<1z R>

1 2R z R< <

Examples

If x[n] has z-transform X(z) with ROC of ri<|z|<ro , find the z-transform, Y(z), and the region of convergence for the sequence y[n]=an x[n] in terms of X(z)

Solution

37

( ) [ ]

( ) [ ] [ ]

[ ]( / ) ( / )

ROC :

n

n

n n n

n n

n

n

i o

X z x n z

Y z y n z a x n z

x n z a X z a

a r z a r

∞−

=−∞

∞ ∞− −

=−∞ =−∞

∞−

=−∞

=

= =

= =

< <

∑ ∑

Examples

The sequence x[n] has z-transform X(z). Show that the sequence nx[n] has z-transform –zdX(z)/dz

Solution

38

1

( ) [ ]

( ) 1[ ] [ ]

1 ( [ ])

n

n

n n

n n

X z x n z

dX z nx n z nx n zdz z

Z nx nz

∞−

=−∞

∞ ∞− − −

=−∞ =−∞

=

= − = −

= −

∑ ∑

Inverse z-Transform

where C is a closed contour that encircles the origin of the z-plane and lies inside the region of convergence

39

11[ ] ( )2

n

Cx n X z z dz

jπ−= ∫

for X(z) rational(有理), can use a partial fraction expansion (部分分式展开) for finding inverse transforms

Partial Fraction Expansion

40

Example of Partial Fractions

41

Transform Properties

42

Linearity

Shift

Exponential Weighting

Linear Weighting

Time Reversal

Convolution

Multiplication ofSequences

1 2[ ] [ ]ax n bx n+ 1 2( ) ( )aX z bX z+

0[ ]x n n− 0 ( )nz X z−

[ ]na x n 1( )X a z−

[ ]nx n d ( ) / dz X z z−

[ ]x n− 1( )X z−

[ ] [ ]x n h n∗ ( ) ( )X z H z

[ ] [ ]x n w n 11 ( ) ( / )2 C

X v W z v v dzjπ

−∫

Discrete-Time Fourier Transform(DTFT)

43

Discrete-Time Fourier Transform

• evaluation of X(z) on the unit circle in the z-plane

• sufficient condition for existence of Fourier transform is

44

( ) ( ) [ ]

1[ ] ( ) d2

jj j n

z en

j j n

X e X z x n e

x n X e e

ωω ω

π ω ω

πω

π

∞−

==−∞

= =

=

[ ] [ ] , since 1n

n nx n z x n z

∞ ∞−

=−∞ =−∞

= < ∞ =∑ ∑

Simple DTFTs

45

Impulse

Delayed impulse

Step function

Rectangular window

Exponential

Backward exponential

DTFT Examples

46

DTFT Examples

Within interval is comprised of a pair of impulses at

47

, ( )jX e ωπ ω π− < <0ω±

DTFT Examples

48

DTFT Examples

49

Fourier Transform Properties

• Periodicity in ω

• Period of 2π corresponds to once around unit circle in the z-plane

50

( 2 )( ) ( )j j kX e X eω ω π+=

• normalized frequency: f, 0→0.5 →1 (independent of Fs)

• normalized radian frequency: ω, 0→π→2π (independent of Fs)

• digital frequency : fD=f*Fs, 0→0.5Fs →Fs

• digital radian frequency : ωD= ω*Fs, 0→πFs→2πFs

Discrete Fourier Transform(DFT)

51

Discrete-Time Fourier Series

• consider a periodic signal with period N (samples)

can be represented exactly by a discrete sum of sinusoids

52

[ ] [ ],x n x n N n= + −∞ < < ∞

[ ]x n

12 /

01

2 /

0

[ ] [ ]

1[ ] [ ]

Nj kn N

nN

j kn N

k

X k x n e

x n X k eN

π

π

−−

=

=

=

=

• N Fourier series coefficients

• N-sequence values

Finite Length Sequences

• consider a finite length (but not periodic) sequence, x[n], that is zero outside the interval 0≤n ≤N-1

• evaluate X(z) at equally spaced points on the unit circle,

– looks like discrete-time Fourier series of periodic sequence

53

1

0( ) [ ]

Nn

nX z x n z

−−

=

=∑

2 /

12 / 2 /

0

, 0,1,..., 1

[ ] ( ) [ ] , 0,1,..., 1

j k Nk

Nj k N j kn N

n

z e k N

X k X e x n e k N

π

π π−

=

= = −

= = = −∑

Relation to Periodic Sequence

• consider a periodic sequence, , consisting of an infinite sequence of replicas of

• The Fourier coefficients, , are then identical to the values of for the finite duration sequence ⇒a sequence of N length can be exactly represented by a DFT representation of the form

54

[ ]x n[ ]x n

[ ] [ ]r

x n x n rN∞

=−∞

= +∑

[ ]X k2 /( )j k NX e π

12 /

01

2 /

0

[ ] [ ] , 0 1

1[ ] [ ] , 0 1

Nj kn N

nN

j kn N

n

X k x n e k N

x n X k e n NN

π

π

−−

=

=

= ≤ ≤ −

= ≤ ≤ −

Periodic and Finite Length Sequences

55

Sampling in Frequency(Time Domain Aliasing)

56

Sampling in Frequency(Time Domain Aliasing)

57

Time Domain Aliasing Example

58

DFT Properties

• when using DFT representation, all sequences behave as if they were infinitely periodic ⇒ DFT is really the representation of the extended periodic function

59

Periodic Sequence Finite SequencePeriod = N Length = N

Sequence defined for all n Sequence defined for n = 0,1,…, N-1DFS defined for k = 0,1,…, N-1 DTFT defined for all ω

[ ] [ ]x n x n rN∞

−∞= +∑

DFT Properties for Finite Sequences

• X[k], the DFT of the finite sequence x[n], can be viewed as a sampled version of the z-transform (or Fourier transform) of the finite sequence (used to design finite length filters via frequency sampling method)

• the DFT has properties very similar to those of the z-transform and the Fourier transform

• the N values of X[k] can be computed very efficiently (time proportional to N log N) using the set of FFT methods

• DFT used in computing spectral estimates, correlation functions, and in implementing digital filters via convolutionalmethods

60

DFT Properties

61

N-point sequences N-point DFT

Linearity

Shift

Time Reversal

Convolution

Multiplication

1 2[ ] [ ]ax n bx n+ 1 2[ ] [ ]aX k bX k+

0([ ])Nx n n− 02 / [ ]j kn Ne X kπ−

*[ ]X k1

0[ ] ([ ])

N

Nm

x m h n m−

=

−∑ [ ] [ ]X k H k

[ ] [ ]x n w n1

0

1 [ ] ([ ])N

Nr

X r W k rN

=

−∑

([ ])Nx n−

Circular Shifting Sequences

62

Digital Filters

63

Digital Filters• digital filter is a discrete-time linear, shift invariant system

with input-output relation

• is the system function (系统函数) with as the complex frequency response (频率响应)

64

[ ] [ ] [ ] [ ] [ ]

( ) ( ) ( )m

y n x n h n x m h n m

Y z X z H z

=−∞

= ∗ = −

= ⋅

( )H z ( )jH e ω

arg[ ( )]

( ) ( ) ( )

( ) ( )

log ( ) log ( ) arg[ ( )]

log ( ) Re[log ( )]

arg[ ( )] Im[log ( )]

j

j j jr i

j j j H e

j j j

j j

j j

H e H e jH e

H e H e e

H e H e j H e

H e H e

H e H e

ω

ω ω ω

ω ω

ω ω ω

ω ω

ω ω

= +

=

= +

=

=

Digital Filters

• causal linear shift-invariant ⇒ h[n]=0 for n<0

• stable system ⇒ every bounded input produces a bounded output ⇒ a necessary and sufficient condition for stability and for the existence of

65

( )jH e ω

[ ]n

h n∞

=−∞

< ∞∑

Digital Filters

• input and output satisfy linear difference equation (线性差分方程) of the form

• evaluating z-transforms of both sides gives:

66

1 0[ ] [ ] [ ]

N M

k rk r

y n a y n k b x n r= =

− − = −∑ ∑

1 0

0

1

( ) ( ) ( )

( )( )( ) 1

N Mk r

k rk r

Mr

rr

Nk

kk

Y z a z Y z b z X z

b zY zH zX z a z

− −

= =

=

=

− =

= =−

∑ ∑

Digital Filters

• H(z) is a rational function of z-1 with M zeros and N poles

• converges for |z|>R1, with R1 <1 for stability ⇒all poles of H(z) inside the unit circle for a stable, causal system

67

1

1

1

1

(1 )( )

(1 )

M

rr

N

kk

A c zH z

d z

=

=

−=

Ideal Filter Responses

68

FIR System

• If ak=0, all k, then

1)

2) ⇒ M zeros

3) if (symmetric, anti-symmetric)

real(symmetric), imaginary(anti-symmetric)

69

0 10

[ ] [ ] [ ] [ 1] ... [ ]M

r Mr

y n b x n r b x n b x n b x n M=

= − = + − + + − ⇒∑[ ] 0

0 otherwisenh n b n M= ≤ ≤

=

1

0 1

( ) (1 )MM

nn m

n m

H z b z c z− −

= =

= = −∑ ∏[ ] [ ]h n h M n= ± −

/2( ) ( )( )

j j j M

j

H e A e eA e

ω ω ω

ω

−=

=

Linear Phase Filter

• no signal dispersion (散布) because of non-linear phase ⇒precise time alignment of events in signal

70

FIR Filters

• cost of linear phase filter designs– can theoretically approximate any desired response to any degree of

accuracy– requires longer filters than non-linear phase designs

• FIR filter design methods– window approximation ⇒ analytical, closed form method– frequency sampling approximation ⇒ optimization method– optimal (minimax error) approximation ⇒ optimization method

71

Matlab FIR Design

72

Lowpass Filter Design Example

73

FIR Implementation

• linear phase filters can be implemented with half the multiplications (because of the symmetry of the coefficients)

74

IIR Systems

• y[n] depends on y [n-1],…, y[n-N] as well as x[n], …, x[n-M]• for M<N

an infinite duration impulse response

75

1 0[ ] [ ] [ ]

N M

k rk r

y n a y n k b x n r= =

= − + −∑ ∑

01

1

1

1

( )11

[ ] ( ) [ ]

Mr

r Nr k

Nk k k

kk

Nn

k kk

b zAH zd za z

h n A d u n

=−

− =

=

=

= =−−

=

∑∑

(partial fraction expansion)

(for casual systems)

IIR Filters

• IIR filter issues– efficient implementations in terms of computations– can approximate any desired magnitude response with

arbitrarily small error– non-linear phase ⇒time dispersion of waveform

76

IIR Design Methods• Analog filter design

– Butterworth designs: maximally flat amplitude– Bessel designs: maximally flat group delay– Chebyshev designs: equi-ripple in either passband or stopband– Elliptic designs: equi-ripple in both passband and stopband

• Transform to digital filter– Impulse invariant transformation 冲击不变法

• match the analog impulse response by sampling• resulting frequency response is aliased version of analog frequency response

– Bilinear transformation 双线性变换法

• use a transformation to map an analog filter to a digital filter by warping the analog frequency scale (0 to infinity) to the digital frequency scale (0 to pi)

• use frequency pre-warping to preserve critical frequencies of transformation (i.e., filter cutoff frequencies)

77

Matlab Elliptic Filter Design

78

Matlab Elliptic Filter Design

79

IIR Filter Implementation

80

IIR Filter Implementation

81

IIR Filter Implementation

82

Sampling

83

Sampling of Waveforms

84

[ ] ( ),ax n x nT n= −∞ < < ∞

8000Hz 1/ 8000 125 sec10000Hz 1/10000 100 sec16000Hz 1/16000 62.5 sec20000Hz 1/ 20000 50 sec

s

s

s

s

F TF TF TF T

µµµµ

= ↔ = == ↔ = == ↔ = == ↔ = =

The Sampling Theorem

If a signal xa(t) has a bandlimited Fourier transform Xa(jΩ) such that Xa(jΩ) =0 for Ω ≥ 2πFN, then xa(t) can be uniquely reconstructed from equally spaced samples xa (nT), -∞<n<∞, if 1/T ≥ 2 FN (FS ≥ 2FN) (A-D or C/D converter)

85

Sampling Theorem Equations

86

Sampling Theorem Interpretation

87

Sampling Rates

• FN = Nyquist frequency (highest frequency with significant spectral level in signal)

• must sample at least twice the Nyquist frequency to prevent aliasing (frequency overlap)– telephone speech (300-3200 Hz)⇒ FS =6400 Hz– wideband speech (100-7200 Hz) ⇒ FS =14400 Hz– audio signal (50-21000 Hz) ⇒ FS =42000 Hz– AM broadcast (100-7500 Hz) ⇒ FS =15000 Hz

• can always sample at rates higher than twice the Nyquistfrequency (but that is wasteful of processing)

88

Recovery from Sampled Signal

• If 1/T > 2 FN , the Fourier transform of the sequence of samples is proportional to the Fourier transform of the original signal in the baseband, i.e.,

• can show that the original signal can be recovered from the sampled signal by interpolation using an ideal LPF of bandwidth π /T, i.e.,

– digital-to-analog converter

89

1( ) ( ),j TaX e X j

T TπΩ = Ω Ω <

sin( ( ) / )( ) ( )( ) /a a

n

t nT Tx t x nTt nT Tπ

π

=−∞

−= − ∑

Decimation(抽取) and Interpolation(内插) of Sampled Waveforms

• CD rate (44.06 kHz) to DAT rate (48 kHz)—media conversion• Wideband (16 kHz) to narrowband speech rates (8kHz, 6.67

kHz)—storage• oversampled to correctly sampled rates--coding

90

Decimation and Interpolation ofSampled Waveforms

91

Decimation

• Standard Sampling: begin with digitized signal

• can achieve perfect recovery of xa(t) from digitized sample under these conditions

92

Decimation

• to reduce sampling rate of sampled signal by factor of M ≥ 2• to compute new signal xd[n] with sampling rate

such that xd[n]= xa(nT’) with no aliasing• one solution is to downsample x[n]= xa(nT) by retaining one

out of every M samples of x[n] , giving xd[n]=x[nM]

93

' 1 / ' 1/ ( ) /s sF T MT F M= = =

Decimation

• need Fs’ ≥ 2 FN to avoid aliasing for M=2

• when Fs’ < 2 FN , we get aliasing for M=2

94

Decimation

• to decimate by factor of M with no aliasing, need to ensure that the highest frequency in x[n] is no greater than Fs/(2M)

• thus we need to filter x[n] using an ideal lowpass filter with response

• using the appropriate lowpass filter, we can downsample the reuslting lowpass-filtered signal by a factor of M without aliasing

95

1 /( )

0 /j

d

MH e

ω π

π ω π

<= < ≤

Interpolation• assume we have x[n]= xa(nT) (no aliasing) and we wish to increase the

sampling rate by the integer factor of L• we need to compute a new sequence of samples of xa(t) with period

T’’= T / L, i.e., xi[n]= xa(nT’’)= xa(nT/L) • It is clear that we can create the signal

xi[n]=x[n/L] for n = 0, ±L, ±2L, … but we need to fill in the unknown samples by an interpolation process

• can readily show that what we want is

• equivalently with T’’= T / L, x[n]= xa(nT) , we get

which relates xi[n] to x[n] directly96

sin( ( '' ) / )[ ] ( '') ( )( '' ) /i a a

k

nT kT Tx n x nT x kTnT kT Tπ

π

=−∞

−= = −

sin( ( / ))[ ] ( '') [ ]( / )i a

k

n L kx n x nT x kn L kπ

π

=−∞

−= = −

Interpolation• implementing the previous equation by filtering the upsampled sequence

• xu[n] has the correct samples for n = 0, ±L, ±2L, … , but it has zero-valued samples in between (from the upsampling operation)

• The Fourier transform of xu[n] is simply

• Thus is periodic with two periods, namely with period 2π/L due to upsampling and 2π due to being a digital signal

97

[ / ] 0, , 2 ,...[ ]

0 otherwiseu

x n L n L Lx n

= ± ±=

''( )j TuX e Ω

Interpolation

98

Interpolation

• Original signal, x[n] , at sampling period, T, is first upsampledto give signal xu[n] with sampling period T’’= T / L

• lowpass filter removes images of original spectrum givingxi [n]= xa(nT’’)= xa(nT/L)

99

SR Conversion by Non-Integer Factors• T’=MT/L ⇒ convert rate by factor of M/L• need to interpolate by L, then decimate by M (why can’t it be

done in the reverse order?)

– can approximate almost any rate conversion with appropriate values of L and M

– for large values of L, or M, or both, can implement in stages, i.e., L =1024, use L1=32 followed by L2=32

100

Summary - 1• speech signals are inherently bandlimited => must sample

appropriately in time and amplitude• LTI systems of most interest in speech processing; can characterize

them completely by impulse response, h(n)• the z-transform and Fourier transform representations enable us to

efficiently process signals in both the time and frequency domains• both periodic and time-limited digital signals can be represented in

terms of their Discrete Fourier transforms• sampling in time leads to aliasing in frequency; sampling in

frequency leads to aliasing in time => when processing time-limited signals, must be careful to sample in frequency at a sufficiently high rate to avoid time-aliasing

101

Summary - 2

• digital filtering provides a convenient way of processing signals in the time and frequency domains

• can approximate arbitrary spectral characteristics via either IIR or FIR filters, with various levels of approximation

• can realize digital filters with a variety of structures, including direct forms, serial and parallel forms

• once a digital signal has been obtain via appropriate sampling methods, its sampling rate can be changed digitally (either up or down) via appropriate filtering and decimation or interpolation

102

top related