View
324
Download
7
Category
Preview:
Citation preview
Chapter 7. Filter Design Techniques
7.1 Introduction - Digital Filter Design
7.2 IIR Filter Design by Impulse Invariance
7.3 IIR Filter Design by Bilinear Transformation
7.4 FIR Filter Design by Windowing
7.5 Kaiser Window based FIR Filter Design
7.6 Approximation based Optimal FIR Filter Design
BGL/SNU
(1) Frequency selective filters : spectral shapers lowpass highpass bandpass bandstop
1. Introduction -- Digital Filter Design
FIR: - windowing - equiripple design
IIR : - mapping from analog filters - impulse invariance
(2)Filter Design Techniques
BGL/SNU
(3)Filter Specification(LPF)
|)(| jeH
11 1
11
2
0p s
In some IIR filter design11
1
1 2 3
1
2
3
ripple passband : 1ripple passband : 2
],0[ band pass p
],[ band transition sp
],[ band stop s
BGL/SNU
- Utilize existing analog filter design technique- Convert analog impulse response into digital impulse response h[n] by taking samples
)(thc
- Take Then by fundamental sampling property, we get
)(][ dcd nThTnh
)2
()(ddk
cj
T
kj
TjHeH
2. IIR Filter Design by Impulse Invariance
(1) Design Concept
- If analog filter were bandlimited,
)( , || , 0)( , i.e.dd
c TTjH
|| ), (j)( d
cj
THeH
Then
BGL/SNU
- But the issue is that the above assumption is not likely, so aliasing is inevitable in reality
|)(|d
c TjH |)(|
dc T
jH
dT
0dT
)(
dT
dT
20aliasing
- Therefore this design technique is useful only when designing a narrowband sharp lowpass filters
(2) Aliasing Problem
BGL/SNU
- Let the analog filter has the partial-fraction expansion
, )(1
N
k k
kc ss
AsH
0 0
0 , )(1
t
teAthN
k
tskc
k
- Therefore, pole at in is mapped to
][ dcd )(nThTnh ,][1
nu)(eATN
k
nTskd
dk
, 1
][1 1
1
N
k
N
kTs
kd-n
ze
ATznhH(z)
dk
- After sampling,
kss )(sHc
)( in zHez dkTsPole at
(3) Parameter Conversion
nueATN
k
nTskd
dk1
][
BGL/SNU
* Impulse Invariance Filter Design Procedure
1) Given specification in domain.
2) Convert it into specification in domain
3) Design analog filter meeting the specification 4) Convert it into digital filter function H(z)
by putting
[ 5) Implement it in 2nd order cascade form]
)(sHc
dkTsk es
BGL/SNU
Design Example
3.02.0
17783.0
89125.01
1 |)(| jeH
189125.0
17783.0
2.0 3.0
2 |)(| jH
* Choose Td=1
3N
cc jH
22
)/(1
1|)(| filter th ButterworDesign
Nc
22
)/2.0(1
1(0.89125) 2.0at
Nc
22
)/3.0(1
1(0.17783) 3.0at
BGL/SNU
6N 0.58858N Determine-
0.7032 70474.0 cc
79601820 poles Determine- .j.- 49704970 .j.- 18206790 .j.-
))()(4945.036405.0(
12093.0)(
222
ssssHcThen
4 * )1( ez ssConvert ksk dT
21-
-1
6949.01.2971z-1
0.4466z-0.2871 H(z)Then
z
* You plot the pole locations in the z-plans!
c
1S2S
3S
4S
5S6S
BGL/SNU
- s-plane to z-plane conversion
planes planez
axis j cu.
- any mapping than maps stable region is s-plane (left half plane) to stable region in z-plane (inside u.c) ?
bilinear transform! 1
1
1
11
z
z
Ts
d sT
sT
zd
d
21
21
or
* Td inserted for convention may put to any convenient value for practical use.
3. IIR Filter Design by Bilinear Transformation
(1) Design Concept
1
21
21
, if |z| T
j
Tj
zjΩ sd
d
2tan
2
1
12 , if
ω
Tj
e
e
Tsez
dj
j
d
j
2tan
2
ω
Td
2tan2 1 dT
(2) Properties
* IIR Filter Design Procedure
Given specification in digital domain
Convert it into analog filter specification
Design analog filter (Butterworth, Chebyshov, elliptic):H(s)
Apply bilinear transform to get H(z) out of H(s)
1
2
3
4
|)(| jeH|)(| jH
s
p
p s
1
21
1
A
1
21
1
A
11
3
4
2
1
2tan
2
ω
Td
1
1
1
11)()(
z
z
Ts
d
sHzH
Design Example (Butterworth Filter)
1
0.20 1 |)(| 89125.0 jeH
2
3
Nc
c jH 22
)/(1
1|)(|
Given specification
0.3 0.17783 |)(| jeH
)( p
)( s
Specification Conversion
pc jH 0 1 |)(| 89125.0
s 0.17783 |)(| jHc
(Set Td=1)
)2
2.0tan(
2
d
p T )
2
3.0tan(
2
d
s T
Butterworth filter design
N
c
p2
2
)1.0tan2
(1
1(0.89125) at
N
c
s2
2
)15.0tan2
(1
1(0.17783) at
766.0 6 take3055 c, N .N
))()()()()(()(
654321
0
ssssssssssss
HsHc
))()(5871.03996.0(
20238.02
ss
1
1
1
12
)()(
z
zs
c sHzH))()(7051.02686.11(
)1(0007378.021
61
zz
z
Bilinear Transform4
c
1S2S
3S
4S
5S
-Filter equations
B Butterworth filter
Nc
c jjjH
22
)/(1
1|)(|
*Comparison of Butterworth, Chebyshev, elliptic filters
c
1
2
1
C Chebyshev filter (type I)
)/(1
1|)(| 22
2
cN
cV
jH
)coscos()( 1 xNxVN
c
1
1
Chebyshev polynomial
E
*Comparison of Butterworth, Chebyshev, elliptic filters (Cont’d)
Elliptic filter
)(1
1|)(|
222
Nc U
jH
sp
1
11
2
Chebyshev filter (type II)
122
2
)]/([1
1|)(|
cN
cV
jH
1
c
Jacobian elliptic function
*Comparison of Butterworth, Chebyshev, elliptic filters: Example
-Given specification
0.4| | .011 |)(| 99.0 jeH
||0.6 0.001 |)(| jeH
6.0 ,4.0 001.0 ,01.0 s21 p
)( s
-Order
Butterworth Filter : N=14. ( max flat)
Chebyshev Filter : N=8. ( Cheby 1, Cheby 2)
Elliptic Filter : N=6 ( equiripple)
B
C
E
-Pole-zero plot (analog)
-Pole-zero plot (digital)
B C1 C2 E
B C1 C2 E
(14) (8)
-Magnitude -Group delay
B
C1
C2
E
B
C1
C2
E
4.0 6.0 4.0 6.0
5
20
4. FIR Filter Design by Windowing
- Given a desired frequency response
evaluate
specification. given the in fall spectrum frequency
resulting thethat suchor ,segment of finite
Therefore, take a practical.not so long, infinitely is
However, coefficients.filter desired the is - Then,
,)( jd eH
deeHnh njjdd )(
2
1][
This process of getting out of is
called Windowing
][nh ][nhd
(1) Design Concept
][nhd
][nhd
][nhd ][nh, )( jeH
otherwise
Mnnwnwnhnh d , 0
0, 1 ][],[][][
)2
sin(
)2
)1(sin(
1
1)(
)()(2
1
)()()(
2/)1(
0
)(
M
ee
eeeW
deWeH
eWeHeH
Mjj
MjM
n
njj
jjd
jjd
j
(2) Rectangular Windowing
0 2
1
2
M
sidelobe peak
lobe main
0 2
)( )( jeW)( jd eH
)( jeH
)()(jeW
n
n
n
)( jeW
)( jeH
)( jd eH
cc
1
2
M
0 M
][nhd
][nw
][nh
)(e
][][][ nhnwnh Rd )()()( jjR
jd eHeWeH
This can be improved by increasing M.
of lobe main of width the on depends :
of sidelobe peak the of attenuation the on depends :
).(
)(
).(
)(
j
j
eW
e
eW
e
(3) Design Point
But M cannot improve this. (due to Gibb’s phenomena).
Therefore, once a specific window is given, is fixed.
otherwise
MnMM
n
MnM
n
nw
otherwise
Mnnw
,0
2/,2
2
2/0,2
][
r)(TriangulaBarlett
,0
0,1][
rRectangula
(4) Commonly Used Windows
BGL/SNU
otherwise
MnM
n
M
nnw
otherwise
MnM
nnw
otherwise
MnM
nnw
,0
0,4
cos08.02
cos5.042.0][
Blackman
,0
0,2
cos46.054.0][
Hamming
,0
0,2
cos5.05.0][
Hanning
BGL/SNU
Frequency Spectrum of Windows
(a) Rectangular, (b) Bartlett, (c) Hanning, (d) Hamming, (e) Blackman , (M=50)
BGL/SNU
5. Kaiser Window based FIR Filter Design
otherwise , 0
2,0,
)(
]))(1([
][0
2/120 M
MnI
nI
nwk
: 0th order modified Bessel function)( 0I
- targets at limited duration in time and energy concentration at
low frequency
- compromisable. (choose appropriate )
-Performance comparable to Hamming window ( when )
and )(e
5
n
)(nw )( jeW
(1) Design Concept
BGL/SNU
Frequency Spectrum of Kaiser Window
(a) Window shape, M=20, (b) Frequency spectrum, M=20, (c) beta=6
BGL/SNU
(2) Determination of Filter Order ( Kaiser, 1974 )
21,, sp Given①
②
③
21,0.0
5021,)21(07886.0)21(5842.0
50,)7.8(1102.0
log20
4.0
10
A
AAA
AA
on)(attenuati A
that such ) and A( Determine
)2
M (note,
that such M Determine
)-ω(ω.
A-M
ps2852
8
BGL/SNU
①
②
④
③
- Design Example :
001.0,01.0,6.0,4.0 21 sp : ionSpecificat
653.5
)5.02
(,60)(log20 110
spc-A
37M
)(
]))2/
2/(1([
][
)2
(
)2
(sin][
,0
,)(
0
2/120
2/
IM
MnI
nw
Mn
Mn
nh
elsewhere
eeH
k
c
d
cMj
jd
Mnnwnhnh kd 0 , ][][][
(Note)(Note)
1
20 ]
!
)2
([1)(
k
k
kI
BGL/SNU
6. Approximation based Optimal FIR Filter Design
- Linear phase filters possess the property
L
n
jj nnaeeH0
cos][)(
term Phase )( jR eH function Real
- More Generally, constant delay filters have the expression
)()(
cos][)()(
)(
0
)(
jj
L
n
jj
ePQe
nnaQeeH
term Phase
)( jR eH function Real
Sinusoid
L
n
nna0
cos][
(1) Design Concept
BGL/SNU
- Approximation error
)}()(){()( jR
jD
j eHeHWeE
function
Weighting Desired edApproximat
)}()(ˆ{)(ˆ
)}()(
)({)()(
jjD
jj
D
ePeHW
ePQ
eHQW
BGL/SNU
- Approximation ( Chebyshev)
) norm Chebyshev (where
, deviation edprespecifi and
band) stop band, (pass B band edprespecififor
meet curveerror thethat such
in L,,0,1,n a(n), tscoefficien Determine
p
1
,])([lim)(
})(max{min)(
)(
)(
1
0
)(
dxxEeE
eEeE
eE
eP
p
p
j
j
Bna
j
j
j
BGL/SNU
(2) Type I Lowpass Filter case
- desired :
L
n
j
jjj
L
n
jj
nnaePQL
ePQe
nnaeeH
0
0
cos][)(,1)(,0,
)()(
cos][)(
s
pjD eH
,0
0,1)(
- approximation
- weighting
s
pkW
,1
0,/1)(
BGL/SNU
- Error function
)]()()[()( jjD
j ePeHWeE
sp
22
11 11
7,2
1 LK
p s
0
02
2
1B2B
points extremal
92L
21 BBB
(3) Type II Lowpass Filter case
- desired (original) :
L
n
j
jjj
M
n
Mj
M
n
Mj
M
n
Mjj
nnbePQM
ePQe
nnbe
nnbe
nM
nheeH
0
2
1
0
2
2
1
1
2
2
1
0
2
cos][~
)(,2
cos)(,0,2
)()(
]cos[)(~
]2
cos[
)]2
1(cos[][
)]2
(cos[][2)(
s
pjD eH
,0
0,1)(
- approximationMnoutside
nh
0
,0][
2
1,,2,1
]2
1[2][
Mn
nM
hnb
2
1
ML
BGL/SNU
- Weighting (modified)
s
pkQWW
),2
cos(
0,/)2
cos()()()(ˆ
- Desired (modified)
s
pj
D eH
,0
0,
2cos
1
)(ˆ
- error function
)]()(ˆ)[(ˆ)( jjD
j ePeHWeE
BGL/SNU
) Note (*
2
1
0
2
1
1
2
1
0
2
1
1
2
1
0
2
1
0
2
1
0
))2
1(cos(][
2cos]
2
1[
~
2
1
2
1cos][
~
2
1))
2
1(cos(
2
][~
]1[~
))2
1(cos(][
~
2
1))
2
1(cos(]1[
~
2
1
))2
1(cos(][
~
2
1))
2
1(cos(][
~
2
1)
2cos()cos(][
~
M
n
M
n
M
n
M
n
M
n
M
n
M
n
nnb
MMbnbn
nbnb
nnbnnb
nnbnnbnnb
BGL/SNU
(4) Alternation Theorem
B.in sfrequencie extremal
2Lleast at exhibits )E(function error the
thatis ][0, ofsubset compact a
),B( Bon )(H ion toapproximat Chebyshev
best unique thebe tocos][)P(e
for condition sufficient andNecessary
iD
L
0n
j
j
i
j
e
e
nna
ripple. extra called is case which
3,L is sfrequencie extremal ofnumber the fact, In
)E(max)E( and 1M,1,2,I ),-E()E(
that such and that such
B, in points 2Lleast at exist must there is,That
2M21
}{1
j
B
jjj eeee iii
BGL/SNU
p s
)( je eA
)(
3
ripple extra
L
p s
)( je eA
2L
)(a
)(b
BGL/SNU
p s
)( je eA
2L
p s
2L
)( je eA
)(c
)(dBGL/SNU
(5) Parks-McClellan Algorithm
①
②
④
③
)]()(ˆ[)(ˆ)(
),(),(
jj
Dj
jD
ePeHWeE
WeH
for L and Given
L
n
nna0
cos)(
problem ionapproximat equivalent the formulate
2,,2,1
)1()]()(ˆ[)(ˆ)(
Li
ePeHWeE ijjDi
j iii
AlgorithmExchange Romez
using problem ionapproximat the Solve
)P(e samples frequency spaced equally L)( on
IDFT taking by response impulse the Evaluatej
BGL/SNU
⑤
h(n) tscoefficienfilter original
the determine Finally,
Remez Exchange Algorithm (1934) (multiple exchange)
①
②
) , (including points external 2L initial the Guess ps
)(ˆ
)(ˆ
)(ˆ
)(ˆ)1(
cos2coscos
)(ˆ)1(
cos2coscos
)(ˆ1
cos2coscos
2
1
2
2
2
222
2
2
222
1
111
Lj
j
j
L
L
LLL e
e
e
WL
WL
WL
D
D
D
H
H
H
a(L)
a(1)
a(0)
1
1
1
points external the on optimum the Calculate
BGL/SNU
③
iiji
L
iji
L
L
jDL
jD
jD
xxx
d
W
d
W
d
W
deHdeHdeHd L
cos,1
,
)(ˆ)(ˆ)(ˆ
)(ˆ)(ˆ)(ˆ
2
1
2
2
2
2
1
1
221221
form cbarycentri
the in formula ioninterpolat Lagrange the using
)P(e obtain to points 1L theover ioninterpolat Do j
,1
,)(ˆ
)1()(ˆ
,)()()(
1
1
1
1
1
1
/
ji
L
iji
i
ij
Di
L
i i
iL
i i
iij
xxb
WeHc
xx
b
xx
cbeP
i
BGL/SNU
④
)(
)(j
j
eE
eE
with extrema local the locate to
(grid) sfrequencie ofset dense a on Evaluate
⑤
⑥
them. using process same therepeat and
extrema, 2Llargest the Take
changenot do points extremal the if
process the Terminate
BGL/SNU
1 2 3
67s
p
Selection of new extrema
BGL/SNU
Initial guess of(L+2) extremal frequencies
Initial guess of(L+2) extremal frequencies
Calculate the optimum On extremal set
Calculate the optimum On extremal set
Interpolate through (L+1)Points to obtain Ae(ej)
Interpolate through (L+1)Points to obtain Ae(ej)
Calculate error E()And find local maxima
Where | E()|>=
Calculate error E()And find local maxima
Where | E()|>=
More than (L+2) extrema?
Retain (L+2)Largest extrema
Retain (L+2)Largest extrema
Yes
No
Check whether theExtremal points changed
Check whether theExtremal points changed
Best approximationBest approximation
Unchanged
Changed
Remez Exchange Algorithm
BGL/SNU
Design Examples
① :filter pass Low
26Morder filter
10
,001.0,01.0
,6.0,4.0
2
1
21
K
sp
Kaiser, (1974)Kaiser, (1974)
)(324.2
13log10 2110
ps
M
BGL/SNU
② filter tionreconstruc dCompensate
DSPDSP Sample& HoldSample& Hold
Comp.Reconst.
filter
Comp.Reconst.
filter
)(ny )(tyr
)( jH r
)( jHo )(~ jH r
2/
2/
)2/sin()(
,0
,)(
~)()(
Tjo
cror
eT
jH
Otherwise
TjHjHjH
elsewhere
eTjH c
Tj
r
,0
,)2/sin(
2/
)(~
2/
BGL/SNU
s
pjD eH
,0
0,)2/sin(
2/
)(~
28M take
take sp
001.0,01.0
,6.0,4.0
21
BGL/SNU
H.W. of Chapter 7
Due 11/17 (Mon.)[1] Design a IIR lowpass filter whose specification is the same as that given in Example 7.3 (page 454) except the passband and stopband edges are shifted to 0.7pi and 0.8pi respectively, using bilinear transform technique.
Text : [2] 7.2 [3] 7.3 [4] 7.17
BGL/SNU
H.W. of Chapter 7
Due 11/24 (Mon.)[1] Design a Length-21 FIR Filter Use the MATLAB command h=remez(20, [0,0.4,0.5,1], [1,1,0,0]) to design a length-21 filter with a passband from 0 to wp=0.4pi and a stopband from ws=0.5pi to pi with a desired response of 1 in the passband and zero in the stopband. Plot the impulse response, the zero locations, and the amplitude response. How many “ripples” are there? How many extremal frequencies are there (places where the ripples are the same maximum size)? How many “small ripples” are there that do not give extremal frequencies, and if there are any, are they in the passband or stopband? Are there zeros that do not contribute directly to a ripple? Most zero pairs off the unit circle in the z-plane cause a maximum-size ripple in the passband or stopband. Some cause only a “small ripple,” and some cause no ripple.
Text : [2] 7.28 [3] 7.23 [6] 7.36 BGL/SNU
Recommended