LINEAR-PHASE FIR FILTERS: THE WINDOWING ETHOD Prof. Siripog Potisuk FIR Filter Characteristics Completely specified by iput-output relatio: y[ ] b k0 x[ k] b k = filter coefficiets ad +1 = filter legth All poles are at the origi always stable Impulse respose has oly a fiite umber of terms fiite legth k 1
Group Delay Negative of the slope of the phase respose of a liear system, i.e., filters d 1 d D( ) H ( ) or D( f ) H ( f d 2 df ) The amout by which the spectral compoet at frequecy f gets delayed as it is processed by the filter A digital liear-phase filter has a costat group delay except possibly at frequecies at which the magitude respose is zero Types of Liear-phase FIR filters Filter type h[] symmetry Filter order Phase offset Ed-poit zeros Cadidate filters 1 Eve Eve 0 Noe All 2 Eve Odd 0 z = 1 LP, BP 3 Odd Eve 2 z = 1 BP 4 Odd Odd 2 z = 1 HP, BP 2
The Widowig ethod Start with the desired or ideal frequecy respose Compute IDTFT to obtai the desired impulse respose accordig the filter type & order Trucate the resultig impulse respose usig oe of the fiite-legth widowig fuctios, i.e., rectagular, Bartlett, Hammig, Haig, ad Blackma Ideal Lowpass Characteristics 3
Impulse Resposes of Ideal Liear-phase type-1 FIR filters of Order = 2 Filter type h[], 0, h[] Lowpass Highpass Badpass Badstop si{ ( )} c ( ) si{ c ( )} ( ) si{ ( )} si{ ( )} h ( ) si{ ( )} si{ ( )} l ( ) l h c c h l ) ( h l Example Costruct a type 1 liear-phase filter of order 6 with coefficiets satisfyig the highpass respose characteristics ad cutoff frequecy of 2000 Hz assumig a samplig frequecy of 8000 Hz. Also, fid the trasfer fuctio ad geerate the polezero plot. Repeat for order 40. 4
Widowig (Trucatio) Effect 1. Passbad & Stopbad ripples caused by sidelobes 2. Trasitio badwidth depedet o mailobe width Effects of Widow Shape & Size For a fixed size widow, widow shape affects both the mailobe width ad sidelobe height Widow size affects the mailobe width oly 5
6 Commoly-used Widowig Fuctios 2 2 0 0, 2-2, 2, w[] 0 0, 1, ] [ 2.Bartlette widow 1.Rectagular widow w 0 0, ), 0.08cos(4 ) 0.5cos(2 0.42 ] [ Blackma widow 5. 0 0, ), 0.46 cos(2 0.54 ] [ widow Hammig 4. 0 0, ), 0.5cos(2 0.5 ] [ widow Haig 3. w w w
eetig Desig Specificatios Appropriate widow selected based o frequecydomai specificatios Estimate the filter order,, to cotrol the width of the ormalized trasitio bad of the filter. F FT F F s P F C F P F 2 T 7
ATLAB Implemetatio Fuctio B = firwd(n, Ftype, WL, WH, Wtype) ATLAB user-defied fuctio for FIR filter desig usig the widowig method (text, pp.288-290) Iput Argumets: N = umber of filter taps (must be a odd umber) = +1 where is a filter order (eve umber for Type 1) Ftype = filter type ( 1 lowpass, 2 highpass, 3 Badpass, 4 badstop ) WL = lower cut-off frequecy i rad (set to zero for highpass) WH = upper cutoff frequecy i rad (set to zero for lowpass) Wtype = widow type ( 1 rectagular, 2 triagular, 3 Haig, 4 Hammig, 5 Blackma ) Desig Characteristics of Widows Widow Type Filter Order () Passbad Ripple Stopbad Atteuatio p A p (db) s A s (db) Rectagular 0.9F 0.0819 0.7416 0.0819 21 Haig 3.1F 0.0063 0.0546 0.0063 44 Hammig 3.3F 0.0022 0.0194 0.0022 53 Blackma 5.5F 0.00017 0.0017 0.00017 74 8
Example Desig a type 1 liear-phase filter with coefficiets satisfyig badstop respose characteristics with the followig specificatios: Lower cutoff frequecy of 1250 Hz Lower trasitio width of 1500 Hz Upper cutoff frequecy of 2850 Hz Upper trasitio width of 1300 Hz Stopbad atteuatio of 60 db Passbad ripple of 0.02 db Samplig frequecy of 8000 Hz. 9
Kaiser Widow Near-optimal widow defied as 2 1 2 I0{ (1 [( ) ] ) }, 0 w[ ] I0( ) 0, = 2, ad I 0 () represets the zero th -order modified Bessel fuctio of the 1 st kid Two parameters: +1 = filter legth ad = shape parameter Kaiser Widow Characteristics 10
Desig ethod 0.1102( A 8.7), 0.4 0.5842( A 21) 0.07886( A 21), 0.0, A 8 2. 285 where A 20log 10 T P A 50 21 A 50 A 21 P is the passbad cutoff frequecy T is the stopbad cutoff frequecy is the passbad ripple ad stopbad atteuatio 11