22
Copyright © 2005. Shi Ping CUC Chapter 5 Sampling Rate Conversion Conte nt Introduction Decimation by a factor D Interpolation by a factor I Sampling rate conversion by a rational factor I/D

Chap5-Sampling Rate Conversion

Embed Size (px)

DESCRIPTION

Sampling Rate Conversion

Citation preview

Copyright © 2005. Shi Ping CUC

Chapter 5 Sampling Rate Conversion

Content

Introduction

Decimation by a factor D

Interpolation by a factor I

Sampling rate conversion by a rational factor I/D

Copyright © 2005. Shi Ping CUC

In many practical applications of DSP, one is faced with the problem of changing the sampling rate of a signal.

The process of converting a signal from a given rate to a different rate is called sampling rate conversion.

Systems that employ multiple sampling rates in the processing of digital signals are called multirate digital signal processing systems.

Introduction

Copyright © 2005. Shi Ping CUC

There are two general methods to accomplish the sampling rate conversion of a digital signal.

To pass the digital signal through a D/A converter, filter it if necessary, and then to resample the resulting analog signal at the desired rate;

To perform the sampling rate conversion entirely in the digital domain.

The process of reducing the sampling rate by an integer factor D (downsampling by D) is called decimation.

The process of increasing the sampling rate by an integer factor I (upsampling by I) is called interpolation.

Introduction

return

Copyright © 2005. Shi Ping CUC

In downsampling by an integer factor D>1, every D-th samples of the input sequence are kept and others are removed:

)()( Dnxnxd

D)(nx )(nxd

Decimation by a factor D

sfD

f s

Copyright © 2005. Shi Ping CUC

Relationship in time domain

)()()( npnxnx p

)(nx Input sequence

k

kDnnp )()( Periodic train of impulses

)()()( DnxDnxnx pd Output sequence

demo

Decimation by a factor D

Copyright © 2005. Shi Ping CUC

Relationship in frequency domain

2

0

)( )()(2

1)( deXePeX jjj

p

1

0

21

0

2

)()( ,)(1

)(D

n

knD

jD

k

knD

jenpkPekP

Dnp

1)()()(1

0

21

0

2

D

n

knD

jD

n

knD

j

i

eneiDnkP

Decimation by a factor D

Copyright © 2005. Shi Ping CUC

1

0

)( )(1

)(D

k

kjjp

seXD

eX

)()()(

)()()(

Dj

pn

D

nj

pmDn

D

nj

p

m

mjp

m

mjd

jd

eXenxenx

emDxemxeX

Ds

2

1

0

1

0

2

1

0

2

)2

(21

)(1

)()(

D

k

D

kn

njkn

Dj

n

njD

k

knD

j

n

njj

kDD

eeD

eekPD

enpeP

mDnlet

demo

Copyright © 2005. Shi Ping CUC

h(n))(nx )(nxd D

)(' nx

otherwise ,0

|0 ,1)( Dπ|ωeH j

Using a digital low-pass filter to prevent aliasing

Decimation by a factor D

return

Copyright © 2005. Shi Ping CUC

In up-sampling by an integer factor I >1, I -1 equidistant zeros-valued samples are inserted between each two consecutive samples of the input sequence. Then a digital low-pass filter is applied.

otherwise ,0

2 , ,0 ),()( IInI

nxnx p

I)(nx )(nxIh(n))(nx p

demo

Interpolation by a factor I

sf sIf

Copyright © 2005. Shi Ping CUC

Relationship in frequency domain

k

p kInkxnx )()()( )(nx Input sequence

)()(

)()()(

Ij

k

Ikj

n

nj

k

jp

eXekx

ekInkxeX

otherwise ,0

|0 ,)( Iπ|ωIeH j demo

Interpolation by a factor I

return

Copyright © 2005. Shi Ping CUC

If is a rational numberD

IR

h1(n)

h2(n)

I D)(nx

interpolation decimationsf

)(nxI

sIf

)(nxId

sfD

I

Sampling rate conversion by a rational factor I/D

Sampling period

T I

T

I

T

I

T

I

DT

Copyright © 2005. Shi Ping CUC

h (n) I D)(nx )(nxId

otherwise ,0

),min(|0 ,)( Dπ

Iπ|ωIeH j

example1

Sampling Rate Conversion

example2

return

Copyright © 2005. Shi Ping CUC

-15 -10 -5 0 5 10 150

2

n

-15 -10 -5 0 5 10 150

0.5

1

n

-15 -10 -5 0 5 10 150

2

n

-15 -10 -5 0 5 10 150

2

n

)(nx

)(np

)(nx p

)(nxd

return

4D

Copyright © 2005. Shi Ping CUCreturn

hh

)( jeX

0 22

)( jeP

0 22 ss s3s3

D

2

0 22 hh

D

1

ss s3s3

)( jp eX

0 22 hDhD

D

1)( jd eX

Copyright © 2005. Shi Ping CUC

0 4 8 12 16 20 24 28 32 36 40 44 480

2

4

n

0 4 8 12 16 20 24 28 32 36 40 44 480

2

4

n

0 4 8 12 16 20 24 28 32 36 40 44 480

2

4

n

)(nx

)(nx p

)(nxI

return

4I

Copyright © 2005. Shi Ping CUCreturn

0 22 hh

)( jeX

0 22 I

hI

h

)( jI eX

0 22 I

hI

2I

6

)( jp eX

Ih

Copyright © 2005. Shi Ping CUC

7

2

)( jeX

0 22 7

2

7

127

167

12

7

16

7

6

)( jd eX

0 22 7

6

3D

Copyright © 2005. Shi Ping CUCreturn

7

2

)( jeX

0 22 7

2

7

127

167

12

7

16

7

)( jI eX

0 22 7

2I

)( jId eX

0 22

7 ,2 DI

Copyright © 2005. Shi Ping CUC

P137, No.26 in textbook

,3 ,1 ,0

,4 ,2 ,0 ),()(

n

nnxnx p

)2()( nxnxd

DeX

DeX s

D

k

kjjp

s 2

,)(1

)(1

0

)(

)()( Dj

pj

d eXeX

Copyright © 2005. Shi Ping CUC

n

)(nx

0

n

)(nx p

0

n

)(nxd

0

2D

Copyright © 2005. Shi Ping CUC

4

3

)( jeX

0 22 4

3

4

54

114

5

4

11

1

)( jp eX

04

3 22 4

3

4

54

114

5

4

11

2

1 Ds

2

2

1

)( jp eX

04

3 22 4

3

4

54

114

5

4

11

Copyright © 2005. Shi Ping CUC

4

3

)( jeX

0 22 4

3

4

54

114

5

4

11

1

2

1

)( jd eX

0 22 4

62

2

4

6

2

1

)( jd eX

0 22 4

62

2

4

6

return