AB - IIR Filter Design2

You might also like

Download as ppt, pdf, or txt
Download as ppt, pdf, or txt
You are on page 1of 44

Chapter 4

FIR and IIR Filters


4.1. IIR Filter Design

MeU, FET, ECE:


Abinet T.

1
Introduction
 IIR filter have infinite-duration impulse responses,
hence they can be matched to analog filters, all of
which generally have infinitely long impulse
responses.
 The basic technique of IIR filter design transforms
well-known analog filters into digital filters using
complex-valued mappings.
 The advantage of this technique lies in the fact that
both analog filter design (AFD) tables and the
mappings are available extensively in the literature.
2
Introduction
 The basic technique is called the A/D filter
transformation.
 However, the AFD tables are available only for
lowpass filters. We also want design other frequency-
selective filters (highpass, bandpass, bandstop, etc.)
 To do this, we need to apply frequency-band
transformations to lowpass filters. These
transformations are also complex-valued mappings,
and they are also available in the literature.
3
Two IIR Filters Design
Approaches
Apply Freq. band Apply filter
Design analog Desired
transformation transformation
lowpass filter IIR filter
s-->s s-->z

Approach 1, used in Matlab

Apply filter Apply Freq. band


Design analog Desired
transformation transformation
lowpass filter IIR filter
s-->z z-->z

Approach 2

4
IIR Filter Design Steps based on
Approach 1
 Design analog lowpass filter
 Study and apply frequency-band
transformations to obtain other analog filters
(HPF, BPF & BSF) from analog lowpass filter
 Study and apply filter transformations to
obtain digital filter

5
IIR Filter Design Steps based on
Approach 2
 Design analog lowpass filter
 Study and apply filter transformations to
obtain digital lowpass filter
 Study and apply frequency-band
transformations to obtain other digital filters
(HPF, BPF & BSF) from digital lowpass filter

6
Characteristics of IIR Filters
 We have no control over the phase
characteristics of the IIR filter.
 Hence IIR filter designs will be treated as
magnitude-only designs.

7
Main Content of This Chapter
 Analog filter specifications and the properties of the
magnitude-squared response used in specifying
analog filters.
 Characteristics of three widely used analog filters
 Butterworth, Chebyshev, and Elliptic filter
 Transformation to convert these prototype analog
filters into different frequency-selective digital filter

8
Typical set of specifications for
analog low pass filters:
 The low pass filter specifications on the magnitude-response in
terms of the parameters are given by:

9
…Cont’d: Specifications for
analog low pass filters in terms:

10
2 1
| H a ( j ) |  at    p
1  2

2 1
| H a ( j ) |  2 at    s
A

11
Definitions of terms on the
specification of analog low pass filters:

12
The relations among epsilon, A, Rp, As,
deltap and deltas

1 R p / 10
R p [ dB]  10 log10    10 1
1  2

1 As / 20
As [ dB]  10 log10  A  10
A2
or ,
R p [ dB]  20 log10 (1   p )
As [ dB]  20 log10  s

13
Properties of |Ha(jOmega)|2
Analog filter specifications, which are given in terms of the
magnitude-squared response, contain no phase information. Now to
evaluate the s-domain system function Ha(s), consider
H a ( j  )  H a ( s ) | s  j
| H a ( j) |2  H a ( j) H a* ( j)  H a ( j) H a ( j)  H a ( s ) H a ( s ) |s  j
or , H a ( s ) H a ( s ) | H a ( j) |2 |  s / j
Therefore the poles and zeros of the magnitude-squared function are
distributed in a mirror-image symmetry with respect to the jOmega axis.
Also for real filters, poles and zeros occur in complex conjugate pairs (or
mirror-image symmetry with respect to the real axis).
From this pattern we can construct Ha(s), which is the system function of
14
our analog filter.
Properties of |Ha(jOmega)|2
 We want Ha(s) to represents a causal and stable filter.
Then all poles of Ha(s) must lie within the left half-
plane. Thus we assign all left-half poles of Ha(s)Ha(-
s) to Ha(s).
 We will choose the zeros of Ha(s)Ha(-s) lying inside
or on the jOmega axis as the zeros of Ha(s).
 The resulting filter is then called a minimum-phase
filter.

15
Characteristics of Prototype
Analog Filters
 IIR filter design techniques rely on existing analog
filter filters to obtain digital filters. We designate
these analog filters as prototype filters.
 Three analog prototypes are widely used in practice
 Butterworth lowpass
 Chebyshev lowpass (Type I and II)
 Elliptic lowpass

16
Butterworth Lowpass Filter
 This filter is characterized by the property that its
magnitude response is flat in both passband and
stopband.
2 1
The magnitude-squared
| H a ( j ) |  2N

response of an N-order 1   
lowpass filter  c 
Omega_c is the cutoff frequency in rad/sec.
Plot of the magnitude-squared response is shown
below:

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

1.2

1
N=100

0.8 N=2
N=1 N=200

0.6

0.4

0.2

0
0 10 20 30 40 50 60 70 80 90 100

18
Properties of Butterworth Filter
 Magnitude Response
 |Ha(0)|2 =1, |Ha(jΩc) |2 =0.5, for all N (3dB attenuation at Ωc)
 |Ha(jΩ)|2 monotonically decrease for Ω
 Approaches to ideal filter when N→∞
To determine the system function Ha(s)
1 ( j c ) 2 N ( j c ) 2 N
H a ( s) H a ( s)  2N
 2N 2N
 2N
 s  s  ( j c )
1     ( s  pk )
 j c 
k 1

1 j 2N ( 2 k  N 1)
pk  (1) ( j c )   c e
2N
, k  0,1,,2 N  1
19
Poles of |Ha(jΩ)|2 Ω=s/j =Ha(s) Ha(-s)
 Equally distributed on a circle of radius Ωc with angular
spacing of pi/N radians
 For N odd, pk= Ωcej2pik/N
 For N even, pk= Ωcej(pi/2N+kpi/N)
 Symmetry respect to the imaginary axis
 A pole never falls on the imaginary axis, and falls on the real
axis only if N is odd
 A stable and causal filter Ha(s) can now be specified by
selecting poles in the left half-plane c
N
H a ( s)  N
 ( s  pk )
LHP poles

20
Design Equations for Analog
Lowpass IIR Butterworth Filter
The analog lowpass filter is specified by the parameters, Omega_p.
R_p,Omega_s, and A_s. Therefore the essence of the design in the
case of Butterworth filter is to obtain the order N and the cutoff
frequency Omega_c.
1 at    p ,  10 log10 | H a ( j) |2  R p
| H a ( j ) | 2  2N
 at    s ,  10 log10 | H a ( j) |2  As
1   
 c 
 log10 [(10 R p /10  1) /(10 As /10  1)] 
N  
 2 log10 ( p /  s ) 
p s
c  , or  c 
R / 10
2N
(10 p  1) 2N
(10 As /10  1)
21
Analog IIR Butterworth Filter
Design Examples
1. Design a first order ideal lowpass analog IIR
Butterworth Filter with a cutoff frequency of
500Hz.
2. Design a second order ideal lowpass analog IIR
Butterworth Filter with a cutoff frequency of
1kHz.

22
Chebyshev Lowpass Filter
 Chebyshev-I filters
 Have equiripple response in the passband
 Chebyshev-II filters
 Have equiripple response in stopband
 Butterworth filters
 Have monotonic response in both bands
 We note that by choosing a filter that has an equripple rather
than a monotonic behavior, we can obtain a low-order filter.
 Therefore Chebyshev filters provide lower order than
Buttworth filters for the same specifications.

23
The magnitude-squared response
of Chebyshev-I filter
2 1
| H a ( j ) |  N is the order of the filter,
2 
2
1   T 
N
 Epsilon is the passband ripple
 c  factor
cos( N cos 1 ( x)), 0  x  1 Nth-order Chebyshev polynomial
TN ( x)   1
cosh(cosh ( x)), 1  x  

(a) For 0<x<1, TN(x) oscillates between –1 and 1, and


(b) For 1<x<infinity, TN(x) increases monotonically to infinity
Figure on P.314 (two possible shapes)

24
Observations
At x=0 (or Ω=0); |Ha(j0)|2 = 1; for N odd;
= 1/(1+epson^2); for N even
At x=1 (or Ω= Ωc); |Ha(j1)|2= 1/(1+epson^2) for all N.
For 0<=x<=1 (or 0<= Ω<= Ωc)
|Ha(jx)|2 oscillates between 1 and 1/(1+epson^2)
For x>1 (or Ω > Ωc), |Ha(jx)|2 decreases monotonically to 0 .
At x= Ωr, |Ha(jx)|2 = 1/(A^2).

25
Causal and stable Ha(s)
To determine a causal and stable Ha(s), we must find the poles of
Ha(s)Ha(-s) and select the left half-plane poles for Ha(s).
The poles of Ha(s)Ha(-s) are obtained by finding the roots of
 s 
1   T 
2 2
N

 j c 

It can be shown that if pk   k  j k , k  0,1, , N  1


are the (left half-plane) roots of the above polynomial,
then
26
pk   k  j k , k  0,1,  , N  1
  (2k  1) 
 k  (a c ) cos  
2 2 N 
  ( 2k  1) 
 k  (b c ) sin  
2 2 N 

a
2

1 N

  1/  , b 
N

2

1 N

  N 1/  ,

1 1
   1 2
 
27
The poles of Ha(s)Ha(-s)

The poles fall on an ellipse


with major axis b Ωc and
minor axis a Ωc .
Now the system function is

K
H a (s) 
 ( s  pk )
k

Left half-plane
K is a normalizing factor
28
Design Equations for Analog
Lowpass IIR Chebyshev-I filter
Given Ωp, Ωs, Rp and As, three parameters are required to
determine a Chebyshev-I filter

  100.1Rp  1, and A  10 As / 20
s
 c   p , and  r 
c
g  ( A2  1) /  2


 log g  g 2  1  
 
10
N  
 log10  r   2r  1 

29
Chebyshev-II filter
Related to the Chebyshev-I filter through a simple
transformation.
It has a monotone passband and an equiripple stopband,
which implies that this filter has both poles and zeros in
the s-plane.
Therefore the group delay characteristics are better (and
the phase response more linear) in the passband than the
Chebyshev-I prototype.
2 1
| H a ( j ) | 
1   T  c /  
2 2 1
N
30
Elliptic Lowpass Filters
These filters exhibit equiripple behavior in the passband as
well as the stopband. They are similar in magnitude
response characteristics to the FIR equiripple filters.
Therefore elliptic filters are optimum filters in that they
achieve the minimum order N for the given specifications
These filters, for obvious reasons, are very difficult to
analyze and therefore, to design.
It is not possible to design them using simple tools, and
often programs or tables are needed to design them.

31
The magnitude-squared response
2 1 N: the order; epsilon: passbang
| H a ( j ) | 
2 
2 ripple; UN() is the Nth order
1   U 
N 
 c  Jacobian elliptic function
Typical responses for odd and even N are shown on P.323

Computation of filter order N:

 
K (k ) K 1  k12  p   /2 d
K (k ) K  1  k 
N ,k  , k1  , K ( x )  0
1
2  s
2
A 1 1  x 2 sin 2 

32
Analog-to-digital Filter
Transformations
 After discussing different approaches to the design of analog
filters, we are now ready to transform them into digital filters.
 These transformations are derived by preserving different
aspects of analog and digital filters.
 Impulse invariance transformation
 Preserve the shape of the impulse response from A to D filter
 Finite difference approximation technique
 Convert a differential eq. representation into a corresponding difference eq.
 Step invariance
 Preserve the shape of the step response
 Bilinear transformation
 Preserve the system function representation from A to D domain

33
Bilinear Transformation
 This mapping is the best transformation method.
2 1  z 1 1  sT / 2
s 1
z
T 1 z 1  sT / 2
T T
sz  s  z  1  0 Linear fractional transformation
2 2

The complex plane mapping is shown in Figure


below

34
Complex-plane mapping in
bilinear transformation

35
Observations
 Sigma < 0 |z| < 1, Sigma = 0 |z| = 1, Sigma > 0 |z| > 1
 The entire left half-plane maps into the inside of the
UC. This is a stable transformation.
 The imaginary axis maps onto the UC in a one-to-one
fashion. Hence there is no aliasing in the frequency
domain.
• Relation of ω to Ω is nonlinear
ω= 2tan-1(ΩT/2)↔ Ω=2tan(ω/2)/T;

36
Given the digital filter specifications wp,ws,Rp and As, we
want to determine H(z). The design steps in this procedure are
the following:

1. Choose a value for T. this is arbitrary, and we may set T = 1.


2. Prewarp the cutoff freq.s wp and ws; that is calculate Ωp and
Ωs using (8.28) :
Ωp=2/T*tan(wp/2), Ωs=2/T*tan(ws/2)
3. Design an analog filter Ha(s) to meet the specifications.
4. Finally set
 2 1  z 1 
H ( z )  H a  
1 
 T 1 z 
And simplify to obtain H(z) as a rational function in z-1

37
Advantage of the bilinear
Transformation
 It is a stable design
 There is no aliasing
 There is no restriction on the type of filter that
can be transformed.

38
Lowpass Digital IIR Filters
Design Using Matlab
 Matlab Function:
 [b, a] = butter(N, wn)
 [b, a] = cheby1(N, Rp, wn)
 [b, a] = cheby2(N, As, wn)
 [b, a] = ellip(N, Rp, As, wn)
 Buttord, cheb1ord, cheb2ord, ellipord can provide filter
order N and filter cutoff frequency wn, given the
specification.

39
Lowpass filter design
 Digital filter specification
 Analog prototype specifications
 Analog prototype order calculation,Omega_c,wn
 Digital Filter design (four types)
 dir2cas

40
Digital filter design examples
For the same specifications, do the following:
 Ex8.21: Butterworth LP filter design;
w p  0.2 , R p  1dB
 Ex8.22: Chebyshev-I LP filter design;
ws  0.3 , As  15dB
 Ex8.23: Chebyshev-II LP filter design;

 Ex8.24: Elliptic LP filter design;

Prototype Order N Stopband Att.


Butterworth 6 15
Chebyshev-I 4 25
Elliptic 3 27
41
Frequency-band Transformation
 Design other kinds of filters:
 High-pass filters
 Band-pass filters
 Band-stop filters
 Using the results of Low-pass filter and
Frequency Band Transformation

42
Matlab Implementation
 Function [b, a] = BUTTER(N, wn,’high’)
 Designs an Nth-order highpass filter with digital 3dB cutoff frequency wn in
unit of pi
 Function [b,a] = BUTTER(N,wn,’pass’)
 Designs an order 2N bandpass filter if wn is a two-element vectro wn=[w1,w2],
with 3dB bandpass w1<w<w2 in unit of pi.
 Function [b,a] = BUTTER(N,wn,’stop’)
 Designs an order 2N bandstop filter if wn=[w1,w2] with 3dB stopband
w1<w<w2 in unit of pi.
 Function [N,wn] = Buttord(wp, ws, Rp, As)
 Similar discussions apply for cheby1, cheby2, and ellip functions with
appropriate modifications.

43
Comparison of FIR vs. IIR Filters
 In the case of FIR filters these optimal filters are the equiripple
filters designed via the parks-McClellan algorithm, while in
the case of IIR filters these are the elliptic filters.
 For FIR filter the standard realization is the linear-phase direct
form, while for elliptic filters cascade forms are widely used.
 Comparisons: Multiplications per output sample
 For most applications IIR elliptic filter are desirable from the
computational point of view. If we take into account the phase
equalizers, then FIR filter designs look good because of their
exact linear-phase characteristics.

44

You might also like