You are on page 1of 22

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

Introduction

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.

Copyright 2005. Shi Ping CUC

Introduction

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.
return

Copyright 2005. Shi Ping CUC

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

xd ( n) x ( Dn)

x (n)
fs

xd (n)
fs
D
Copyright 2005. Shi Ping CUC

Decimation by a factor D

Relationship in time domain

x (n)

Input sequence

p( n )

(n kD)

Periodic train of impulses

x p ( n ) x ( n ) p( n )
xd ( n) x p ( Dn) x ( Dn)

Output sequence

demo
Copyright 2005. Shi Ping CUC

Decimation by a factor D

Relationship in frequency domain

1
X p (e )
2

D 1

1
p( n) P ( k )e
D k 0
D 1

n 0

P (k )

P (e j ) X (e j ( ) )d

2
kn
D

P ( k ) p( n)e

2
kn
D

n0

(n iD) e

D 1

2
kn
D

D 1

( n)e

2
kn
D

n 0

Copyright 2005. Shi Ping CUC

P (e )

p(n)e

j n

n
D 1

1
e
D k 0 n

2
kn
j n
D

2
j
kn
1 D 1
j n
D

P ( k )e
e

n D k 0

2
(
k)

D
k 0
D 1

D 1
1
X p (e j ) X (e j ( k s ) )
D k 0
j

X d (e )

n mD

( n)e

n
D

( m )e

j m

2
s
D

( n)e

n
D

( mD )e

j m

let n mD
X p (e

demo

Copyright 2005. Shi Ping CUC

Decimation by a factor D

Using a digital low-pass filter to prevent aliasing

x (n)

h(n)

x' ( n )

xd (n)

1, 0 | |
H ( e j )
D
0, otherwise
return

Copyright 2005. Shi Ping CUC

Interpolation by a factor I
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.

x p ( n)

x (n)
fs

n
x ( ), n 0, I , 2 I
I
0,
otherwise
I

h(n)

x p (n)

x I (n)
If s
demo

Copyright 2005. Shi Ping CUC

Interpolation by a factor I
Relationship in frequency domain

x (n)

Input sequence
j

X p (e )

x p ( n)

x(k ) (n kI )

x(k ) (n kI ) e

j n

j Ik
j I
x
(
k
)
e

X
(
e
)

I , 0 | |
j
H (e )
I
0, otherwise

demo
return

Copyright 2005. Shi Ping CUC

Sampling rate conversion by a rational factor I/D


I
If R
is a rational number
D

fs

h1(n
)
interpolation

If s

h2(n
D
)
decimation

T
I

T
I

Sampling period

x Id (n)

x I (n)

x (n)

T
I

I
fs
D

DT
I
Copyright 2005. Shi Ping CUC

Sampling Rate Conversion


x (n)

h (n)

x Id (n)

I , 0 | | min( , )
H ( e j )
I D
0,
otherwise
example1

example2
return

Copyright 2005. Shi Ping CUC

D4

x (n)
2
0

p(n)

-15

-10

-5

10

15 n

-15

-10

-5

10

15 n

-15

-10

-5

10

15 n

-15

-10

-5

10

15 n

0.5
0

x p (n)
2
0

xd (n)
2
0

return

Copyright 2005. Shi Ping CUC

X ( e j )

P ( e j )

3 s

3 s

3 s

s h 0 h s

3 s

0
1
D

X d ( e j )

2
D

X p ( e j )

h 0 h

D h

1
D

D h

return

Copyright 2005. Shi Ping CUC

x (n)

I 4

x p (n)

12

16

20

24

28

32

36

40

44

48 n

12

16

20

24

28

32

36

40

44

48 n

12

16

20

24

28

32

36

40

44

48 n

x I (n) 4
2

return

Copyright 2005. Shi Ping CUC

X ( e j )

X p ( e j )

h 0 h 2
I
I
I

6
I

X I ( e j )

h 0 h
I
I

return

Copyright 2005. Shi Ping CUC

X ( e j )

16 2 12

7
7

X d ( e j )

6
7

2
7

12 2 16
7
7

D3

6
7

Copyright 2005. Shi Ping CUC

X ( e j )

16 2 12

7
7

2
7

X I ( e j )

12 2 16
7
7

I 2

0
7
7

X Id (e j )

2
7

I 2, D 7

return

Copyright 2005. Shi Ping CUC

P137, No.26 in textbook

x ( n), n 0, 2, 4,
x p ( n)
n 1, 3,
0,

x d ( n ) x ( 2n )
D 1
1
2
j ( k s )
j
X p (e ) X (e
), s
D k 0
D

X d (e j ) X p (e

Copyright 2005. Shi Ping CUC

x (n)

x p (n)

xd (n)

D2

n
Copyright 2005. Shi Ping CUC

X ( e j )

11
4

5 3

4
4

X p ( e j )

11
4

5 3

4
4

11
4

5 3

4
4

3 5
4
4

3 5
4
4

1
2

X p ( e j )

3 5
4
4

11
4

11
4

2
s

1
2

11
Copyright 2005. Shi4Ping

CUC

X ( e j )

11
4

5 3

4
4

X d ( e j )

6
4

6
4

11
4

1
2

X d ( e j )

3 5
4
4

6
4

6
4

1
2

return

Copyright 2005. Shi Ping CUC

You might also like