Professional Documents
Culture Documents
Marc Moonen
Dept. E.E./ESAT, K.U.Leuven
marc.moonen@esat.kuleuven.be
www.esat.kuleuven.be/scd/
DSP-II p. 1
PART-I : Filter Design/Realization
• FIR filters
– Linear-phase FIR filters
– FIR design by optimization
Weighted least-squares design, Minimax design
– FIR design in practice
`Windows’, Equiripple design, Software (Matlab,…)
• IIR filters
– Poles and Zeros
– IIR design by optimization
Weighted least-squares design, Minimax design
– IIR design in practice
Analog IIR design : Butterworth/Chebyshev/elliptic
Analog->digital : impulse invariant, bilinear transform,…
Software (Matlab)
k
L
frequency response is e jx e jx 2. cos x
L L
j
H (e ) h[k ].e
k L
j . k
... d k . cos( .k )
k 0
PS: IIR filters can NEVER have linear-phase property ! (proof see literature)
Ex: Low-pass
1.2
Passband Ripple
1
1 P 0.8
P S
0.6 Passband Cutoff -> <- Stopband Cutoff
0
0 0.5 1 1.5 2 2.5 3
F ( d 0 ,..., d L )
xT d 0 d1 ... d L
Q W ( ).c( ).cT ( ) d
0
p W ( ). Ad ( ).c( )d
0
Passband Ripple
• Example: Low-pass design 1
0.8
Ad ( ) 0, S (stop - band)
0.4 Stopband Ripple
0.2
optimization function is
P 0
0 0.5 1 1.5 2 2.5 3
F ( d 0 ,..., d L ) A( ) 1 d . A ( )d ...
2 2
0
S
pass - band stop - band
i.e.
W () 1, P W () , S
1
xOPT Q . p Compare to p.10
+++ : simple
- - - : unpredictable behavior in between sample freqs.
DSP-II Version 2008-2009 Lecture-2 FIR/IIR Filter Design p. 12
FIR Filter Design by Optimization
• This is often supplemented with additional constraints, e.g.
for pass-band and stop-band ripple control :
A( P ,i ) 1 P , for pass - band freqs. P,1 , P ,2 ,... ( P is pass - band ripple)
A(S ,i ) S , for stop - band freqs. S ,1 , S ,2 ,... ( S is stop - band ripple)
xT d 0 d1 ... d L
subject to AP .x bP (=pass-band constraints)
AS .x bS (=stop-band constraints)
= `Quadratic Programming’ problem
DSP-II Version 2008-2009 Lecture-2 FIR/IIR Filter Design p. 13
FIR Filter Design by Optimization
• this is equivalent to
min x
subject to
2
W ( ). c ( ). x Ad ( )
2 T
for 0
with
x T d 0 d1 ... d L
cT ( ) 1 cos( ) ... cos( L )
• the constraint is equivalent to a so-called `semi-definiteness’ constraint
W ( ).(cT ( ).x Ad ( ))
D( ) 0
W ( ).(c ( ).x Ad ( ))
T
1
where D>=0 denotes that the matrix is positive semi-definite
min x
subject to
D(1 ) 0 ... 0
0 D ( ) ... 0
2 0
: : :
0 0 ... D ( m
)
• Conclusion:
(I) weighted least squares design
(II) minimax design
provide general `framework’, procedures to translate filter
design problems into standard optimization problems
• In practice (and in textbooks):
emphasis on specific (ad-hoc) procedures :
- filter design based on `windows’
- equiripple design
1 C
H d ( )
0 C
• hence ideal time-domain impulse response is
1 j sin( c k )
H
j
hd [k ] (e ).e .k
d ... . k
2 c k
d
h[k ] hd [k ].w[k ]
1 N /2 k N /2
w[k ]
0 otherwise
• +++: simple procedure (also for HP,BP,…)
• - - - : truncation in time-domain results in `Gibbs effect’ in frequency
domain, i.e. large ripple in pass-band and stop-band (at band edge
discontinuity), which cannot be reduced by increasing the filter order N.
DSP-II Version 2008-2009 Lecture-2 FIR/IIR Filter Design p. 19
FIR Filter Design using `Windows’
h[k ] hd [k ].w[k ]
H ( z) H d ( z ) *W ( z )
• candidate windows : Han, Hamming, Blackman, Kaiser,…. (see
textbooks, see DSP-I)
• window choice/design = trade-off between side-lobe levels (define peak
pass-/stop-band ripple) and width main-lobe (defines transition
bandwidth)
+++
• low-order filters can produce sharp frequency response
• low computational cost
---
• design more difficult
• stability should be checked/guaranteed
• phase response not easily controlled
(e.g. no linear-phase IIR filters)
• coefficient sensitivity, quantization noise, etc. can be a
problem (see Lecture-4)
DSP-II Version 2008-2009 Lecture-2 FIR/IIR Filter Design p. 24
IIR filters
Frequency response versus pole-zero location :
(cfr. frequency response is z-transform evaluated on the unit circle)
Example-1 :
pole pole
Low-pass filter
Re
Im DC (z=1)
pole near unit-circle introduces `peak’ in frequency response
pole pole
Example-2 :
Low-pass filter
0 .8 0 .2 j
zeros at
0.75 0.66 j
zero DC
zero near (or on) unit-circle introduces `dip’ (or transmision zero) in freq. response
F ( b0 ,..., bN , a1 ,..., a N )
W ( )
Wk ( )
Ak 1 ( )
2
• Conclusion:
(I) weighted least squares design
(II) minimax design
provide general `framework’, procedures to translate filter
design problems into ``standard’’ optimization problems
• In practice (and in textbooks):
emphasis on specific (ad-hoc) procedures :
- IIR filter design based analog filter design (s-domain
design) and analog->digital conversion
- IIR filter design by modeling = direct z-domain design
(Pade approximation, Prony, etc., not addressed here)
DSP-II Version 2008-2009 Lecture-2 FIR/IIR Filter Design p. 31
Analog IIR Filter Design
1
G ( j ) H ( j )
2
- all-pole filters (H) characterized by a specific 2N
1 ( )
magnitude response (G): (N=filter order) c
- poles of G(s)=H(s)H(-s) are equally spaced on circle of radius
c
N=4
N
poles of H(s) poles of H(-s)
c
- Then H(jw) is found to be monotonic in pass-band & stop-band, with
`maximum flat response’, i.e. (2N-1) derivatives are zero at 0,
1 2TN2 ( )
c
T0 ( x ) 1
is related to passband ripple
T1 ( x ) x
TN (x) are Chebyshev polynomials:
T2 ( x ) 2 x 2 1
...
TN ( x ) 2 x.TN 1 ( x ) TN 2 ( x )
Frequency Transformations :
• Principle : prototype low-pass filter (e.g. cut-off frequency = 1
rad/sec) is transformed to properly scaled low-pass, high-pass, band-
pass, band-stop,… filter
s
• example: replacing s by moves cut-off frequency to C
C
C
• example: replacing s by turns LP into HP, with cut-off frequency C
s
s 2 1. 2
• example: replacing s by turns LP into BP
s.( 2 1 )
• etc...
DSP-II Version 2008-2009 Lecture-2 FIR/IIR Filter Design p. 35
Analog -> Digital
• Principle :
design analog filter (LP/HP/BP/…), and then convert it to a digital filter.
• Conversion methods:
- convert differential equation into difference equation
- convert continuous-time impulse response into discrete-time
impulse response
- convert transfer function H(s) into transfer function H(z)
• Requirement: the left-half plane of the s-plane should map into the
inside of the unit circle in the z-plane, so that a stable analog filter is
converted into a stable digital filter.
jw j
s-plane z-plane
s 0 z 1
1 s z 0
-stable analog filters are mapped into stable digital filters, but pole
location for digital filter confined to only a small region (o.k. only for LP
or BP)
• Conversion methods:
(II) convert continuous-time impulse response into
discrete-time impulse response :
-given continuous-time impulse response ha(t), discrete-time impulse
response is h[k ] ha (k.T ) where T=sampling interval.
-eventually (details omitted) this corresponds to a (many-to-one) mapping
j
ze sT
s-plane
jw
z-plane
s 0 z 1 1
s j / T z 1
H ( z ) H a (s) s 2 .( 1 z 1 ) s 0 z 1
T 1 z 1 s j. z 1
jw j
s-plane z-plane
1
-for low-frequencies, this is an approximation of z e
sT