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) D xd (n)
fs
fs
D
Copyright 2005. Shi Ping CUC
Decimation by a factor D

Relationship in time domain

x (n) Input sequence



p( n ) (n kD)
k
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 2

j
X p (e ) P (e j ) X (e j ( ) )d
2 0

2 2
1 D 1 j kn D 1 j kn
p( n) P ( k )e D , P ( k ) p( n)e D
D k 0 n0

2 2
D 1

j D 1 j
P (k ) (n iD ) e ( n)e
kn kn
D D
1
n 0 i n 0

Copyright 2005. Shi Ping CUC


1 D 1 j
2
kn
j
P (e ) p(n)e j n

n D k 0
P ( k )e D
e
j n

n
2
1 D 1 j D kn jn 2 D 1
2
e e ( k)
D k 0 n D k 0 D
D 1
1 2
X p (e j ) X (e j ( k s ) ) s
D k 0 D

X d (e ) j
x d ( m )e j m
x p ( mD )e j m

m m
let n mD
n n
j j j
x
n mD
p ( n)e D
x
n
p ( n)e D
X p (e D
)
demo
Copyright 2005. Shi Ping CUC
Decimation by a factor D

Using a digital low-pass filter to prevent aliasing

x(n) h(n) D xd (n)


x' ( n )

1, 0 | |
j
H (e ) 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.
n
x ( ), n 0, I , 2 I
x p ( n) I
0, otherwise
x(n) I h(n) x I (n)
x p (n)
fs If s
demo
Copyright 2005. Shi Ping CUC
Interpolation by a factor I

Relationship in frequency domain



x (n) Input sequence x p ( n) x(k ) (n kI )
k



X p (e ) j

n k
x ( k ) ( n kI )

e j n


x (
k
k )e j Ik
X ( e j I
)

I , 0 | | demo
j
H (e ) I
0, otherwise return
Copyright 2005. Shi Ping CUC
Sampling rate conversion by a rational factor I/D

I
If R is a rational number
D

x(n) x I (n) x Id (n)


I h1(n h2(n D
fs ) If s ) I
interpolation decimation fs
D
Sampling period
T T T DT
T
I I I I
Copyright 2005. Shi Ping CUC
Sampling Rate Conversion

x (n) I h (n) D x Id (n)

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

example1 example2

return
Copyright 2005. Shi Ping CUC
D4
x (n)
2

0
-15 -10 -5 0 5 10 15 n
p(n) 1

0.5

0
-15 -10 -5 0 5 10 15 n
x p (n)
2

0
-15 -10 -5 0 5 10 15 n
xd (n)
2

0
-15 -10 -5 0 5 10 15 n

return
Copyright 2005. Shi Ping CUC
X ( e j )

2 h 0 h 2
P ( e j )
2
D

2 3 s s 0 s 3 s 2
X p ( e j ) 1
D

2 3 s s h 0 h s 3 s 2
X d ( e j ) 1
D

2 D h 0 D h 2
return
Copyright 2005. Shi Ping CUC
I 4
x (n) 4

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

x p (n) 4
2

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

x I (n) 4
2

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

return
Copyright 2005. Shi Ping CUC
X ( e j )

2 h 0 h 2

X p ( e j )

2 h 0 h 2 6 2

I I I I

X I ( e j )

2 h 0 h 2

I I
return
Copyright 2005. Shi Ping CUC
X ( e j )

16 2 12 2 2 12 2 16
0
7 7 7 7 7 7

X d ( e j )
D3

2 6 0 6 2
7 7

Copyright 2005. Shi Ping CUC


X ( e j )

16 2 12 2 0 2 12 2 16

7 7 7 7 7 7
X I ( e j )
I 2

0 2
2
7 7

X Id (e j ) I 2, D 7

2 0 2
return
Copyright 2005. Shi Ping CUC
P137, No.26 in textbook

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

x d ( n) x ( 2n)

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


j
X d ( e j ) X p ( e D
)

Copyright 2005. Shi Ping CUC


x (n)

0 n

x p (n)

0 n

xd (n) D2

0 n
Copyright 2005. Shi Ping CUC
X (e j )
1

11 2

5 3

0 3 5 2 11
4 4 4 4 4 4
2
X p (e j ) 1 s
2 D

11 2

5 3

0 3 5 2 11
4 4 4 4 4 4
X p (e j ) 1
2

11 2

5 3

0 3 5 2 11
4 4 4 4 4 Copyright 2005. Shi4Ping CUC
X (e j )
1

11 2

5 3

0 3 5 2 11
4 4 4 4 4 4
X d ( e j ) 1
2

2

6

0 6 2
4 2 2 4
X d ( e j ) 1
2

2

6

0 6 2
4 2 2 4
return
Copyright 2005. Shi Ping CUC

You might also like