You are on page 1of 19

MODULE 4

1
IIR FILTER DESIGN
❖ IIR FILTER FORMAT:
• An IIR filter is designed using the difference equation 𝑦 𝑛 = 𝑏0 𝑥 𝑛 + 𝑏1 𝑥 𝑛 − 1 + ⋯ + 𝑏𝑀 𝑥 𝑛 − 𝑀 −
𝑎1 𝑦 𝑛 − 1 − ⋯ − 𝑎𝑁 𝑦(𝑛 − 𝑀).
𝑌(𝑧) 𝑏0 +𝑏1 𝑧 −1 +⋯+𝑏𝑀 𝑧 −𝑀
• IIR filter transfer function 𝐻 𝑧 = = .
𝑋(𝑧) 1+𝑎1 𝑧 −1 +⋯+𝑎𝑀 𝑧 −𝑀

• Remarks: 1. 𝑦 𝑛 depends on current input 𝑥 𝑛 and the previous inputs 𝑥 𝑛 − 1 and past outputs
𝑦 𝑛 − 1 . Transfer function is a ratio of numerator polynomial over denominator polynomial and impulse
response has infinite number of terms.
2. The poles of the IIR filter must lie in unit circle to ensure stability.
3. IIR filter size offers much smaller filter size with fewer computations, but no linear phase is obtained.
• Objective: Filter numerator and denominator coefficients are determined for stop band attenuation, pass
band gain and cut off frequencies for LPF, BPF, HPF and BSF.

2
BILINEAR TRANSFORMATION DESIGN METHOD

• Flow chart

• Design procedure involves transforming digital filter into analog filter, performing analog filter design
and applying bilinear transformation

3
ANALOG FILTERS USING LOW PASS PROTOTYPE
TRANSFORMATION
• Low pass filter transformation converts analog lowpass filter with cut off frequency 1
radians per second (low pass prototype) into analog LPF, HPF, BPF and BSP with
specified frequencies.

• Analog LP transformation into a


low pass filter

4
…ANALOG FILTERS USING LOW PASS PROTOTYPE
TRANSFORMATION…
• Lowpass prototype to lowpass filter transformation substitutes the 𝑠 in lowpass prototype function 𝐻 𝑠 with
𝑝
𝑠/𝜔𝑐 .
• First order lowpass prototype 𝐻𝑝 𝑠 = 1/(𝑠 + 1). Its frequency response is obtained by substituting 𝑠 =
1 1
𝑗𝑣 to obtain 𝐻𝑝 𝑗𝑣 = and its magnitude gain 𝐻𝑝 𝑗𝑣 = 2
.
𝑗𝑣+1 1+𝑣
1
• We compute the gains at 𝑣 = 0, 𝑣 = 1, 𝑣 = 100, 𝑣 = 10,000 to obtain 1, , 0.0995 𝑎𝑛𝑑 0.01. The cut-off
1 2
frequency gain 𝑣 = 1 equals which is equivalent to -3dB and direct current gain = 1. Gain goes to zero
2
when 𝑣 = +∞.
• Lowpass prototype is a normalised lowpass filter with cut-off frequency of 1. Prototype transformation 𝑠 =
1
we get an analog lowpass filter with cut-off frequency 𝜔𝑐 .
𝜔𝑐
1 𝜔𝑐 1
• Therefore 𝐻 𝑠 = 𝑠 = . Analog frequency response is obtained by 𝑠 = 𝑗𝜔, 𝐻 𝑗𝜔 = 𝑗𝜔 and
+1 𝑠+𝜔𝑐 +1
𝜔𝑐 𝜔𝑐
1
magnitude response 𝐻 𝑗𝜔 = 𝜔
. Gains at 𝜔 = 0, 𝜔 = 𝜔𝑐 , 𝜔 = 100𝜔𝑐 and 𝜔 = 10,000𝜔𝑐 to be
1+ 𝜔𝑐
1
1, , 0.0995 𝑎𝑛𝑑 0.01.
2 5
…ANALOG FILTERS USING LOW PASS PROTOTYPE
TRANSFORMATION…
1
• Filter gain at 𝜔𝑐 is and dc gain is 1. Gain approaches zero when 𝜔 = +∞.
2
• It is noticeable that gain do not change when frequency changes from 𝜔 to 𝜔𝑐 .

• Analog lowpass prototype to high pass filter

6
…ANALOG FILTERS USING LOW PASS PROTOTYPE
TRANSFORMATION…
𝜔𝑐
• For high pass filter we replace 𝑠 by 𝑠 = in the low pass filter transformation.
𝑠

• Analog lowpass prototype to band pass filter

𝑠 2 +𝜔02
• For band pass filter we replace 𝑠 by 𝑠 = in the low pass filter transformation. 𝜔0 = 𝜔𝑙 𝜔ℎ
𝑠𝑊
and 𝑊 = 𝜔ℎ − 𝜔𝑙 . Here 𝜔ℎ is the higher cut-off frequency and 𝜔𝑙 is the lower cut-off frequency.
7
…ANALOG FILTERS USING LOW PASS PROTOTYPE
TRANSFORMATION…
𝑠𝑊
• For band pass filter we replace 𝑠 by 𝑠 = 2 2 in the low pass filter transformation.
𝑠 +𝜔0
𝜔0 = 𝜔𝑙 𝜔ℎ and 𝑊 = 𝜔ℎ − 𝜔𝑙 . Here 𝜔ℎ is the higher cut-off frequency and 𝜔𝑙 is
the lower cut-off frequency.

• Analog lowpass prototype to band stop filter

8
BILINEAR TRANSFORMATION AND FREQUENCY
WARPING
𝑡 𝑋 𝑠
• Area under the curve y t = ‫׬‬0 𝑥 𝑡 𝑑𝑡. Applying the laplace transform 𝑌 𝑠 = .
𝑠
𝑌(𝑠) 1
• The Laplace transfer function 𝐺 𝑠 = = .
𝑋(𝑠) 𝑠

• Digital Integration Method to find


area under the curve.

𝑥 𝑛 +𝑥(𝑛−1)
• Using difference equation for numerical integration 𝑦 𝑛 = 𝑦 𝑛 − 1 + 𝑇, 𝑇 is the sampling
2
period.
• 𝑦 𝑛 = 𝑦 𝑛𝑇 is the output sample that represents the whole area under the curve, while 𝑦 𝑛 − 1 =
𝑦 𝑛𝑇 − 𝑇 is the previous output sample.
9
…BILINEAR TRANSFORMATION AND FREQUENCY
WARPING…
• 𝑥 𝑛 = 𝑥 𝑛𝑇 and 𝑥 𝑛 − 1 = 𝑥(𝑛𝑇 − 𝑇) are the current input sample and
previous input sample respectively.
𝑇
• Applying Z-transform, 𝑌 𝑧 = 𝑧 −1 𝑌 𝑧 + (𝑋 𝑧 + 𝑧 −1 𝑋 𝑧 ). Hence, 𝐻 𝑧 =
2
𝑌(𝑧) 𝑇 1+𝑧 −1
= .
𝑋(𝑧) 2 1−𝑧 −1
1 𝑇 1+𝑧 −1 𝑇 𝑧+1 2 𝑧−1
• Comparing 𝐺(𝑠) with 𝐻(𝑧), we have = = . Therefore, 𝑠 = .
𝑠 2 1−𝑧 −1 2 𝑧−1 𝑇 𝑧+1
• BLT methods maps or transforms points from s-plane to z-plane. Therefore, 𝑧 =
1+𝑠𝑇/2
.
1−𝑠𝑇/2

10
…BILINEAR TRANSFORMATION AND FREQUENCY
WARPING…
• General Mapping properties:
1. The left half of s-plane is mapped into the inside half of the z-plane.
2. The right half of s-plane is mapped into the outside half of the z-plane.
3. The positive 𝑗𝜔 axis of the s-plane is mapped onto the positive half circle on the
unit circle, while negative 𝑗𝜔 axis of the s-plane is mapped onto the negative half
circle on the unit circle

S-plane and Z-plane mapping by BLT.

11
…BILINEAR TRANSFORMATION AND FREQUENCY
WARPING…
• Next we examine the frequency mapping between s-plane and z-plane. 𝜔𝑎 is the analog
frequency marked on the 𝑗𝜔 axis of the s plane while 𝜔𝑑 is the digital frequency labelled on
the unit circle in the z plane.
2 𝑒 𝑗𝜔𝑇 −1 2 𝜔𝑑 𝑇
• We replace 𝑠 = 𝑗𝜔𝑎 and 𝑧 = 𝑒 𝑗𝜔𝑇 in the BLT to get 𝑗𝜔𝑎 = . 𝜔𝑎 = tan . Taking
𝑇 𝑒 𝑗𝜔𝑇 +1 𝑇 2
2 𝜔𝑎 𝑇 𝜔𝑠
inverse 𝜔𝑑 = 𝑡𝑎𝑛−1 ; 𝜔𝑑 ∈ [0, ].
𝑇 2 2

• Frequency warping from BLT

12
…BILINEAR TRANSFORMATION AND FREQUENCY
WARPING…
• The digital frequency range 0 ≤ 𝜔𝑑 ≤ 0.25𝜔𝑠 is mapped to the analog frequency
range 0 ≤ 𝜔𝑎 ≤ 0.25𝜔𝑠 , the transformation appears to be linear; however, when
the digital frequency range 0.25𝜔𝑠 ≤ 𝜔𝑑 ≤ 0.5𝜔𝑠 is mapped to the analog
frequency range for 0.25𝜔𝑠 ≤ 𝜔𝑎 ≤ 0.5𝜔𝑠 , the transformation is nonlinear.
• The analog frequency range for 𝜔𝑎 > 0.32𝜔𝑠 is compressed into the digital
frequency range 0.25𝜔𝑠 ≤ 𝜔𝑑 ≤ 0.5𝜔𝑠 . Non linear frequency mapping is called
frequency warping.

13
• IIR filter design using BLT

14
…BILINEAR TRANSFORMATION AND FREQUENCY
WARPING…
To correct frequency error:
1. First, given the digital frequency specification, we pre-warp the digital frequency specification
to the analog frequency specification.
2. Second, we obtain the analog lowpass filter 𝐻(𝑠) using the pre-warped analog frequency 𝜔𝑎
𝑠
and the lowpass prototype. For LPF 𝐻 𝑠 = 𝐻𝑝 𝑠 |𝑠= 𝑠 = 𝐻𝑝 . Finally substituting the
𝜔𝑎 𝜔𝑎
BLT equation we get the digital filter 𝐻 𝑧 = 𝐻 𝑠 | 2 𝑧−1
𝑠=𝑇𝑧+1
.

15
BILINEAR TRANSFORMATION DESIGN PROCEDURE
1. Given the digital filter frequency specifications, pre-warp the digital frequency specifications to the analog
2 𝜔 𝑇
frequency specifications. For the low pass filter and high pass filter: 𝜔𝑎 = tan 𝑑 . For the Band pass
𝑇 2
2 𝜔𝑇 2 𝜔 𝑇
filter and band stop filter: 𝜔𝑎𝑙 = tan 𝑙 , 𝜔𝑎ℎ = tan ℎ , 𝜔0 = 𝜔𝑎𝑙 𝜔𝑎ℎ and 𝑊 = 𝜔𝑎ℎ − 𝜔𝑎𝑙 .
𝑇 2 𝑇 2

2. Perform the prototype transformation using the lowpass prototype:


From low pass to low pass : 𝐻 𝑠 = 𝐻𝑝 𝑠 |𝑠= 𝑠 ; From low pass to high pass : 𝐻 𝑠 = 𝐻𝑝 𝑠 |𝑠=𝜔𝑎 ;
𝜔𝑎 𝑠

From lowpass to bandpass : 𝐻 𝑠 = 𝐻𝑝 𝑠 | 𝑠2 +𝜔2


0
and From lowpass to band stop: 𝐻 𝑠 = 𝐻𝑝 𝑠 | 𝑠2 +𝜔2
0
.
𝑠= 𝑠=
𝑠𝑊 𝑠𝑊

3. Substitute the BLT to obtain the digital filter: 𝐻 𝑧 = 𝐻 𝑠 |𝑠=2𝑧−1


𝑇𝑧+1

16
DIGITAL BUTTERWORTH FILTER DESIGN USING BLT
❖ Low pass prototype function and its order:
• BLT design requires obtaining the analog filter with pre-warped frequency specifications. These
include the ripple specification at the passband frequency edge, the attenuation specification at the
stopband frequency edge, and the type of lowpass prototype and its order.
• The magnitude response function of the Butterworth lowpass prototype with order n is shown in
Figure 8.13, where the magnitude response 𝐻𝑝 𝑣 versus the normalized frequency v is given by
1
𝐻𝑝 𝑣 = 2 2𝑛
.
1+𝜀 𝑣
• With the given passband ripple 𝐴𝑝 dB at the normalized passband frequency edge 𝑣𝑝 = 1, and
the stopband attenuation 𝐴𝑠 dB at the normalized stopband frequency edge 𝑣𝑠 , the following two
1
equations must be satisfied to determine the prototype filter order: 𝐴𝑝 dB = −20𝑙𝑜𝑔10 2
and
1 1+𝜀
𝐴𝑠 dB = −20𝑙𝑜𝑔10 .
1+𝜀 2 𝑣𝑠2

17
…DIGITAL BUTTERWORTH FILTER DESIGN USING
BLT…
100.1𝐴𝑠 −1
𝑙𝑜𝑔10
𝜀2
• Lowpass prototype order as 𝜀 2 = 100.1𝐴𝑝 − 1. 𝑛 ≥ . 𝜀 is the absolute ripple
[2𝑙𝑜𝑔10 (𝑣𝑠 )]
specification.
• The magnitude response function of a Chebyshev lowpass prototype with order n where the magnitude
1
response 𝐻𝑝 𝑣 versus the normalized frequency v is given by 𝐻𝑝 𝑣 = , 𝐶𝑛2 𝑣𝑠 =
1+𝜀 2 𝐶𝑛2 (𝑣)
cosh[𝑛𝑐𝑜𝑠ℎ−1 𝑣𝑠 ].
• Normalised Butterworth magnitude
response function

18
REALIZATION OF IIR FILTERS IN DIRECT FORM I AND II
0.1936−0.1936𝑧 −1
1. Realize the first order digital high pass butterworth filter 𝐻 𝑧 = .
1+0.6128𝑧 −1
Sol: From the transfer function, 𝑏0 = 0.1936, 𝑏1 = −0.1936 and 𝑎1 = 0.6128.
Thus on applying direct form-1 we have, 𝑦 𝑛 = −0.6128𝑦 𝑛 − 1 + 0.1936𝑥 𝑛 − 0.1936𝑥(𝑛 − 1).
0.7157+1.4324𝑧 −1 +0.7151𝑧 −2
2. Realize the following digital filter using direct-form II: 𝐻 𝑧 = .
1+1.3490𝑧 −1 +0.5140𝑧 −2
Sol: From the transfer function, 𝑏0 = 0.7157, 𝑏1 = 1.4314, 𝑏2 = 0.7151 and 𝑎1 = 1.3490 𝑎2 =
0.5140.
Thus on applying direct form-2 we have, 𝑦 𝑛 = 0.7157𝑤 𝑛 + 1.4314𝑤 𝑛 − 1 − 0.5140𝑤 𝑛 − 2 ,
where w 𝑛 = 𝑥 𝑛 − 1.3490𝑤 𝑛 − 1 − 0.5140𝑤(𝑛 − 2).

19

You might also like