FIR Filters
Window Method of Design
© 2019 Arm Limited
Window Method of FIR Filter Design
If we know the coefficients of an FIR filter, we can compute its
frequency response.
How do we find the FIR filter coefficients that will give a desired
frequency response?
How do we design an FIR filter?
2 © 2019 Arm Limited
Ideal Filter Prototypes
H(
ˆ)
1.0
Low pass
0
ˆc
ˆ
H(
ˆ)
1.0
High pass
ˆ
0.0
ˆc
3 © 2019 Arm Limited
Ideal Filter Prototypes
H(
ˆ)
1.0
Band pass
ˆ
0.0
H(
ˆ)
1.0
Band stop
ˆ
0.0
4 © 2019 Arm Limited
Window Method of FIR Filter Design
Design steps
1) Specify desired frequency response.
2) Use inverse Fourier transformation to obtain corresponding (discrete)
impulse response.
3) Multiply impulse response (the FIR filter coefficients) by finite tapered
window function.
5 © 2019 Arm Limited
Widely Used Window Functions
Window functions
0.54 0.46 cos( n L), Ln L
whamming
0, otherwise
0.5 0.5 cos( n L ), Ln L
whanning
0, otherwise
0.42 0.5 cos( n L) 0.08 cos( 2n L), Ln L
wblackman
0, otherwise
6 © 2019 Arm Limited
Example of Window Function
1.5
1
h(n)
0.5
0
-30 -20 -10 0 10 20 30
n
33-point Hanning window
7 © 2019 Arm Limited
Design of a Low Pass FIR Filter
H(
ˆ)
1, ˆ ˆ c
1.0 H (
ˆ)
0, ˆ ˆ c
0
ˆc
ˆ in the range
ˆ
sin(ˆ c n)
Taking inverse DTFT , n0
h( n) n
ˆc for Ln L
, n0
Order of filter: 2L
Number of coefficients: 2L 1
8 © 2019 Arm Limited
Design of a Low Pass FIR Filter
1.5 0.3
0.25
0.2
1
magnitude
0.15
h(n)
0.1
0.5
inverse 0.05
0
DTFT -0.05
0
-0.1
-30 -20 -10 0 10 20 30
-3 -2 -1 0 1 2 3
frequency n
The inverse DTFT of a continuous, ideal (rectangular), low pass frequency response is a discrete-time impulse
response (filter coefficients) of infinite extent.
9 © 2019 Arm Limited
Design of a Low Pass FIR Filter
Truncated, or rectangular-windowed
finite impulse response
0.3 1.5
0.25
0.2
1
magnitude
0.15
h(n)
0.1
0.05
0.5
0
DTFT
-0.05
-0.1
-30 -20 -10 0 10 20 30
0
-3 -2 -1 0 1 2 3
n frequency
h(n) H (
ˆ)
A finite impulse response filter has a finite set of coefficients.
Truncating the impulse response corresponding to an ideal low pass frequency response has the effect of
introducing ripple.
10 © 2019 Arm Limited
Design of a Low Pass FIR Filter
Symmetrical, tapered-windowed
finite impulse response
0.3 1.5
0.25
0.2
1
magnitude
0.15
h(n)
0.1
0.05
0
DTFT 0.5
-0.05
-0.1 0
-30 -20 -10 0 10 20 30 -3 -2 -1 0 1 2 3
n frequency
Multiplying the filter coefficients by a symmetrical, tapered window function reduces ripple at the expense
of widening the transition from pass band to stop band.
11 © 2019 Arm Limited
Design of a Low Pass FIR Filter
10
-10
magnitude (dB)
-20
-30
-40
-50
-60
-70
-80
-3 -2 -1 0 1 2 3
frequency
The effect of windowing the filter coefficients on the frequency response of a filter is clearer if
the magnitude is plotted on a log scale.
12 © 2019 Arm Limited
High Pass FIR Filter
H(
ˆ)
0, ˆ ˆ c
1.0 H (
ˆ)
1, ˆ ˆ c
ˆ
0.0
ˆc in the range
ˆ
Taking inverse DTFT sin(ˆ c n)
, n0
h( n) n for Ln L
1 c ,
ˆ
n0
Order of filter: 2L
Number of coefficients: 2L 1
13 © 2019 Arm Limited
Band Pass FIR Filter
H(
ˆ) 0, ˆ ˆ c1
1.0 H (
ˆ ) 1, ˆ c1 ˆ ˆ c 2
0, ˆ ˆ c 2
ˆ
0.0 in the range
ˆ
Taking inverse DTFT sin(
ˆ c 2 n) sin( ˆ c1n)
, n0
h( n) n
ˆ c 2 ˆ c1
for Ln L
, n0
Order of filter: 2L
Number of coefficients: 2L 1
14 © 2019 Arm Limited
Band Stop FIR Filter
H(
ˆ) 1, ˆ ˆ c1
1.0 H (
ˆ ) 0, ˆ c1 ˆ ˆ c 2
1, ˆ ˆ c 2
ˆ
0.0 in the range
ˆ
Taking inverse DTFT sin(
ˆ c1n) sin(ˆ c 2 n)
, n0
h( n) n for Ln L
ˆ ˆ c1
1 c2 , n0
Order of filter: 2L
Number of coefficients: 2L 1
15 © 2019 Arm Limited
Window Method of FIR Filter Design
Design steps
1) Specify desired frequency response.
2) Use inverse Fourier transformation to obtain corresponding (discrete)
impulse response.
3) Multiply impulse response (the FIR filter coefficients) by finite tapered
window function.
16 © 2019 Arm Limited
Discrete Frequency Response
Taking the inverse DTFT of a rectangular function is straightforward.
Taking the inverse DTFT (algebraic operation) of a more sophisticated, or arbitrary,
function may be problematic.
Alternatively, specify a discrete (desired) frequency response and take its inverse
DFT (computational operation).
17 © 2019 Arm Limited