Bilinear z transform: Warping and Prewarping.

advertisement
Design of IIR Filters.
Introduction
Various design methods available
Structures/Architetures
Implementation
The Basic Building block of the IIR filter is shown in the diagram. It is a second order
section.
x(n)
b0
+
y(n)
+
z-1
-a1
b1
+
+
z-1
-a2
b2
Take an internal node and write the equations describing the circuit
From the output summer
y(n)  b0 w(n)  b1w(n  1)  b2 w(n  2)
which transforms to
X ( z )  W ( z ) b0  b1 z 1  b2 z 2
For the input summer
w(n)  x(n)  a1w(n 1)  a2 w(n  2)
yielding
W ( z ) 1  a1 z 1  a2 z 2  X ( z )
Solving (eliminating W(z)) gives
Y ( z ) b0  b1 z 1  b2 z 2 B( z )
H ( z) 


X ( z ) 1  a1 z 1  a2 z 2
A( z )




The design problem is to find the coefficients of the pol;ynomials B(z), A(z) that
meets a stated specification.
Higher order Filter functions are obtained by combining the 2nd order sections in
different ways. Two of the more common ones are cascade and parallel shown below
x(n)
H1
H
H2
y(n)
M
H1
y(n)
x(n)
H2
+
HM
Approaches to designing IIR Filters.
Most IIR filters are designed by first designing an analog filter to the same
specification and the transforming it into the disctrete time or z domains using one of
a number of methods



Pole Zero Placement
Impulse Invariant
Bilinear z-Transform (BZT)
The most common method for anumber of reasons is the BZT method.
The Bilinear z-transform.
The problem to be solved is how to convert
H ( s)  H ( z )
given the mapping between s and z
z  e sT
A number of approximations are used
The Bilinear Transformation is as follows
z e
sT

e
e

s T2
 s T2

1  sT2  ( sT2 ) 2 21!  ....
1  sT2  ( sT2 ) 2 21!  ....
1  sT2
1  sT2
Thus the Bilinear z transform is
z
Yielding
1  sT2
1  sT2
s
2 z 1
T z 1
Bilinear z transform: Warping and Prewarping.
The bilinear transform method transforms a suitable filter function H(s) to H(z) as
follows:
H ( z )  H (s) s  2 z 1
T z 1
Both filters will have the same behaviour but the behaviour is not matched at the same
frequencies in the analog and digital domains. The reason for this distortion or
2 z 1
warping is the fact that s 
is an approximation to z  e sT .
T z 1
This distortion can be deduced as follows:
Let ’ be the frequency in the analog domain.
Let  be the frequency in the digital domain.
2 z 1
T z 1
Replace s with j’ and z with its exact frequency description e sT
Then
2 e sT  1
j ' 
T e sT  1
The BLT gives s 

2 e jT  1
T e jT  1
j T
wher e s  j
 j T
2 e 2 e 2

T
T
T e j 2  e  j 2

2
 T 
j tan 

T
 2 
THUS  ' 
2
 T 
j tan 

T
 2 
What this means is that when you use the BLT method the behaviour of the digital
filter is matched by the behaviour of the analog filter but slightly distorted.
EXAMPLE:
If we require a digital filter with a cut off of 100Hz the the analog filter must have a
cut-off of
 'c  T2 tan 2cT / 2
 T2 tan 2 100T / 2
For T=2mS,
 'c 

2
tan 2. .100.2.10 3 / 2
3
2.10
=762.54 rad/s
=115.6 Hz

So the analog filter is chosen to have a cut-off frequency of 115.6 Hz knowing that
the BLT method will generate a digital filter with a cut-off of 100 Hz. This process is
called pre-warping.
EXAMPLE:
Design a 2nd order high pass digital Butterworth filter with a cut off frequency of
100Hz and a sampling frequency of 625Hz.
1. Prewarp.
The cut off of the prewarped analog function is
 'c  T2 tan 2cT / 2
 2. .100 
 2 * 625 tan 

 625 * 2 
=687.19 rad/s
=109.37 Hz
2. Apply prewarping and denormalising to the analog filter function.
The normalised 2nd order high pass butterwrth is
s2
H (s)  2
s  2s  1
The denormalised prewarped function H(s) is given by using the
s
transformation s 
.
c
2
 s 


 687.19 
H P ( s) 
2
 s 
 s 

  2
 1
 687.19 
 687.19 
s2
 2
s  971.8s  4.722 105
3. Apply the BLT to the resulting filter function
The Digital filter is found by
H ( z )  H ( s) s  2 z 1
T z 1
 z 1
1250 

z  1


2
 z 1
 z 1
5
12502 
  971.8 *1250
  4.722 10
 z 1
 z  1
which simplifies to
1  2 z 1  z 2
H ( z) 
2.08  1.395 z 1  0.5248 z  2
2
2

0.4808  0.9615 z 1  0.4808 z  2
1  0.617 z 1  0.2523z  2
NOTE:
The denormalised analog values are large while the digital filter values have
become ‘normal’ again. This is because the digital filter is NECESSARILY
normalised to a unit sampling frequency.
EXERCISE:
Investigate how the steps of prewarping, denormalising and BLT transformation
can be combined to eliminate the ‘intermediate’ stage of numbers. (See section
7.4.8 in Ifeachor and Jervis).
4.
Calculate the Frequency Response of the filter.
The exact frequency response of this filter ma be found by substituting z  e jT
giving
H ( j ) 

0.4808(1  2e jT  e 2 jT )
1  0.617e jT  0.2523e 2 jT
0.4804(1  2 cos T  cos 2T )  0.4808 j (2 sin T  2 sin 2T )
1  0.671cos T  0.2523 cos 2T  j (0.671sin T  0.2523 sin 2T )
which can be written as a magnitude H( j and a phase  ( j ) .
Use of MATLAB in the design of IIR Filters
MATLAB uses the BILINEAR z Transform in its algorithms for IIR filter design. The
Algorithms design analog filters to meet the specifications and apply the BZT with
prewarping to produce the Digital Filter.
We examine this with a number of examples.
EXAMPLE 1.
Sampling frequency
Passband
Stopband
Passband Ripple
Stopband Attenuation
fsamp=1000;fnyq=fsamp/2;
Rp=2;Rs=40;
fs=85; %Stop band
fp=60; %Pass band
400
0-60Hz
>85 Hz
<2dB
>40dB
%Pass and stop band ripple
% Design an elliptic digital filter using the MATLAB filter design
% commands
[N,Wn]=ellipord(fp/fnyq,fs/fnyq,Rp,Rs);
[bd,ad]=ellip(N,Rp,Rs,Wn);
% Examine the filters frequency response
[hd,wd]=freqz(bd,ad,256);
plot(wd*1000/pi/2,20*log10(abs(hd)));
Rlow=-60;
%Choose a suitable value for the low end of the yaxis plot;
Rhigh=10;
axis([0 fnyq Rlow Rhigh]);
hold on
pause
% Compare with the design specification
F1=[0 fs1 fs1];F2=[fp1 fp1 fnyq];F21=[fp fnyq];
M1=[-Rs -Rs Rlow];M2=[Rlow 0 0];M21=[-Rp -Rp];
plot(F1,M1,'r');plot(F2,M2,'r');plot(F3,M3,'r');
plot(F21,M21,'r');
Example 2.
fsamp=1000;fnyq=fsamp/2;
Rp=.5;Rs=20;
fs1=150;fs2=350;
fp1=200;fp2=300;
fpass=[fp1 fp2];
fstop=[fs1 fs2];
%Pass and stop band ripple
%Pass band
%Stop band
% Design an elliptic digital filter using the MATLAB filter design
% commands
[N,Wn]=ellipord(fpass/fnyq,fstop/fnyq,Rp,Rs);
[bd,ad]=ellip(N,Rp,Rs,Wn);
% Examine the filters frequency response
[hd,wd]=freqz(bd,ad,256);
plot(wd*1000/pi/2,20*log10(abs(hd)));
Rlow=-60;
%Choose a suitable value for the low end of the yaxis plot;
Rhigh=10;
axis([0 fnyq Rlow Rhigh]);
hold on
pause
% Compare with the design specification
Rlow=-60;
F1=[0 fs1 fs1];F2=[fp1 fp1 fp2 fp2];F3=[fs2 fs2 fnyq];
M1=[-Rs -Rs Rlow];M2=[Rlow 0 0 Rlow];M3=[Rlow -Rs -Rs];M21=[Rlow -Rp Rp Rlow];
plot(F1,M1,'r');plot(F2,M2,'r');plot(F3,M3,'r');
plot(F2,M21,'r');
Download