You are on page 1of 103

IIR Filter Design

A.V.Ramachandran
Syllabus
• Structure of IIR –
• System design of discrete time IIR filter from
continuous time filter Approximation
derivatives –
• IIR filter design by impulse invariance –
• Bilinear transformation –
• Design of IIR filter in the frequency domain.
Frequency Domain
• What is it?
• x(n) = cos(
Frequency Domain Understanding
• It helps me to design filters easily. Tea Filter

• Okay what is filter?

• Here, filtering means:


– Suppose I have two signals (one is my voice and other is
noise)
– I need only my voice signal
– Luckily, voice is in different frequency from noise.
– If its possible to remove(filter) noise frequency from the
signal, it is called Filtering.
Frequency Response of LTI System

Remember Discrete Fourier Transform,


How Filtering is done?
Why H(z) is so important?

1*

System Function, 1*
. +
H(z) .
.
.
0*

Assumption, Noise Frequency: > 5KHz and


speech signal frequency: < 5KHz.
H(z) = 1 for f < 5KHz and
= 0 for f > 5KHz
Ideal vs. Practical Filters
H(ω)
(Filter specification)

ωp

H(ω)

δp

δs
ω
ωp ωs
Practical Filter

1
Other Filters
LTI system Digital Filter
After π, it
repeats.

Since
Discrete
time,
signals are
redundant
after 2π

Apart from it, there


are also other
shapes of filters
Why H(z) is so important?
• By choosing H(z) properly, any type of
filtering can be obtained.
Why H(z) is so important?
Pole Zero Plot
• If you equate the denominator of H(z) to zero,
then you get Poles

• If you equate the numerator of H(z) to zero,


then you get Zeros
To find Z transform of Nth order Constant
Coefficient Linear Difference Equation

Z{ } Z{ } Z{ }
To find H(z) for LTI system
Convolution Formula:

After applying Z transform:

Applying this equation to our previous derivation


H(z) for IIR Filters
• Rational function

• Poles and zeros Representation


H(z) vs H(ω)
(Representation of Digital Filters)
How to plot
poles and
zeros?

H(ω) is clearly showing, this is Low Pass Filter. Why not I find only H(ω) for any filter?
Why I’m finding H(z) for filter design?
H(z) actually what it says?

H(z) is the form you can implement (design) filters directly. Using H(ω), you can’t
implement filter directly.
But H(ω) tells you, how the filter works.
Somehow, I must try to understand from H(z), how the filter works.
Understanding Poles and Zeros in H(z)
(Poles and Zero to Frequency Response)
H(z) to H(ω)

H(ω) dz / dp

dp dz

ω
How the following filters work?
Find what is this filter?
IIR Filter Design
Analog Filter

Digital Filter
Why doing like this?
Splendid research has been done in Analog Filters and really very good
Analog filters are readily available.
why not just use them?
Techniques to convert Analog Filter to
Digital Filter
• Ways to find s in terms of z:
– Approximation Derivatives
– Impulse Invariance
– Bilinear Transformation

H(s) H(z)
{Analog Filter} {Digital Filter}

To find H(z) from H(s), what we Need actually?


s in terms of z
For eg:
s = (1-z-1 )/T
Important Condition To satisfy by all the
conversion techniques
1. s-plane to z-plane Conversion

2. If Analog Filter is stable, then Digital Filter


also should be stable.
Method 1: Approximation Derivative

• In continuous Time (Analog), Filters are


represented using system Function, H(s)
(Which is a Laplace Transform of Continuous
Time Domain)
Since Analog
filters are
usually
represented as
differential
equation Backward difference

T  Sampling Time. 1/T = Fs (Sampling Rate)


Analog Filter
Design a digital filter from the analog filter
Using
approximation of
derivative
method.
Mapping Function for (Using backward
Approximation Derivative is: Difference)

Okay, let’s substitute s and find H(z). Wait, before that, simplify the H(s), so
that your substitution will be easy.
Rearranging in the denominator
H(z)

Let, T = 0.1, then

Easy way to
find the poles.
Whether Approximation Derivative satisfy
the condition?
Yes, it satisfy both the
conditions.
But what is the problem?

Find z in terms of s:

s=-1 s=0
s=-∞
Think of Designing Low Pass Filter and
High pass Filter using Backward
Difference Method
• Low Pass Filter: High Pass Filter

It’s impossible to design High Pass Filter


using Approximation Derivative Method
Impulse Invariance
h(n) = ha(nT)
(Shape of Digital Filter is same as that of continuous Filter)

Impulse
L-1 Invariance Z
Mapping of s to z: 𝒂

Assume a simple continuous filter:

Applying Inverse Laplace Transform:

Applying Impulse Invariance idea:


Mapping of s to z:

=
So what about
zeros in s domain?
Mapping of s to z: I’m not currently
bother about it.

What is the pole


for this function?

What is the pole here?

Pole, pk in the s-plane is plotted as pole , in z plane

So no direct one to one mapping as in Approximation Derivative method.


Problem:
2.Convert the analog filter with system function

into a digital IIR filter by means of the impulse


invariance method. Assume T = 0.1 second.
Solution
• To convert the poles from s-plane to z-plane. So first need to find
pole in s-plane.

• Pole, pk is found using equating the denominator to zero.


Solution contd…

• We know what to substitute for poles in z-


plane( ).
• We need Ha(s) only in sum of poles form.
• Any method to convert product of poles to
sum of poles???
• Any Math Technique?
Partial Fraction Expansion using Residue
Method:

c and c’ are called Residues.


c and c’ are complex conjugates. i.e if c = a+jb, then c’ = a-jb
To find c using Residue Method:

Substituting c and c’,


then,
Poles in s-plane: -0.1±j3

Poles in z-plane : e(-0.1±j3)T

(1-(pole in z-plane) z-1 )


Given T = 0.1,
Only after

Butterworth Filter 30years from its


invention, its
usefulness is
realized.
• British Engineer Stephen Butterworth
• Maximally Flat Pass band
– Monotonic in Passband and stop band
H(ejω )

ωc ω
"An ideal electrical filter should not only completely reject the unwanted frequencies
but should also have uniform sensitivity for the wanted frequencies".
-Butterworth
System Function of Butterworth Filter

• All pole system.


– No zeros at all.
• N – order of the filter
– Higher the order, higher the flatness and complexity.
• Ωc - Cutoff frequency.
Design a digital Butterworth filter satisfying the constraints.

With T=1 sec using impulse invariance method.

Idea to design for Digital Butterworth Filter :

Find the poles Using Any of the three IIR


Butterworth Circle Design Technique can be
used here.

Given Digital Analog Butterworth Analog Butterworth Digital Butterworth


Butterworth Filter Filter specification Filter Design Filter Design
Specification H(z)
Design a digital Butterworth filter satisfying the constraints.

With T=1 sec using impulse invariance method.

Understanding what it means:


What filter is this?
Low Pass Filter
Since Butterworth

1 Note:
0.707
Butterworth is not
necessarily a Low
Pass Filter.

0.2
1. To convert digital specification to
analog specification
To convert, we need to map digital frequency, ω and analog frequency, Ω

In impulse invariance,

Ha(s) H(z)
Ha(jΩ) H(ejω)
Given, T =1sec

Analog Filter Specification is found.


Next need to find Ha(s).
To find Ha(s):
For a Butterworth Filter,

Ha (j0.5π) = 0.707 Found from the analog filter specification.


(Assuming ≥ and ≤ to =)
Ha (j0.75π) = 0.2

From this, find, Ωc and N.


Taking Log on both sides,
Taking Log on both sides,
2Nlog

2Nlog

Taking anti-log on both sides,


.

To find poles using Butterworth circle


Draw the circle of radius,Ωc in the s-plane
Divide the circle by 2N poles equally. (LHP and RHP, N poles each)
From this, find the values of the poles using the formula:

Show them,
s-plane other way of
dividing and the
problem due to
Ha (s) that dividing.
Ha (-s)
p1 and p2 are complex conjugates

Similarly, p3 and p4 are complex conjugates

Angle of separation between poles: π/N


(Negative because left half of the s-plane)

(Negative because left half of the s-plane)


Poles are found. Now write the Ha (s).
 
To implement Impulse Invariance Transformation, sum of poles form is needed.
To do it, we need to find the partial fraction expansion using Residue method.
 

To find
To find c1 and c2
Applying Impulse Invariance Technique,
Using Calculator,
Similarly, for H2 (z),
Show them 0 to 2pi and –pi to +pi are same
Highest freq : at pi
Mapping between ω and Ω:
(Impulse Invariance)

Other values of Ω are also mapped again in the range of

Many analog frequencies have same digital frequency. This is called : ALIASING
Aliasing in Impulse Invariance:
Bilinear Transformation

• Used to design all the filters


• Features of Bilinear Transformation:
– maps the axis into the unit circle only once (unlike
impulse invariance approach), hence no aliasing
effect
– Left half of s-plane is mapped into the unit circle
(hence stable analog filter to stable digital filter)
– Right half of s-plane is mapped outside the unit
circle.
Derivation of the Mapping between s and
z

Convert to Input Convert to Digital


Convert to Time
and Output terms, Domain by means of
domain (x(t) and y(t))
(X(s) and Y(s)) sampling (t = nT)

Apply Trapezoidal
Represent Derivative in formula and convert to
Integral form digital By Substituting, H(z) is found by
taking Z transform and is
(t = nT, t0 = nT-T) compared with Ha (s) to find the
mapping between s and z.
Since, Y(s) = Ha(s) X(s) ==> Ha(s) =
Laplace Recall:
L(dy/dt) = sY(s)
Represent derivative in integral form:
Trapezoidal Rule
Mapping of s and z:
• Converting to Digital Domain, t = nT and
previous time, t0 = nT-T,

Since T is understood implicitly,


Rearranging the above equation:

Time to take Z transform to find H(z):


Z-Transform (Bilinear Tranformation)

Comparing this equation with Ha (s),

Numerator should contain only b, then, what should


be done?
Divide the terms other than ‘b’, in both
numerator and denominator

Again, Comparing this equation with Ha (s),

This mapping of s and z is called Bilinear Transformation.


To find relation between
Mapping between in Biliear Transformation:

• So, entire Ω is mapped into the unit circle only once, unlike impulse invariance
technique.

• Hence, no aliasing effect.


• But this is done at a cost.
Nonlinear
relation between

Frequency Warping Ω and ω causes


Frequency
Warping.

Frequency
Warping
To meet the desired Digital Filter
specification
• Pre-warp the critical frequencies (band edge
frequencies) according to the

• Design the Analog Filter accordingly.

• From the designed Analog Filter, Transform


the analog filter to digital filter.
Frequency Prewarp
Recall:
• IIR Design:
• (Analog To Digital Conversion)
• Ha(s) to H(z)
– Approximate Derivative
– Impulse Invariance
– Bilinear Transformation
• Butterworth Filter Design
Find the poles
Find
Using poles
using
Butterworth
Circle
Any of the three IIR
Design Technique
formula can be used here.

Given Digital Analog Analog Digital


Butterworth Filter Butterworth Filter Butterworth Filter Butterworth
Specification specification and Design Filter Design
then Find N and H(z)
Analog Frequency
Nonlinear
relation between

Frequency Warping Ω and ω causes


Frequency
Warping.

Frequency
Warping
Digital Frequency Vs Analog Frequency in
Impulse Invariance Method
• Many Analog frequencies are mapped to same
digital frequency resulting in Aliasing effect
Problems in Bilinear Transformation
1. Convert the analog filter
into digital IIR filter by means of bilinear Transformation.
Given: Digital should have resonant frequency,
From the given
Resonant Frequency:
Frequency at which Filter
frequency response is exactly
unity (Maximum)
Plot the Poles

Problem ends
here…

Poles: +j0.987 and -j0.987

Hence, Desired Resonant Frequency is matched.


2. Design a single-pole low pass digital filter with a 3-dB bandwidth of
0.2π, using the bilinear transformation applied to the analog filter

where, Ωc is the 3-dB bandwidth of the analog filter.


If T is not cancelled, assume T = 1 in
case if T is not given
3. Design a digital filter from
Since T is not given either directly or indirectly,
then assume T = 1, then,
Try to implement in atleast in Direct form I. (Since asked for 16 marks)
Design a digital butterworth filter satisfying the
following constraints:

using Bilinear Transformation.

Solution: Recall the design procedure


Taking only the Passband limit:

Taking only the stopband limit:


Substituting the limit,

Analog Butterworth Filter Design:


Taking Log on both sides, Taking Log on both sides,

– (2)
Find N by solving (1) and (2)
To solve (1) and (2), substitute,

Always,
Substitute N = 2 in (1) (satisfying pass band criterion),

Since N =2 ,then two poles:


Analog filter design is over
Analog to Digital Filter Conversion

Thus digital filter design is over.


How it is implemented?
Other Filters
All Pass Filter
Implementation Details
• Hardware or software implementation
• Basic building block requirement
• – Memory unit (i.e. ROM) for storing filter’’s
coefficients.
• – Memory unit (i.e. RAM) for storing input and output
values.
• – Hardware or software multipliers.
• – Hardware or software adder and/or another arithmetic
logic
• units.

You might also like