Design of Linear-Phase FIR Filters Using Windows
Design of Linear-Phase FIR Filters Using Windows
FIR
Determine
coefficients of
h(n) [or P(z)
and Q(z)]
IIR
No rational transfer
function
H ( z)
P( z )
Q( z )
x(n) 1 X ( )e jn d 1 e jn d
2
2
1
e j c n e j c n
j n c
x( n)
[e ]c
j 2n
j 2n
x ( n)
sin c n
n
Multiply by a
rectangular window
DesiredFrequencyResponseofthesystemis
CorrespondingUnitsampleresponseis
ThisUnitsampleresponseisinfiniteinduration&must
betruncatedatsomepointn=M1,totakeFIRfilterof
lengthequaltoM
ButabrupttruncationoftheFourierseriesresultsinoscillationsin
thepassbandandstopband.
TheseoscillationsareduetoslowconvergenceofFourierseries
andthiseffectisknownasGibbsphenomenon.
Toreducetheseoscillations,theFouriercoefficientsofthefilter
aremodifiedbymultiplyingtheinfiniteimpulseresponsewitha
finiteweighingsequencew(n).
GibbsPhenomenonOscillatorybehaviourinthe
magnituderesponsesofcausalFIRfiltersobtainedby
truncatingtheimpulseresponsecoefficientsofidealfilters.
Asthelengthofthelowpassfilterisincreased,thenumber
ofripplesinbothpassbandandstopbandincreases,witha
correspondingdecreaseintheripplewidths.
Heightofthelargestripplesremainthesameindependent
oflength.
Gibbsphenomenoncanbereducedeither:
1. Usingawindowthattaperssmoothlytozeroateachend,or
2.Providingasmoothtransitionfrompassbandtostopbandinthe
magnitudespecifications
Rectangular
Window
W(n)shouldbeassmallaspossible.Thisminimizescomputation
intheimplementationofthefilter.
W e jw
1 e
1 e jw
jw M 1
w n e jwn e jwn
jwM 2
n0
sin w M 1 2
sin w 2
H e jw
Thefrequencyresponseofthefiltercan
jw
H d e
beobtainedbyconvolutionofand
H e
jw
H d e jw W e j w d H d e jw
M 1
We
jw
2
M 1
TheFourierTransformofwindowconsistsofacentrallobe
andsidelobes.Thecentrallobecontainsmostoftheenergy
13
ofthewindow.
H ( ) H d ( ) *W ( )
H d e j W e j d
M 1 N
Rectangular
Window
function
(Oppenheim and Schaffer, 2009)
Filter Specifications
Pass-band:
Stop-band:
0 p
s
Pass-band ripple:
1 p
Stop-band ripple:
2 s
Transition width: s p
What is the ideal situation?
Filter Specifications
20 log H ( )
Observations
Width of transition is
not sharp!
Q: How can we control the transition width (size of the main lobe)?
A1: using the size of the window
Dependency
Rectangular Window
Narrowest main lobe
4/(M+1)
Sharpest transitions at
discontinuities in
frequency
Simplest window
possible
1 0nM
w n
else
0
Side lobes
-25 dB
Hamming window
performs better
Simple equation
2n / M
0 n M /2
w n 2 2n / M M / 2 n M
0
else
Hanning Window
Medium main lobe
8/M
Side lobes
-31 dB
Hamming window
performs better
Same complexity as
Hamming
1
2 n
1
cos
w n 2
M
0nM
else
Hamming Window
Medium main lobe
8/M
Good side lobes
-41 dB
Simpler than
Blackman
2 n
w n
0nM
else
Blackman Window
Large main lobe
12/M
Complex equation
2 n
0.42
0.5cos
0nM
w n
4 n
0.08cos
0
else
Sr.
N
o.
Window Type
Rectangular
Window
Bartlett Window
(Triangular)
Hanning
Window
Hamming
Window
Blackman
Window
Weight Equation
40
41