Engineering Tripos Part IIa
Module 3F1 -- Signals and Systems
Discrete Time Systems (Lectures 1--6)
Handout 1
Ioannis Lestas, October 2010
Module 3F1 -- Signals and Systems
Summary of topics covered:
• Definition and properties of the z-transform.
• Solution of linear difference equations using z-transforms.
• Stability of LTI discrete time systems.
• Frequency response of discrete time systems.
• Bode diagrams (gain-phase plots).
• Elementary design of digital filters
• Discrete Fourier transform.
• The Nyquist stability criterion for discrete time systems.
2
kT < t < kT + T
u(t)
1. Applications of Discrete-Time System Concepts
1.1 Digital Controllers
Examples:• aircraft• electrical power generation• chemical processes,• steel mills, etc.
3
PhysicalSystem
ADCDAC clockperiod, T
zero orderhold
DigitalComputer
u(t) = u(kT ) for
y(t)
u(kT ) y(kT )
externalcommands
Terminology (strictly speaking):! discrete - signals occurring
at discrete times! digital - signals quantised in
amplitude
y(k) = (1 + r)kD +
�k−1�
i=0
(1 + r)i
�b
1.2 Interest and Amortisation
The accumulation on bank deposits can be described by a first-order “difference equation”.
y(k): amount at the beginning of year k
r: interest rate
b(k): amount of deposit (withdraw) at the end of year k
Model:
(Difference Equation)
If b(k) = b = constant, and y(0) = D, then
4
Example with a 5% interest (b=0):
y(k) = (1 + r)kD +
�k−1�
i=0
(1 + r)i
�b
5
1.3 Signal Processing
• Digital audio (like a CD player)• Digital communication link• Image processing• Speech synthesis
1.4 Advantages and Disadvantages
Some advantages of digital signal processors/controllers over analogue/continuous time ones:
• greater flexibility• easier to implement complex control methods, e.g.
! start-up routines! safety checks! non-linear terms
• easier to modify
Some disadvantages are:• signals are sampled in time so less information is available• signals are quantised in amplitude via analogue-to-digital/digital-to-analogue (ADC/DAC) converters• the greater potential complexity can give problems with software reliability
6
This section is provided for reference and comparison purposes. It summarisesmaterial from IB Paper 6 (Control Systems), for the continuous time case, ina form which closely parallels these same topics which will now be covered forthe discrete time case.
2. Revision on Continuous Time Systems
System
7
Consider a continuous time signal x(t) for t ∈ [0,∞).The Laplace transform is defined by:
X(s) = L (x(t)) =� ∞
0−x(τ)e−sτdτ.
A continuous time system is a device which transforms continuous timeinputs into continuous time outputs: II. Convolution representations:
Taking Laplace transforms (assuming zero initial conditions) gives
where G(s) is the transfer function.
y(t) + a1y(t) + a2y(t) = b0u(t) + b1u(t).
Some common ways to represent systems are:
I. Differential equation descriptions. E.g.
G(s) =Y (s)U(s)
=b0s + b1
s2 + a1s + a2
y(t) =� ∞
0g(t− τ)u(τ)dτ
where g(t) is the impulse response. Taking Laplace transforms again givesY (s) = G(s)U(s) and G(s) = L (g(t)). It is assumed that u(t) and g(t) arezero for t < 0.
8
• A system is linear if it satisfies the Principle of Superposition:for any inputs u1, u2 which give outputs y1, y2 then the inputλ1u1 + λ2u2 gives the output λ1y1 + λ2y2, for any constantsλ1 and λ2.
Linear Time-Invariant (LTI) systems:
Let G(s) be the transfer function of a stable system and consider an input u(t) = sin(!t). Then the steady state output (i.e. after transients have died away) is:
A system is stable if ``bounded inputs produce bounded outputs''. For a system with a rational transfer function, this is equivalent to: G(s) has no poles in the right half plane or on the imaginary axis (and the numerator degree is no greater than the denominator degree).
• A system is time-invariant if shifting the input in time producesa time shift of the same amount at the output.
yss(t) = |G(jω)| sin(ωt + ∠(G(jω))).
9
The Nyquist Stability Criterion gives a test for the (closed loop)
system to be stable.
First plot the Nyquist diagram of F (s)G(s)K(s), which is the locus
of F (jω)G(jω)K(jω) as ω varies from −∞ through 0 to +∞.
Let N be the number of anti-clockwise encirclements of the −1/kpoint by the Nyquist diagram.
Then, closed loop stability is equivalent to: “N equals the number
of RHP poles of F (s)G(s)K(s)”.
Consider the following feedback system:
kF(s)
+ K(s) G(s)
10
Re
Im
Remarks.
1. If the system is open loop stable then the criterion requires that theNyquist diagram does not encircle the −1/k point.
2. An easy way to count the number of encirclements is to draw a straightline from −1/k out to infinity (in any direction) and count the individualcrossings of that line. That is: +1 for every crossing in the anti-clockwisedirection and −1 for every crossing in the clockwise direction.
3. If F (s)G(s)K(s) has any poles on the imaginary
axis then it is necessary to modify the Nyquist
diagram by evaluating it around some small
semicircular excursions into the RHP as shown
below. The imaginary axis poles are notincluded in the RHP pole count of F (s)G(s)K(s).
x
x
x
11
G(s) =s + 1
s(s− 1), K(s) = k, F (s) = 1.
Nyquist diagram
Example:
xRe
Im
Re
Im
x-1
12
There is one RHP pole of the open loop system G(s).There is one anticlockwise encirclement of −1/k for 1 < k <∞.Thus, there is closed loop stability if, and only if, 1 < k <∞.
(x(0), x(T ), x(2T ), ...) or (x0, x1, x2, ...)
{x(kT )}k≥0 or {xk}k≥0
A discrete time signal is a number sequence (mostly assume signals are zero or undefined for negative times):
3. The z-transform
The z-transform is the discrete-time equivalent of the Laplace transform. It plays a similar role to the Laplace transform for both signals and systems in discrete time.
where T = sampling period. A standard notation is:
A discrete time system is a device which processes discrete-time signals:
{u(kT )} {y(kT )}System“Black box”
input output
13
X(s) = L(x(t)) =� ∞
0−x(τ)e−sτdτ
∞�
k=0
x(kT )e−skT
The definition we will use puts z = esT :
For x(t) a continuous time signal, the Laplace transform
By analogy we could define a discrete transform for {x(kT )}k≥0as:
14
�pz−1
�kX(z) =
∞�
k=0
X(z) = Z�{xk}k≥0
�=
∞�
k=0
xkz−k
Example: Let xk = pk (k ≥ 0).
=1
1− pz−1
providing |pz−1| < 1, i.e. |z| > |p|.(most of the time we will ignore this).
pkz−k =∞�
k=0
Note: the sum may not converge for all z. Typically, it converges for all |z| > R, for some R. (Compare with Laplace transform where integral converges if Re(s) > ", for some ".)
where z is a complex variable.
Definition. The z-transform of a sequence {xk}k≥0 is:
15
u∗(t) =∞�
k=0
u(kT )δ(t− kT )
L (u∗(t)) =∞�
k=0
u(kT )e−ksT
(where z = esT )= Z ({u(kT )})
=∞�
k=0
u(kT )z−k
Side remark
A number of books use a fictitious sampling process called “impulse sampling”.
A continuous time signal u(t) becomes an impulse train (of Dirac delta functions) with weights equal to the sampled values u(kT):
u(t) u*(t)
Impulse sampler
This allows Laplace (or Fourier) transforms to be taken of u*(t). Note that
Impulse sampling is a useful trick in some signal processing topics but we will not use it in these lectures. (In control it makes things more confusing). 16
αZ ({xk}) + βZ ({yk})where α and β are constants.
{xk} = (x0, x1, x2, ...) ⇒ {xk−1} = (x−1, x0, x1, ...)
Z ({xk−1}) =∞�
k=0
xk−1z−k = x−1 +
∞�
k=1
xk−1z−k
= x−1 +∞�
i=0
xiz−i−1 (i = k − 1)
= x−1 + z−1X(z)
3.1 Properties of z-transform(see Elec. & Inf Data book)
Linearity
Time delay
Often zero
Z (α {xk}+ β {yk}) =
Which means that in the z-domain, z−1 is the time delay operator. 17
⇒ z is the timeadvance operator
= −zx0 + zX(z)
Z ({xk+1}) =∞�
k=0
xk+1z−k =
∞�
i=1
xiz−i+1
= −zx0 + z∞�
i=0
xiz−i
Z��
rkxk
��=∞�
k=0
xkrkz−k
=∞�
k=0
xk
�r−1z
�−k
= X�r−1z
�
Time advance
Scaling
18
=k�
i=0
xk−iyi
= limz→∞
∞�
k=0
xkz−k
x0
= limz→∞
X(z)
{xk} � {yk}
{yk}
(x0, x1, ..., xk−1, xk, ...)
(..........., y1, y0)
yk−iy−iyi
= limz→∞
�x0 +
x1
z+
x2
z2+ · · ·
�Initial value theorem
Convolution
1. Time reverse
2. Shift by k
3. Multiply
4. Sum
xi
19
=k�
i=0
xiyk−i = Y (z)X(z)
Z ({xk} � {yk}) =∞�
k=0
�k�
i=0
xk−iyi
�z−k
=∞�
i=0
yiz−i
∞�
k=i
xk−iz−(k−i)
pk ↔1
1− pz−1
pz−1
(1− pz−1)2kpk ↔
It is helpful to work in terms of z−1.
i
k
When X(z) is rational we can use partial fractions and some standard transforms:
3.2 Inversion of z-transform
=∞�
i=0
∞�
k=i
xk−iyiz−k
z−1
(1− z−1)2k ↔
20
X(z) =z − 3
z2(z − 1)(z − 2)
= z−3
�1− 3z−1
�
(1− z−1) (1− 2z−1)
= z−3
�2
1− z−1+
−11− 2z−1
�
{2}k≥0
�−2k
�k≥0
xk =�
0, k = 0, 1, 22− 2k−3, k ≥ 3
Example
time delay by 3
Hence,
21
−6z−2 + 4z−3
−2z−1
z2 − 3z + 2 z − 3z−1 −6z−4
z − 3 + 2z−1
−6z−2 · · · · · ·
⇒ {xk} = (0, 0, 0, 1, 0,−2,−6, · · · )
3z−1 − 21− z−1
= −3 +1
1− z−1←→ (−2, 1, 1, 1, · · · )
Note 1. For a few terms, can use long division (same example):
⇒ X(z) = z−2
e.g.
X(z) =z − 3
z2(z2 − 3z + 2)
−2z−3
−2z−1 + 6z−2 − 4z−3
Note 2. It helps if degree of numerator(z−1) < degree of denominator(z−1).
Otherwise split off constant.
22
�z−1 − 2z−3 − 6z−4 + · · ·
�
Z ({yk+m}) = zmY (z)− zmy0 − · · ·− zym−1
yk+2 = yk+1 − 0.25yk + uk
⇒ z2Y (z)− z2 = zY (z)− z −0.25Y (z) +1
1− z−1
=4
1− z−1− 5
�1− 1
2z−1�2 +
21− 1
2z−1⇔ Y (z) =
1− 2z−1 + 2z−2
�1− 1
2z−1�2 (1− z−1)
⇒ yk = 4− 10(k + 1)�
12
�k+1
+ 2�
12
�k
, k ≥ 0
3.3 Solution of linear difference equations
Data book:
Example: A digital filter is implemented by the recursion:
with initial conditions Find the step response.
Taking z-transforms:
⇔�z2 − z + 0.25
�Y (z) = z2 − z +
11− z−1
23
⇒ Y (z)U(z)
=b0 + b1z−1 + · · · + bmz−m
1 + a1z−1 + · · · + anz−n
yk + a1yk−1 + · · · + anyk−n = b0uk + · · · + bmuk−m
yk = uk = 0 for k < 0
Y (z) + a1z−1Y (z) + · · · + anz−nY (z) = b0U(z) + · · · + bmz−mU(z)
= G(z)
3.4 z-transfer function
A system described by difference equations
and subject to zero initial conditions:
is LINEAR and TIME-INVARIANT. I.e., it satisfies the Principle of Superpositionand shifting the input to the right does the same to the output.
Such a system has a z-transfer function. Taking z-transforms:
Note: ratio is independent of U(z) Transfer Function24
{uk}k≥0 =
{gk}k≥0 =
{uk}k≥0 = {yk}k≥0 =?
{yk}{uk}
(1, 0, 0, 0, · · · )
(g0, g1, g2, g3, · · · )
Now consider a linear, time-invariant system with pulse response{gk}k≥0. Take a general input:
(g0, g1, g2, · · · )
3.5 The pulse response
Consider the unit pulse input:
Let the system have output:
This is called the pulse response.
G(1,0,0,…)
G
(u0, u1, u2, u3, · · · )
25
u0(1, 0, 0, 0, · · · ) = u0(g0, g1, g2, · · · )
u1(0, g0, g1, · · · )
u2(0, 0, g0, g1, · · · )
(u0, 0, 0, · · · )
(0, u1, 0, · · · )
(0, 0, u2, · · · )
−→
−→
−→
−→· · · · · ·
{uk}k≥0 {yk}k≥0
yk =k�
i=0
uigk−i
=k�
i=0
uk−igi
Then:
input output
where
CONVOLUTION SUM
26
Y (z) = G(z)U(z)
Taking z-transforms gives:
I.e., the transfer function equals the z-transform of the pulse response.
Some books call G(z) the pulse transfer function.
27
{gk} = (g0, . . . , gn, 0, 0, . . .)
G(z) = g0 + g1z−1 + · · · + gnz−n =
zng0 + · · · + gn
zn
3.6 Terminology
1. Digital filters (i.e. discrete time systems) whose pulse response
terminates after a finite number of steps:
are called FIR (finite impulse response) filters. In such a case:
so all poles of G(z) are at z=0. IIR (infinite impulse response) filters can have poles at arbitrary locations.
A feedback loop where the closed loop transfer function is FIR is called a deadbeat (or finite settling time) system. This is a phenomenon that cannot happen in continuous time linear systems.
28
G(z) = g0 + g1z−1 + g2z
−2 + · · ·
(· · · , 0, 0, g0, g1, g2, · · · )
(· · · , 0, g−1, g0, g1, g2, · · · )
2. Discrete time systems whose pulse response is zero for negative time are called causal.
G(…,0,0,1,0,0,…)
Causal:k=0
G(…,0,0,1,0,0,…)
Non-causal:k=0
Appears before input!
For causal systems G(z) is finite at z =∞ (and equals g0 in fact).Thus if
G(z) =b0zm + b1zm−1 · · · + bm
zn + a1zn−1 + · · · + an
is the transfer function of a causal filter then m ≤ n.
(e.g. g−1 �= 0)
29
3.7 Stability
k
M
-M
(Value of M may be different for input and output)
A discrete time system is said to be stable if bounded inputs producebounded outputs.(A signal {uk} is said to be bounded if there is some fixedconstant M such that |uk| ≤M for all k.)
30
=⇒ =⇒(A)
Theorem (Stability conditions). Consider a discrete time system with a rational transfer function:
(no common factors between n(z) and d(z)).
Proof of theorem (logical sequence):
stable 1. 2.Ex. Sheet 6(a)Ex. Sheet 6(c)
(B)
Ex. Sheet 6(b) shows stable => 2.
Then, stability of the system is equivalent to either of the following:
G(z) =n(z)d(z)
=b0zm + · · · + bm
zn + a1zn−1 + · · · + an(m ≤ n)
Suppose the system has impulse response {gk}k≥0.
1. If p1, . . . , pn denote the roots of d(z), then |pi| < 1 for all i.
2.∞�
k=0
|gk| is finite.
31
G(z) =
If for any i then the system cannot be stable (pulse input givesunstable output)
(A) Suppose p1, ..., pn are distinct. Then
G(z) =α1
1− p1z−1+ · · · +
αn
1− pnz−1
|pi| > 1
Then, G(z) has a pole at z = 1 and gk = 1, for all k ≥ 0.
gk = α1pk1 + α2p
k2 + · · · + αnpk
n
Proof (in part)
Example: Consider
stable =⇒ 1. =⇒ 2.(A)
(B)
1. |pi| < 1 for all i.
using partial fractions. Thus
Note: V ⇒W is equivalent to ∼W ⇒∼ V . So, ∼ (1.)⇒∼ stable.
32
11− z−1
k, k ≥ 0
G(z) =1
1− z−1
{uk} = (0, 1, 1, 1, ...)
⇒ Y (z) = G(z)U(z) =z−1
(1− z−1)2
which is not a bounded output.
This shows (in part) that systems with poles on the unit circle cannot be stable.
Consider
⇒ U(z) =z−1
1− z−1
(Note: the system G is actually a summer: yk =k�
i=0
ui).
33
⇒ yk =
M = Mk�
i=0
|gi|
2.∞�
k=0
|gk| is finite.
yk =k�
i=0
giuk−i
|yk| =
�����
k�
i=0
giuk−i
�����
≤k�
i=0
|gi| |uk−i|
Page 19
stable =⇒ 1. =⇒ 2.(A)
(B)
(B) Consider a bounded input {uk}, i.e., |uk| ≤M , for all k. Then
Want to show |yk| ≤My, for some My.
≤ M∞�
i=0
|gi|
So, if condition 2. holds, then the output is bounded, i.e. the system is stable. 34
≤k�
i=0
|gi|