IIR vs. FIR Filters Explained
IIR vs. FIR Filters Explained
BY,
ASWINI S H
ASSISTANT PROFESSOR
DEPARTMENT OF ECE, CET
INTRODUCTION TO IIR FILTERS
➢ IIR filters are of recursive type, where the present output sample depends on the
present input, past input & past output samples.
➢ When compared to FIR filters, the IIR filter satisfies a given magnitude response
design objective with a lower order filter
➢ IIR filter does not exhibit linear phase or constant group delay behaviour
➢ If the principal objective of the digital filter design is to satisfy the specified
magnitude response alone, an IIR is usually the preferred choice
➢ Since the order of an IIR filter is significantly less than that of a FIR filter, IIR filter
would require fewer coefficients.
08-05-2024 2
INTRODUCTION TO IIR FILTERS (Contd.)
Trade-offs:
When selecting between FIR and IIR filters:
➢ Linear Phase Requirement: If linear phase is critical (e.g., in applications like audio
processing), FIR filters might be preferred despite their higher computational
requirements.
➢ Transition Bandwidth and Efficiency: For applications where computational
efficiency is crucial or steeper transition bands are acceptable, IIR filters might be
chosen despite their nonlinear phase response.
08-05-2024 3
INTRODUCTION TO IIR FILTERS (Contd.)
➢ IIR filters are described by the difference equation:
08-05-2024 6
DESIGN OF IIR FILTERS FROM ANALOG FILTERS
(Contd.)
(b) Approach 2:
➢ Transform the analog LPF HLP(s) to a digital filter HLP(z).
➢ Apply frequency band transformation in z-domain to obtain other frequency
selective filters (high-pass, band-pass, and band-stop) H(z).
08-05-2024 7
DESIGN OF IIR FILTERS FROM ANALOG FILTERS
(Contd.)
➢ To convert an analog filter H(s) into a digital filter H(z), the transformation should
possess the following properties:
➢ The 𝐣𝜴 axis of the s-plane should map onto the unit circle in the z-plane.
➢ The left half of the s-plane maps to the inside of the unit circle. This implies
that the poles in the left half of the s-plane maps into the inside of the unit
circle. Hence a stable analog filter will be transformed to a stable digital filter.
08-05-2024 8
DESIGN OF IIR FILTERS FROM ANALOG FILTERS
(Contd.)
Specifications for the magnitude response of a low pass filter (a) analog , (b) digital
08-05-2024 9
DESIGN OF IIR FILTERS FROM ANALOG FILTERS
(Contd.)
➢ The range of frequencies that are passed through the filter is called passband and those frequencies that are
blocked is called stopband.
➢ Transition band is specified between the passband and the stop band to permit the magnitude to drop off
smoothly.
08-05-2024 10
DESIGN OF IIR FILTERS FROM ANALOG FILTERS (Contd.)
➢ Cutoff Frequency:
➢ The cutoff frequency is a critical parameter that defines the boundary between the passband
and the stopband in a digital filter's frequency response.
➢ For low-pass and high-pass filters, the cutoff frequency marks the point at which the filter's
response starts to transition from the passband to the stopband.
➢ For band-pass and band-stop filters, there are multiple cutoff frequencies defining the edges of
the passband and stopband.
➢ Transition Bandwidth:
➢ The transition bandwidth is the frequency range over which the filter transitions from the
passband to the stopband (or vice versa).
➢ It specifies the width of the transition region in the filter's frequency response and affects the
sharpness of the filter's cutoff.
08-05-2024 11
DESIGN OF IIR FILTERS FROM ANALOG FILTERS (Contd.)
➢ Passband Ripple:
➢ Passband ripple refers to the variation in magnitude response within the passband of the
filter.
➢ It quantifies the amount of ripple allowed in the passband and affects the filter's amplitude
response in the frequency domain.
➢ Stopband Ripple:
➢ Stopband ripple is the maximum variation in the magnitude of the filter's frequency response
within the stopband.
➢ It quantifies the deviation of the filter's response from the ideal stopband attenuation level.
➢ Passband Attenuation:
➢ Passband attenuation refers to the reduction in signal amplitude within the specified range of
frequencies that a filter is designed to allow or pass through without significant attenuation
08-05-2024 12
DESIGN OF IIR FILTERS FROM ANALOG FILTERS (Contd.)
➢ Stopband Attenuation:
➢ Stopband attenuation specifies the level of attenuation (or suppression) of frequencies in the
stopband of the filter.
➢ It defines how effectively the filter suppresses unwanted frequencies outside the passband.
➢ Filter Order:
➢ The filter order determines the complexity of the filter and the number of filter coefficients
required to achieve the desired frequency response.
➢ Higher-order filters typically offer sharper cutoffs and better stopband attenuation but may
require more computational resources.
08-05-2024 13
DESIGN OF IIR FILTERS FROM ANALOG FILTERS
(Contd.)
➢ There are 2 types of analog filter design
➢ They are:
➢ Butterworth filter
➢ Chebyshev filter
08-05-2024 14
ANALOG LOW PASS BUTTERWORTH FILTER
08-05-2024 15
ANALOG LOW PASS BUTTERWORTH FILTER (Contd.)
➢ Butterworth low pass filters are all pole filters with a flat passband and is
characterized by the magnitude frequency response
N = 1,2,3,…….
➢ The above function has a total of 2N poles which lie on a unit circle - N poles on the
left half of the s plane as well as N poles on the right half of the s plane due to the
presence of H(s) & H(-s).
➢ Angular separation between the poles is given by:
3600
which is = 600 for N = 3
2𝑁
08-05-2024 17
ANALOG LOW PASS BUTTERWORTH FILTER (Contd.)
Q. Find the expression for order N of an analog low pass Butterworth filter .
08-05-2024 18
ANALOG LOW PASS BUTTERWORTH FILTER (Contd.)
08-05-2024 19
ANALOG LOW PASS BUTTERWORTH FILTER (Contd.)
08-05-2024 20
ANALOG LOW PASS BUTTERWORTH FILTER (Contd.)
08-05-2024 21
ANALOG LOW PASS BUTTERWORTH FILTER (Contd.)
N = 3.758
08-05-2024 22
ANALOG LOW PASS BUTTERWORTH FILTER (Contd.)
Q. Find the expression for cut-off frequency of an analog low pass Butterworth filter.
08-05-2024 23
ANALOG LOW PASS BUTTERWORTH FILTER (Contd.)
08-05-2024 24
STEPS TO DESIGN ANALOG BUTTERWORTH LOW PASS FILTER
08-05-2024 25
STEPS TO DESIGN ANALOG BUTTERWORTH LOW PASS FILTER
(Contd.)
Necessary Equations for Butterworth LPF Design:
08-05-2024 26
STEPS TO DESIGN ANALOG BUTTERWORTH LOW PASS FILTER
(Contd.)
08-05-2024 27
STEPS TO DESIGN ANALOG BUTTERWORTH LOW PASS FILTER
(Contd.)
Q. Design an analog Butterworth filter that has a -2dB passband attenuation at a
frequency of 20 rad/sec and at least -10 dB stopband attenuation at 30 rad/sec.
08-05-2024 28
STEPS TO DESIGN ANALOG BUTTERWORTH LOW PASS FILTER
(Contd.)
08-05-2024 29
STEPS TO DESIGN ANALOG BUTTERWORTH LOW PASS FILTER (Contd.)
30
STEPS TO DESIGN ANALOG BUTTERWORTH LOW PASS FILTER
(Contd.)
𝝀
𝒍𝒐𝒈
𝑵≥ 𝜺
𝜴
𝒍𝒐𝒈 𝜴 𝑺
𝑷
31
𝑵 ≥ 𝟑. 𝟑𝟒 ≈ 𝟒
STEPS TO DESIGN ANALOG BUTTERWORTH LOW PASS FILTER
(Contd.)
32
FREQUENCY TRANSFORMATIONS IN ANALOG DOMAIN
➢ So far we have discussed designing of a low pass filter for the given specifications
➢ Frequency transformations can be done so as to design low pass filters with
different passband frequencies, high pass filters, bandpass filters and band stop
filters from a normalised low pass analog filter (𝜴𝑪 = 𝟏 𝒓𝒂𝒅/𝐬𝐞𝐜)
33
FREQUENCY TRANSFORMATIONS IN ANALOG DOMAIN
34
FREQUENCY TRANSFORMATIONS IN ANALOG DOMAIN
35
FREQUENCY TRANSFORMATIONS IN ANALOG DOMAIN
36
FREQUENCY TRANSFORMATIONS IN ANALOG DOMAIN
37
FREQUENCY TRANSFORMATIONS IN ANALOG DOMAIN
38
FREQUENCY TRANSFORMATIONS IN ANALOG DOMAIN (Contd.)
39
FREQUENCY TRANSFORMATIONS IN ANALOG DOMAIN (Contd.)
40
FREQUENCY TRANSFORMATIONS IN ANALOG DOMAIN (Contd.)
41
FREQUENCY TRANSFORMATIONS IN ANALOG DOMAIN (Contd.)
42
43
44
45
46
47
48
49
OVERVIEW AND COMPARISON OF OTHER ANALOG FILTERS
ANALOG LOW PASS CHEBYSHEV FILTERS:
➢ There are two types of Chebyshev filters.
➢ Type I Chebyshev filters are that exhibit all-pole filters that exhibit equiripple behaviour in the
passband and a monotonic characteristics in the stopband.
➢ On the other hand, the family of type II Chebyshev filter contains both poles and zeros and exhibits
a monotonic behaviour in the passband and an equiripple behaviour in the stopband
50
OVERVIEW AND COMPARISON OF OTHER ANALOG FILTERS (Contd.)
ANALOG LOW PASS CHEBYSHEV FILTERS (Contd.):
➢ Poles of the Chebyshev transfer function are located on an ellipse in the s-plane
➢ The equation of the ellipse is given by:
where a and b are minor and major axes of the ellipse respectively.
51
OVERVIEW AND COMPARISON OF OTHER ANALOG FILTERS (Contd.)
52
OVERVIEW AND COMPARISON OF OTHER ANALOG FILTERS (Contd.)
53
DESIGN OF IIR FILTER FROM ANALOG FILTERS
IIR FILTER DESIGN BY IMPULSE INVARIANCE
➢ In impulse invariance method, the IIR filter is designed such that the unit impulse
response h(n) of digital filter is the sampled version of the impulse response of
analog filter
➢ The z-transform of an infinite impulse response is given by:
…(1)
➢ Consider the mapping of points from the s-plane to the z-plane implied by the
relation: …(2) 54
IIR FILTER DESIGN BY IMPULSE INVARIANCE (Contd.)
…(2)
➢ If we substitute 𝒔 = 𝝈 + 𝒋𝜴 and express the complex variable z in polar form as
𝒛 = 𝒓𝒆𝒋𝝎 we get:
…(3)
which gives:
…(4)
…(5)
55
IIR FILTER DESIGN BY IMPULSE INVARIANCE (Contd.)
…(3)
➢ The first term in the product in Eqn. (3), 𝑒 𝜎𝑇 , has a magnitude of 𝑒 𝜎𝑇 and an angle of
0 – a real number
➢ The second term 𝑒 𝑗Ω𝑇 , has unity magnitude and an angle of Ω𝑇
➢ The analog pole is mapped to a place in the z-plane of magnitude 𝒆𝝈𝑻 and angle 𝜴𝑻
➢ Real part of the analog pole determines the radius of the z-plane pole and the
imaginary part of the analog pole dictates the angle of the digital pole.
56
IIR FILTER DESIGN BY IMPULSE INVARIANCE (Contd.)
➢ Consider any pole on the 𝒋𝜴-axis, where 𝝈 = 𝟎
➢ These poles map to the z-plane at a radius 𝒓 = 𝒆𝟎.𝑻 = 𝟏
➢ Therefore, the impulse invariant mapping map poles from the s-plane’s 𝒋𝜴-axis to
the z-plane’s unit circle
57
IIR FILTER DESIGN BY IMPULSE INVARIANCE (Contd.)
➢ Consider the poles in the left half of s-plane where 𝝈 < 𝟎
➢ These poles map inside the unit circle, because 𝒓 = 𝒆𝝈𝑻 < 𝟏 for 𝝈 < 𝟎
➢ Therefore, all s-plane poles with negative real parts map to z-plane poles inside the
unit circle – stable analog poles are mapped to stable digital poles
➢ Impulse invariant mapping preserves the stability of the filter
58
IIR FILTER DESIGN BY IMPULSE INVARIANCE (Contd.)
➢ Consider the poles in the right half of s-plane where 𝝈 > 𝟎
➢ These poles map outside the unit circle, because 𝒓 = 𝒆𝝈𝑻 > 𝟏 for 𝝈 > 𝟎
➢ Therefore, all s-plane poles in the right half of s-plane map to digital poles outside
the unit circle
59
IIR FILTER DESIGN BY IMPULSE INVARIANCE (Contd.)
➢ Although the 𝒋𝜴-axis is mapped into the unit circle, it is not one-to-one mapping
rather it is many-to-one mapping, where many points in s-plane are mapped to a
single point in the z-plane
➢ Consider two poles in the s-plane with identical real parts, but with imaginary
𝟐𝝅
components differing by
𝑻
…(6)
➢ These poles map to z-plane poles z1 and z2, via impulse invariant mapping
60
IIR FILTER DESIGN BY IMPULSE INVARIANCE (Contd.)
…(7)
…(8)
➢ From Eqn. (7) and (8), we find that these poles map to the same location in the z-plane
61
IIR FILTER DESIGN BY IMPULSE INVARIANCE (Contd.)
➢ There are an infinite number of s-plane poles that map to the same location in the
z-plane.
𝟐𝝅
➢ They must have the same real parts and that differ by some integer multiple of .
𝑻
62
IIR FILTER DESIGN BY IMPULSE INVARIANCE (Contd.)
➢ Let Ha(s) is the system function of an analog filter.
➢ This can be expressed in partial fraction form as:
…(9)
where 𝑝𝑘 are the poles of the analog filter & 𝑐𝑘 are the coefficients in the partial fraction
expansion.
➢ The inverse Laplace transform of Eq.(9) is:
…(10)
63
IIR FILTER DESIGN BY IMPULSE INVARIANCE (Contd.)
➢ If we sample ha(t) periodically at t = nT, we have:
…(11)
➢ We know:
…(12)
…(13) 64
IIR FILTER DESIGN BY IMPULSE INVARIANCE (Contd.)
➢ For high sampling rates (for small T), the digital filter gain is high.
➢ Therefore, instead of Eq. (13), we can use
…(14)
66
IIR FILTER DESIGN BY IMPULSE INVARIANCE (Contd.)
Q. For the analog transfer function, 𝑯(𝒔) = 𝟐/(𝒔𝟐 + 𝟑𝒔 + 𝟐), determine H(z) using
Impulse Invariance Method. Assume T=1 sec.
67
IIR FILTER DESIGN BY IMPULSE INVARIANCE (Contd.)
68
IIR FILTER DESIGN BY IMPULSE INVARIANCE (Contd.)
Q) Design a third order Butterworth digital filter using impulse invariance technique.
Assume sampling period of T= 1 sec.
69
IIR FILTER DESIGN BY IMPULSE INVARIANCE (Contd.)
70
IIR FILTER DESIGN BY IMPULSE INVARIANCE (Contd.)
71
IIR FILTER DESIGN BY IMPULSE INVARIANCE (Contd.)
72
IIR FILTER DESIGN BY IMPULSE INVARIANCE (Contd.)
73
IIR FILTER DESIGN BY IMPULSE INVARIANCE (Contd.)
74
IIR FILTER DESIGN BY BILINEAR TRANSFORMATION
➢ The bilinear transformation is a conformal mapping that transforms the 𝒋𝜴 axis into
the unit circle in the z - plane only once, thus avoiding aliasing of frequency
components
➢ All points in the LHP of ‘s’ are mapped inside the unit circle in the z – plane and all
points in the RHP of ‘s’ are mapped into corresponding points outside the unit
circle in the z – plane
➢ Consider an analog linear filter with system function: …(1)
…(2) 75
IIR FILTER DESIGN BY BILINEAR TRANSFORMATION (Contd.)
➢ This can be characterized by the differential equation:
…(3)
…(4)
76
IIR FILTER DESIGN BY BILINEAR TRANSFORMATION (Contd.)
➢ The approximation of the integral in Eqn. (4) by the trapezoidal formula at t = nT and
t0 = nT – T yields:
…(5)
…(6)
…(7)
77
IIR FILTER DESIGN BY BILINEAR TRANSFORMATION (Contd.)
…(7)
➢ which implies:
…(8)
78
IIR FILTER DESIGN BY BILINEAR TRANSFORMATION (Contd.)
𝑇
➢ Dividing numerator and denominator by (1 + 𝑧 −1 ) we get:
2
…(9)
79
IIR FILTER DESIGN BY BILINEAR TRANSFORMATION (Contd.)
➢ Comparing Eqn. (1) and Eq.(9), the mapping from s-plane to the z-plane can be
obtained as:
…(10)
80
IIR FILTER DESIGN BY BILINEAR TRANSFORMATION (Contd.)
➢ Separating imaginary and real parts, we have:
…(12)
…(13)
➢ From Eqn.(13), we find that if r ≤ 1, then 𝜎 < 0 and if r > 1, then 𝜎 > 0
➢ Consequently, the LHP in 's' maps into the inside of the unit circle in the z – plane and the RHP in the
‘s’ maps into the outside of the unit circle
➢ When r = 1, 𝜎 = 0 and
…(15)
…(14) 81
IIR FILTER DESIGN BY BILINEAR TRANSFORMATION (Contd.)
THE WARPING EFFECT:
➢ Let Ω and ω represent the frequency variables of the analog filter and the derived
digital filter respectively
➢ From Eqn.(14), we have:
➢ For small value of 𝜔:
…(16)
➢ For low frequencies, the relationship between Ω and ω are linear, as a result the
digital filter have the same amplitude response as the analog filter.
82
IIR FILTER DESIGN BY BILINEAR TRANSFORMATION (Contd.)
THE WARPING EFFECT (Contd.):
➢ For high frequencies, however, the relationship between Ω and ω becomes non-
linear and distortion is introduced in the frequency scale of the digital filter to that
of the analog filter
➢ This is also known as warping effect
83
IIR FILTER DESIGN BY BILINEAR TRANSFORMATION (Contd.)
THE WARPING EFFECT (Contd.):
➢ The influence of the warping effect on the amplitude response is shown in the
below figure by considering an analog filter with a number of passbands centered at
regular intervals:
➢ The derived digital filter will have same
number of passbands.
➢ But the center frequencies and bandwidth
of higher frequency passband will tend to
reduce disproportionately
84
IIR FILTER DESIGN BY BILINEAR TRANSFORMATION (Contd.)
THE WARPING EFFECT (Contd.):
➢ The influence of the warping effect on the phase response is shown in the below
figure:
85
IIR FILTER DESIGN BY BILINEAR TRANSFORMATION (Contd.)
PREWARPING:
➢ The warping effect can be eliminated by prewarping the analog filter.
➢ This can be done by finding prewarping analog frequencies using the formula:
𝟐 𝝎
𝛀 = 𝒕𝒂𝒏 …(17)
𝑻 𝟐
➢ Therefore, we have:
…(18)
…(19)
86
IIR FILTER DESIGN BY BILINEAR TRANSFORMATION (Contd.)
STEPS TO DESIGN DIGITAL FILTER USING BILINEAR TRANSFORM TECHNIQUE:
87
IIR FILTER DESIGN BY BILINEAR TRANSFORMATION (Contd.)
𝟐
Q. Apply bilinear transformation to 𝑯(𝒔) = with T=1 sec and find H(z)
(𝒔+𝟏)(𝒔+𝟐)
88
IIR FILTER DESIGN BY BILINEAR TRANSFORMATION (Contd.)
89
IIR FILTER DESIGN BY BILINEAR TRANSFORMATION (Contd.)
90
IIR FILTER DESIGN BY BILINEAR TRANSFORMATION (Contd.)
91
IIR FILTER DESIGN BY BILINEAR TRANSFORMATION (Contd.)
92
IIR FILTER DESIGN BY BILINEAR TRANSFORMATION (Contd.)
93
IIR FILTER DESIGN BY BILINEAR TRANSFORMATION (Contd.)
94
IIR FILTER DESIGN BY BILINEAR TRANSFORMATION (Contd.)
95
IIR FILTER DESIGN BY BILINEAR TRANSFORMATION (Contd.)
96
IIR FILTER DESIGN BY BILINEAR TRANSFORMATION (Contd.)
97
FREQUENCY TRANSFORMATION IN DIGITAL DOMAIN
98
FREQUENCY TRANSFORMATION IN DIGITAL DOMAIN (Contd.)
99
FREQUENCY TRANSFORMATION IN DIGITAL DOMAIN (Contd.)
100
FREQUENCY TRANSFORMATION IN DIGITAL DOMAIN (Contd.)
101
FREQUENCY TRANSFORMATION IN DIGITAL DOMAIN (Contd.)
102