Design of Digital Filters IIR, Butterworth Filter

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

Chapter 4

DESIGN OF IIR FILTERS

4.1 INTRODUCTION

Let our goal be to design a lowpass filter. The passband edge frequency of the filter is 1 kHz
and the stopband edge frequency is 3 kHz. Moreover, the ripple allowed in the passband is
1.938 dB and minimum attenuation in the stopband is 13.98 dB.

We can of course design an analog filter for this purpose. However the advantages of digital
filters over analog filters are many – one of them being the flexibility. For example, if you
want to change the passband and stopband edges of the filter, just change one or two
statements in your program (when implemented with a general purpose digital signal
processor) in contrast to changing the components (which have some tolerances as well) in
analog filters. Figs. 1 and 2 show the block diagrams of the processing of the input signal
with analog and digital filters, respectively.

Output
Input signal Analog Lowpass
signal
(analog) Filter
(analog)

Fig. 1

Input Output
C/D Digital D/C signal
signal
Lowpass Filter (analog)
(analog)

T T
Fig. 2

If we want to design a digital filter to perform the desired task, we need two additional blocks
– Continuous-to-discrete time converter (C/D) and Discrete-to-Continuous time converter
(D/C), as shown in fig. 2. Also we need to obtain the passband and stopband edges for the
digital filter.
The first parameter to be considered, if we go for design of the digital filter for the above
task, is the sampling frequency (= 1/T). Once we choose the sampling frequency, mapping of
the passband and stopband edges is very straightforward. We know the relation between the
Fourier transform Xc(jΩ) of a continuous-time signal xc(t) and the Fourier transform X(ejω) of
the signal x[n] that is obtained by sampling xc(t), assuming that there is no aliasing, is given
by

1   2k 
X (e j  )  X c  j(T  T  (1)
T k    

Equation (1) provides us the desired relation between the continuous-time frequency Ω and
the discrete-time frequency ω:

ω = ΩT (2)

Now we can solve problem of mapping of the passband and stopband edges, provided we
choose the sampling frequency. There is no restriction on the sampling frequency except that
you must sample at higher than the Nyquist rate. Since the stopband edge is given as 3 kHz,
we can take the analog signal to be bandlimited in 5 kHz and accordingly choose sampling
frequency = 2× 5 = 10 kHz. The passband and stopband edges of the digital filter are found
out as

ωp = ΩpT = 2πfp/fT = 2π(1000)/10000 = 0.2π (3)

ωs = ΩsT = 2πfs/fT = 2π(3000)/10000 = 0.6π (4)

Now we have to convert the magnitude responses in dB to the absolute magnitude responses
at the passband and stopband edges (taking the maximum value of the magnitude response as
unity).

In this problem, 20 log10 H (e j p ) = − 1.938

and

20 log10 H ( e j s ) = − 13.98

Accordingly, H (e j p ) = 0.8 and H ( e j s ) = 0.2

The digital filter specifications are, therefore, as given below

0.8 ≤ H (e j ) ≤ 1 for 0 ≤ ω ≤ 0.2π

H (e j ) ≤ 0.2 for 0.6π ≤ ω ≤ π

(Note that the maximum value of the discrete-time frequency is π, because the discrete-time
Fourier transform is periodic in ω with a period = 2π and magnitude response of a real filter is
symmetric. Therefore, we consider only the region 0 ≤ ω ≤ π instead of the complete period –
π to π)

The most common approach to design an IIR digital filter is to design a prototype
continuous-time filter and then apply a transformation to the system function Hc(s) of the
continuous-time filter to obtain the system function H(z) of the discrete-time filter. At this
point, we are left with a number of choices for the prototype continuous-time filter and the
transformation method. We shall discuss only Butterworth and Chebyshev- type I filters as
the prototype (though there are other filters e.g. Bessel and Elliptic filters that give filters of
lower order for a given set of specifications, their design is more complex). Among the
transformation methods, only Bilinear transformation and Impulse Invariance method will be
discussed. We can choose the transformation method and the prototype independently, i.e. we
can design the digital filter in four different ways for the set of prototypes and
transformations mentioned here.

4.2 CHOICE I : CONTINUOUS-TIME PROTOTYPE = BUTTERWORTH,


TRANSFORMATION METHOD = BILINEAR TRANSFORMATION

As it has already been mentioned that the system function of the discrete-time filter is
obtained by applying a transformation to the system function of the continuous-time
prototype filter, the specifications for the prototype are to be obtained from the digital filter
specifications. The transformation of the digital filter specifications to the prototype
specifications depend on the transformation we use for obtaining H(z) from Hc(s).

4.2.1 Obtaining specifications of the Prototype

The transformation specified here is Bilinear transformation. Therefore, we have to first see
how it converts H(s) to H(z) before we attempt to obtain the specifications of the continuous-
time prototype.

The Bilinear transformation is given by

2 z 1
s (5)
T z 1

The inverse transformation is

1  sT / 2
z (6)
1  sT / 2

It can be shown that the points lying on the left half of s-plane get mapped to the points inside
the unit circle while those lying on the right half of s-plane get mapped to the points outside
the unit circle. Moreover the points on the imaginary axis (jΩ-axis) in the s-plane get mapped
onto the unit circle in the z-plane (see problem 8 in Assignment).

Let s = jΩ be mapped to z = ejω , through Bilinear transformation. Hence, using (5),


2 e j  1 2 e j / 2  1 2 
jΩ = j
 j / 2
 ( j tan )
T e 1 T e 1 T 2


   tan (7)
2

(7) gives the desired relation between the continuous-time frequency Ω and the discrete-time
frequency ω.

The passband edge frequency Ωp and the stopband edge frequency Ωs, for the given
problem, are found out as follows

2 0.2 0.65
p  tan 
T 2 T

and 2 0.6 2.753


s  tan 
T 2 T

The specifications for the prototype can now be given as

0.8  H ( j)  1 for 0 ≤ Ω ≤ 0.65/T

H ( j)  0.2 for 2.753/T ≤ Ω < ∞

4.2.2 Finding order of the Butterworth filter

Since the prototype is a Butterworth filter, we start with the magnitude response of a
Butterworth filter

2 1
H ( j )  2N
(8)
  
1   
 c 

where N is the order and Ωc is the cut-off frequency (3 dB) of the Butterworth filter.

Using the specifications of the prototype (as obtained above) and (8), we get

1
0.64  2N
(9)
 0.65 / T 
1   
 c 

and
1
2N
 0.04 (10)
 2.753 / T 
1   
  c 

Using equality instead of ≤ in (9) and (10) i.e. passband and stopband specifications are

just met by the filter to be designed, we get

1
2N
 0.64 (9a )
 0.65 / T 
1   
 c 

1
2N
 0.04 (10a)
 2.753 / T 
1   
 c 

Solving (9a) and (10a), the value of N is obtained as 1.3.

But the order of the Butterworth filter must be an integer. We, therefore, take the next integer
value for N, i.e. N = 2. (why don’t we take N = 1?)

Because here N = 1.3 is not used, obviously both (9a) and (10a) will not be satisfied. In fact,
this is exactly what happens. If one attempts to just satisfy the specification for the passband
i.e. if (9a) is satisfied, then one ends up with overmeeting the specifications in the stopband
(this is, of course, more than what we want!). We are, therefore, left with the choice to use
(9a) or (10a) for obtaining Ωc, with N = 2.

For the present, we solve the problem using (9a) to obtain Ωc. (A different result is obtained
if Ωc is obtained with (10a) and both the solutions are correct - see problem 1 in Assignment )

With N = 2, (9a) gives Ωc = 0.7506/T.

Now that the order of the Butterworth filter and the cut-off frequency are known, we can find
out system function H(s) of the filter.

4.2.3 Finding Pole locations

The first step towards finding out the system function is obtaining the poles of H(s). For a
Butterworth filter of order N,
1
H ( s) H ( s)  2N
(11)
 s 
1   
 j  c 

Note that by putting s = jΩ in (11), we get (8). (We take the filter to be real and therefore
H ( j  )  H * ( j ) )

Now H(s) H(−s) has 2N poles given by


2N
 s 
   1
 j  c 

 s  ( j c ) 2 N  e j ( c e j / 2 ) 2 N  e j ( c e j / 2 ) 2 N e j 2 m
2N
for m  0, 1, ...., 2 N  1

The m-th pole is located at

  1  2m  N 
s m   c exp  j  
  2N 
(12)

As it is clear from (12), the m-th pole lies on a circle of radius Ωc and at an angle (with
 1  2m  N 
respect to real axis) equal to    . The pole locations of H(s) H(−s) for N = 2 are
 2N 
shown in fig. 3. Since we aim to obtain a stable filter, the poles lying in the left half of s-
plane correspond to H(s) and those lying on the right half of s-plane are poles of H(−s).
Therefore, the poles of the prototype filter are given by
3 3
j j
4 4
s1   c e and s 2   c e

Fig. 3. Pole locations of H(s)H(−s) for N = 2


4.2.4 System function of the Prototype filter

The system function of the prototype is

K
H ( s)  3 3
(13)
j j
4 4
(s   c e )(s   c e )

where K is a constant and has to be found out.

From the specifications of the prototype, we see that │H(jΩ) │has maximum value equal to 1 and
since Butterworth filter has a monotonic magnitude response, this maximum value occurs at Ω = 0.
Hence H(j0) = 1. Putting s = j0 = 0 in (13) and using the fact that H(0) = 1, we get

2
2  0.7506  0.5633
K  c    (14)
 T  T2

We are now on the verge of getting the desired filter.

From (13) and (14),

0.5633 0.5633
H ( s)  T2  T2 (15)
3 3
0.7506 j 4 0.7506  j 4 2 1.0613 0.5633
(s  e )(s  e ) s  s
T T T T2

4.2.5 Obtaining System function of the Digital Filter

We are just one step before we get the final answer. Make the substitution for ‘s’ as given in
(5), for the Bilinear transformation and get H(z) as

0.0843(1  z 1 ) 2
H ( z)  (16)
1  1.028 z 1  0.3651z  2

Frequency response of the designed filter is shown in fig. 4.


10

-10

-20
Magnitude response(dB)

-30

-40

-50

-60

-70

-80

-90
0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1
Normalized frequency, w/pi

Fig. 4 Magnitude response of the designed filter with choice I

(Prototype = Butterworth, Transformation = Bilinear)

It is observed from fig. 4 that the magnitude response drops by nearly 2 dB in the passband
while the attenuation in stopband is more than 20 dB. (The magnitude response at passband
and stopband edges, i.e. at ω = 0.2π and ω = 0.6π can be obtained more accurately by plotting
the response of the designed filter, as given by (16), with MATLAB and then zooming
around ω = 0.2π and 0.6π). Therefore, the designed filter just meets the given specifications
in the passband while it exceeds the specifications in the stopband. This is expected since we
attempted the solution, starting from (9a), not (10a), i.e. considering the case when the
passband specifications are just met by the designed filter.

You might also like