Multirate and Adaptive Filters

Download as pdf or txt
Download as pdf or txt
You are on page 1of 55

Multirate and Adaptive Filters

Contents

• Multirate signal processing:


• Decimation
• Interpolation
• Sampling rate conversion by a rational
factor
• Adaptive Filters:
• Introduction
• Applications of adaptive filtering to
equalization.
Multirate Signal Processing
Multirate Digital Signal Processing

Basic Sampling Rate Alteration Devices


• Up-sampler - Used to increase the
sampling rate by an integer factor
• Down-sampler - Used to decrease the
sampling rate by an integer factor
DECIMATION
DECIMATION
Down-Sampler

Time-Domain Characterization
• An down-sampler with a 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]
• Block-diagram representation
x[n] M y[n]
Down-Sampler
• Down-sampling operation is
implemented by keeping every M-th
sample of x[n] and removing M − 1 in-
between samples to generate y[n]
• Input-output relation
y[n] = x[nM]
Down-Sampler
• Figure below shows the down-sampling
by a factor of 3 of a sinusoidal
sequence of frequency 0.042 Hz
obtained using Program 10_2
Input Sequence Output sequence down-sampled by 3
1 1

0.5 0.5

Amplitude
Amplitude

0 0

-0.5 -0.5

-1 -1
0 10 20 30 40 50 0 10 20 30 40 50
Time index n Time index n
Decimation by a factor D

In down sampling 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
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


Decimation by a factor D

⚫ Relationship in frequency domain


1 2

j
X p (e ) = P (e j ) X (e j ( − ) )d
2 0

D −1 2 D −1 2
1 −j
p( n) =  P ( k )e P ( k ) =  p( n)e
j kn kn
D D
,
D k =0 n=0

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

C
   1 D −1 2
kn 
 p(n)e =    P ( k )e
j
j − j n − j n
P (e ) = D
e
n = − n = −  D k = 0 
2
1 D −1 
2 D −1
2
=  e 
j kn
− j n
D
e =  ( − k)
D k = 0 n= − D k =0 D
D −1
1
X p (e j ) =  X (e j ( − k s ) ) 2
s =
D k =0 D
 
X d (e ) = j
x
m = −
d ( m )e − j m
= x
m = −
p ( mD )e − j m

n  n 
− j − j
 x p (n)e  x p (n)e
j
= D
= D
= X p (e D
)
n = mD n = −
let n = mD
C
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  |ω | π
H (e j ) =  D
0, otherwise
INTERPOLATION
INTERPOLATION
Up-Sampler
Time-Domain Characterization
• An up-sampler with an up-sampling
factor L, where L is a positive integer,
develops an output sequence xu [n] with
a sampling rate that is L times larger
than that of the input sequence x[n]
• Block-diagram representation
x[n] L xu [n]
Up-Sampler
• Up-sampling operation is implemented
by inserting L − 1 equidistant zero-
valued samples between two
consecutive samples of x[n]
• Input-output relation

 x[n / L], n = 0,  L,  2 L,


xu [n] = 
 0, otherwise
Up-Sampler

• Figure below shows the up-sampling by


a factor of 3 of a sinusoidal sequence
with a frequency of 0.12 Hz obtained
using Program 10_1
Input Sequence Output sequence up-sampled by 3
1 1

0.5 0.5
Amplitude

Amplitude

0 0

-0.5 -0.5

-1 -1
0 10 20 30 40 50 0 10 20 30 40 50
Time index n
Time index n
Up-Sampler
• In practice, the zero-valued samples
inserted by the up-sampler are replaced
with appropriate nonzero values using
some type of filtering process
• Process is called interpolation and will
be discussed later
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
Interpolation by a factor I

Relationship in frequency domain


x(n) Input sequence x p ( n) =  x( k ) ( n − kI )


k =−

 
 − j n
X p (e ) =    x( k ) ( n − kI ) e
j

n = −  k = − 

=  x (
k = −
k )e − j Ik
= X ( e j I
)

 I , 0  |ω | π
j
H (e ) =  I
0, otherwise
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
Sampling Rate Conversion

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

 I , 0  |ω | min( π , π )
H (e j ) =  I D
0, otherwise
D=4
x(n)
2

0
-15 -10 -5 0 5 10 15 n
1
p(n)
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
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 
4
I =4
x(n)
2

0
0 4 8 12 16 20 24 28 32 36 40 44 48 n
4
x p (n)
2

0
0 4 8 12 16 20 24 28 32 36 40 44 48 n
4
x I (n)
2

0
0 4 8 12 16 20 24 28 32 36 40 44 48 n
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
INTRODUCTION
TO
ADAPTIVE FILTER
Adaptive filter
• the signal and/or noise characteristics are often
nonstationary and the statistical parameters vary
with time

• An adaptive filter has an adaptation algorithm, that is


meant to monitor the environment and vary the filter
transfer function accordingly

• based in the actual signals received, attempts to find


the optimum filter design
ADAPTIVE FILTER
• The basic operation now involves two processes :
1. a filtering process, which produces an output signal
in response to a given input signal.
2. an adaptation process, which aims to adjust the filter
parameters (filter transfer function) to the (possibly
time-varying) environment
Often, the (avarage) square value of the error signal
is used as the optimization criterion
Adaptive filter
• Because of complexity of the optimizing
algorithms most adaptive filters are digital
filters that perform digital signal processing

When processing
analog signals,
the adaptive filter
is then preceded
by A/D and D/A
convertors.
• Adaptive filters differ from other filters
such as FIR and IIR in the sense that:
– The coefficients are not determined by a
set of desired specifications.
– The coefficients are not fixed.
• With adaptive filters the specifications
are not known and change with time.
• Applications include: process control,
medical instrumentation, speech
processing, echo and noise calculation
and channel equalisation.
Introduction

• To construct an adaptive filter the


following selections have to be made:
– Which method to use to update the
coefficients of the selected filter.
– Whether to use an FIR or IIR filter.
y[n] (output signal)
Digital
x[n] (input signal)
Filter

-
+ d[n] (desired signal)
+

Adaptive e[n] (error signal)


Algorithm
Adaptive filter

• The generalization to adaptive IIR filters leads to


stability problems

• It’s common to use


a FIR digital filter
with adjustable
coefficients.

43
LMS Algorithm
• Most popular adaptation algorithm is LMS
Define cost function as mean-squared error

• Based on the method of steepest descent


Move towards the minimum on the error surface to
get to minimum
gradient of the error surface estimated at every
iteration

 update value   old value   learning -  tap − 


       error 
 of tap - weigth  =  of tap - weight  +  rate  input  
 vector   vector   parameter  vector  signal 
      
44
LMS Algorithm

W (n) = [ w0 , w1 ,..., wN ], X (n) = [ x(n), x(n − 1),..., x(n − N )]


e( n ) = d ( n ) − y ( n )
ˆ = e 2 (n)
W (n + 1) = W (n) − e 2 (n),  = StepSize
e 2 (n) e(n) e ( n ) = d ( n ) − y ( n ) y (n)
= 2e(n) ⎯⎯ ⎯ ⎯ ⎯→ = −2e(n)
Wi Wi Wi
N −1
e 2 (n)
y =  W ( n) x ( n − i )  = −2e(n) x(n − i )
i =0 Wi
e 2 (n) = −2e(n) X (n)  W (n + 1) = W (n) + 2e(n) X (n)

45
Stability of LMS
• The LMS algorithm is convergent in the mean square
if and only if the step-size parameter satisfy 0    2
max

• Here max is the largest eigenvalue of the correlation


matrix of the input data
2
• More practical test for stability is 0    input signal power

• Larger values for step size


– Increases adaptation rate (faster adaptation)
– Increases residual mean-squared error

46
Applications of Adaptive Filters:
Identification
• Used to provide a linear model of an unknown plant

• Applications:
– System identification

47
Applications of Adaptive Filters:
Inverse Modeling
• Used to provide an inverse model of an unknown
plant

• Applications:
– Equalization (communications channels)
48
Applications of Adaptive Filters:
Prediction
• Used to provide a prediction of the present value of a
random signal

• Applications:
– Linear predictive coding

49
Applications of Adaptive Filters:
Interference Cancellation
• Used to cancel unknown interference from a primary
signal

• Applications:
– Echo / Noise cancellation
hands-free carphone, aircraft headphones etc

50
Example:
Acoustic Echo Cancellation

51

You might also like