N DSP6
N DSP6
N DSP6
30/11/16
dy (t )
d 2 y (t )
dx (t )
d 2 x(t )
b2
a
x
(
t
)
0
1
2
dt
dt
dt 2
dt 2
H a s
a 0 a1 s a 2 s 2 ... a N s N
b0 b1 s b2 s 2 ... bM s M
This is a ratio of polynomials in s . The order of the system function is max(N,M). Replacing s by j
gives the frequency-response H a (j), where denotes frequency in radians/second. For values of s
with non-negative real parts, H a (s) is the Laplace Transform of the analogue filters impulse response
h a(t). H(s) may be expressed in terms of its poles and zeros as:
H a s k
s z1 s z 2 ... s z N
s p1 s p2 ... s p M
There is a wide variety of techniques for deriving H a(s) to have a specified type of frequency response.
For example, it may be shown that a general expression for the system function of an n th order
analogue Butterworth low-pass filter, with gain response:
G ( )
1
1 ( / C ) 2 n
is as follows:1
H a s
s
c
1 2 sin 2k 1 2n s s
c
c
k 1
[n/2]
CS3291
DSP
6.2
30/11/2016 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. ( 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:x(t)
y(t)
R
C
Fig. 6.1
Since the current in R is equal to the current in C it follows that:
y t x t c dy t
R
dt
Therefore the differential equation for this circuit is:
RCdy t
y t
x t
dt
The system function is:
H a s
1
1 RCs
Ga H a j
1 RCj
where c = 1 / (RC) . This is the gain response of a first order Butterworth low-pass filter with cutoff frequency c . It is shown graphically below when c = 1:
2
0
-4
-6
-8
0.5
1.5
Gain (dB)
-2 0
2.5
3
Radians/second
3.5
-10
-12
-14
Fig. 6.2
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 e
t RC
: t 0
CS3291
DSP
6.3
30/11/2016 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 lowpass. 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:
dy t
dt
lim
t 0
y t y t t
t
dt
y t y t T
T
y(t) = y[n]
and
dy t y n y n 1
dt
T
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:
RC
y n y n 1
T
y n x n
i.e.
i.e.
where
RC
RC
y n x n
y n 1
T
T
y n a 0 x n b1 y n 1
a0
1
RC
and,
b1
RC
T RC
This is the difference equation of the recursive discrete time filter illustrated below:
y[n]
x[n]
a0
-b1
Fig. 6.3
The 3 dB cut-off frequency of the original analogue filter is at c = 1/(RC) radians/second.
Instead of making this equal to one as before, lets make it 500 Hz.
CS3291
DSP
6.4
30/11/2016 BMGC
dy t T
dy t / dt
d y t
dt 2
2
dt
y t 2 y t T y t 2T
T
y t y t T
y t T y t 2T
T
y n 2 y n 1 y n 2
T2
Example: Confirm from the general formula that the system function for a 2nd order Butterworth
type low-pass analogue filter with cut-off frequency C radians per second is:
1
H a s
2 s
1
dt
c
c
y t
d 2 y t
x t
dt 2
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 C = 3141.6 radians/second. Substituting into the differential equn we obtain:
y n 4.502 y n y n 1 10.132 y n 2 y n 1 y n 2 x n
H z
1
0.0640
1
2
15.634 24.766 z 10.132 z
1 1.584 z 1 0.6481z 2
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.
CS3291
DSP
6.5
30/11/2016 BMGC
1
1 RCs then,
z 1
1 z 1
K
1 2 RC z 1 2 RC
1 b1 z 1
CS3291
DSP
where k
6.6
30/11/2016 BMGC
1 2 RC
1
and b1
1 2 RC
1 2 RC
Properties:
(i) This transformation produces a function H(z) such that given any complex number z,
H(z) = Ha(s) where s = 2 (z - 1) / (z + 1)
(ii) The order of H(z) is equal to the order of Ha(s)
(iii) If Ha (s) is causal and stable, then so is H(z).
(iv) H(exp(j)) = H a (j) where = 2 tan(/2)
Proofs of properties (ii) and (ii) are straightforward but are omitted here.
Proof of property (iv):
j
j
2
2 j tan
2
Radians/sample
e
s 2 j
e
2 e
e
1
j
j
1
e 2 e 2
j
2
3.14
2.355
1.57
0.785
Radians/second
0
-12
-10
-8
-6
-4
-2
0
-0.785
10
12
-1.57
-2.355
-3.14
Fig
6.36.1:
Frequency
Warping
Fig
Frequency
warping
Frequency warping: By property (iv) the discrete time filter's frequency response H(exp(j)) at
relative frequency will be equal to the analogue frequency response H a (j) with = 2 tan(/2).
The graph of against in fig 6.3, shows how in the range - to is mapped to in the range -
to . The mapping is reasonably linear for in the range -2 to 2 (giving in the range -/2 to /2),
but as increases beyond this range, a given increase in produces smaller and smaller increases in .
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 . This
"frequency warping" effect must be taken into account when determining a suitable Ha(s) prior to the
bilinear transformation.
CS3291
DSP
6.7
30/11/2016 BMGC
|Ha(j )|
|H(exp(j )|
Fig. Fig
6.4(a):
Analogue
Gain
Response
6.2(a):
Analogue
gain
response
Fig.Fig
6.4(b):
Effect
Of Bilinear
Transformation
6.2(b):
Effect
of bilinear
transformation
z 2 2Z 1
1 2 z 1 z 2
0
.
093
1 0.94 z 1 0.33z 2
10.3z 2 9.7 z 3.4
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]
0.097
0.94
-0.33
Fig.Fig.
6.5 6.3
CS3291
DSP
6.8
30/11/2016 BMGC
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 4th order Butterworth-type IIR low-pass digital filter is needed with 3dB cutoff at one sixteenth of the sampling frequency f s.
Solution: The relative cut-off frequency is C = /8 radians/sample
The prewarped cut-off frequency is therefore C = 2 tan (/16) = 0.4 radians/sec.
Formula for 4th order Butterworth 1 radian/sec low-pass system function:
1
1
2
2
1 0.77 s s 1 1.85s s
H a s
1 2 z 1 z 2
0.028
1
2
1 1.365z 0.48 z
H(z) may be realised in the form of cascaded bi-quadratic sections as shown in fig 6.6.
x[n]
y[n]
0.028
0.033
1.6
1.36
-0.48
-0.74
Fig.6.6
6.4:Fourth
FourthOrder
order IIR
filter
withWith
cut-offCut-Off
fs/16 fs/16
Fig.
IIRButterworth
Butterworth
Filter
1.1
0.9
0.5
Gain
0.7
0.3
Radians/second
0.1
-0.1 0
0.5
1.5
2.5
3.5
4.5
CS3291
DSP
6.9
30/11/2016 BMGC
1.1
0.9
Gain
0.7
0.5
0.3
Radians/sample
0.1
-0.1 0
0.785
1.57
2.355
3.14
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 whereas the gain of the digital filter becomes exactly
zero at = . The shape of the Butterworth gain response is " warped " by the bilinear transformation.
However, the 3dB point occurs exactly at c for the digital filter, and the cut-off rate becomes sharper
and sharper as because of the compression as .
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, bandpass 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 (fU >> 2fL) 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 (fU not >> 2fL) 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
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:
H a s
1
s s 1 s 1
2
6.2. Confirm from the general formula that the system function for a 3nd order Butterworth type low-
CS3291
DSP
6.10
30/11/2016 BMGC
pass analogue filter with cut-off frequency C radians per second is:
1
H a s
3
s 2 s 2 2 s
1
c
c c
Gain (dB)
-10
-20
-30
-40
-50
-60
Radians/second
-70
0