IIR Filter Design

You might also like

Download as pdf or txt
Download as pdf or txt
You are on page 1of 18

1

EKT 353 Notes by Prof Dr. Farid Ghani



IIR FILTER DESIGN

There are two general approaches used to design IIR digital
filters. The most common is to design an analog IIR filter and
then nap it into an equivalent digital filter because the art of
analog filter design is highly advanced.
Further more it is prudent to consider optimal ways for
mapping these filters into the discrete-time domain.
Furthermore, because
there are powerful design procedures that facilitate the
design of analog filters, this approach to IIR filter design is
relatively simple. The second approach to design IIR digital
filters is to use an algorithmic design procedure, which
generally requires the use of a computer to solve a set of
linear or nonlinear equations.
These methods may be used to design digital filters with
arbitrary frequency response characteristics for which no
analog filter prototype exists or to design filters when other
types of constraints are imposed on the design.
We will now consider the approach of mapping analog filters
into digital filters. Initially the focus will be on the design of
digital low-pass filters from analog low-pass filters.
Techniques for transforming these designs into more general
frequency selective filters will then be discussed.











2

EKT 353 Notes by Prof Dr. Farid Ghani

Analog Low-Pass Filter Prototypes

To design an IIR digital low-pass filter from an analog low-
pass filter, we must first know how to design an analog low-
pass filter. Historically, most analog filter approximation
methods were developed for the design of passive systems
having a gain less than or equal to 1. Therefore, a typical set
of specifications for these filters is as shown in Fig.1 with the
pass-band specifications having the form

1-op s |H
d
(jO)| s1
|H
a
(jO)|
O
0
1
O
p
O
s
Pass Band Stop Band
Transition
Band
1-
p

s

Figure 1. Specifications in terms of
p
and
s


Another convention that is commonly used is to describe the
pass-band and stop-band constraints in terms of the
parameters c and A as illustrated in the Figure 2. Notice that
the analog frequency is represented by O.
3

EKT 353 Notes by Prof Dr. Farid Ghani

|H
a
(jO)|
O
0
1
O
p
O
s
Pass Band Stop Band
Transition
Band
1/(1+
2
)
1/A

Figure 2. Specifications in terms of and A
The analog frequency is O.


Two auxiliary parameters of interest are the discrimination
factor


s
p
s
p
k factor y selectivit the and
A
d
O
O
=

=
(
(

1
1
1 ) 1 (
2
2 / 1
2
2
c
o
o


The three most commonly used analog low-pass filters are

1. BUTTERWORTH FILTER
2. CHEBSHEV FILTER
3. ELLIPTIC FILTER



4

EKT 353 Notes by Prof Dr. Farid Ghani

Butterworth Filter

A low-pass Butterworth filter is an all pole filter with a
squared magnitude response given by

| H
a
(jO) |
2
= 1 / [ 1+ (jO / jO
c
)
2N
]

The parameter N is the order of the filter (number of poles in
the system function), and O
c
is the 3-dB cutoff frequency.
The magnitude of the frequency response may also be
written as

| H
a
(jO) |
2
= 1 / [ 1+c
2
(jO / jOp)
2N
]

Where c = (O
p
/ O
c
)
N


The frequency response of the Butterworth filter decreases
monotonically with increasing O, and as the filter order
increases, the transition band becomes narrower. These
properties are illustrated in the Figure 3, which shows
| H
a
(jO) |
2
for Butterworth filters of orders N = 2,4, 8, and 12.


Figure 3 The magnitude of the frequency response for
Butterworth filters of orders N = 2,4, 8.
5

EKT 353 Notes by Prof Dr. Farid Ghani


Because
| H
a
(jO) |
2
= H
a
(s)H
a
(-s)|
s=jO


for the magnitude squared function, we may write

G
a
(s) = H
a
(s)H
a
(-s) = 1 / [1+(s/jO
c
)
2N
]

Therefore, the poles of G
a
(s) are located at 2N equally
spaced points around a circle of radius O
c
.

1/ 2N
k c c
(N 1 2k)
s ( 1) (j ) exp j , k=0,1,2, . . . 2N-1
2N
+ + t
= O = O
`
)
and are symmetrically located about the jO-axis. Figure 4
shows these pole positions for N = 6 and N = 7.


(a) Order N = 6. (b) Order N = 7.

Figure 4: The poles of Ha(s) for a Butterworth filler of order N
= 6 and N = 7.

The system function H
a
(s) is then formed from the N roots of
H
a
(s)H
a
(-s) that lie in the left-half s-plane. For a normalized
6

EKT 353 Notes by Prof Dr. Farid Ghani

Butterworth filter with O
c
= 1 , the system function has the
form

N N
N N
N
a
a s a s a s s A
s H
+ + + +
= =

1
1
. . . 1
1
) (
1
) (

Table 1 lists the coefficients of A
N
(s) for 1 s N s 8.

Table 1 The Coefficients in the System Function of a
Normalized Butterworth Filter (t
1
= 1) for Orders 1 <N <8

N a1 a2 a3 a4 a5 a6 a7 a8
1 1.0000
2 1.4142 1.0000
3 2.0000 2.0000 1.0000
4 2.6131 3.4142 2.6131 1.0000
5 3.2361 5.2361 5.2361 3.2361 1.0000
6 3.8637 7.4641 9.1416 7.4641 3.8673 1.0000
7 4.4940 10.0978 14.5918 14.5918 10.0978 4.4940 1.0000
8 5.1258 13.1371 21.8462 25.6884 21.8462 13.1372 5.1258 1.0000


Given O
p
, O
s
, o
p
, o
s
, the steps involved in designing a
Butterworth filter are as follows

1. Find the values for the selectivity factor k and the
discrimination factor d, from the filter specifications.

2. Determine the order of the filter required to meet the
specifications using the design formula

N > log d / log k

3. Set the 3dB cutoff frequency O
c
, to any value in the
range
7

EKT 353 Notes by Prof Dr. Farid Ghani



N
s s c
N
p p
2 / 1
2
2 / 1 2
] 1 [ ] 1 ) 1 [(


O s O s O o o


4. Synthesize the system function of the Butterworth filter
from the poles of

G
a
(s) = H
a
(s)H
a
(-s) = 1 / [1+(s/jO
c
)
2N
]

that lie in the left-half of the s-plane. Thus

H
a
(s) =
[

1
0
N
k
k
k
s s
s


Where
1 . . 1 0
2
) 2 1 (
exp =
)
`

+ +
O = N k
N
k N
j s
c k
t


Example

Design a lowpass Butterworth filter to meet the following
specifications:
f
p
= 6kHz f
s
= 10Khz o
p
= o
s
=0.1

First we calculate the selectivity and discrimination factors:

6 . 0 0487 . 0
1
1 ) 1 (
2 / 1
2
2
= =
O
O
= =
(
(

s
p
s
p
s
p
f
f
k d
o
o

Because N > log d / log k = 5.92

Thus the minimum filter order is 6.

8

EKT 353 Notes by Prof Dr. Farid Ghani

fp[(1-o
p
)-2
-1]
-1/2N
= 6770 and fs[o
s
-2
-1]
-1/2N
= 6819

Therefore the centre frequency f
c
may be any value in the
range

6670 s f
c
s 6819

The system function of the Butterworth filter may then be
found using Eqn. by first constructing a sixth order
normalized Butterworth filter from Table 1 and then replacing
s with s / O
c
so that the cut-off frequency is O
c
instead of
unity. The result of performing these operations is the
system function of the required filter as
1 8637 . 3 4641 . 7 1416 . 9 4641 . 7 8637 . 3
1
) (
2 3 4 5 6
+ + + + + +
=
s s s s s s
s H
a


Chebyshev Filters

Chebyshev filters are defined in terms of Chebyshev
polynomials:

>
s
=

1 ) cosh cosh(
1 ) cos cos(
) (
1
1
x x N
x x N
x T
N


These polynomials may be generated recursively as follows,

T
k+1
(x) = 2xT
k
(x) T
k-1
(x) k > 1

With T
0
(x) = 1 and T
1
(x) = x


9

EKT 353 Notes by Prof Dr. Farid Ghani

The following properties of the Chehyshev polynomials
follow from its defining equation above.

1. For x < 1 the polynomials are bounded by 1 in magnitude,
|T
N
(x)| s 1, and oscillate between 1. For | x | > 1, the
polynomials increase monotonically with x.

2. T
N
(1) = 1 for all N.

3. T
N
(0) = 1 for N even, and T
N
(0) = 0 for N odd.

4. All of the roots of TN (x) are in the interval -1 s x s1.

There are two types of Chebyshcv filters. A type I
Chebyshev filter is all-pole with an equiripple passband and
a monotonically decreasing stopband. The magnitude of the
frequency response is

|H
a
(jO)|
2
= 1 / [1+c
2
T
N
2
(O/O
p
)]

where N is the order of the filter, O
p
is the passband cutoff
frequency, and c is a parameter that controls the passband
ripple amplitude. Because T
N
2
(O/Op) varies between 0 and 1
for|O| < O
p
, |H
a
(jO)|
2
oscillates between 1 and 1/(1+c
2
). As
the order of the filter increases, the number of oscillations
(ripples) in the passband increases, and the transition width
between the passband and stopband becomes narrower.
Examples are given in Figure 5 for N=5 and N= 6.

10

EKT 353 Notes by Prof Dr. Farid Ghani


(a) Odd order (N = 5). (b) Even order (N = 6).

Figure 5 showing frequency response of
Chebyshev type I filter for orders N = 5 and N = 6.

The system function of a type I Chebyshev filter has the form


[

=
1
0
) 0 ( ) (
N
k
k
k
a a
s s
s
H s H

where H
a
(0)= (1 - c2)-1/2 if N is even, and H
a
(0) = 1 if N is
odd. Given the passband and stopband cutoff frequencies
O
p
and O
s
the passband and stopband ripples o
p
, and o
s
(or
the parameters c and A), the steps involved in designing a
type I Chebyshev filter are as follows:

1. Find the values for the selectivity factor k, and the
discrimination factor, d.

2. Determine the filter order using the formula
N > [cosh
-1
(1/d) / Cosh
-1
(1/k)]

3. Form the rational function
Ga(s) = Ha(s)Ha(-s) = 1 / [1+c
2
T
N
2
(s/jOp)]

11

EKT 353 Notes by Prof Dr. Farid Ghani

where c = [(1-op
)-2
-1]
1/2
, and construct the system
function H
a
(s) by taking the N poles of G
a
(s) that lie in
the left-half s-plane.


EXAMPLE 2 If we were to design a low-pass type I
Chehvshev filter to meet the specifications given in
Example1 where we found d = 0.0487 and k = 0., the
required filter order would be

N > cosh
-1
(1/d) /[cosh
-1
(1/k)] = 3.38 or N= 4

Therefore, with c = [(1-o
p
)
-2
-1]
1/2
= 0.4843 and T4(x) = 4x
3
-4x

2 2
2
] 1 ) / [( 7527 . 3 1
1
) (
O O +
= O
p
j H
a
where O
p
= 2t(6000)

A type II Chebyshev filter, unlike a type I filter, has a
monotonic passband and an equiripple stopband, and the
system function has both poles and zeros. The magnitude of
the frequency response is


2
a
2 2
s p s
1
H (j) =
1+ [TN( / )/TN( /)]


where N is the order of the filter, O
p
is the passband cutoff
frequency, O
s
is the stopband cutoff frequency, and c is the
parameter that controls the stopband ripple amplitude.
Again, as the order N is increased, the number of ripples
increases and the transition width becomes narrower.
Examples are given in Figure 6 for N = 5, 6.
12

EKT 353 Notes by Prof Dr. Farid Ghani


(a) Odd order (N = 5). (b) Even order
(N = 6).
Figure 6 showing frequency response of a
Chebyshev type II filter for orders N = 5 and N = 6.

The system function of type II Chebyshev filter has the form


[

=
1
0
) (
N
k
k
k
k
k
a
a s
b s
b
a
s H


The poles are located at
a
k
= O
s
2
/s
k

where s
k
for k = 0, 1, . . . N 1 are the poles of a type I
Chebyshev filter. The zeros b
k
lie on the jO-axis at the
frequencies for which TN(O
s
/ O) = 0. The procedure for
designing a type II Chebyshev filter is the same as for a type
I filter, except that

c = (os
-2
-1)
-1/2







13

EKT 353 Notes by Prof Dr. Farid Ghani

Elliptic Filter

An elliptic filter has a system function with both poles and
zeros. The magnitude of its frequency response is


) / ( 1
1
) (
2
2
2
p U
j Ha
N
O O +
= O
c


Where U
N
(O/O
p
) is a Jacobian elliptic function. The Jacobian
elliptic function U
N
(x) is a rational function of order N with the
following property:
U
N
(1/O) = 1/[U
N
(O)]

Elliptic filters have an equiripple passband and an equiripple
stopband. Because the ripples are distributed uniformly
across both bands unlike the Butterworth and Chebvshev
filters, which have a monotonically decreasing passband and
/or stopband), these filters are optimum in the sense of
having the smallest transition width for a given filter order,
cutoff frequency O
p
, and passband and stopband ripples.
The frequency response for a 4th-order elliptic filter is as
shown in Figure 7.

Figure 7 showing the magnitude of the frequency response
of a sixth-order elliptic filter.
14

EKT 353 Notes by Prof Dr. Farid Ghani


The design of elliptic filters is more difficult than the
Butterworth and Chebyshev filters, because their design
relies on the use of tables or series expansions. However,
the filter order necessary to meet a given set of
specifications may be estimated using the formula

N > log (16/d2) / log(1/q)

Where d is the discrimination factor, and

q = q
0
+2q
0
5
+ 15q
0
9
+150q
0
13


Where q
0
= [11 (1 k
2
)
1/4
] / [21 + (1-k
2
)
1/4
]

k being the selectivity factor.



















15

EKT 353 Notes by Prof Dr. Farid Ghani

Design of IIR Filters from Analog Filters

The design of a digital filter from an analog prototype
requires that we transform h
a
(t) to h(n) or H
a
(s) to H(z). A
mapping from the s-plane to the z-plane may be written as

H(z) = H
a
(s)|
s=m(z)


where s = m(z) is the mapping function.

In order for this transformation to produce an acceptable
digital filter, the mapping m(z) should have the following
properties:

1. The mapping from the jO to the unit circle, z = 1, should
be one to one and onto the unit circle in order to
preserve the frequency response characteristics of the
analog filter.

2. Points in the left half s-plane should map to points
inside the unit circle to preserve the stability of the
analog filter.

3. The mapping m(z) should be a rational function of z so
that a rational H
a
(s) is mapped to a rational H(z).

The Bilinear Transformation

The bilinear transformation is a mapping from the s-plane to
the z-plane defined by


1
1
s
2 1 z
s
T 1 z

=
+

16

EKT 353 Notes by Prof Dr. Farid Ghani


Given an analog filter with a system function H
a
(s), the digital
filter is designed as follows:


( )
1
1
s
2 1 z
a
s
T
1 z
H(z) H s

=
+
=
(1)

The bilinear transformation is a rational function that maps
the left-half s-plane inside the unit circle and maps the jO-
axis in a one-to-one manner onto the unit circle. However,
the relationship between the jO -axis and the unit circle is
highly nonlinear and is given by the frequency warping
function


-1
s
T
2tan
2
| |
=
|
\ .
(2)

Notice that represents the frequency in the digital domain.

As a result of this warping, the bilinear transformation will
only preserve the magnitude response of analog filters that
have an ideal response that is piecewise constant.
Therefore, the bilinear transformation is generally only used
in the design of frequency selective filters.

The parameter T
s
in the bilinear transformation is normally
included for historical reasons. However, it does not enter
into the design process because it only scales the jO-axis in
the frequency warping function, and this scaling may he
done in the specification of the analog filter. Therefore, T
s
may be set to any value to simplify the design procedure.
The steps involved in the design of a digital low-pass filter
with a pass-band cutoff frequency e
p
stop-band cutoff
17

EKT 353 Notes by Prof Dr. Farid Ghani

frequency e
s
pass-band ripple o
p
and stop-band ripple o
s
are
as follows:

1. Prewarp the pass-band and stop-band cutoff
frequencies of the digital filter e
p
and e
s
using the
inverse of Equation 2 to determine the pass-band and
stop-band cutoff frequencies of the analog low-pass
filter. The pre-warping function is
O = (2/T
s
)tan (e/2)

2. Design in analog low-pass filter with the cutoff
frequencies found in step 1 and a pass-band and stop-
band ripples op and o
s
, respectively.

3. Apply the bilinear transformation to the filter designed in
step 2.

EXAMPLE
Design a first order digital low pass filter with a 3-dB cutoff
frequency of
c
=0.25t by applying the bilinear
transformation to the analog Butterworth filter

H
a
(s) = [1 / 1+ (s/O
c
)]

Because the three dB cutoff frequency of the Butterworth
filter is O
c
, for a cut-off frequency
c
= 0.25t in the digital
filter, we must have

s s
c
T T
828 . 0
2
25 . 0
tan
2
=
|
.
|

\
|
= O
t


Therefore, the system function for the analog filter is
H
a
(s) = 1 / [1+s(T
s
/0.828)]

Applying the bilinear transformation to the analog filter gives
18

EKT 353 Notes by Prof Dr. Farid Ghani


1
1
1 1
1
1 2
4159 . 0 1
1
292 . 0
)] 1 / ) 1 )[( 828 . 0 / 2 ( 1
1
) ( ) (
1
1

+
=
+ +
= =

z
z
z z
s H z H
z
z
T
s
a
s

Note that the parameter T
s
does not enter the design.

Frequency Transformations
The preceding section considered the design of digital low-
pass filters from analog low-pass filters. There are two
approaches that may be used to design other types of
frequency selective filters, such as high-pass, band-pass, or
band-stop filters. The first is to design an analog low-pass
filter and then apply a frequency transformation to map the
analog filter into the desired frequency selective prototype.
This analog prototype is then mapped to a digital filter using
a suitable s-plane to z-plane mapping. Following Table
provides a list of some analog-to-analog transformation


Transformation

Mapping
New Cut-off
Frequencies

Low-pass
p
p
s s
'
O

O


O
p



High-pass
p p
'
s
s
O O



O
p


Band-pass
u l
p
2
l u
s( )
s
s
O O
O
+ OO


O
l
, O
u


Band-stop
u l
p
2
l u
s( )
s
s
O O
O
+ OO


O
l
, O
u


The Transformation of an Analog Low-pass filter with a 3-dB
cut-off frequency O
p
to other frequency selective filters

You might also like