Lecture_Note_15

advertisement
IIR based Digital Filters:
The design uses the analog prototype of
given specifications.
For the given specifications, IIR filters yield
much smaller order of the filter.
Hence requires much less number of elements.
Appropriate mapping and spectral
transformation is carried out to result in a
desired digital filter.
The object is to:
Investigate the relationship between
s- and z- domains.
Workout the equivalence of
analog and digital systems.
To study the different mapping rules
and response matching.
Equivalence of analog and digital systems:
The approximate continuous time domain impulse
response h(t) at the sampling interval ts (=1/fs) is:
h(t)  ha(t) = tsh(t) (t-kts)
= ts  h(kts) (t-kts); k =[-, ].
For the normalized sampled time impulse
response, the sampling period ts is 1s
and replacing t by n :
hs[n] =  hs[k] [n-k] for k =[-, ].
Equivalence of analog and digital systems:
For k  [-, ], the Laplace transform of
ha(t)= ts  h(kts) (t-kts) is
H(s)  Ha(s) = ts  h(kts) exp(-sts)k
and
z-transform H(z) of normalized hs[n] is:
hs[n] =  hs[k] [n-k] is
Hd(z) =  hs[k]z-k
Equivalence …..
Thus for zk = exp(skts),
Ha(s) = ts Hd(z)
the conditions can be rewritten as
z exp(sts) and s  ln(z)/ts.
These relationships describe a mapping between
variables s and z:
z = exp(j)ts = exp(ts) exp(jts)
= exp(ts) exp(j)
Here  = ts = 2f/fs = 2F,
where F is the digital frequency in cycles/sample
ts is the sampling rate per second
 is the analog frequency in radians per second..
…..and mapping
The DTFT of hs[n] has a periodic spectrum.
Therefore ensure that
the analog signal h(t) is strictly band-limited
and moreover,
to obliterate aliasing,
is sampled much above the Nyquist rate
The normalized band of frequency should lie well
within the principal period of Hp(f)
–0.5 F  0.5.
aliasing revisited:
The relationships z exp(sts)  s  ln(z)/ts
does not describe a unique mapping between
the s-plane and the z-plane.
Since exp(j) has a period of 2; frequencies beyond ,
such as   kfs
are also mapped on the same circle after k .
Thus a one to one mapping is possible only if the signal is
restricted in the range f/fs= F = 0.5.
j
3/T
Im z
/T

Re z
-1
1
-/T
-3/T
s-plane
z-plane
Notes …
The logarithmic nature of the transformation
s  ln(z)/ts, being a infinite series,,does not
convert a rational TF H(s) into a rational TF
H(z).
The unique representation is true only for band
limited signals, those lie well within the
principal range.
The spectra of such band limited signal repeats
at every sampling frequency.
If the signal is not band-limited, it will cause inherent aliasing
(introduction of corrupted signal in the principal region).
Notes….
We need to study the practical mappings.
The methods are:
Use of standard z-transform:
Equivalent finite element integrators.
Other methods (not discussed)
w-v transform
z-forms
etc.
Use of standard z-transform
Impulse invariant filters and
Matched z-transform filters
•
•
•
•
These filters use standard z-transform.
Therefore the intelligence has to be band limited.
The Impulse invariant filter preserves time response.
The Matched z-transform filters preserves frequency
response.
• Aliasing is severe. Use high sampling rate.
Equivalent Integrator:
The basic philosophy:
The simulation element in signal processing is
Integrator. It is (1/s) in Laplace Transform.
Different numerical methods of integration are
used to create equivalence.
They are grouped as :
Backward difference,
Forward difference,
Trapezoidal integration,
Simpson’s integration. [not used,increases the order of filter]
“ Philips CL,+ Nagle HT, “ Digital Control System Analysis and Design” 3/e, PH Ch.11
Backward Difference: (right side rectangular rule)
• Difference of present and the past sample.
y[t] = y(t) – y(t-T)
• It’s Laplace transform:
sY(s) = [Y(s) – e-sTY(s)]/T + Y(0+)
letting Y(0+)=0, we get:
s = (1- e-sT)/T
It is not the z
transform of 1/s
= (1-z-1)/T
Or, 1/s = T/(1-z-1)
z = 1/(1-Ts) = ½ [(1-sT)+(1+sT)]/(1-sT)
= ½ [(1- (1+sT)/(1-sT)];
Backward Difference: (right side rectangular rule)
z = ½ [(1- (1+sT)/(1-sT)];
replacing s = j returns:
= ½ [1+ e j2arctan(T)]
= ½ [1+ej].
Mapping left half of j axis of s-plane into
a circle of radius ½ centered at (½ ,0) in z plane.
The region enclosed is very small. If our frequency
extends little beyond s=0 or, z=1, there will be severe
distortion.
Sampling Frequency should be increased to improve
the performance.
Forward Difference: left side rectangular rule
• It is the difference between present pulse
and forth coming pulse.
y[t] =[y(t+T)- y(t)]/T
• It’s Laplace transform:
s = (z-1)/T
z = 1+Ts = 1+ jT
This mapping only shifts j axis to right by 1.
It can make a stable filter into unstable one.
In literature: Same mapping rule for
Impulse Invariance Integrator,
backward difference Integration
and
right side rectangular integration.
Step invariance Integrator,
forward difference integration
and
Left side rectangular integration.
Bilinear z-transform Mapping
• It does not require band limitation.
• Pre warping of analog frequency is
essential before bilinear z-transformation
for suitable matching of frequency
response.
• Most suitable for polynomial based flat
response filters.
• Uses Trapezoidal Integration rule.
Algorithms for Bilinear Transformation
This transformation follows the trapezoidal
interpolation rule, or, Tustin’s rule, and is
represented by the numerical integration
algorithm:
y[n] = y[n-1] + (ts /2){x[n] + x[n-1]}.
So that:
H(z) = 0.5 ts [z+1]/[z-1]
And equating with integration rule in s-domain.
H(s)  1/s. Thus
s = (2/ts){(z–1) / (z+1)}
The time-response matching
The idea behind response matching is to match the time-domain analog and
digital response at the sampling instants t = ts for a given input.
One way to achieve the response is as under.
t-domain input



input sampled @ ts

Input X[z]
 s-domain input
 analog filter in s-domain

output in s-domain

output in t-domain

output sampled @ ts

output Y[z]
hence: H[z] = Y[z]/X[z].
The example below will illustrate that the H[z] is excitation specific.
Time response matching…
Example 10.01
Convert analog filter of transfer function H(s) =
1/(s+1) into a digital filter H[z] for (a) impulse
input (b) unit step input.
Soln: (a) Impulse input :
x(t) = (t)  X(s) = 1;
H(s) = 1/(s+1),
output Y(s) = 1/(s+1)
or, y(t) = e-t U(t).
the sampled version is y(nT) = e-nTU[n] .
And at n=0, y(nT) = 1.
Example 7.01
• Letting sampling time ts = 1, for impulse input,
we get
H[z] =Z e-nTU[n] =1/[1-e-1z-1] =1/[1- 0.3679 z1].
We thus note:
 The DC gain H[z=1] = 1.582 while it at H(s=0) =1.
 This increase is solely due to aliasing.
 Even if the DC gain is normalized, the frequency
characteristics does not match. It is shown in
Magnitude plot of Fig. 7.02 (a) and (b).
 This can be remedied by higher rate of sampling.
Normalized amplitude response:
1
H[z]
H(s)
magnitude
0.8
0.6
0.4
0.2
0
0
0.5
1
1.5
2
analog frequency
2.5
3
Phase response
0
-10
Phase in degrees
-20
-30
-40
-50
-60
-70
-80
0
Phase[z]
Phase(s)
0.5
1
1.5
2
analog frequency, radians
2.5
3
Time response of Impulse Invariance
digital filters and equivalent analog filter:
 note similarity in time response.
1
amplitude
0.8
0.6
0.4
0.2
0
0
1
2
3
4
5
time in seconds, sampling period 1 second
6
Response with step input:
Step response of the filter
H[z] = z / [z-0.3679] is
Y[z] = z2 / [z-1][z – 0.3679]
Inverse Z-transform is
y[n] = 1.5820U[n]–0.214 (0.3679)-n U[n]
=1.5820[1-0.1353(0.3679)-n]U[n].
Magnitude-frequency response
for step input
1.6
1.4
amplitude
1.2
1
0.8
0.6
0.4
0.2
0
0
1
2
3
4
5
time in seconds, sampling period 1 second
6
Remarks on impulse invariant method:
Comparison of response in analog domain filters
and impulse invariant method in digital domain
while the frequency and phase plots are not
alike, the time response at the sampling intervals
is same in analog and impulse invariant digital
filters
the time response is remarkably different from
its analog counterpart for step input.
This clearly illustrates that this scheme is
excitation specific.
Why Bilinear Transformation
Due to high rate of sampling, Impulse
invariant filters (IIF) are not suitable for high
pass/band reject/all-pass modes while
matched-z filters can not realize LPF.
Frequency response does not match with
those of analog filters in IIF while there is a
distortion in matched-z.
Aliasing problem in both cases.
Bilinear Transformation
Alternatively a transformation is attempted
which converts 0 to 2 change in
  [0 to ].
Thus the circle of z-domain is converted onto
entire j-axis with one to one mapping. This
eliminates the aliasing problem.
It is
BILINEAR TRANSFORMATION
s- and z- planes mapping- we want
The relationship between analog and
digital frequency :
s = (2/ts)[(z-1)/(z+1)]
Putting s = j , and z = ej
j= (2/ts)[(ej -1) / (ej +1)]
=(2/ts)[{ej/2 (ej/2 – e-j/2)} / {ej/2(ej/2+ e-j/2)}]
=(2/ts)[(ej/2 – e-j/2)/ (ej/2+ e-j/2)]
=j (2/ts)sin(/2)/cos(/2)
Or,

 = (2/ts)tan(/2)
 = 2 tan-1(ts/2)
Frequency Warpage in BLT:
The graph between  and  for ts=1, red color, is non-linear
implying that the warpage has been introduced in the frequency
translation. Blue color graph for  is drawn for understanding.
3
digital frequency
2
1
0
-1
-2
-3
-30
-20
-10
0
10
20
30
Working out frequency in BLT:
 = (2/ts)tan(/2)
and  = 2 tan-1(ts/2)
The above is a non linear or warped
characteristic.
It has one to one mapping between s and z
domains.
For ; /2.
To undo this frequency warping, we pre-warp the
analog frequency   p in s-plan so that:
pts/2 = tan(ts/2).
Linearization of relationship
After frequency prewarping pts/2 = tan(ts/2)
The Digital frequency becomes:
= 2 tan-1(p ts/2)
= 2 tan-1 tan(ts/2)
= (2/ts)(ts/2);
we get a linear relation:  = .
More over due to carrying out the
prewarping, the term 2/ts turns out to be
redundant as it cancels out in calculations.
• Therefore we can individually use:
• s = (z-1)/(z+1)
• p = (2/ts)tan(ts/2).
Or, combining the two:
s = cot (ts/2) (z-1)/(z+1) .
[Ifeacher et al,”Digital signal Processing’ 2/e, Prentice Hall, pp 473-500.
Example: 10.02
Using un-prewarped bilinear transformation and
impulse invariance technique synthesize:
H(s) = c /(s+c ), c = 105.
1. Bilinear Transformation Method:
Putting the transformation s =(2/ts)[(z-1) / (z+1)];
we get;
H[z} = c/[(2/ts)[(z-1) / (z+1)] )+ c]
= cT(z+1)/(2+cT)z – (2 -cT).
Selecting the value of T such that T << /c
say = 0.1/c,
H[z] = 0.1357(z +1)/[z- 0.7284]
Ex. 9.02 contd.
Thus |H(ejT)| =
0.024(1+cos (10-6)/(1-0.9518cos(10-6)
and  H(e jT)
= tan-1[sin(10-6)/ [1+ cos(10-6)]
- tan-1[sin(10-6)/[cos(10-6)-0.7285].
Ex. 9.03:
Bilinear transformation method
without pre-warping
H(s) = (s+0.1)/{(s+0.1)2 +9}
replace s by (2/T) {(z-1)/(z+1)},
H(z) =
0.1077{(z2 + 0.18 z – 0.82) / (z2 + 1.569z + 0.96)}
Ex.9.03: Magnitude plots
1.4
1.2
bilinear
Impinvar
analog
Magnitude
1
0.8
0.6
0.4
0.2
0
-4
-2
0
2
4
analog frequency, radians
6
8
Ex. 10.03: Design an IIR digital filter for the TF of
analog filter given as: H(s) = (s+a)/{(s+a)2 + b2}.
where [a,b] =[0.1,3] and the resonant frequency r=/4.
with pre-warping.
• The sampling time, given that b = c= 3;
• Using the relation:  =2 tan-1(ts/2)
and replacing
 c and c;
ts = (2/c) tan(c/2) = (2/3)tan(/8)=0.276.
• H(z) = N(z)/D(z) = H(s) for s = (2/T)(z-1)/(z+1)
• N(z) = (2/0.276){(z-1)/(z+1)} + 0.1
• D(z) = N2(z) + 9.
• H(z) = [1+0.027z-1-0.973z-2]/[8.572 –11.84z-1+8.177z-2]
[Salivahanan, “DSP” Mcgraw Hills, p.429-430]
BZT
Bilinear transformation method are useful when
the gains are constant over certain frequency
bands. This condition exists in low-pass, bandpass, high-pass and band-stop filters.
This method requires lower sampling rate
compared to Impulse Invariance Method
because of absence of aliasing. This absence
of aliasing is the result of one-one mapping
from a s-plane to z-plane.
Warping
The digital frequency is limited in the
range of -0.5  F  0.5, and sampling
time period is decided by the highest
frequency of the signal Fh is to be
preserved.
Warping of Digital Frequency scale is
inherent in Bilinear Transformation.
This can be reduced by pre warping the
frequencies in analog domain.
Steps to Design IIR BZT filters
• From specifications, workout the desired discrete-time
filter requirements and attributes.
• Pre-warp the critical discrete time frequencies into
corresponding analog frequencies and estimate the
order of filter and -3dB critical frequency.
• Design the analog prototype filter from the continuoustime parameters obtained from above.
• Convert the analog prototype into an analog filter
using frequency-frequency transform.
• Design a digital filter using a BZTof H(s) that warps the
frequency axis which was previously pre-warped.
[1.Taylor,”Hands-on digital signal processing”, McGraw Hills, pp414-420 ISBN:0-07-912965-x
2.Chen,”Digital Signal Processing” Oxford, PP. 386-394: ISBN 0-19-513638-1]
Example 10.04:
Using the bilinear transformation and a low pass
analog Butterworth prototype, design a low pass filter
operating at a rate of 20 kHz and having a pass band
extending to 4kHz with maximum attenuation of 0.5 dB
and stop band starting at 5 kHz with a minimum stop
band attenuation of 10 dB.
Soln : Given that sampling rate is fs=20 kS/s,
Pass band =fpass= 4kHz.Fpass= 4/20 Hz/s at -0.5 dB.
Stop band =fstop = 5kHz. Fstop= 5/20 Hz/s at +10 dB.
[Orfanidis: Introduction to signal Processing pp 612-617]
Soln..:
•
•
•
•
Prewarped Digital frequencies are:
pass= tan (2Fpass/2) = 0.7265 rad/sample
stop= tan (2Fstop/2) = 1.00 rad/sample.
ln()= ln (stop/ pass) = ln(1.0/0.7265)
Determination of order n of the filter:
Given that H(s)H(-s) = [1+(s/j)2n]-1,
Gx = 20 log |H(jx)| = -10log[1 + (x/c)2n]
Where s =x, c = cut-off frequency, n is order of filter.
Letting Pass band gain Gp dB occur at p rad/sec
and
stop band gain Gs dB occur at s rad/sec.
We get expressions as:
Gp = -10log[1 + (p/c)2n]  (p/c)2n = 10-Gp/10 -1
Gs = -10log[1 + (s/c)2n]  (s/c)2n = 10-Gs/10 –1
Hence: (s/p)2n = (10-Gs/10 –1)/ (10-Gp/10 –1)
Conclusion
From here we conclude:
n, the order of the filter =
log {(10-Gs/10 –1)/ (10-Gp/10 –1)} / 2log(s/p).
c, the cut off frequency
= p/{10-Gp/10 –1}1/2n
ALTERNATIVELLY AS
= s/{10-Gs/10 –1}1/2n
Hence:
(s/p)2n = (10-Gs/10 –1)/ (10-Gp/10 –1)
 2nlog((s/p)=log[(10-Gs/10 –1)/ (10-Gp/10 –1)]
Or,
n = 0.5 log[(10-Gs/10 –1)/ (10-Gp/10-1)]/log(s/p)
In this case,
n = 0.5 log[(10-Gs/10 –1)/ (10-Gp/10-1)]/log(s/p)
= 6.73 say 7.
The -3dB cutoff frequency calculated as
c, = p/{10-Gp/10 –1}1/2n = 0.8443
 f = (f /) tan-1( )= 4.464 kHz.
o
s
c
The filter is a 7th order filter
One real pole and three complex poles. The
composite TF is:
= 0.4578 (1+z-1)/1-0.0844 z-1
+ 0.3413(1+z-1)2/[1-0.2749z-1 + 0.6402z-2]
+ 0.2578(1+z-1)2/[1-0.2076 z-1+0.2386 z-2]
+ 0.2204(1+z-1)2/[1-0.1775 z-1+0.0592 z-2]
Example_10.05
[ extention of example 9.4]
A band stop filter to satisfy
Butterworth and
Tchebyshev Criteria.
is required to meet following specifications.
to meet the following specifications.
1. Stop band 100 to 600 Hz (assumed at -3dB)
2. At and between 200 and 400 Hz, the
magnitude should be at least -20 dB.
3. Maximum Gain (at the zero) =1.
4. Pass band ripple  1.1 dB.
5. Sampling frequency 2000 Hz.
Conversion to normalized LPF specs.
• Calculation of prewarp frequencies:
pr_x= tan (xT/2) = tan (f/fs)
•
fx Hz
fx/fs
rad/s
since fsT=1
pr_x
rad/s
fx1
100
0.1571
0.1584
fx2
200
0.3141
0.3249
fx3
300
0.6283
0.7265
fx4
400
0.9425
1.3764
Normalized Bandwidth = B = fx4-fx1 = 1.3764-0.1584 = 1.218
Normalized center frequency =02= fx4fx1 = 0.2180
Calculation of equivalent LPF
• Basic equation is:
n  Bx /(02 - x2)
• Calculating n for various values of x in the equation
=1.218 x / (0.2180 - x2)
• x
•
•
•
•
0.1584
0.3249
0.7265
1.3764
n
soln
1.218 x 0.1584/[0.218 – (0.1584)2]
1.218 x 0.3249 /[0.218 – (0.3249)2]
1.218 x 0.7265 /[0.218 – (0.7265)2]
1.218 x 1.3764 /[0.218 – (1.3764 )2]
=1
= 3.519
=-2. 856
= -1
• s/p=min(2/ 1 3/ 4) = 2.856  3.
and 1/cosh-1(2.856) = 0.5846
Calculation of number of
Tchebyshev poles
• The control equations is where
Given:Gs =-20 dB, R=-1.1 dB and
Calculated s/p= 2.856
G
s
1
n
cosh
1
s
p
 cosh
1
10
10
1
R
10
10
1
1/cosh-1(2.856) =0.5846
cosh-1( )=cosh-1(18.53) = 3.612
n= 2.11  3 for better transit characteristic
Chebyshev polynomial for n=3 and
R = 1.1 dB
• In the polynomial calculated in 9.4
Hlp(s) =0.4656/(s+0.4766)(s2+0.4766s+0.977)
• To convert this normalized LP to desired BS,
substitute s 1.218 s / (s2+ 0.2180).
• Use BZT in the so obtained polynomial in s.
1. Butterworth filter.
Number of poles of LP filter 
= log10 {(10-Gs/10 –1)/ (10-Gp/10 –1)} / 2log10 (s/p)
= log10{(102-1)/(100.3-1)/2 log10(2.856)
= 2.199  3 (for better transition characteristic).
The normalized TF = 1/ (s+1)(s2+s+1)
= 1/ 1+2s+2s2 +s3
Transform normalized LP to required BS
by s 1.218 s / (s2+ 0.2180)
USE BZT on the HBS(s).
Download