6.0 iir filter bee3213
TRANSCRIPT
-
8/13/2019 6.0 Iir Filter Bee3213
1/54
Digital Signal Processing
1
Chapter 6IIR Filter
-
8/13/2019 6.0 Iir Filter Bee3213
2/54
Introduction
2
oDigital filters are widely used in almost all areas
of DSP.
oIf linear phase is not critical, infinite impulse
response (IIR) filters yield a much smaller filter
order for a given application.
oDigital filters process discrete-time signals.
-
8/13/2019 6.0 Iir Filter Bee3213
3/54
3
Low & constantly
decreasing cost
Freedom from
component
variations
Easy modification
of filter
characteristics
High accuracy
High noise
immunity
Advantages
-
8/13/2019 6.0 Iir Filter Bee3213
4/54
4
o Digital filters are therefore rapidly replacing
analog filters in many applications.
o Digital filtering is not only as a smoothing or
averaging operation, but also as any processing
of the input signal.
-
8/13/2019 6.0 Iir Filter Bee3213
5/54
Techniques of Digital Filter Design
5
oDigital filter design revolves around 2 differentapproaches.
oIf linear phase is not critical, IIR filters yield a
much smaller filter order.
oThe design starts with an analog lowpass
prototypebased on the given specifications.
oIt is then converted to the required digital filter,
by using appropriate mapping and spectral
transformation.
-
8/13/2019 6.0 Iir Filter Bee3213
6/54
-
8/13/2019 6.0 Iir Filter Bee3213
7/54
7
oTo make the infinitely long symmetric impulse
response sequence of an IIR filter causal, we need
an infinite delay.
oSymmetric truncation (to preserve linear phase)
simply transforms the IIR filter into an FIR filter.
o
Only FIR filters can be designed with linearphase (no phase distortion).
-
8/13/2019 6.0 Iir Filter Bee3213
8/54
8
oTheir design is typically based on selecting a
symmetric impulse response sequence whose
length is chosen to meet design specifications.
oThis choice is often based on iterative techniques
(trial & error).
oFor given specifications, FIR filters requiremany more elements in their realization than do
IIR filters.
-
8/13/2019 6.0 Iir Filter Bee3213
9/54
IIR Filter Design
9
oThere are 2 related approaches:
Using the well-established analog filter design,
followed by a mapping that converts the analog
filter to the digital filter.
Directly designing the digital filter using
digital equivalents of analog approximations.
-
8/13/2019 6.0 Iir Filter Bee3213
10/54
Equivalence of Analog & Digital Systems
10
oThe impulse response h(t) of an analog system
may be approximated by
ots is the sampling interval corresponding to the
sampling rate S =1/ts.
oThe discrete-time impulse response hs[n]describes the samples h(nts) of h(t):
s
n
sss
n
sa nttnthtnttthtthth
~
knkhnthnhk
sss
-
8/13/2019 6.0 Iir Filter Bee3213
11/54
11
oThe Laplace transformHa(s) of is given by
oThe z-transformHd(z) of hs[n] is given by
oComparison suggests the equivalence
Ha(s) =t
sH
d(z) providedz-k= , or
k
skt
ssa
sekthtsHsH
k
ksd zkhzH
sskt
e
sstez
s
t
zs
ln
-
8/13/2019 6.0 Iir Filter Bee3213
12/54
12
oThese relations describe amappingbetween the
variableszands.
oSince s = + j, where is the continuous
frequency, the complex variable z can be
expressed as
where is the digital
frequency in radians/sample.
jttjttj eeeeez ssss
FS
fts
2
2
-
8/13/2019 6.0 Iir Filter Bee3213
13/54
Response Matching
13
oThe idea of response matching is to match the
time-domain analog & digital response.
oTypically the impulse response or step response.
o
Given the analog filter H(s) & the input x(t)whose invariance we seek, first find the analog
responsey(t) as the inverse transform ofH(s)X(s).
ox(t) & y(t) are then sampled at intervals ts toobtain their sampled versionsx[n] &y[n].
oFinally, H(z) = Y(z)/X(z) is computed to obtain
the digital filter.
-
8/13/2019 6.0 Iir Filter Bee3213
14/54
14
The concept of response invariance:
The quality of the approximation depends on the
choice of the sampling interval ts & a unique
correspondence is possible only if the sampling
rate S =1/tsis above Nyquist rate (avoid aliasing).
-
8/13/2019 6.0 Iir Filter Bee3213
15/54
15
oThis mapping is thus useful only for analog
systems such as lowpass & bandpass filters,
whose frequency response is essentially band-
limited.
o
The analog transfer function H(s) must bestrictly proper (with numerator degree less than
the denominator degree).
oThe response y(t) of H(s) matches the response
y[n] ofH(z) at the sampling instants t =nts.
-
8/13/2019 6.0 Iir Filter Bee3213
16/54
16
Example 6.1
Convert toH(z) by using:
I) Impulse invariance transformation.
II)Step invariance transformation.
Solution
I) Choosex(t) = (t). Then,X(s) = 1.
21
4
sssH
2
4
1
4
21
4
sssssXsHsY
-
8/13/2019 6.0 Iir Filter Bee3213
17/54
17
Taking the inverse Laplace Transform,
The sampled input and output are given by
x[n] = [n]
Their z-Transform gives
X(z) = 1
tuetuety tt 2
44
nuenueny ss ntnt 244
ss tt
ez
z
ez
zzY
2
44
-
8/13/2019 6.0 Iir Filter Bee3213
18/54
18
The ratio of their z-Transform gives the transfer
function of the digital filter,
II)Choosex(t) = u(t). Then,X(s) = 1/s.
ss ttI ez
z
ez
zzY
zX
zYzH
2
44
2
2
1
42
21
4
sssssssXsHsY
-
8/13/2019 6.0 Iir Filter Bee3213
19/54
19
Taking the inverse Laplace Transform,
The sampled input and output are given by
x[n] = u[n]
tuetuetuty tt 2
242
nuenuenuny ss ntnt 2242
-
8/13/2019 6.0 Iir Filter Bee3213
20/54
20
Their z-Transform gives
The ratio of their z-Transform gives the transfer
function of the digital filter,
1z
z
zX
ss tt ez
z
ez
z
z
zzY
2
24
1
2
ss ttS ez
zez
zzXzYzH
2
12142
-
8/13/2019 6.0 Iir Filter Bee3213
21/54
The Bilinear Transformation
21
oThe bilinear transformation is defined by
o
(6.9)where C = 2/tsoBy letting = 0, the complex variable z is
obtained in the form
1
1
z
zCs
sC
sCz
CjejC
jCz
1tan2
-
8/13/2019 6.0 Iir Filter Bee3213
22/54
22
oSince z = ej, where = 2F is the digital
frequency, then
(6.12)
oThis is a non-linear relation between the analog
frequency & the digital frequency .
oWhen = 0, = 0 &, .
oIt is a one-to-one mapping that nonlinearly
compressesanalog frequency range -
-
8/13/2019 6.0 Iir Filter Bee3213
23/54
23
It avoids the effect of aliasing at the expense of
distorting, compressing or warping the analog
frequencies as shown:
-
8/13/2019 6.0 Iir Filter Bee3213
24/54
24
oThe higher the frequency, the more severe is the
warping.
oWarping can be compensated but cannot be
eliminated!
oWarping can be compensated if the frequency
specifications is prewarped before designing theanalog system H(s) or by applying bilinear
transformation.
-
8/13/2019 6.0 Iir Filter Bee3213
25/54
25
Graph of versus for different values of C
compared to the linear relation = .
-
8/13/2019 6.0 Iir Filter Bee3213
26/54
26
oThe analog & digital frequencies always show a
match at the origin & at one other value dictated
by the choice of C.
oThe advantages of bilinear transformation are:
1.simple
2.stable
3.one-to-one mapping.
o It avoids problems caused by aliasing & hence
can be used for HP & BS filters.
-
8/13/2019 6.0 Iir Filter Bee3213
27/54
Using ilinear Transformation
27
oGiven an analog transfer function H(s) whose
response at analog frequency Ais to be matched
toH(z) at the digital frequency D, we can design
H(z) in one of 2 ways:
1)Take C by matching A & the prewarped
frequency D, & obtain H(z) from H(s) using the
Equation 6.9. From Equation 6.12,
DA C 5.0tan
DAC
5.0tan
11 zzCssHzH
-
8/13/2019 6.0 Iir Filter Bee3213
28/54
28
2)Take a convenient value for C, (say C= 1). This
matches the response at prewarped frequency x
given by
H(s) is frequency scaled to H1(s) = H(sA/x),
& then H(z) is obtained from H1(s) using the
transformations = (z- 1)/(z+ 1), where C= 1.
Dx 5.0tan
xAsssHsH /1
111
zzs
sHzH
-
8/13/2019 6.0 Iir Filter Bee3213
29/54
29
Example 6.2
Consider a Bessel filter described by
Design a digital filter whose magnitude at f0 = 3
kHz equals the magnitude of H(s) at A = 4 rad/s
if the sampling rate S= 12 kHz.
The digital frequency is given by = 2f0/S =
0.5.
33
32
ss
sH
-
8/13/2019 6.0 Iir Filter Bee3213
30/54
30
Solution
We can solve the problem by using either one of
the two methods discussed earlier:
Method 1
C is selected by choosing the prewarped
frequency equal to A = 4 rad/s.
A = 4 = Ctan(0.5)
4
5.05.0tan
4
5.0tan
4
C
-
8/13/2019 6.0 Iir Filter Bee3213
31/54
31
H(s) is transformed toH(z) using
1
14
1
1
z
z
z
z
Cs
114
zz
sHzH
3
1
1212
1
1216
3
31
143
1
14
3
2
22
z
z
z
zz
z
z
z
zzH
72631
13
2
2
zz
zzH
-
8/13/2019 6.0 Iir Filter Bee3213
32/54
32
Method 2
Choose C = 1.
Then,H(s) is frequency scaled to
H1(s) =H(sA/x) =H(s(4/1)) =H(4s)
15.05.0tan5.0tan Dx
31216
3
3434
3221
ssss
sH
-
8/13/2019 6.0 Iir Filter Bee3213
33/54
33
H(z) is obtained from H1(s) using the
transformations = (z- 1)/(z+ 1):
111
zzs
sHzH
3
1
1212
1
163216
3
31
112
1
116
3
2
22
z
z
z
zz
z
z
z
zzH
72631
132
2
zz
zzH
-
8/13/2019 6.0 Iir Filter Bee3213
34/54
34
The magnitude of H(s)= ats = j=j4 matches
the magnitude of H(z)atz = ej= ej/2=j.
33
3
2
sssH
12133
31216
3
3434
3
24 jjjjsH js
313
36
313
39
144169
3639
1213
1213
1213
3
4
jj
j
j
jsH js
1695.0313
36
313
39 22
4
jssH
-
8/13/2019 6.0 Iir Filter Bee3213
35/54
35
72631
13
2
2
zz
zzH
1695.01252
144
1252
156 22
jzzH
Spectral Transformations for IIR
-
8/13/2019 6.0 Iir Filter Bee3213
36/54
Spectral Transformations for IIR
Filters
36
oAs with analog filters, the design of IIR filters
usually starts with analog LP prototype, which is
converted to digital LP prototype by appropriate
mapping & transformed to the required filter type
by appropriate spectral transformation.
oFor bilinear mapping, we can perform the
mapping & spectral transformation (in a single
step) on the analog prototype itself.
-
8/13/2019 6.0 Iir Filter Bee3213
37/54
Digital-to-Digital Transformations
37
oIf a digital LP prototype has been designed, thedigital-to-digital transformations of Table 6.1 can
be used to convert it to the required filter.
oThe LP to BP transformations & LP to BStransformations yield a digital filter with twice the
order of the LP prototype.
oThe LP to LP transformation is actually a special
case of the more general allpass transformation.
oThe digital LP prototype cutoff frequency is D.
-
8/13/2019 6.0 Iir Filter Bee3213
38/54
-
8/13/2019 6.0 Iir Filter Bee3213
39/54
39
oAll digital frequencies are normalized to
= 2f/S
Example 6.3
A LP filter operates at S = 8 kHz. Its cutoff
frequency is 2 kHz. UseH(z) to design a HP filter
with a cutoff frequency of 1 kHz.
Solution
D= 2fC/S = 2(2)/8 = 0.5
C= 2fC/S = 2(1)/8 = 0.25
-
8/13/2019 6.0 Iir Filter Bee3213
40/54
40
Spectral transformation:
4142.0125.0cos
375.0cos
5.0cos
5.0cos
CD
CD
z
z
z
z
z
zz
4142.01
4142.0
4142.01
4142.0
1
74142.01
4142.026
4142.01
4142.031
14142.01
4142.03
72631
13
2
2
2
2
zz
zz
z
z
zz
zzHHP
0723.00476.0
128.0
2
2
zz
zzHHP
E l 6 4
-
8/13/2019 6.0 Iir Filter Bee3213
41/54
41
Example 6.4
A lowpass filter operates at
S= 8 kHz. Its cutoff frequency is 2 kHz. UseH(z)
to design a bandpass filter with band edges of 1
kHz & 3 kHz.Solution
D= 2fC/S = 2(2)/8 = 0.5
1= 2fC/S = 2(1)/8 = 0.252= 2fC/S = 2(3)/8 = 0.75
2- 1= 0.5
2+ 1=
72631
13
2
2
zz
zzH
-
8/13/2019 6.0 Iir Filter Bee3213
42/54
42
A1= 0,A2= 0
Spectral transformation:
125.0tan
25.0tan
5.0tan
5.0tan
12
DK
025.0cos
5.0cos
5.0cos
5.0cos
12
12
22
1
2
2
21
2
11
zz
zAzA
AzAzz
72631
13
72631
113
72631
13
72631
13
24
22
24
22
24
22
2
2
zz
z
zz
z
zz
z
zz
zzH
BP
f
-
8/13/2019 6.0 Iir Filter Bee3213
43/54
Direct Analog-to-Digital Transformations
for Bilinear Design
43
oAll stable transformations are free of aliasing &
introduce warping effects.
oOnly bilinear mapping offers a simple relation to
compensate for the warping.
oTable 6.2 shows the analog-to-digital
transformations of for bilinear design.
oThese can be used to convert a prewarped analog
lowpass prototype (with a cutoff frequency of 1
rad/s) directly to the required digital filter.
-
8/13/2019 6.0 Iir Filter Bee3213
44/54
44
Form Band Edges Mapping s Parameters
LP toLP
C C= tan(0.5C)
LP to
HP
C C= tan(0.5C)
LP toBP
1< 0 < 2 C= tan[0.5(2- 1)], = cos0or
LP to
BS
1< 0 < 2 C= tan[0.5(2- 1)], = cos0or
11
zCz
1
1
z
zC
112
2
2
zCzz
12
1
2
2
zz
zC
12
12
5.0cos
5.0cos
12
12
5.0cos
5.0cos
Bilinear Transformation for
-
8/13/2019 6.0 Iir Filter Bee3213
45/54
Bilinear Transformation for
Peaking & Notch Filters
45
oIf bilinear transformation is used to design a
second-order digital peaking (BP) filter with a 3
dB BW of & a center frequency of 0, westart with the LP analog prototype:
(6.20)
whose cutoff frequency is 1 rad/s.
11
ssH
Th l di i l LP BP f i i
-
8/13/2019 6.0 Iir Filter Bee3213
46/54
46
oThe analog-to-digital LP to BP transformation is
applied to obtain:
(6.21)
= cos0
(6.22)
C = tan(0.5) (6.23)
= 2 - 1
(6.24)
C
C
zCz
z
C
CzHBP
1
1
1
2
1
1 2
2
Si il l if bili f i i d
-
8/13/2019 6.0 Iir Filter Bee3213
47/54
47
oSimilarly, if bilinear transformation is used to
design a second-order digital notch (BS) filter
with a 3 dB notch BW of & a notch frequencyof 0, we start with LP analog prototype of
Equation 6.20.
oThe analog-to-digital LP to BS transformation is
applied to obtain:
(6.25)
C
Cz
Cz
zz
CzHBS
1
1
1
2
12
1
1
2
2
Th l f & C i b th E ti
-
8/13/2019 6.0 Iir Filter Bee3213
48/54
48
oThe value of & C are given by the Equation
6.22 & 6.23 respectively.
oIf either design requires for anAdB BW of ,the constant C is replaced byKC, where
(Ais in dB)
oThe LP prototype gain corresponds to an
attenuation ofA dB.
o0is used to determine the parameter .
110
1
1.0
AK
If only the band edges & are specified
-
8/13/2019 6.0 Iir Filter Bee3213
49/54
49
oIf only the band edges 1 & 2 are specified
instead of 0, can be found from the alternative
relation in terms of the given band edges.oHere, 0 can be found by means of geometric
symmetry of the prewarped frequencies:
oTo find the digital band edges of 1 & 2, we
can start from the expression:
210
5.0tan5.0tan5.0tan
5.0cos
5.0cos
5.0cos
5.0coscos
12
12
12
0
-
8/13/2019 6.0 Iir Filter Bee3213
50/54
50
From Eq. 6.24, we get 1= 2 - . Then,
Example 6.5
Design a peaking filter (BP filter) with a 3 dB BW
of 5 kHz & a center frequency of 6 kHz. The
sampling frequency is 25 kHz.
5.0coscos5.0cos012
5.0coscoscos5.00
1
12
5.0coscoscos5.00
1
22
5.0coscoscos5.00
1
2
Solution
-
8/13/2019 6.0 Iir Filter Bee3213
51/54
51
Solution
C =tan(0.5)= 0.7265
=cos0= 0.0628
Substituting these into Equation 6.21:
4.025
5223
S
fdB
48.0
25
6220
0
S
f
-
8/13/2019 6.0 Iir Filter Bee3213
52/54
52
Magnitude
spectrum of the
bandpass filter
7265.01
7265.01
7265.01
0628.02
1
7265.01
7265.0
2
2
zz
zzHBP
1584.00727.0
14208.0
2
2
zz
zzHBP
-
8/13/2019 6.0 Iir Filter Bee3213
53/54
53
The band edge 2 can be computed using
Equation 6.28:
2 = 2.1483
1 can be computed using Equation 6.24:
1= 2 - = 2.1483 - 0.4= 0.8917
4.05.0cos48.0coscos4.05.0 12
-
8/13/2019 6.0 Iir Filter Bee3213
54/54
As a result, these correspond to:
kHzS
f 55.32
10258917.0
2
3
1
1
kHzSf 55.8210251483.2
2
3
22