Franklin Note 2
Franklin Note 2
Fourier transfonn
(5.59)
Discrete Equivalents
1 approach it from
e direct transfonn A Perspective on Computing Discrete Equivalents
vs
One of the exciting fields of application of digital systems I is in signal process
ing and digital filtering. A filter is a device designed to pass desirable signal
components and to reject undesirable ones; in signal processing it is common to
represent signals as a sum of sinusoids and to define the "desirable components"
as those signals whose frequencies are in a specified band. Thus a radio receiver
is designed to pass the band of frequencies transmitted by the station we want
to hear and reject aU others. We would call a filter which does this a bandpass
its transform, we filter. In electrocardiography it often happens that power-line frequency signals
are strong and unwanted, so a filter is designed to pass signals between 1 and 500
Hz but to eliminate those at 60 Hz. The magnitude of the transfer function for
this purpose may look like Fig. 6.1 on a log-frequency scale, where the amplitude
response between 59.5 and 60.5 Hz might reach 10- 3 Here we have a band-reject
es, this is exactly filter with a 60-dB rejection ratio in a I-Hz band centered at 60 Hz.
~xponential. If we In long-distance telephony some filters playa conceptually different role.
There the issue is that ideal transmission requires that all desired frequencies be
20 log I HI t
0
-3 -----
Chapter Overview
The specific problem of this chapter is to find a discrete transfer function thai
will have approximately the same characteristics over the frequency range of
importance as a given transfer function, H (s). Three approaches to this task are
presented. The first method is based on numerical integration of the differential
equations that describe the given design. While there are many techniques for
numerical integration, only simple fonnulas based on rectangular and trapezoid
rules are presented. The second approach is based on comparisons of the s and
z domains. Note that the natural response of a continuous filter with a pole al
some point s = s" will, when sampled with period T, represent the response of II
discrete filter with a pole at z e'" T. This formula can be used to map the pole~
and zeros of the given design into poles and zeros of an approximating discrete
filter. This is called pole and zero mapping. The third and final approach is based
on taking the samples of the input signal, extrapolating between samples to form
an approximation to the signal, and passing this approximation through the given
filter transfer function. This technique is called hold equivalence. The method~
are compared with respect to the quality of the approximation in the frequency
domain as well as the ease of computation of the designs.
6.1 Design of Discrete Equivalents via Numerical Integration 189
Many rules have been developed based on how the incremental area term is
sfer function that approximated. Three possibilities are sketched in Fig. 6.2. The first approximation
equency range of leads to the forward rectangular rule2 wherein we approximate the area by the
.es to this task are rectangle looking forward from kT - T and take the amplitude of the rectangle
of the differential to be the value of the integrand at k T - T. The width of the rectangle is T. The
ny techniques for result is an equation in the first approximation, u I
dar and trapezoid
isons of the s and
ul(kT) = ul(kT - T) + T[-aul(kT - T) + ae(kT - T)]
Figure 6.2
Sketches of three ways
the area under the curve
from kT to kT + T can
be approximated:
(a) forward rectangular
rule, (b) backward
rectangular rule,
(c) trapezoid rule
3 It is worth noting that in order to solve for Eq. (6.6) we had to eliminate u(k T) from the right-hand
side where it entered from the integrand. Had Eq. (6.2) been nonlinear, the result would have been an
implicit equation requiring an iterative solution. This topic is the subject of predictor-corrector rules,
which are beyond our scope of interest. A discussion is found in most books on numerical analysis. See
Golub and Van Loan (1983).
6.1 Design of Discrete Equivalents via Numerical Integration 191
Again we take the z-transform and compute the transfer function of the backward
rectangular rule
aT I aTz
ItB (z) = I + aT -I-z---:-/-(-I-+-a-T-) = -z(-l-+-a-T-)---I
a
=------ (backward rectangular rule). (6.7)
(z-l)/Tz+a
Our final version of integration rules is the trapezoid rule found by taking the
area approximated in Eq. (6.3) to be that of the trapezoid formed by the average
of the previously selected rectangles. The approximating difference equation is
T
u/kT) = u 3 (kT - T) + Z[-au 3 (kT - T)
+ae(kT - T) - au 3 (kT) + ae(kT)] (6.8)
1 (aT/2) aT/2
= 1+ (aT/2) u3 (kT - T) + I + (aT /2) [e3 (kT - T) + e3 (kT)].
H (z) = aT(z+ 1)
r (2 + aT)z + aT - 2
approximating
r- T, namely,
H(s) Method Transfer function
ition,3 is a a
Forward rule H =
s+a F (z-I)/T+a
a a (6.10)
Backward rule H =
(6.6) s+a B (z-l)/Tz+a
a a
-":j
Trapezoid rule H=
s+a (2/T){(z - l)/(z + I)} +a
from the righI-hand
would have been an
CIOf-COrrectOf rules, From direct comparison of H (s) with the three approximations in this tabu
merical analysis. See lation, we can see that the effect of each of our methods is to present a discrete
transfer function that can be obtained from the given Laplace transfer function
192 Chapter 6 Discrete Equivalents
(6.12)
Each of the approximations given in Eq. (6.11) can be viewed as a map from
the s-plane to the z-plane. A further understanding of the maps can be obtained
by considering them graphically. For example, because the (s jw)-axis is the
boundary between poles of stable systems and poles of unstable systems, it would
be interesting to know how the jw-axis is mapped by the three rules and where
the left (stable) half of the s-plane appears in the z-plane. For this purpose we
must solve the relations in Eq. (6.11) for z in terms of s. We find
i) z = I +Ts, (forward rectangular rule).
I
ii) z = (backward rectangular rule).
1 Ts
1 + Ts/2
iii) z (bilinear rule).
I Ts/2
If we let s = j w in these equations, we obtain the boundaries of the regions
in the z-plane which originate from the stable portion of the s-plane. The shaded
areas sketched in the z-plane in Fig. 6.3 are these stable regions for each case.
t
To show that rule (ii) results in a circle, is added to and subtracted from the
right-hand side to yield
z=~+{~-~}
1 I 1 + Ts
- - ----
2 21 - Ts
6,1 Design of Discrete Equivalents via Numerical Integration 193
Figure 6.3
mabie as shown Maps of the left-half of the s-plane by the integration rules of Eq, (6.10) into the
z-plane. Stable s-plane poles map into the shaded regions in the z-plane. The unit circle
is shown for reference, (a) Forward rectangular rule. (b) Backward rectangular rule.
(c) Trapezoid or bilinear rule
(6.11)
y in digital and
] after the British
,eal of interest in
transformation
:l can be summa
<a) (b) (c)
(filter), H (s), a
Now it is easy to see that with s = jw. the magnitude of z - ~ is constant
(6.12) I 1
Iz - 2: 1 2:'
::d as a map from
can be obtained and the curve is thus a circle as drawn in Fig. 6.3(b). Because the unit circle
= jw)-axis is the is the stability boundary in the z-plane, it is apparent from Fig. 6.3 that the
;ystems, it would forward rectangular rule could cause a stable continuous filter to be mapped into
rules and where an unstable digital filter.
this purpose we It is especially interesting to notice that the bilinear rule maps the stable
d region of the s-plane exactly into the stable region of the z-plane although the
entire j w-axis of the s-plane is compressed into the 2ir -length of the unit circle!
Obviously a great deal of distortion takes place in the mapping in spite of the
I.
congruence of the stability regions. As our final rule deriving from numerical
(6.13) integration ideas, we discuss a formula that extends Tustin's rule one step in an
attempt to correct for the inevitable distortion of real frequencies mapped by the
rule. We begin with our elementary transfer function Eq. (6.1) and consider the
bilinear rule approximation
es of the regions
a
lane. The shaded
1S for each case . (2/T)[(z - I)/(z + 1)] + a
tracted from the The original H(s) had a pole at s -a, and for real frequencies, s = jw, the
magnitude of H (j w) is given by
a2
IH(jw)1
2
= W 2 +a 2
1
(6.14)
194 Chapter 6 Discrete Equivalents
(6.15)
or
wIT aT
tan-- = (6.16)
2 2
Exarr
Equation (6.16) is a measure of the frequency distortion or warping caused by
Tustin's rule. Whereas we wanted to have a half-power point atw a, we realized
a half-power point at WI = (2/ T) tan-I (aT /2). WI will be approximately correct
only if aT /2 I so thattan- I(aT /2) ~ aT /2, that is, if w, (= 2rr / T) a and
the sample rate is much faster than the half-power frequency. We can turn our
intentions around and suppose that we really want the half-power point to be at
WI' Equation (6.16) can be made into an equation of prewarping: If we select
a according to Eq. (6.16), then, using Tustin's bilinear rule for the design, the
half-power point will be at WI' A statement of a complete set of rules for filter
design via bilinear transformation with prewarping is
1. Write the desired filter characteristic with transform variable s and critical
frequency WI in the form H(S/W I).4
2. Replace WI by a such that
2 WIT
a = T
tan-
2'
4 The critical frequency need not be the band edge, We can use the band center of a bandpass filter or the
crossover frequency of a Bode plot compensator, However. we must have WI < IT / T if a stable filter is
to remain stable after warping,
6.1 Design of Discrete Equivalents via Numerical Integration 195
;;:: a. It will be and in place of H(sjw l ), consider the prewarped function H(s ja). For more
complicated shapes, such as bandpass filters, the specification frequencies,
1 axis in the s such as band edges and center frequency, should be prewarped before the
. A sinusoid of continuous design is done; and then the bilinear transformation will bring all
:) to a sinusoid these points to their correct frequencies in the digital filter.
md manipulate 3. Substitute
2 Z
s=
Tz+l
in H(sja) to obtain the prewarped equivalent H/z).
It is clear from Eq. (6.17) that when W wI' H/z J ) = H(1) and the discrete
filter has exactly the same transmission at WI as the continuous filter has at
this frequency. This is the consequence of prewarping. We also note that as the
sampling period gets small, Hp(z) approaches H(jwjw 1).
(6.16)
Example 6.1 Computing a Discrete EqUivalent
ling caused by
a, we realized The transfer function of a third order low-pass Butterworth filte~ designed to have unity pass
bandwidth (wp 1) is
mately correct
rjT)>> a and
H (s) = -,---;;---
e can tum our + 2s + I
. point to be at A simple frequency scaling would of course translate the design to have any desired passband
~: If we select frequency. Compute the discrete equivalents and plot the frequency responses using the forward
he design, the rectangular rule, the backward rectangular rule, the Tustin bilinear rule and the bilinear rule
rules for filter with prewarping at w = I. Use sampling periods T = 0.1, T I, and T = 2.
Solution. Computation of the discrete equivalents is numerically tedious and the state-space
algorithms described below were used in MATIAB to generate the transfer functions and the
:S and critical response curves plotted in Fig. 6.4. Fig 6.4(a) shows that at a high sample rate (T 0.1),
where the ratio of sampling frequency to passband frequency is wJw , "'" 63, all the rules do
l
reasonably well but the rectangular rules are already showing some deviation. From Fig. 6.4(b)
we see that at wJw = 2rr the rectangular rules are useless (the forward rule is unstable).
P
Finally. in Fig. 6.4(c) at very slow sampling frequency with wJw = rr corresponding to a
P
sampling period of T = 2 sec, only with prewarping do we have a design that comes even close
to the continuous response. In each case at the Nyquist frequency, w = rr IT, the magnitude
lndpass filter or the
" if a stable filter is 5 A description of the properties of Butterworth filters is given in most books on filter design and briefly
in Franklin, Powell and Emami-Naeini (1986).
196 Chapter 6 Discrete Equivalents
Figure 6.4
(a) Response of
0.8
third-order lowpass filter
and digital equivalents 0.6
IHI
for ws/wp = 20rr. 0.4
(b) Response of
third-order lowpass filter 0.2
and digital equivalents 0
for wslwp = 2rr. 0 0.5 1.5 2 2.'
(c) Response of
third-order lowpass filter
and digital equivalents
for =rr -so
-100
LH
-ISO
-200
.2'0
0 0.5 I 1.5 2 2.'
(a) Nonnalized frequency ootCilp
..
0.8
0.6
!HI o
+
+
0.4 ....0'0''+ +
o +
0.5
L __ _ _ _ _ _
I.,
~ ______ ..
~~uu~~
2.5
O~~----~--------~------~--------~------_,
'0
)00
LH
-150
200
.2'0 '---_ _ _--'-_ _ _ _-'-_ _ _ _"'--_ _ _--'_----"..::...lr..............
o 0.5
(b)
6.1 Design of Discrete Equivalents via Numerical Integration 197
0.8~ ... .
...... , ......,
I
0.6r H
IHl ,
0.4r
0.2i
0L.
2.5 0 0.5 1.5 2 2.5
0
-so
.100
LH
-ISO
-200
~ +
~ -250 +
2.5 0 0.5 I 1.5 2 2.5
(c) Normalized frequency (J)/O>p
responses of the discrete filters start to repeat according to the periodic nature of discrete
transfer-function frequency responses. It can be seen that the magnitude and phase of the
prewarped designs match those of the continuous filter exactly at the band edge, (.f) I, for all
these cases. This is no surprise, because such matching was the whole idea of prewarping .
The formulas for discrete equivalents are particularly simple and convenient
when expressed in state-variable form and used with a computer-aided design
package. For example, suppose we have a vector-matrix description of a contin
2.5 uous design in the form of the equations
x= Ax+Be,
u = Cx + De. (6.18)
The Laplace transform of this equation is
sX = AX +BE.
U=CX+DE. (6.19)
We can now substitute for s in Eq. (6.19) any of the forms in z corresponding to
2.S an integration rule. For example, the forward rectangular rule is to replace s with
(z l)fT from Eq. (6.10
z- I
- - X AX+BE,
T
U =CX+DE. (6.20)
200 Chapter 6 Discrete Equivalents
J
r( The MATLAB Control Toolbox provides for the computation of Tustin bi
linear equivalents with the function c2d. The syntax of computing the bilinear
equivalent SYSD of a continuous system SYS at sampling period Ts is
SYSD = c2d( SYS,Ts, 'tustin') (6.32)
If 'tustin' is replaced with 'prewarp', the bilinear equivalent with prewarping b
computed.
1. All poles of H(s) are mapped according to z = esT. If H(s) has a pole al
S = -G, then H (:::) has a pole at ~ = e- . If H(s) has a pole at -a + j/J,
aT
cp
then Hcl'(z) has a pole at re , where r = e- aT and
iH
hT. e
2. Alljinite zeros are also mapped by z = e,T. If H(s) has a zero at s = -1/,
then Hcl'(:::} has a zero at z = e- aT , and so on.
3. The zeros of H (s) at s = 00 are mapped in H:p (z) to the point z = -1. The
rationale behind this rule is that the map of real frequencies from jw = 0 \0
6.2 Zero-Pole Matching Equivalents 201
)y the equations increasing w is onto the unit circle at Z = e jO = 1 until z = ei1r = -1. Thus
the point z = -1 represents, in a real way, the highest frequency possible
in the discrete transfer function, so it is appropriate that if H (s) is zero at
the highest (continuous) frequency, IH zp (z) I should be zero at z = -1, the
highest frequency that can be processed by the digital filter.
>n of Tustin bi 4. The gain of the digital filter is selected to match the gain of H(s) at the band
:ing the bilinear center or a similar critical point. In most control applications, the critical
Ts is frequency is s = 0, and hence we typically select the gain so that
(6.32)
H(s)I,=o H:p(Z)lz=I'
:h prewarping is
zero at s = -a,
int z = -1. The As with the rules based on numerical analysis, an algorithm to generate the
from jw = 0 to matched zero-pole equivalent is also readily constructed. In MATLAB, a matched
202 Chapter 6 Discrete Equivalents
Figure 6.5
System construction for hold equivalents. (a) A continuous transfer function. (b) Block
diagram of an equivalent system.
~I
e(t) u(l)
H(s) 0
(I)
u(k)
HhO(z)
(b)
7 Some books on digital-signal processing suggest using no hold at all. using the equivalent
H(z) = Z(H(s)}, This choice is called the z-transfonn equivalent.
6.3 Hold Equivalents 203
Figure 6.6
us system, SYS, A signal, its samples, and
its approximation by a
zero-order hold
r the third-order
'ith that of other
The samplers in
obtained by the operation of holding eh(t) constant at e(k) over the interval from
Iples at its output
k T to (k + I) T. This operation is the zero-order hold (or ZOH) we've discussed
. The philosophy
before. If we use a first-order polynomial for extrapolation, we have afirst-order
;ystem that, with
hold (or FOH), and so on for higher-order holds.
mates the output
[he discrete hold
lmples e(k) with 6.3.1
Zero-Order Hold Equivalent
There are many
. holding them to If the approximating hold is the zero-order hold, then we have for our approxima
ched in Fig. 6.6. tion exactly the same situation that in Chapter 5 was analyzed as a sampled-data
ximation to e(t) system. s Therefore, the zero-order-hold equivalent to H(s) is given by
HhO(z) = (1 - z- I ) z { H(s) } .
-s- (6.35)
Solution. The partial fraction expansion of the s-plane terms of Eq. (6.35) is
H(s) a
s s(s+a) s s+a
and the z-transform is
(6.36)
e
8 Recall that we noticed in Chapter 5 that the signal is. on thc average, delayed from e by T /2 sec. The
the equivalent size of this delay is one measure of the quality of the approximation and can be used as a guide to the
selection of T.
204 Chapter 6 Discrete Equivalents
z {H;S) }= ~Z-k
1
= 1- 1
(1 - e- aT Z-I) - (1 - Z-I)
= (1 z 1)(I-e aT z I) .
(6.37)
Substituting Eq. (6.37) in Eq. (6.35), the zero-order-hold equivalent of H(s) is found as
-------------------------------------------------------------~------- .
(6.38)
We note that for the trivial example given, the zero-order-hold equivalent of
Eq. (6.38) is identical to the matched zero-pole equivalent given by Eq. (6.34).
However, this is not generally true as is evident in the comparison with frequency
responses of other equiva1ents for the third-order Butterworth filter example
plotted in Fig. 6.9. Because a sample and zero-order hold is an exact model for
the sample and hold with AID converter used in the majority of discrete systems,
we have already seen the computation of this equivalent in MATLAB as
SYSD = c2d(SYS, TS,'zoh')
where the continuous system is described by SYS and the sample period is T s.
Triangle-Hold Equivalent
Figure 6.7
Impulse response of the 1.0
extrapolation filter for
the triangle hold
\nl"',_hAlri equi'
6.3 Hold Equivalents 205
hold. The effect of the triangle hold is to extrapolate the samples so as to connect
sample to sample in a straight line. Although the continuous system that does
this is noncausal, the resulting discrete equivalent is causal.
The Laplace transform of the extrapolation filter that follows the impulse
sampling is
e Ts _ 2 + e- Ts
(6.37)
TS2
) is found as Therefore the discrete equivalent that corresponds to Eq. (6.35) is
(6.38)
Htri(z) (z -TZ1)2 Z { H(S)} . (6.39)
Example 6.4 A Triangle-Hold Equivalent
Id equivalent of
I by Eq. (6.34).
Compute the triangle-hold equivalent for H (s) IIS2.
with frequency
filter example Solution. In this case, from the tables of z-transforms
!xact model for
iscrete systems,
z { H(s) } = Z{ 7}
ABas T3 (2 2 + 4z + l)z
(6.40)
6
and direct substitution into Eq. (6.39) results in
: period is Ts. (z - 1)2 T3 (;:2 +4z + l)z
H,ri(z) -T---6 4
Z (z I)
he T2 Z2 +4z +I
(6.41)
6 (z
that we have a
6.7. The result
,lUsal first-order
An alternative, convenient way to compute the triangle-hold equivalent is
again to consider the state-space formulation. The block diagram is shown in
Fig. 6.8. The continuous equations are
x = Fx+ GV.
v wiT,
th = u(t + T)o(t + T) - 2u(t)o(t) + u(t - T)o(t - T), (6.42)
Figure 6.8
diagram of the
:>"r""_,.,,,,1'1 equivalent
206 Chapter 6 Discrete Equivalents
u
where represents the input impulse functions. We define the large matrix in Eq.
(6.43) as FT , and the one-step solution to this equation is
t(kT + 1) eFTTt(kT)
Figure 6.9
Comparison of digital
0.8
equivalents for sampling
(a) T 1 and 0.6
(6.43) IHI
= 2;r: and
0.4
2 and w)wn = 1t
ZOH =0, 0.2
ge matrix in Eq.
= +. and 0
0 0.5 2.5
0
ve define
100
(6.44) LH -200
300
.400
0 2 2.5
Normalized Frequency wlwp
(a)
ed to show that
efined as ~(k)
tis 0.8
0.6 +
IHI ..... :*:.
+
(6.45) 0.4 +
+
0.2 . "+ +
+
0
(6.46)
-200
by [F, G, H, J]
LH -400
600
800 0 2.5
0.5
Normalized Frequency wlwp
(6.47) (b)
=:ontrol Toolbox. In Fig. 6.9 the frequency responses of the zero-pole, the zero-order hold,
renced there as a and the triangle-hold equivalents are compared again for the third-order Butter
worth lowpass filter. Notice in particular that the triangle hold has excellent phase
responses, even with the relatively long sampling period of T = 2, which corre
sponds to a sampling frequency to passband frequency ratio of only wJwP = rr.
208 Chapter 6 Discrete Equivalents
6.4 Summary
In this chapter we have presented several techniques for the construction of dis
crete equivalents to continuous transfer functions so that known design methods
for continuous systems can be used as a basis for the design of discrete systems.
The methods presented were
1. Numerical integration
2. Zero-pole matching
3. Hold equivalents
All methods except the forward rectangular rule guarantee a stable discrete
system from a stable continuous prototype with the provision that the warping
frequency of the bilinear transformation with prewarping must be less than the
Nyquist frequency of ~ radl sec. Zero-pole matching is the simplest method
to apply computationally if the zeros and poles of the desired filter are known
and takes advantage of the known relations between response and poles and
zeros. This is one of the most effective methods in the context of an overall
design problem and in later chapters the zero-pole matching method is frequently
selected. With a reasonable computer-aided-design tool, the designer can selecl
the method that best meets the requirements of the design. The MATLAB function
(2 d computes the discrete description for most of these discrete equivalents from
a continuous system described by SYS with sample period Ts as follows.
6.5 Problems
lstruction of dis 6.1 Sketch the zone in the z-plane where poles corresponding to the left half of the s-plane
design methods will be mapped by the zero-pole mapping technique and the zero-order-hold technique.
Jiscrete systems. 6.2 Show that Eq. (6.15) is true.
6.3 The following transfer function is a lead network designed to add about 60 phase lead
atw i 3rad
Hs _ s+1
( ) - O.ls + I
(a) For each of the following design methods compute and plot in the z-plane the pole
and zero locations and compute the amount of phase lead given by the equivalent
network at Zl = e jw , T if T 0.25 sec and the design is via
i. Forward rectangular rule
ii. Backward rectangular rule
iii. Bilinear rule
iv. Bilinear with prewarping (use WI as the warping frequency)
v. Zero-pole mapping
vi. Zero-order-hold equivalent
vii. Triangular-hold equivalent
(b) Plot over the frequency range WI = 0.1 -* wh 100 the amplitude and phase Bode
plots for each of the above equivalents.
6.4 The following transfer function is a lag network designed to increase Kv by a factor of
10 and have negligible phase lag at WI 3 rad.
a stable discrete
lOs +1
that the warping H(s) = 10 .
100s + I
be less than the
(a) For each of the following design methods. compute and plot on the z-plane the
,implest method zero-pole patterns of the resulting discrete equivalents and give the phase lag at
0.25 sec.
e and poles and i. Forward rectangular rule
:xt of an overall
ii. Backward rectangular rule
hod is frequently
iii. Bilinear rule
signer can select
AATLAB function iv. Bilinear with prewarping (Use WI = 3 radians as the warping frequency)
equivalents from v. Zero-pole matching
IS follows. vi. Zero-order-hold equivalent
vii. Triangle-hold equivalent
(b) For each case computed. plot the Bode amplitude and phase curves over the range
WI 0.0 I -* w h = 10 rad.