Lecture 8 - FIR Filter Design include all of the following content: FIR filter design, commonly used windows, generalized linear-phase FIR filter, the Kaiser window filter design method.
Trang 1Digital Signal Processing, VIII, Zheng-Hua Tan, 2006
1
Digital Signal Processing, Fall 2006
Zheng-Hua Tan
Department of Electronic Systems Aalborg University, Denmark
zt@kom.aau.dk
Lecture 8: FIR Filter Design
Course at a glance
Discrete-time signals and systems
Fourier-domain
representation
DFT/FFT
System analysis
Filter design
z-transform
MM1
MM2
MM9, MM10
MM3
MM6
MM4
MM7 , MM8
Sampling and reconstruction MM5
System structure System
Trang 2Digital Signal Processing, VIII, Zheng-Hua Tan, 2006
3
FIR filter design
Design problem: the FIR system function
Start from impulse response directly
Find
to approximate a desired frequency response
⎩
⎨
=
= ∑
=
−
otherwise
, 0
0 , ]
[
)
(
0
M n b
n
h
z b z
H
n
M
k
k k
M z M h z
h h z
H ( ) = [ 0 ] + [ 1 ] −1+ + [ ] −
Part I: FIR filter design
FIR filter design
Commonly used windows
Generalized linear-phase FIR filter
The Kaiser window filter design method
Trang 3Digital Signal Processing, VIII, Zheng-Hua Tan, 2006
5
Lowpass filter – as an example
Ideal lowpass filter
IIR filter: based on transformations of
continuous-time IIR system into discrete-continuous-time ones.
FIR filter: how? is non-causal, infinite! h [n ]
∞
<
<
∞
−
=
⎩
⎨
⎧
≤
<
<
=
n n
n n
h
e H
c c
c j
lp
,
sin ] [
, 0
|
| , 1 ) (
π ω
π ω ω
ω ω ω
N c
c j
) / ( 1
1
| ) (
|
Ω Ω +
= Ω
poles
Design by windowing
Desired frequency responses are often
piecewise-constant with discontinuities at the boundaries
between bands, resulting in non-causal and infinte
impulse response extending from to , but
So, the most straightforward method is to truncate
the ideal response by windowing and do
time-shifting:
0 ] [
±∞
∞
∞
−
] [
] [
otherwise
, 0
|
| ], [ ]
[
M n g n
h
M n n h n
−
=
⎩
⎨
=
Trang 4Digital Signal Processing, VIII, Zheng-Hua Tan, 2006
7
Design by windowing
After Champagne & Labeau, DSP Class Notes 2002.
Design by rectangular window
In general,
For simple truncation, the window is the rectangular
window
∫−
−
π
θ ω θ
π H e H e d
e
2
1 )
⎩
⎨
=
=
otherwise
, 0
0 ,
1
]
[
] [ ] [
]
[
M n n
w
n w n h
n
Trang 5Digital Signal Processing, VIII, Zheng-Hua Tan, 2006
9
Convolution process by truncation
Fig 7.19
? t then wha ,
,
1
]
[ n = − ∞ < n < ∞
r
jω ∑∞ πδ ω π
−∞
=
+
= band
narrow be
should
)
( ejω
W
Requirements on the window
Requirements
reproduce the desired frequency response
filter) to minimize computation in the implementation of
the filter
Take the rectangular window as an example.
,
,
1
]
[ n = − ∞ < n < ∞
r
jω ∑∞ πδ ω π
−∞
=
+
= band narrow be
should
)
( ejω
W
) ( ejω
W
Trang 6Digital Signal Processing, VIII, Zheng-Hua Tan, 2006
11
Rectangular window
M+1
M=7
π
4
constant
Part II: Commonly used windows
FIR filter design
Commonly used windows
Generalized linear-phase FIR filter
The Kaiser window filter design method
Trang 7Digital Signal Processing, VIII, Zheng-Hua Tan, 2006
13
Standard windows – time domain
Rectangular
Triangular
Hanning
Hamming
Blackman
⎩
⎨
=
otherwise
, 0 0 ), / 2 cos( 5 0 5 0 ] [ n n M n M w π ⎪ ⎩ ⎪ ⎨ ⎧ ≤ ≤ − ≤ ≤ = otherwise , 0 2 / , / 2 2 2 / 0 , / 2 ] [ n M M n M M n M n n w ⎩ ⎨ ⎧ ≤ ≤ = otherwise , 0 0 , 1 ] [ n n M w ⎩ ⎨ ⎧ − ≤ ≤ = otherwise
, 0 0 ), / 2 cos( 46 0 54 0 ] [ n n M n M w π ⎩ ⎨ ⎧ − + ≤ ≤ = otherwise
,
0
0 ), / 4 cos(
08 0 ) / 2 cos(
5 0 42
.
0
]
Standard windows – figure
Fig 7.21
Plotted for convenience In fact, the window is defined only at integer values of n.
Trang 8Digital Signal Processing, VIII, Zheng-Hua Tan, 2006
15
Standard windows – magnitude
Standard windows – comparison
Magnitude of side lobes vs width of main lobe
Trang 9Digital Signal Processing, VIII, Zheng-Hua Tan, 2006
17
Part III: Linear-phase FIR filter
FIR filter design
Commonly used windows
Generalized linear-phase FIR filter
The Kaiser window filter design method
Linear-phase FIR systems
Generalized linear-phase system
Causal FIR systems have generalized linear-phase
if h[n] satisfies the symmetry condition
M n
n h n
M
h
M n
n h n
M
h
, , 1 , 0 ], [ ] [
or
, , 1 , 0 ], [ ] [
=
−
=
−
=
=
−
constants real
are and
of function real
a is )
(
) ( ) (
β
α
ω ω
β ωα ω
ω
j
j j j j
e
A
e e A e
Trang 10Digital Signal Processing, VIII, Zheng-Hua Tan, 2006
19
Types of GLP FIR filters
1
or
, , 1 , 0 ], [ ]
[
−
=
=
=
−
ε
n
M
h
Type IV Type III
Type II Type I
M odd
M even
1
=
ε
1
−
=
ε
Generalized linear phase FIR filter
Often aim at designing causal systems with a
generalized linear phase (stability is not a problem)
symmetric about M/2,
is a real, even function of w
Æ the resulting frequency response will have a
2 /
) ( ) ( ej We ej e j M
W ω = ω −ω
⎩
⎨
= otherwise
, 0
0 ], [ ]
w
) ( jω
e e W
] [ ]
hd − = d
Trang 11Digital Signal Processing, VIII, Zheng-Hua Tan, 2006
21
Linear-phase lowpass filter – an example
Desired frequency response
so
apply a symmetric window Æ a linear-phase system
∞
<
<
∞
−
−
−
=
⎩
⎨
⎧
≤
<
<
n M
n
M n n
h
e e
H
c lp
c
c M
j j
lp
, ) 2 / (
)]
2 / ( sin[
]
[
, 0
|
| , )
(
2 /
π ω
π ω ω
ω ω
ω ω
] [ ]
hlp − = lp
] [ ) 2 / (
)]
2 / ( sin[
] [ ] [ ]
M n
M n n
w n h n
−
=
=
π ω
Window method approximations
even and real is ) (
) ( ) (
even and real is ) (
) ( ) (
2 /
2 /
ω
ω ω ω
ω
ω ω ω
j e
M j j e j
j e
M j j e j
d
e W
e e W e
W
e H
e e H e
H
−
−
=
=
∫−
−
−
=
=
π π
θ ω θ
ω
ω ω ω
θ
e A
e e A e
H
j e j e j
e
M j j e j
) ( ) ( 2
1 ) (
) ( ) (
) ( 2 /
Trang 12Digital Signal Processing, VIII, Zheng-Hua Tan, 2006
23
Key parameters
To meet the requirement of FIR filter, choose
Trail and error is not a satisfactory method to design
filters Æ a simple formalization of the window
method by Kaiser
Part IV: Kaiser window filter design
FIR filter design
Commonly used windows
Generalized linear-phase FIR filter
The Kaiser window filter design method
Trang 13Digital Signal Processing, VIII, Zheng-Hua Tan, 2006
25
The Kaiser window filter design method
An easy way to find the trade-off between the
main-lobe width and side-main-lobe area
The Kaiser window
the first kind is an adjustable design parameter.
adjusted to trade side-lobe amplitude for main-lobe
width (not possible for preceding windows!)
2 /
otherwise
, 0
0 , )
(
] ) ] / ) [(
1 ( [ ]
2 / 1 2 0
M
M n I
n I
n
w
=
⎪
⎩
⎪
⎨
⎧
≤
≤
−
−
=
α
β
α α β
)
0 ⋅
I
0
≥ β
β
The Kaiser window
Trang 14Digital Signal Processing, VIII, Zheng-Hua Tan, 2006
27
Design FIR filter by the Kaiser window
Calculate M and to meet the filter specification
Define then
Stopband cutoff frequency by:
Transition width
M must satisfy
δ
ω) | ≥ 1 − (
| H ej
β δ
β
δ
ω) | ≤ (
| H ej
⎪
⎩
⎪
⎨
⎧
<
≤
≤
− +
>
−
=
21
, 0 0 50 21
), 21 ( 07886 0 21) -0.5842(A 50
), 7 8 ( 1102 0 0.4 A A A A A β p s ω ω ω = − Δ p ω δ 10 log 20 − = A s ω ω Δ − = 285 2 8 A M (Peak error is fixed for other windows) (Rectangular) A lowpass filter Specifications Specifications for a discrete-time lowpass filter π ω ω π ω ω ω ω 6 0 , 001 0 | ) ( | 4 0 0 , 01 0 1
| ) (
| 01
.
0
1
=
≥
≤
=
≤
≤ +
≤
≤
−
s j
p j
e
H
e H
001 0
01 0
2
1
=
= δ δ
Trang 15Digital Signal Processing, VIII, Zheng-Hua Tan, 2006
29
Design the lowpass filter by Kaiser window
Designing by window method indicating , we
must set
Transition width
The two parameters:
Cutoff frequency of the ideal lowpass filter
Impulse response
60 log
−
A
001 0
= δ
π ω
ω
2
1 δ
37
, 653 5 = = M β ⎪ ⎩ ⎪ ⎨ ⎧ ≤ ≤ − − ⋅ − − = otherwise
,
0
0 , )
(
] ) ] / ) [(
1 ( [ ) (
) ( sin
]
2 / 1 2 0
M n I
n I
n
n n
h
c
β
α α β
α π
α ω
π ω
ω
ωc = ( s+ p) / 2 = 0 5
Design the lowpass filter
What is the group delay?
M/2=18.5
Trang 16Digital Signal Processing, VIII, Zheng-Hua Tan, 2006
31
Summary
FIR filter design
Commonly used windows
Generalized linear-phase FIR filter
The Kaiser window filter design method
Course at a glance
Discrete-time signals and systems
Fourier-domain
representation
DFT/ FFT
System analysis
Filter design
z-transform
MM1
MM2
MM6
MM4
MM7, MM8
Sampling and reconstruction MM5
System structure System