Bilinear Tranformation2
Bilinear Tranformation2
Bilinear Tranformation2
|
.
|
\
|
+ +
|
|
.
|
\
|
+
=
[n/2]
1 k
2
2
1 2 sin 2 1 1
1
c c
p
c
a
s s
n
k
s
s H
e e
t
e
n
C
G
2
) / ( 1
1
) (
e e
e
+
=
CS3291 DSP 6. 2 12/7/2013 BMGC
where [n/2] is the integer part of n/2 and P = 0 or 1 depending on whether n is even or odd. Such
analogue filters have an important property in common with IIR type discrete time filters: their
impulse responses are also infinite. ( H stands for product )
6.3: First order analogue RC filter: Consider the first order analogue low-pass filter below with
input and output voltages x(t) and y(t) respectively:-
R
C
x(t) y(t)
Since the current in R is equal to the current in C it follows that:
( ) ( ) ( ) ( )
dt
t dy
c
R
t x t y
=
Therefore the differential equation for this circuit is:
( )
( )
( ) t x
dt
t RCdy
t y = +
The system function is:
( )
RCs
s H
a
+
=
1
1
The gain response is :
( )
( )
|
|
.
|
\
|
|
.
|
\
|
+
=
+
= =
2
1
1
1
1
c
a a
RCj
j H G
e
e
e
e
e
where e
c
= 1 / (RC) . This is the gain response of a first order Butterworth low-pass filter with cut-
off frequency e
c
. It is shown graphically below when e
c
= 1:
Gain response of RC filter
-14
-12
-10
-8
-6
-4
-2
0
0 0.5 1 1.5 2 2.5 3 3.5 4
Radians/second
G
a
i
n
(
d
B
)
The impulse-response of this analogue circuit may be calculated, for example, by looking up the
inverse Laplace transform of H
a
(s). It is as follows:-
0 : t < 0
h
a
(t) =
| |
( ) RC t
e
RC
|
.
|
\
|
1
: t > 0
Fig. 6.1
Fig. 6.2
CS3291 DSP 6. 3 12/7/2013 BMGC
The question now arises, how can we transform this analogue filter into an equivalent discrete time
filter? There are many answers to this question.
6.4: Firstly, we dispose quickly of one method that will not work. That is simply replacing s by z
( or perhaps z
- 1
) in the expression for H
a
(s) to obtain H(z). In the simple example above with
RC = 1, the resulting function of z would have a pole at z = -1 which is on the unit circle. Even if we
moved the pole slightly inside the unit circle, the gain response would be high-pass rather than low-
pass. Lets forget this one.
6.5: Derivative approximation technique
This is a more sensible approach. Referring back to the circuit diagram of the RC filter, assume that
x(t) and y(t) are sampled at intervals of T seconds to obtain sequences {x[n]} and {y[n]} respectively.
Remembering that:
( ) ( ) ( )
t
t t y t y
dt
t dy
t
A
A
=
A
lim
0
and assuming T is small , we can approximate dy(t) / dt by:
( ) ( ) ( )
T
T t y t y
dt
t dy
~
Therefore at time t = nT, x(t) = x[n], y(t) = y[n] and
( ) | | | | ( )
T
n y n y
dt
t dy 1
~
The differential equation given above describes the relationship between x(t) and y(t) for any value of
t. Therefore substituting for x(t), y(t), and dy(t)/dt , at t = nT we obtain:
| | | | | | | | ( ) 1
|
.
|
\
|
= n y n y
T
RC
n x n y
i.e. | | | | | | 1 1
|
.
|
\
|
+ =
|
.
|
\
|
+ n y
T
RC
n x n y
T
RC
i.e. | | | | | | 1
1 0
= n y b n x a n y
where
|
.
|
\
|
+
=
T
RC
a
1
1
0
and,
( ) RC T
RC
b
+
=
1
This is the difference equation of the recursive discrete time filter illustrated below:
x[n]
y[n]
a0
-b1
Fig. 6.3
CS3291 DSP 6. 4 12/7/2013 BMGC
The 3 dB cut-off frequency of the original analogue filter is at e
c
= 1/(RC) radians/second.
Instead of making this equal to one as before, lets make it 500 Hz.
Then 1/(RC) = 2t x 500 = 3141. We could make R = 1k Ohm and C = 1/(2t) F.
Also let T = 0.0001 seconds, corresponding to a sampling rate of 10 kHz.
Then the parameters for the recursive discrete time filter are a
0
= 0.24 and b
1
= -0.76.
The resulting difference equation for a recursive discrete time filter whose 3 dB cut-off point is at 500
Hz when the sampling rate is 10 kHz is:
y[n] = 0.24 x[n] + 0.76 y[n-1]
The system function for this discrete time filter is H(z) = 0.24 / (1 - 0.76 z
- 1
).
Exercise: Compare its gain-response |H(e
j O
) | with that of the original analogue filter. You should
find that the shapes are similar, but not exactly the same.
A second order analogue filter will have a term involving d
2
y(t) / dt
2
which is, of course, is equal to
d/dt (dy(t) / dt ) and may be approximated by:
( )
( )
( )
( ) ( ) ( ) ( ) ( ) ( )
T
T
T t y T t y
T
T t y t y
T
dt
T t dy
dt t dy
dt
t y d
|
.
|
\
|
=
2
/
2
2
( ) ( ) ( ) ( ) | | | | | | ( )
2 2
2 1 2
2 2
T
n y n y n y
T
T t y T t y t y +
=
+
=
Example: Confirm from the general formula that the system function for a 2
nd
order Butterworth
type low-pass analogue filter with cut-off frequency e
C
radians per second is:
( )
( )
2
2
1
1
|
|
.
|
\
|
+
(
+
=
c c
a
s s
s H
e e
and that the corresponding differential equation is:
( )
( ) ( )
( ) t x
dt
t y d
dt
t dy
t y
c c
=
|
|
.
|
\
|
+
|
|
.
|
\
|
+
2
2
2
1 2
e e
Apply the derivative approximation technique to derive from this differential equation a second order
Butterworth-type digital filter with cut-off frequency 500 Hz where the sampling frequency is 10 kHz.
Solution:
T = 10
-4
and e
C
= 3141.6 radians/second. Substituting into the differential equn we obtain:
| | | | | | ( ) | | | | | | ( ) | | n x n y n y n y n y n y n y = + + + 2 1 2 132 . 10 1 502 . 4
( )
2 1 2 1
6481 . 0 584 . 1 1
0640 . 0
132 . 10 766 . 24 634 . 15
1
=
z z z z
z H
CS3291 DSP 6. 5 12/7/2013 BMGC
The derivative approximation technique may be applied directly to H
a
(s) by simply replacing s by
(1 - z
- 1
)/T to obtain the required function H(z). It is not commonly used.
Exercise: Use MATLAB to plot the gain response of this digital filter. Give its signal flow graph.
6.6: Impulse-response invariant technique:
The philosophy of this technique is to transform an analogue prototype filter into an IIR discrete time
filter whose impulse response {h[n]} is a sampled version of the analogue filters impulse response,
multiplied by T. The impulse-response invariant technique may be found in the recommended
textbook. It will not be examined in this course.
6.7: Bilinear transformation technique:
This is the most common method for transforming the system function H
a
(s) of an analogue filter to
the system function H(z) of an IIR discrete time filter. It is not the only possible transformation, but a
very useful and reliable one.
Introduction
Consider derivative approximation technique:
D(y[n]) = dy(t) /dt at t=nT ~ ( y[n] - y[n-1]) / T.
D(x[n]) = dx(t) /dt at t=nT ~ (x[n] - x[n-1]) / T.
D'(y[n]) = d
2
y(t)/dt
2
at t=nT ~ D(D(y[n]) ) = (y[n] - 2y[n-1]+y[n-2])/T
2
D''(y[n]) = d
3
y(t)/dt
3
at t=nT ~ D(D'(y[n]) ) = (y[n]-3y[n-1]+3y[n-2]-y[n-3])/T
3
Backward difference approximation introduces delay which becomes greater for higher orders.
Try "forward differences" : D[n] ~ [y[n+1] - y[n]] / T, etc.
But this does not make matters any better.
Bilinear approximation:
0.5( D[n] + D[n-1]) ~ (y[n] - y[n-1]) / T
and similarly for dx(t)/dt at t=nT.
Similar formulae may be derived for d
2
y(t)/dt
2
, and so on.
If D(z) is the z-transform of D[n] :
0.5( D(z) + z
-1
D(z) ) = ( Y(z) - z
-1
Y(z) ) / T
D(z) = [2 (1 - z
-1
)/ [T(1+z
-1
)] Y(z)
= [ (2/T) (z-1)/(z+1)] Y(z).
Applying y[n] to [(2/T) (z-1)/(z+1)] produces an approximation to dy(t)/dt at t=nT.
In an analogue circuit, applying y(t) to an LTI circuit with system function H(s) = s produces dy(t)/dt
since the Laplace Transform of dy(t)/dt is sY(s) .
Therefore, replacing s by [ (2/T) (z-1)/(z+1)] is the bilinear approximation.
Definition: Given analogue transfer function H
a
(s), replace s by :
2 1
1 T
z
z
+
(
to obtain H(z). For convenience we can take T=1.
Example 6.1:
CS3291 DSP 6. 6 12/7/2013 BMGC
If ( )
( ) RCs
s H
a
+
=
1
1
then,
( )
( ) ( )
1
1
1
1
1
2 1 2 1
1
+
+
=
+ +
+
=
z b
z
K
RC z RC
z
z H
where
( ) RC
k
2 1
1
+
= and
( )
( ) RC
RC
b
2 1
2 1
1
+
=
Properties:
(i) This transformation produces a function H(z) such that given any complex number z,
H(z) = H
a
(s) where s = 2 (z - 1) / (z + 1)
(ii) The order of H(z) is equal to the order of H
a
(s)
(iii) If H
a
(s) is causal and stable, then so is H(z).
(iv) H(exp(jO)) = H
a
(je) where e = 2 tan(O/2)
Proofs of properties (ii) and (ii) are straightforward but are omitted here.
Proof of property (iv): When z = exp(jO), then
|
.
|
\
| O
=
+
|
|
.
|
\
|
=
+
=
O
O
O
O
O
O
2
tan 2
2
1
1
2
2 2
2 2
j
e e
e e
e
e
s
j j
j j
j
j
Fig 6.1: Frequency warping
-3.14
-2.355
-1.57
-0.785
0
0.785
1.57
2.355
3.14
-12 -10 -8 -6 -4 -2 0 2 4 6 8 10 12
Radians/second
R
a
d
i
a
n
s
/
s
a
m
p
l
e
Frequency warping: By property (iv) the discrete time filter's frequency response H(exp(jO)) at
relative frequency O will be equal to the analogue frequency response H
a
(je) with e = 2 tan(O/2).
The graph of O against e in fig 6.3, shows how e in the range - to is mapped to O in the range -t
to t. The mapping is reasonably linear for e in the range -2 to 2 (giving O in the range -t/2 to t/2),
but as e increases beyond this range, a given increase in e produces smaller and smaller increases in
O. Comparing the analogue gain response shown in fig 6.4(a) with the discrete time one in fig. 6.4(b)
produced by the transformation, the latter becomes more and more compressed as O t. This
"frequency warping" effect must be taken into account when determining a suitable H
a
(s) prior to the
bilinear transformation.
Fig 6.3 Frequency Warping
CS3291 DSP 6. 7 12/7/2013 BMGC
t e
|Ha(j )| e |H(exp(j )|
O
O
t/ 2 t
Fig 6.2(a): Analogue gain response Fig 6.2(b): Effect of bilinear transformation
6.8: Design of an IIR low-pass filter by the bilinear transformation method:
Given the required cut-off frequency O
c
in radians/sample:-
(i) Find H
a
(s) for an analogue low-pass filter with cut-off e
c
= 2 tan(O
c
/2) radians/sec.
(e
c
is said to be the "pre-warped" cut-off frequency).
(ii) Replace s by 2(z - 1)/(z + 1) to obtain H(z).
(iii) Rearrange the expression for H(z) and realise by bi-quadratic sections.
Example 6.2 : Design a second order Butterworth-type IIR lowpass filter with O
c
= t / 4.
Solution: Pre-warped frequency e
c
= 2 tan(t / 8) = 0.828
For an analogue Butterworth low-pass filter with cut-off frequency 1 radian/second:
H
a
(s) = 1 / (1 + \2 s + s
2
)
Replace s by s / 0.828, then replace s by 2(z - 1)/(z + 1) to obtain:
( )
|
|
.
|
\
|
+
+ +
=
+
+ +
=
2 1
2 1
2
2
33 . 0 94 . 0 1
2 1
093 . 0
4 . 3 7 . 9 3 . 10
1 2
z z
z z
z z
Z z
z H
which may be realised by the signal flow graph in fig 6.5. Note the extra multiplier scaling the input
by 0.097.
x[n] y[n]
Fig. 6.3
0.097
2
0.94
-0.33
Fig. 6.4(a): Analogue Gain Response Fig. 6.4(b): Effect Of Bilinear Transformation
Fig. 6.5
CS3291 DSP 6. 8 12/7/2013 BMGC
6.9: Higher order IIR digital filters:
Recursive filters of order greater than two are highly sensitive to quantisation error and overflow. It is
normal, therefore, to design higher order IIR filters as cascades of bi-quadratic sections.
Example 6.3: Design a 4
th
order Butterworth-type IIR low-pass digital filter is needed with 3dB cut-
off at one sixteenth of the sampling frequency f
s.
Solution: The relative cut-off frequency is O
C
= t/8 radians/sample
The prewarped cut-off frequency is therefore e
C
= 2 tan (t/16) = 0.4 radians/sec.
Formula for 4th order Butterworth 1 radian/sec low-pass system function:
( )
|
.
|
\
|
+ +
|
.
|
\
|
+ +
=
2 2
85 . 1 1
1
77 . 0 1
1
s s s s
s H
a
Scale the analogue cut-off frequency to e
c
by replacing s by s / 0.4.
Then replace s by 2 (z - 1)/(z +1) to obtain:
( )
|
|
.
|
\
|
+
+ +
|
|
.
|
\
|
+ +
=
2 1
2 1
2 1
2 1
48 . 0 365 . 1 1
2 1
028 . 0
74 . 0 6 . 1 1
2 1
033 . 0
z z
z z
z z
z z
z H
H(z) may be realised in the form of cascaded bi-quadratic sections as shown in fig 6.6.
x[n]
0.033
2
1.6
-0.74
0.028
y[n]
2
1.36
-0.48
Fig. 6.4: Fourth order IIR Butterworth filter with cut-off fs/16
Fig. 6.6 Fourth Order IIR Butterworth Filter With Cut-Off fs/16
CS3291 DSP 6. 9 12/7/2013 BMGC
Fig. 6.7(a) shows the gain response for the 4th order Butterworth low-pass filter whose transfer
function was used here as a prototype. Fig 6.7(b) shows the gain response of the derived digital filter
which, like the analogue filter, is 1 at zero frequency and 0.707 at the cut-off frequency. Note
however that the analogue gain approaches 0 as e whereas the gain of the digital filter becomes
exactly zero at O = t. The shape of the Butterworth gain response is " warped " by the bilinear
transformation. However, the 3dB point occurs exactly at O
c
for the digital filter, and the cut-off rate
becomes sharper and sharper as O t because of the compression as e .
6.10: IIR discrete time high-pass band-pass and band-stop filter design:
The bilinear transformation may be applied to analogue system functions which are high-pass, band-
pass or band-stop. Such system functions may be obtained from an analogue low-pass 'prototype'
system function (with cut-off 1 radian/second) by means of the frequency band transformations
introduced in Section 2. Wide-band band-pass and band-stop filters (f
U
>> 2f
L
) may be designed by
cascading low-pass and high-pass sections, thus avoiding the need to apply frequency band
transformations, but 'narrow band' band-pass/stop filters (f
U
not >> 2f
L
) will not be very accurate if a
cascading approach is used.
6.11: Comparison of IIR and FIR digital filters:
IIR type digital filters have the advantage of being economical in their use of delays, multipliers and
adders. They have the disadvantage of being sensitive to coefficient round-off inaccuracies and the
Fig. 6.7(a) Analogue 4th order Butterworth gain response
CS3291 DSP 6. 10 12/7/2013 BMGC
effects of overflow in fixed point arithmetic. These effects can lead to instability or serious distortion.
Also, an IIR filter cannot be exactly linear phase.
FIR filters may be realised by non-recursive structures which are simpler and more convenient for
programming especially on devices specifically designed for digital signal processing. These
structures are always stable, and because there is no recursion, round-off and overflow errors are easily
controlled. A FIR filter can be exactly linear phase. The main disadvantage of FIR filters is that large
orders can be required to perform fairly simple filtering tasks.
Problems:
6.1 By referring to the general formula, show that the system function of a third order analogue
Butterworth low-pass filter with 3 dB cut-off frequency at 1 radian/second is:
( )
( )( ) 1 1
1
2
+ + +
=
s s s
s H
a
6.2. Confirm from the general formula that the system function for a 3
nd
order Butterworth type low-
pass analogue filter with cut-off frequency e
C
radians per second is:
( )
(
|
.
|
\
|
+ + +
=
3
2
2
2 2 1
1
c
c
c
a
s s s
s H
e
e
e
Give the corresponding differential equation.
Apply the derivative approximation technique to derive from this differential equation a third order
IIR Butterworth-type digital filter with cut-off frequency 500 Hz where the sampling frequency is
10 kHz.
6.3. A third order low-pass IIR discrete time filter is required with a 3dB cut-off frequency of one
quarter of the sampling frequency, f
s
. If the filter is to be designed by the bilinear transformation
applied to a Butterworth low-pass transfer function, design the IIR filter and give its signal flow
graph in the form of a second order and a first order section in serial cascade.
6.4. Give a computer program to implement the third order IIR filter designed above on a processor
with floating point arithmetic. How would it be implemented in fixed point arithmetic?
6.5. A low-pass IIR discrete time filter is required with a cut-off frequency of one quarter of the
sampling frequency, f
s
, and a stop-band attenuation of at least 20 dB for all frequencies
greater than 3f
s
/8 and less than f
s
/2. If the filter is to be designed by the bilinear
transformation applied to a Butterworth low-pass transfer function, show that the minimum
order required is three. Design the IIR filter and give its signal flow graph.
CS3291 DSP 6. 11 12/7/2013 BMGC
-70
-60
-50
-40
-30
-20
-10
0
10
0 1 2 3 4 5 6 7
Radians/second
G
a
i
n
(
d
B
)
Fig. 6.8(a): Analogue 4th order Butterworth gain response