Você está na página 1de 35

Multi-rate Digital

Signal Processing
Dr Suprava Patnaik
Pending Topics

Multirate Signal Processing


- Decimation
- Interpolation

Multistage decimation and interpolation

Poly-phase Filtering

Filter banks and wavelet transform

23
rd
and 25
th
Tutorial (Assignment & class
performance evaluation- 25 marks)

Quiz test of 20 marks.

Midtest(30)+ End test(50)


Why Multi-rate Processing

Multirate signal processing deals with a change in


sampling rate for discrete signals.

Multirate signal processing is used for the practical


applications in signal processing to save costs,
processing time, for compression, feature extraction,
device compatibility and many other practical reasons.
Basic Sampling Rate Alteration Devices Basic Sampling Rate Alteration Devices

Up-sampler Up-sampler - Used to increase the sampling rate by an


integer factor

Down-sampler Down-sampler - Used to decrease the sampling rate by


an integer factor
Up-Sampler
Up-Sampler
Time-Domain Characterization Time-Domain Characterization

An up-sampler with an up-sampling factor up-sampling factor L, where L is a


positive integer, develops an output sequence with
a sampling rate that is L times larger than that of the
input sequence x[n].

Up-sampling operation is implemented by inserting


equidistant zero-valued samples between two
consecutive samples of x[n]

Input-output relation

Block-diagram representation
] [n x
u
L x[n]
] [n x
u

'

t t

otherwise , 0
, 2 , , 0 ], / [
] [
L L n L n x
n x
u
0 10 20 30 40 50
-1
-0.5
0
0.5
1
Input Sequence
Timeindexn
A
m
p
l
i
t
u
d
e
0 10 20 30 40 50
-1
-0.5
0
0.5
1
Outputsequenceup-sampledby3
Timeindexn
A
m
p
l
i
t
u
d
e

Figure above demonstrates up-sampling by factor 3.

In practice, the zero-valued samples inserted by the up-sampler


are replaced with appropriate nonzero values using some type of
filtering process.

This process is called interpolation interpolation


Example of Up-Sampling

X(n)=8 8 4 -5 -6

Y(n)=8 0 0 8 0 0 4 0 0 -5 0 0 -6 0 0, L=3
If T=original sampling rate, T
L
=T/L
f
sL
=Lf
s
( Folding frequency will increase by a factor L)

After up-sampling, the spectral replicas originally centered


at f
s
, 2f
s
,. are included in the frequency range 0Hz to the
new Nyquist limit Lf
s
/2 Hz.
Equivalent z-domain equations
1
1
1
N
Z
z

_

+
,
1
1
1
N
Z
z

,
Time Domain figure
Is inserting zero equivalent to inserting some other value
Up-Sampler
Up-Sampler
Frequency-Domain Characterization Frequency-Domain Characterization

Consider first a factor-of-2 up-sampler whose input-output


relation in the time-domain is given by

In terms of the z-transform, the input-output relation is then


given by



even
] / [ ] [ ) (
n
n
n
n
n
u u
z n x z n x z X 2

'

t t

otherwise ,
, , , ], / [
] [
0
4 2 0 2 n n x
n x
u
2 2
[ ] ( )
m
m
x m z X z

Up-Sampler
Up-Sampler

In a similar manner, we can show that for a factor-of- factor-of-L L up- up-
sampler sampler

On the unit circle, for , the input-output relation is


given by

In the case of a factor-of-L sampling rate expansion, there


will be L-1 additional images of the input spectrum in
the baseband

Lowpass filtering of removes the L-1 images and in


effect fills in the zero-valued samples in with
interpolated sample values
] [n x
u
) ( ) (
L
u
z X z X
j
e z
) ( ) (
L j j
u
e X e X

] [n x
u
Up-Sampling is responsible for spectrum compression and
presence of more than one image spectrum below folding
frequency.
Imaging( Removal requires
Interpolation/ anti-image filter)

As can be seen, a factor-of-2 sampling rate expansion leads


to a compression of by a factor of 2 and a 2-fold repetition in
the baseband [0, 2].

This process is called imaging imaging as we get an additional


image of the input spectrum

To remove those extra spectral replicas, an interpolation filter


with a stop frequency edge f
s
/2 must follow the up-sampler.

Normalized stop frequency edge is:


2
2
s
stop
f T
radians
L L


4000 2500
3250
2
1
2 3250 0.2708
24000
cut off
c
f



2 1000 2 2500
( ) 5sin cos
8000 8000
n n
x n

_ _
+

, ,
Down-Sampler
Down-Sampler
Time-Domain Characterization
Time-Domain Characterization

An down-sampler with a down-sampling factor down-sampling factor M,


where M is a positive integer, develops an output
sequence y[n] with a sampling rate that is (1/M)-th of
that of the input sequence x[n]

Down-sampling operation is implemented by keeping


every M-th sample of x[n] and removing M-1
samples in-between samples to generate y[n]

Input-output relation
y[n] = x[nM]

Block-diagram representation
M x[n]
y[n]
0 10 20 30 40 50
-1
-0.5
0
0.5
1
Input Sequence
Timeindexn
A
m
p
l
i
t
u
d
e
0 10 20 30 40 50
-1
-0.5
0
0.5
1
Outputsequencedown-sampledby3
A
m
p
l
i
t
u
d
e
Timeindexn
M
) ( ] [ nMT x n y
a

) ( ] [ nT x n x
a

Input sampling frequency


T
F
T
1

Output sampling frequency


'
1
'
T M
F
F
T
T

x[n]=8 7 4 8 9 6 4 2 -2 -5 -7 -7 -6 -4 with T=0.1 , f
s
=10
y[n]=8 8 4 -5 -6 T=3 x 0.1=0.3 , f
sM
=3.3
Precaution has to be taken to avoid aliasing due to reduced
sampling rate.

After down-sampling new folding frequency


reduces by factor M.

If the original signal has frequency components


larger than the new folding frequency aliasing
noise will be introduced into down-sampled data.

To overcome this the original signal has to be


processed by a LPF before down-sampling,
which to stop frequency components above f
s
/
(2M) Hz.

Normalized cut-off frequency is


2
2
s
stop
f T
radians
M M


max
2
s
f
f
M
<
Anti-Aliasing filter
2 1000 2 2500
( ) 5sin cos
8000 8000
n n
x n

_ _
+

, ,
8000
s
f Hz
Down sample by a factor of 2. New folding frequency is 2000Hz.
Aliasing frequency introduced will be 4000-2500=1500Hz
Required Normalized Cut-off frequency of the filter is
Folding frequency is 4000
( )
2 1500 1/ 8000 0.375
c

Down-Sampler
Down-Sampler

Aliasing is absent if and only if


as shown below for M = 2
2 / for 0 ) (
j
e X
M for e X
j
/ 0 ) (

Down-Sampler
Down-Sampler
Frequency-Domain Characterization
Frequency-Domain Characterization

Applying the z-transform to the input-output


relation of a factor-of-M down-sampler
we get

The expression on the right-hand side cannot


be directly expressed in terms of X(z)

n
n
z Mn x z Y ] [ ) (
] [ ] [ Mn x n y
Down-Sampler
Down-Sampler

To get around this problem, define a


new sequence :

Then

'

t t

otherwise ,
, , , ], [
] [
int
0
2 0 M M n n x
n x
] [
int
n x



n
n
n
n
z Mn x z Mn x z Y ] [ ] [ ) (
int
) ( ] [
/
int
/
int
M
k
M k
z X z k x
1

Down-Sampler
Down-Sampler

Now, can be formally related to x[n] through



where

A convenient representation of c[n] is given by


where
] [
int
n x
] [ ] [ ] [
int
n x n c n x

'

t t

otherwise ,
, , , ,
] [
0
2 0 1 M M n
n c
M j
M
e W
/ 2

1
0
1
[ ]
M
kn
M
k
c n W
M


Down-Sampler
Down-Sampler

Taking the z-transform of and


making use of
we arrive at
] [ ] [ ] [
int
n x n c n x
n
n
M
k
kn
M
n
n
z n x W
M
z n x n c z X



,
_

] [
1
] [ ] [ ) (
1
0
int
( )
1 1
0 0
1 1
[ ]
M M
kn n k
M M
k n k
x n W z X zW
M M



_


,

1
0
1
[ ]
M
kn
M
k
c n W
M


( )
1
1
1/
int
0
1
( ) ( )
M
M k
M
D M
k
Y z X z X z W
M

What does it represent?

stretching of to

creating M 1 copies of the stretched


versions

shifting each copy by successive multiples


of 2 and superimposing (adding) all the
shifted copies

dividing the result by M


( )
jw
X e
/
( )
jw M
X e
Down-Sampler
Down-Sampler

Now
implying that the second term
in the previous equation is simply
obtained by shifting the first term
to the right by an amount 2 as
shown below
) ( ) (
2 / ) 2 ( 2 /

j j
e X e X
) (
2 /

j
e X
) (
2 / j
e X
Down-Sampler
Down-Sampler

The plots of the two terms have an


overlap, and hence, in general, the original
shape of is lost when x[n] is
down-sampled as indicated below

To ensure decimation process we must


first bandlimit the signal to
) (
j
e X
/ w M <
Down-Sampler
Down-Sampler

frequency-domain properties of the up-


sampler shown below for M = 2 and 3
0 0.2 0.4 0.6 0.8 1
0
0.2
0.4
0.6
0.8
1

M
a
g
n
i
t
u
d
e
Input spectrum
0 0.2 0.4 0.6 0.8 1
0
0.1
0.2
0.3
0.4
0.5

M
a
g
n
i
t
u
d
e
Output spectrum
0 0.2 0.4 0.6 0.8 1
0
0.1
0.2
0.3
0.4
0.5

M
a
g
n
i
t
u
d
e
Output spectrum
Cascade Equivalences
Cascade Equivalences

A complex
multirate system
multirate system is formed
by an interconnection of the up-
sampler, the down-sampler, and the
components of an LTI digital filter

In many applications these devices


appear in a cascade form

An interchange of the positions of the


branches in a cascade often can lead to
a computationally efficient realization
Cascade Equivalences
Cascade Equivalences

To implement a
fractional change (L/M)
fractional change (L/M)
in the
sampling rate
sampling rate we need to employ
a cascade of an up-sampler and a
down-sampler

Consider the two cascade connections


shown below
M L
] [n x
] [
1
n y
M L
] [n x
] [
2
n y
Cascade Equivalences
Cascade Equivalences

A cascade of a factor-of-M down-sampler


and a factor-of-L up-sampler is
interchangeable with no change in the
input-output relation:
if and only if
if and only if
M
M
and
and
L
L
are relatively prime
are relatively prime,
i.e., M and L do not have any common
factor that is an integer k > 1
] [ ] [
2 1
n y n y
Changing sampling rate by L/M
Up sampler
Down Sampler
If L>M the system will not introduce aliasing
If M>L ,x[n] must be band limited to the new nyquist rate either intrinsically
or by a filter.
Changing sampling rate by L/M

Interpolation and anti-aliasing filters


appear in cascade.

Since both operate at same rate, we can


select one of them.

We choose the one with the lower stop


frequency edge and choose the most
demanding requirement for pass-band
gain and stop-band attenuation for filter
design.

,
_

M L
s

, min
Cascade Equivalences
Cascade Equivalences
Two other cascade equivalences are shown below
L
] [n x
] [
2
n y
) (
L
z H
L
] [n x
] [
2
n y
) (z H

M
] [n x
] [
1
n y
) (z H
M
] [n x ) (
M
z H
] [
1
n y

Cascade equivalence #1 Cascade equivalence #1


Cascade equivalence #2 Cascade equivalence #2
1
1 1
1
0
( ) ( ) ( )( )
1
( ) ( )
M
M
k k M
M M
k
Y z X z H z downsampler
X z W H z W
M


1
1
1
( ) ( ) ( )
k
M
Y z X z W H z
M

Why FIR Filter?

Linear Phase

FIR requires less computation


1
0
N
m
m n x m h n v ] [ ] [ ] [

If the decimation filter H(z) is an FIR filter of length N implemented in a


direct form, then
Now, the down-sampler keeps only every M-th sample of v[n] at its output.
Hence, it is sufficient to compute v[n] only for values of n that are multiples of M
and skip the computations of in-between samples. This leads to a factor of M
savings in the computational complexity
Now assume H(z) to be an IIR filter of order K with a transfer function
n
K
n
n
z p z P

0
) (
n
K
n
n
z d z D

+
1
1 ) (

Its direct form implementation is given by

Since v[n] is being down-sampled, it is sufficient


to compute v[n] only for values of n that are
integer multiples of M

However, the intermediate signal w[n] must be


computed for all values of n

As a result, the savings in the computation in


this case is going to be less than a factor of M
] [ ] [ ] [ 2 1
2 1
n w d n w d n w ] [ ] [ n x K n w d
K
+
] [ ] [ ] [ ] [ K n w p n w p n w p n v
K
+ + + 1
1 0
Multistage Decimation

On Board