Digital Signal Processing
Discussion #16IIR Filter Design
Tarun ChoubisaDept of ETC,
KIIT University
12 April 2011 1
Introduction
Analog filter design theory was developed in the mid-1900s.
As digital signal processing developed, it seemed reasonable to leverage existing knowledge in analog filter design.
Our strategy will be to design the filter in the analog domain, and then transform the filter to the digital domain.
Feb.2008 3
Introduction
IIR filter design methods
Continuous frequency
band transformation
Impulse
Invariance
method
Bilinear
transformation
method
Step invariance
method
IIR filter
Normalized analog
lowpass filter
Feb.2008 4
IIR Filter Design by Impulse invariance method
The most straightforward of these is the impulse invariance transformation
Let be the impulse response corresponding to , and define the continuous to discrete time transformation by setting
We sample the continuous time impulse response to produce the discrete time filter
( )ch t
( )cH s
( ) ( )ch n h nT
Feb.2008 5
IIR Filter Design by Impulse invariance method
is expanded a partial fraction expansion to produce
We have assumed that there are no multiple poles
And thus
( )cH s
1
( )N
kc
k k
AH s
s s
1
( ) ( )kN
s t
c k
k
h t A e u t
1
( ) ( )kN
s nT
k
k
h n A e u n
11
( )1 k
Nk
s Tk
AH z
e z
Feb.2008 DISP Lab 6
IIR Filter Design by Impulse invariance method
Example:
Expanding in a partial fraction
expansion, it produce
The impulse invariant transformation
yields a discrete time design with the
system function
2 2( )
( )c
s aH s
s a b
1/ 2 1/ 2( )cH s
s a jb s a jb
( ) 1 ( ) 1
1/ 2 1/ 2( )
1 1a jb T a jb TH z
e z e z
7 IIR filter that has poles placed on the unit circle at e j 0
Impulse Response of a Filter
0
ej
e-j
1
0 1
1 2
1 2
( )1
a a ZH z
b Z b Z
8Filter Coefficients
Output frequency 0 Cosine wave: h(n) = cos( 0T) u(n)
a0 = 1, a1 = cos( 0T)
b1 = 2cos( 0T), b2 = -1
Sine wave: h(n) = sin( 0T) u(n)
a0 = 0, a1 = sin( 0T)
b_1 = 2cos( 0T), b2 = -1
9Effect of Coefficient Quantization
Implemented as recursive filter on a DSP
Accuracy of output frequency 0dependent on the accuracy of filter coefficients
depends on accuracy of cos( 0T)
difficult to implement in finite precision arithmetic (quantization error)
10
Effect of Coefficient Quantization
Uniform quantization of filter coefficients
Possible to obtain only certain output frequencies (pole locations)
Pole locations more closely spaced around /2 radians than in the regions corresponding
to 0 and radians
Re-0.5-1.0
Z plane
Im
0 rad.rad.0 0.5 1.0
Direct Form
Implementation (3 bits
+ sign bit)
Coefficient quantization can change the pole locations and hence the output frequency
An originally stable IIR filter with precession coefficients may become unstable after implementation due to unavoidable
quantization error in its coefficients. !!!
1 2
1( )
1 1.845 0.850586H z
z z
1 2
1( )
1 1.85 0.85H z
z z
Stable IIR filter
After quantization unstable IIR filter
Effect of Coefficient Quantization
%Demonistration for the effect of quantization of filter coefficientsL=100; %L is the length of the impulse response h[n]num=[1];den=[1 -1.845 0.850586];den2=[1 -1.85 0.85][h1 t]=impz(num,den,L);subplot(2,1,1);stem(h1);ylabel('Amplitude');xlabel('Time index n');[h2 t]=impz(num,den2,L);subplot(2,1,2);stem(h2);ylabel('Amplitude');xlabel('Time index n');
This program draws the previous impulse
response that shows the effect of quantization on
the system stability.
Effect of Coefficient Quantization
Feb.2008 13
IIR Filter Design by Impulse invariance method
The impulse invariance transformation does map the -axis and the left-half s plane into the unit circle and its interior, respectively
j
Re(Z)
Im(Z)
1
S domain Z domain
sTe
j
Complex-plane mapping in impulse invariance transformation
If Ha is band limited, there will be no aliasing, and if it is not band limited there will be aliasing as it was seen
before.
Properties:
Sigma = Re(s): Sigma < 0, maps into |z|0, maps into |Z|>1 (outside of the UC)
Many s to one z mapping: many-to-one mapping Every semi-infinite left strip (so the whole left plane) maps
to inside of unit circle
Causality and Stability are the same without changing;
Aliasing occur if filter not exactly band-limited
Given the digital lowpass filter specifications wp,ws,Rp and As, we want to determine H(z) by first designing an equivalent analog filter and then mapping it into the desired digital filter. Design Procedure:
1. Choose T and determine the analog frequencies:
p=wp/T, s=ws/T
2. Design an analog filter Ha(s) using the specifications with one of the three
prototypes .
3. Using partial fraction expansion, expand Ha(s) into
4. Now transform analog poles {pk} into digital poles {epkT} to obtain the digital filter
N
k
k
ka
ps
RsH
1)(
N
k Tp
k
ze
RzH
k1 11)(
Ex:
Feb.2008 DISP Lab 17
IIR Filter Design by Impulse invariance method
Example:
Expanding in a partial fraction
expansion, it produce
The impulse invariant transformation
yields a discrete time design with the
system function
2 2( )
( )c
s aH s
s a b
1/ 2 1/ 2( )cH s
s a jb s a jb
( ) 1 ( ) 1
1/ 2 1/ 2( )
1 1a jb T a jb TH z
e z e z
Advantages of Impulse Invariance Mapping
It is a stable design and the frequencies and w are linearly related.
Disadvantage We should expect some aliasing of the analog frequency
response, and in some cases this aliasing is intolerable.
Consequently, this design method is useful onlywhen the analog filter is essentially band-limited to a lowpass or bandpass filter in which there are no oscillations in the stopband.
Feb.2008 19
IIR Filter Design by Bilinear transformation method
The most generally useful is the
bilinear transformation.
To avoid aliasing of the frequency response as encountered with the impulse invariance transformation.
We need a one-to-one mapping from the splane to the z plane.
The problem with the transformation is many-to-one. sTz e
Design of Digital Filters Using Analog Prototypes
Analog filter design theory was developed in the mid-1900s.
As digital signal processing developed, it seemed reasonable to leverage existing knowledge in analog filter design.
Our strategy will be to design the filter in the analog domain, and then transform the filter to the digital domain.
We can derive this transformation by recalling the relationship between the Laplace transform and the z-transform:
We can approximate the logarithm using a Taylor series:
This transformation is known as the bilinear transform. It maps the left-halfs-plane to the interior of the unit circle in the z-plane.
Unfortunately, it also warps the frequency axis, so the analog filter design must be prewarped so that it lands at the proper frequency in the z-plane.Let s = + j and z = re j :
)ln(1
zT
sez sT
1
1
1
12
1
12)ln(
1
z
z
Tz
z
Tz
Ts
j
j
re
re
Tj
1
12
Frequency Warping In the Bilinear Transform
We can solve for and by equating real and imaginary parts:
To understand the implications on frequency response, set r = 1 and = 0 :
This suggests a design strategy where:
(1) Establish requirements (e.g., cutoff frequency of c).
(2) Prewarp by computing the equivalent analog frequency: .
(3) Design an analog filter, generating H(s).
(4) Derive:
2tan2
2tan
2
cos1
sin2
1 T
TT
cos21
sin22
cos21
12
2
2
2
rr
r
T
rr
r
T
2tan
2 cc
T
1
12)()(z
z
Ts
sHzH
Impulse response of a filterImpulse response of an IIR filter with poles on the unit circle for sinusoidal generation
Acknowledgement
Various graphics used here has been taken from public resources instead of redrawing it. Thanks to those who have created it.
Thanks to:
Prof. John G. Proakis
Prof. Dimitris G. Manolakis