dsp u lec09 iir filter design
DESCRIPTION
Iir Filter DesignTRANSCRIPT
5 l lEC533: Digital Signal Processing
Lecture 9IIR Filter Design
9.1 – IIR Filter
Difference EquationNN
∑∑==
−+−=N
jj
N
ii jnybinxany
10)()()(
Transfer Function ∑ −N
i
ii za
0
∑ −
=
+= N
jj
i
zbzH 0
1)(
where; N is the filter’s order.ai,bj are the filter’s coefficients.
∑=j
j1
ai,bj are the filter s coefficients.
9.1 – IIR Filter – contd.• IIR filter have infinite-duration impulse responses, hence they can be
matched to analog filters, all of which generally have infinitely long impulse responses.
• The basic techniques of IIR filter design transform well-known analogfilters into digital filters using complex-valued mappings.
• The advantage of these techniques lie in the fact that both analog filter design (AFD) tables and the mappings are available extensively in the literature.
• The basic techniques are called the A/D filter transformation.
H th AFD t bl il bl l f l filt W l• However, the AFD tables are available only for lowpass filters. We also want design other frequency-selective filters (highpass, bandpass, bandstop, etc.)
• To do this, we need to apply frequency-band transformations to lowpass filters. These transformations are also complex-valued mappings, and they are also available in the literature.
9.2 – Design Methods
The following A/D filter transformation methods are used in calculating the coefficients of IIR filter:g ff f f
1. Impulse Invariant Method.2. Bilinear Z-transform Method.
to achieve a digital filter that has a certain specification equivalent to an g f p f qanalogue filter
NoteNote
We have no control over the phase characteristics of the IIR filter. Hence IIR filter designs will be treated as magnitude-onlydesigns.
9.3 – Impulse Invariant Method
• Here we require that the impulse response of the discrete system (digital filter) be the discrete version of the impulse response of the analogue system (filter), (H h l )(Hence the name: impulse invariant).
ZŁ-1 t = nTH(s) h(t) h(nT) X T H(z)
Steps:To remove the sampling effect:
(1/T) δ(t‐nT)Steps:1. Get H(s), continuous time transfer function of an analogue filter that satisfies the prescribed
magnitude response.2. Apply the inverse Laplace transform to get the impulse response h(t). h(n).3. Obtain a discrete version of h(t) by replacing t by nT h(nT).4. Apply the Z-transform to h(nT) to get H(z) and multiply by T.
h(t)h(nT)
h(n).
n ∞
n
Example - 1
Using the invariant impulse response method, design a digital filter that has the shown pole-zero distribution. jω
Solutionσ
x ω0
‐ a)]()][([)(
00 ωω jasjasassH
−++++
=
x - ω0
)])[()( 2
02 ω+++
=as
assH
)()cos()(1 thtesH at == −− ω L (1) )()cos()( 0 thtesH == ωL (1)
)cos( 0nTeh(nT) anT ω−= (2)aT 1)(1 T
zezTezTeh(nT)T aTaT
aT
×+−
−=× −−−−
−−
2210
10
)cos(21)cos(1
ωω
Z (3)
1aT
2210
10
))cos(2(1))cos(()( −−−−
−−
+−−
=zezTe
zTTeTzH aTaT
aT
ωω
Example - 1 – cont.
221
10
))cos(2(1))cos(()( −−−−
−−
+−
=zezTe
zTTeTzH aTaT
aT
ωω
0 ))cos(2(1 +− zezTe ωa0
Xx(n) y(n)
Xa1- b1
b
T
TX
- b2 TX
Tawhere, 0 =
aT
aT
Teb
TTea
Ta where,
01
0
)cos(2
)cos(−
−−=
ω
ω
aT1
eb
Teb 2
2
0 )cos(2−=
−= ω
9.4 – Bilinear Z-Transform (BZT) Methods t z
Impulse Invariant Method
ss1
z
Bilinear Z Transform Method
• It is the most important method of obtaining IIR filter coefficients.• In the BZT method, the basis operation is to convert an analogue filter H(s) into
i l di i l fil H( ) b i h bili i i
Bilinear Z‐Transform Method
an equivalent digital filter H(z) by using the bilinear approximation.
Ha(s) HD(z)
1 sTsT
...21
...21
2
2
+−
++=== − sT
sT
e
eez sT
sTsTQ 1st order bilinear
approximation...21 +e
21 sT+
212
sTz−
≅∴
9.4 – BZT Method – cont.
21 sTz
+≅ sTsTzz +=− 1
21 sTz−
≅
s2T1)z1-z
zz
+=
+=
(
21
2
2
12 −z112
+≅∴
zz
Ts
1
12)()( −=
= zsaD sHzH1+zT
s
9.4 – BZT Method – cont.
2
112
112
Tj
Tj
Tj
Tj eeT
zT
s Ω
Ω−
Ω
Ω
×−
=−
=Q211 TjTj
eeTzT Ω−Ω ++( )( )
2sin222 22 TjeeTjTj Ω
=−
=Ω−Ω
( )2cos222 TTeeT TjTj Ω=
+= Ω−Ω
( )t2 Tjj Ω( )2tan TT
jj aΩ=ω
( )2tan2 TΩ=ω Pre-Warping effect( )2tanTa =ω
⎠⎞⎜
⎝⎛=Ω −
2tan2 1 Taω Warping effect
p g ff
⎠⎜⎝ 2T
Digital frequency
p g ff
9.5 – Frequency Warping Effect (BZT)• The effect of the bilinear Z-transform is called
frequency warping: every feature appears in the f f th ti ti filt
ωaAnalogue frequency
frequency response of the continuous-time filter appears as it is in the frequency response of the discrete-time filter but at different frequency.
Ωa when
≤Ω≤−
∞≤≤∞−ππ
ω
σ
jω
S domain tan(θ)
Digital frequency
22ss
TT
Ω≤Ω≤
Ω−
≤Ω≤ σ
S1 domainΩs/2
θπ/2
‐ π/2jΩDigital frequency
• To compensate for this, every frequency specification the designer has a control over (ωc,ωs,…) has to be ‘prewarped’ by setting it with;
22- Ωs/2
( )2tan2 TT
Ω=ω 2
9.6 - IIR Filter Design Procedure Using BZTGiven specification in digital domain1 Given specification in digital domainConvert it into analog filter specification(prewarping)Design analog filter (Butterworth Chebyshov elliptic):H(s)
1
2
3 Design analog filter (Butterworth, Chebyshov, elliptic):H(s)Apply bilinear transform to get H(z) out of H(s)
3
4ω ω
sω32 ( )2tan2 T
TaΩ=ω
Ω|)(| ΩjeH
|)(| ωjHpω
1 1 1 1
( )2Ta
|)(| eH21 ε+
1
211ε+
A1
4 1
sΩpΩ πA1
1
1
112
)()(−
−
+
−⋅=
=zz
Ts
sHzHΩ
9.7 – IIR Filter Design Steps Using BZT
1. Prewarp any critical frequency in the digital filter specifications(ωc,ωp,ωs,…) using; ( ) TT 1t Ω
2. Use the digital filter specifications to find a suitable normalized prototype
( )sF
T; T2tan =Ω=ω
g f p f f p ypanalogue LPF, H(s), e.g., for butterworth;
• 1st order: 11)(+
=s
sH
• 2nd order:
1+s
121)(
2 ++=
sssH
1
For butterworth prototype filter
• 3rd order:
Where
Ap the passband ripple in dB
)1)(1(1)( 2 +++
=sss
sH
⎟⎠
⎞⎜⎜⎝
⎛ −A
A
p
s
1.0
1.0
10 110110log
p p ppAs the stopband attenuation in dB
⎟⎟⎠
⎞⎜⎜⎝
⎛⎠
⎜⎝ −≥
p
s
p
N
ωω
10log.2
110
9.7 – Design Steps – cont.
cs ωs
2. Denormalization according to filter type; (LPF, HPF, BPF, BSF).
• LPF
scω
ωω ss )( 20
2 +
s
s 210 where,; ωωω =2210 ωωω =
• HPF
• BPF
3 M f d i d i
)( 0
)( 20
2 ωω +sss 12
210
ωωω −=• BSF
3. Map from s-domain to z-domain;
11 −−=
zs
4 Realize the IIR filter
11 −+=
zs
4. Realize the IIR filter.
Example – 2
Design a 1st order Butterworth HPF with Ωc = 1 rad/sec, Fs = 1Hz.Solution 1)(H
1)(
+=
ssH scωs
ssH ==1)(
cc ss ωω ++1)(
⎞⎜⎛=⎞⎜⎛
Ω=1tantan Tcω⎠
⎜⎝
=⎠
⎜⎝
=2
tan2tan ccω
1)1( −− z
11
1
1
1
11
)1()1(
)(
)( −−
−
−
−
++−−
=−
+=zz
zz
zzHcc ωω
1)1()(
− ++ z
cccω
Example - 2 – cont.
1
11
11)(
−−=
zzH k 11
1111
)(−
+−
++ zc
cc
ωωω
c
kω+
=1
a0
Xx(n)
ab
y(n)
T
kX
10 =a where,X
a1- b1 TX
111
0
−−=
cb
a ω
1+=
c
c1b
ω
Example - 3
Design a 3rd order Butterworth LPF to have a cutoff frequency at 4 kHz using the BZT method & assuming a sampling frequency of 10 kHz.
1Solution secF
T & kHz fs
c41014 −===
rad Tc 513.2101042 43 =×××=Ω −πc
secrad T :prewarping c
c 0762.3)2tan( =Ω=ω
)1)(1(1)( 2 +++
=sss
sH
⎞⎜⎛
+⎞
⎜⎜⎛ −
+⎞
⎜⎜⎛ −⎞
⎜⎜⎛⎞
⎜⎜⎛
+⎞
⎜⎜⎛ −
=−−−
11111111
1)(12121 zzz
zH
⎟⎠
⎜⎜
⎝+⎠
⎜⎜⎝ +
+⎠
⎜⎜⎝ +⎠
⎜⎜⎝⎠
⎜⎜⎝
+⎠
⎜⎜⎝ + −−− 1
111
1 111 zzz ccc ωωω
Example - 3 – cont.
( )212211
211
)1()1(32490)1(1050)6751032491()1()1()( −−−−
−−
++++++
=z zzH ( )212211 )1()1(3249.0)1(105.0)675103249.1( ++−+−+ zz z z .
211 )21()1( −−− +++ zzz( )211 78060789143051)509501(3249.1
)21()1(−−− +++
+++=
z. z.. z . zzz
( )21
21
1
1
5457.02506.114305.1)21(
)509501(3249.1)1(
−−
−−
−
−
++++
×++
= z z
zzz .
z
( )21
21
1
1
54570250611)21(
)509501()1(52763.0 −−
−−
−
− ++×
+×=
zzz( )211 5457.02506.11)509501( +++ zzz.
Example - 3 – cont.
Filter Realization (Cascaded Realization)
0 52763
x(n)2- 1.2506
y(n)
T
0.52763
X- 0.5095
TX
TX
T
TX
- 0.5457
X
Example - 4
Using BZT method, design a digital filter meeting the specifications given by the following tolerance structure, |H(f)|
assume a Butterworth characteristic for thisfilter. 0.707
1
Solutionf
0.1
(1) From the specifications, the prewarped frequencies are: 0.5 2 4 kHz
19891205002tan =⎞⎜⎛ ×
=πω 198912.0
80002tan =
⎠⎜⎝ ×
=ω p
120002tan =⎞⎜⎛ ×
=πω 1
80002tan =
⎠⎜⎝ ×
=ωs
(2) D t i th d f th t t l B tt th LPF i th f ll i
Example - 4 – contd.(2) Determine the order of the prototype analogue Butterworth LPF using the following
relation,
⎞⎛⎟⎞
⎜⎜⎛ −
Aδ11
2
⎟⎟⎟
⎠
⎞
⎜⎜⎜
⎝
⎛
−
−⎟⎟
⎠⎜⎜⎜
⎝−
−A
A
p
s
p
s
Nδ
δ
110
110log1)1(
1log
10
10
2
⎟⎟⎠
⎞⎜⎜⎝
⎛×
⎠⎝=
⎟⎟⎠
⎞⎜⎜⎝
⎛×
⎠⎝≥
p
s
p
s
pN
ωω
ωω log2
110
log2
)(
⎠⎝⎠⎝ pp
995635.1199log1121
)1(1991
01.0111
22 =⎟⎠⎞
⎜⎝⎛⇒=−=−
−=−=− ,
ps δδ
402678.1198912.0
1log2log2
)(
=⎟⎠⎞
⎜⎝⎛×=⎟
⎟⎠
⎞⎜⎜⎝
⎛×
⎠⎝
p
s
ps
ωω
2.423.1402678.1995635.1
==≥
⎠⎝⎠⎝
N Let N
p
Example - 4 – contd.(3) A 2nd d B tt th l LPF h th l t f f ti H( ) i b(3) A 2nd order Butterworth analogue LPF has the s-plane transfer function, H(s), given by,
121)(
2 ++=
sssH
(4) For a denormalized LPF transfer function, substitute ps ωs
22
2
2 21)( psH
ωωω
++=
⎞⎛=
212
pp
pp
ssss ωω
ωω
++++⎟
⎟⎠
⎞⎜⎜⎝
⎛
(5) Applying the BZT,
2121
2
11
11)()(
1
1 p
zzs zz
sHzHω
⎞⎜⎛ −⎞
⎜⎛ −
==−−⎟
⎟⎠
⎞⎜⎜⎝
⎛
+−
= −
−
211
1
112
11
pp
z
zz
zz ωω +⎟
⎠
⎞⎜⎜⎝
⎛+
+⎟⎠
⎞⎜⎜⎝
⎛+ −−
⎠⎝ +
( )212 1 −+ zω ( )( ) ( )( ) ( )2121121 11121
1−−−− +++−+−
+=
zzz z
z
pp
p
ωω
ω
Example - 4 – contd.
( )212( )( ) ( ) ( )212221
212
21122121
)(−−−−−
−−
+++−++−
++=
zzzzzzz
zHpp
p
ωωω
( ) ( ) ( )pp
( )22122
212 21)(
−− ++=
zzzH pω
22122 )21()1(2)21()(
−− +−+−+++ zz ppppp ωωωωω
,parameterstheofvalues the ngSubstituti
96043.0132087.12122
22 −=−=++ ppp ,
,pfg
ωωω
0395659.07582858.021 22 ==+− ppp , ωωω
( )21210395659.0)(−− ++ zzH ( )
21 7582858.092086.132087.1)( −− +−=
z z zH
Example - 4 – contd.2 32087.1)21( 2 =++ pp by buttom& top Dividing ωω
( )212102995.0)(−− ++ zzH ( )
21 57408.04542.112102995.0)( −− +−
++=
z z zzzH
(6) Realizationa0x(n) y(n)k
(6) Realization,
X
Xx(n)
a1- b1
y(n)
TX
X
X
Xa2- b2 T
X
X
12102995.0
210 ====
a ,a ,a k where,
57408.04542.1210
=−= 21 b , b ,,