Unit-Iii Iir Digital Filters
Unit-Iii Iir Digital Filters
Introduction
Filters are of two types—FIR and IIR. The types of filters which make use of feedback
connection to get the desired filter implementation are known as recursive filters. Their impulse
response is of infinite duration. So they are called IIR filters. The type of filters which do not
employ any kind of feedback connection are known as non-recursive filters. Their impulse
response is of finite duration. So they are called FIR filters. IIR filters are designed by
considering all the infinite samples of the impulse response. The impulse response is obtained
by taking inverse Fourier transform of ideal frequency response. There are several techniques
available for the design of digital filters having an infinite duration unit impulse response. The
popular methods for such filter design uses the technique of first designing the digital filter in
analog domain and then transforming the analog filter into an equivalent digital filter because the
analog filter design techniques are well developed. Various methods of transforming an analog
filter into a digital filter and methods of designing digital filters are discussed.
Y (s)
bk sk
k0
Ha (s) = = N
X(s)
ak s k
k
where {ak} and {bk} are filter coefficients.
The impulse response of these filter coefficients is related to Ha(s) by the Laplace
transform.
The analog filter having the rational system function Ha(s) is expressed by a linear constant
coefficient differential equation.
N M
dk y(t) dk x(t)
ak dtk
= k dtk
b
k 0 k0
where x(t) is the input signal and y(t) is the output of the filter.
The above three equivalent characterizations of an analog filter leads to three alternative
methods for transforming the analog filter into digital domain. The restriction on the design is
that the filters should be realizable and stable.
For stability and causality of analog filter, the analog transfer function should satisfy
the following requirements:
1. The Ha(s) should be a rational function of s, and the coefficients of s should be real.
2. The poles should lie on the left half of s-plane.
3. The number of zeros should be less than or equal to the number of poles.
For stability and causality of digital filter, the digital transfer function should satisfy the
following requirements:
1. The H(z) should be a rational function of z and the coefficients of z should be real.
2. The poles should lie inside the unit circle in z-plane.
3. The number of zeros should be less than or equal to the number of poles.
We know that the analog filter with transfer function Ha(s) is stable if all its poles lie
in the left half of the s-plane. Consequently for the conversion technique to be effective, it
should possess the following desirable properties:
1. The imaginary axis in the s-plane should map into the unit circle in the z-plane.
Thus, there will be a direct relationship between the two frequency variables in the two
domains.
2. The left half of the s-plane should map into the interior of the unit circle centered at
the origin in z-plane. Thus, a stable analog filter will be converted to a stable digital
filter.
The physically realizable and stable IIR filter cannot have a linear phase. For a filter to
have a linear phase, the condition to be satisfied is h(n) = h(N – 1 – n) where N is the length
of the filter and the filter would have a mirror image pole outside the unit circle for every
pole inside the unit circle. This results in an unstable filter. As a result, a causal and stable
IIR filter cannot have linear phase. In the design of IIR filters, only the desired magnitude
response is specified and the phase response that is obtained from the design methodology is
accepted.
The comparison of digital and analog filters is given below.
Y (s)
Ha (s) = = b
X(s) s+a
or sY(s) + aY(s) = bX(s)
Therefore, we get
Comparing this with the analog filter system function Ha(s) we get
This is the relation between analog and digital poles in bilinear transformation. So to convert
an analog filter function into an equivalent digital filter function, just put
The general characteristic of the mapping z = esT may be obtained by putting s = and expressing the
complex variable z in the polar form as in the above equation for s.
Thus,
Since s = , we get
And
From the above equation for , we observe that if r < 1 then σ < 0 and if r > 1, then σ >
0, and if r = 1, then σ = 0. Hence the left half of the s-plane maps into points inside
the unit circle in the z-plane, the right half of the s-plane maps into points outside the unit
circle in the z-plane and the imaginary axis of s-plane maps into the unit circle in the z-plane.
This transformation results in a stable digital system.
The above relation between analog and digital frequencies shows that the entire range in Ω
is mapped only once into the range –π ≤ ω ≤ π . The entire negative imaginary axis in the
s-plane (from Ω = – ∞ to 0) is mapped into the lower half of the unit circle in z-plane
(from ω = –π to 0) and the entire positive imaginary axis in the s-plane (from Ω= α to 0) is
mapped into the upper half of unit circle in z-plane (from ω = 0 to +π ).
But as seen in Figure 1, the mapping is non-linear and the lower frequencies in analog
domain are expanded in the digital domain, whereas the higher frequencies are
Figure 1 Mapping between Ω and ω in bilinear transformation.
compressed. This is due to the nonlinearity of the arctangent function and usually known as
frequency warping.
The effect of warping on the magnitude response can be explained by considering an
analog filter with a number of passbands as shown in Figure 2(a). The corresponding digital
filter will have same number of passbands, but with disproportionate bandwidth, as shown in
Figure 2(a).
In designing digital filter using bilinear transformation, the effect of warping on
amplitude response can be eliminated by prewarping the analog filter. In this method, the
specified digital frequencies are converted to analog equivalent using the equation
These analog frequencies are called prewarp frequencies. Using the prewarp
frequencies, the analog filter transfer function is designed, and then it is transformed to digital
filter transfer function.
This effect of warping on the phase response can be explained by considering an analog
filter with linear phase response as shown in Figure 2(b). The phase response of corresponding
digital filter will be nonlinear.
Figure 2 The warping effect on (a) magnitude response and (b) phase response.
It can be stated that the bilinear transformation preserves the magnitude response of an
analog filter only if the specification requires piecewise constant magnitude, but the phase
response of the analog filter is not preserved. Therefore, the bilinear transformation can be used
only to design digital filters with prescribed magnitude response with piecewise constant
values. A linear phase analog filter cannot be transformed into a linear phase digital filter
using the bilinear transformation.
EXAMPLE 1
into a digital IIR filter by using bilinear transformation. The digital IIR filter is having a
resonant frequency of ω r =π/2.
Solution: From the transfer function, we observe that Ωc = 3. The sampling period
T can be determined using the equation:
Using the bilinear transformation, the digital filter system function is:
EXAMPLE 2
Convert the analog filter with system function
Ha (s) = s + 0.5
(s + 0.5)2 + 16
into a digital IIR filter using the bilinear transformation. The digital filter should have a
resonant frequency of ω r =π/2.
Solution: From the system function, we observe that Ωc = 4. The sampling period T can be
determined using the equation
i.e.
Using the bilinear transformation, the digital filter system function is:
EXAMPLE 3
Apply the bilinear transformation to
and T = 0.5 s
To obtain H(z) using the bilinear transformation in Ha(s) , replace s by
EXAMPLE 4
and T = 1 s.
To get H(z) using the bilinear transformation, put
EXAMPLE 5
Given T = 1 s,
EXAMPLE 6
A digital filter with a 3 dB bandwidth of 0.4 is to be designed from the
analog filter whose system response is:
EXAMPLE 7
The normalized transfer function of an analog filter is given by
Convert the analog filter to a digital filter with a cutoff frequency of 0.6, using the bilinear
transformation.
Solution: The prewarping of analog filter has to be performed to preserve the magnitude
response. For this the analog cutoff frequency is determined using the bilinear transformation,
and the analog transfer function is unnormalized using this analog cutoff frequency. Then the
analog transfer function is converted to digital transfer function using the bilinear transformation.
Given that, digital cutoff frequency, ωc = 0.6 π rad/s. Let T = 1s.
In the bilinear transformation,
Analog cutoff frequency
(a ) (b)
Figure 3 Magnitude response of low–pass filter (a) Gain vs ω and (b) Attenuation vs ω.
Let ω1 = Passband frequency in rad/s.
ω2 = Stopband frequency in rad/s.
Let the gain at the passband frequency ω1 be A1 and the gain at the stopband frequency
ω2 be A2, i.e.
The filter may be expressed in terms of the gain or attenuation at the edge frequencies.
Let α1 be the attenuation at the passband edge frequency ω1, and α 2 be the attenuation at the
stopband edge frequency ω2.
The maximum value of normalized gain is unity, so A1 and A2 are less than 1 and α1
and α2 are greater than 1. In Figure 1, A1 is assumed as 1/ 2 and A2 is assumed as 0.1.
Hence α 1 =1.412 = and α 2 = 1/0.1 = 10.
Another popular unit that is used for filter specification is dB. When the gain is
expressed in dB, it will be a negative dB. When the attenuation is expressed in dB, it will be a
positive dB.
Let k1 = Gain in dB at a passband frequency ω 1
k2 = Gain in dB at a stopband frequency ω 2
Figure 4 Magnitude response of low–pass filter (a) dB–Gain vs ω and (b) dB–attenuation vs ω .
Sometimes the specifications are given in terms of passband ripple and stopband
ripple In this case, the dB gain and attenuation can be estimated as follows:
If the ripples are specified in dB, then the minimum passband ripple is equal to k1 and
the negative of maximum passband attenuation is equal to k2.
And
Assuming equality we can obtain the filter order N and the 3 dB cutoff frequency
Dividing the first equation by the second, we have
From this equation, the order of the filter N is obtained approximately as
If N is not an integer, the value of N is chosen to be the next nearest integer. Also we can get
A 1 dB
i.e. log A1 =
20
or
i.e.
Similarly
and is given by
In fact,
If (where is the 3 dB cutoff frequency of the low-pass filter) is replaced by sn, then the
normalized Butterworth filter transfer function is given by
Step 3 Decide the order N of the filter. The order N should be such that
Choose N such that it is an integer just greater than or equal to the value obtained above.
Step 4 Calculate the analog cutoff frequency
When the order N is odd, for unity dc gain filter, Ha(s) is given by
n
The transfer function of the above equation will have 2N poles which are given by the
roots of the denominator polynomial. It can be shown that the poles of the transfer function
symmetrically lie on a unit circle in s-plane with angular spacing of .
For a stable and causal filter the poles should lie on the left half of the s-plane. Hence
the desired filter transfer function is formed by choosing the N-number of left half poles.
When N is even, all the poles are complex and exist in conjugate pairs. When N is odd, one
of the pole is real and all other poles are complex and exist as conjugate pairs. Therefore,
the transfer function of Butterworth filters will be a product of second order factors.
The poles of the Butterworth polynomial lie on a circle, whose radius is . To
determine the number of poles of the Butterworth filter and the angle between them we use
the following rules.
• Number of Butterworth poles = 2N
• Angle between any two poles = 360°/(2N)
If the order of the filter N is even, then the location of the first pole is at w.r.t. the
positive real axis, with the angle measured in the counter-clockwise direction. The location
of the subsequent poles are respectively, at
If the order of the filter N is odd, then the location of the first pole is on the X-axis. The
location of subsequent poles are at θ , 2θ , ..., (360 –θ ) with the angle measured in the counter-
clockwise direction.
If is the angle of a valid pole w.r.t. the X-axis, then the pole and its conjugate are
located at .
EXAMPLE 8
Design a Butterworth digital filter using the bilinear transformation. The
specifications of the desired low-pass filter are:
with T = 1 s
Solution: The Butterworth digital filter is designed as per the following steps.
From the given specification, we have
Step 5 Determination of the transfer function of the analog Butterworth filter Ha(s)
where
For N = 3, we have
where
EXAMPLE 9
Design a low-pass Butterworth digital filter to give response of 3 dB or less for
frequencies upto 2 kHz and an attenuation of 20 dB or more beyond 4 kHz. Use the bilinear
transformation technique and obtain H(z) of the desired filter.
Solution: The specifications of the desired filter are given in terms of dB attenuation and
frequency in Hz. First the gain is to be expressed as a numerical value and frequency in rad/s.
Here attenuation at passband frequency (ω1) = 3 dB
Therefore, gain at passband edge frequency ( ω1) is k1 = –3 dB
1
A1 =10k1/20 = 103/20 = 0.707 =
2
Attenuation at stopband frequency (ω2) = 20 dB
Therefore, gain at stopband edge frequency (ω2) is k2 = –20 dB
Unnormalized
EXAMPLE 10
Design a low-pass Butterworth filter using the bilinear transformation
method for satisfying the following constraints:
Passband: 0–400 Hz Stopband: 2.1– 4 kHz
Passband ripple: 2 dB Stopband attenuation: 20 dB
Sampling frequency: 10 kHz
Solution: Given
α1 = 2 dB, k1 = –2 dB and
1 A1= 10
k1/20
= 102/20 = 0.794
α2 = 20 dB, k2 = –20 dB A 2 = 10k2 /20 = 1020/20 = 0.1
Step 1 Type of transformation
Bilinear transformation is already specified.
Step 2 Ratio of analog edge frequencies .
Here fs = 10 kHz
Passband edge frequency f1 = 400 Hz
Stopband edge frequency f2 = 2.1 kHz
Normalizing the frequencies, we have
(4915.788)2
=
s2 + 1.414 4915.788 s + (4915.788)2
2.416 107
=
s2 + 6950.92 s + 2.416 107
EXAMPLE 11
A digital low-pass filter is required to meet the following specifications.
Passband attenuation ≤ 1 dB Passband edge = 4 kHz
Stopband attenuation 40 dB Stopband edge = 8 kHz
Sampling rate = 24 kHz
The filter is to be designed by performing the bilinear transformation on an analog
system function. Design the Butterworth filter.
EXAMPLE 12
Design a digital IIR low-pass filter with passband edge at 1000 Hz and stopband edge at
1500 Hz for a sampling frequency of 5000 Hz. The filter is to have a passband ripple of 0.5 dB
and a stopband ripple below 30 dB. Design a Butterworth filter using the bilinear transformation.
Solution: Given fs = 5000 Hz, the normalized frequencies are given as:
The Butterworth filter is designed as follows:
Step 1 Type of transformation.
Bilinear transformation is to be used.
Solution: Given
fp = 0.10 Hz, ωp = ω1 = 2 π fp = 2π (0.1) = 0.2π
fs = 0.15 Hz, ωs = ω2 = 2π fs = 2π (0.15) = 0.30π
αp = α1 = 0.5 dB, k1 = –0.5 dB, so A1 = 10k1/20 = 100.5/20 = 0.944
αs = α 2 = 15 dB, k2 = –15 dB, so A2 = 10k2 /20 = 1015/20 = 0.177
1 1
f = 1 Hz, T= = = 1s.
f 1
1. The type of transformation is not specified. Let us use bilinear transformation.
2. 3.
3.
6.16 7
So the order of the low-pass Butterworth filter is N = 7.
DESIGN OF LOW-PASS CHEBYSHEV FILTER
For designing a Chebyshev IIR digital filter, first an analog filter is designed
using the given specifications. Then the analog filter transfer function is transformed to digital
filter transfer function by using either impulse invariant transformation or bilinear
transformation.
The analog Chebyshev filter is designed by approximating the ideal frequency response
using an error function. There are two types of Chebyshev approximations.
In type-1 approximation, the error function is selected such that the magnitude response is
equiripple in the passband and monotonic in the stopband.
In type-2 approximation, the error function is selected such that the magnitude function is
monotonic in the passband and equiripple in the stopband. The type-2 magnitude response is
also called inverse Chebyshev response. The type-1 design is discussed.
The magnitude response of type-1 Chebyshev low-pass filter is given by
A1 is the gain at the passband edge frequency ω1 and Chebyshev polynomial of the first kind
of degree N given by
(a) (b)
Figure 6 Magnitude response of type–I Chebyshev filter.
The design parameters of the Chebyshev filter are obtained by considering the low-pass
filter with the desired specifications as given below.
The corresponding analog magnitude response is to be obtained in the design process.
We have
The order of the analog filter, N can be determined from the inequality for
Choose N to be the next nearest integer to the value given above. The values of and
are determined from ω1 and ω2 using either impulse invariant transformation or bilinear
transformation.
The transfer function of Chebyshev filters are usually written in the factored form as
given below.
When N is even,
For odd values of N and unity dc gain filter, the parameter Bk are evaluated using the
equation:
The normalized poles in the s-domain can be obtained by equating the denominator of
the above equation to zero, i.e., N n
to zero.
The
The solution to the above expression gives us the 2N poles of the filter given by
The unnormalized poles, s’n can be obtained from the normalized poles as shown below.
The normalized poles lie on an ellipse in s-plane. Since for a stable filter all the poles
should lie in the left half of s-plane, only the N poles on the ellipse which are in the left half of
s-plane are considered.
For N even, all the poles are complex and exist in conjugate pairs. For N odd, one pole is
real and all other poles are complex and occur in conjugate pairs.
where
For even values of N and unity dc gain filter, find such that
For odd values of N and unity dc gain filter, find such that
Step 7 Using the chosen transformation, transform Ha(s) to H(z), where H(z) is
the transfer function of the digital filter.
[The high-pass, band pass and band stop filters are obtained from low-
pass filter design by frequency transformation].
EXAMPLE 14
0.707 H( ω ) 1, 0 ω 0.2π
H( ω ) 0.1, 0.5π ω π
Solution: Given
A1 = 0.707, ω1 = 0.2π
A2 = 0.1, ω2 = 0.5π
T = 1 s and bilinear transformation is to be used. The low-pass Chebyshev IIR digital filter is
designed as follows:
Step 1 Type of transformation
Here bilinear transformation is to be used.
Step 2 Attenuation constant
On simplifying, we get
EXAMPLE 15
Determine the system function H(z) of the lowest order Chebyshev IIR
digital filter with the following specifications:
3 dB ripple in passband 0 ≤ω ≤ 0.2 π
25 dB attenuation in stopband 0.45π ≤ ω≤ π
Solution: Given
α1 = 3 dB, k1 = 3dB and hence A1 = 10k1/20 = 103/20 = 0.707
α2 = 25 dB, k2 = 25dB and hence A2 = 10k2 /20 = 1025/20 = 0.0562
ω 1 = 0.2π and ω2 = 0.45π
Let T = 1 and bilinear transformation is used
Attenuation constant
Order of filter
EXAMPLE 16
The specification of the desired low-pass filter is:
H ( ω ) 0.15; 0.5π ω π
Design a Chebyshev digital filter using the bilinear transformation.
Solution: Given
A1 = 0.9, ω 1 = 0.3 π
A2 = 0.15, ω 2 = 0.5 π
The Chebyshev filter is designed as per the following steps:
Step 1 The bilinear transformation is used.
Step 2 Attenuation constant
When k = 1,
When s = 0
= 0.744
(s + 0.577) (s2 + 0.577s + 1.29)
Step 7 Digital transfer function
EXAMPLE 17
Determine the system function of the lowest order Chebyshev digital
filter that meets the following specifications.
2 dB ripple in the passband 0 ≤ω ≤ 0.25 π
Atleast 50 dB attenuation in stopband 0.4π ≤ω ≤ π
Solution: Given
Ripple in passband = 2 dB, i.e. k1 = –2 dB A1 = 10k1/20 = 102/20 = 0.794
Attenuation in stopband = 50 dB, i.e. k2 = –50 dB A2 = 10k2 /20 = 1050/20 = 0.0031
A1 = 0.794, ω1 = 0.25π
A2 = 0.003, ω2 = 0.4π
The Chebyshev filter is designed as per the following steps:
Step 1 Type of transformation
Let us choose bilinear transformation.
EXAMPLE 18
Determine the lowest order of Chebyshev filter that meets the following
specifications:
(i) 1 dB ripple in the passband 0 ω 0.3π
(ii) Atleast 60 dB attenuation in the stopband 0.35π ω π
Use the bilinear transformation.
Solution: Given ω1 = 0.3 , ω2 = 0.35
60 dB attenuation, so α2 = 60 dB or k2 = – 60 dB
Step 1 Bilinear transformation is to be used.
Step 2 Attenuation constant