You are on page 1of 93

1

Introduction to Discrete Time


Systems and the Z Transform
Dr. Ed. Palmer
School of Electrical & Electronic Systems
Engineering
2

Lecturer Contact Details


 Dr. Ed. Palmer
– School of EESE, QUT, GPO Box 2434,
Birsbane, Q. 4001 Australia
– Tel. +6173864 2632
– e-mail e.palmer@qut.edu.au
3

Module Overview

– Discrete time control - single input /single


output
» z transform based control design
– State space control - multi-input, multi-output
» time domain based
Text & references – Modern 4

Control module
 TEXT
– Ogata, K. “Discrete Time Control Systems”,
Prentice-Hall
 REFERENCE
– Brogan, W., “Modern Control Theory”,
Prentice-Hall
5

Pre-requisite Knowledge
 Good understanding of classical
(continuous time control)
 good knowledge of linear algebra
– in particular, rank, basis, eigenvalues,
eigenvectors
6

Contents
 Data Acquisition,
– A/D conversion, sample/hold,
 Operationson discrete time signals
 Z Transform
– derivation, inverse transform, properties,
examples
 Ref. Chapters 1 & 2 of Ogata
7

Data Acquisition
 Typical Discrete Time control System
Actuation
Plant
G(s)

DAC Digital ADC


Controller
c(t)
output
Set Input (measurement)
8

Data Acquisition
 Analog to digital conversion
– two stage process
» Sample/Hold
» A/D Converson
9

Sample/Hold (S/H)
 Receives an analog signal and holds it
constant for a specified time
 Sampling time short compared to sampling
period
10

Sample/Hold (S/H)
Buffering Amplifiers

Amp 1 Amp 2
Sampling C
Trigger

Switch closed - tracking time, Switch open - hold time


11

Sample/Hold
Aperture Time Capacitor voltage
following signal
Voltage across capacitor

level

Hold time

Tracking Time
12

Analog to Digital Conversion


 Takes sampled signal and converts it to a
digital signal
– a finite number of digits

Continuous Signal Digital Signal


13

Analog to Digital Conversion


 Accuracy depends on number of digital
levels available
 Quantization
– For an n bit word there are 2n available
quantization levels
14

Quantisation
 Error incurred in rounding sampled signal
to nearest digital level
(i+1)th quantization
level

ith quantization level


signal
Signal will be rounded up to (i+1)th
level - closest level
Sampling instant
15

Quantization Error
 Error
incurred in rounding sampled signal to
nearest level
let FSR  Full Scale Reading,
Q  quantizati on level  range between adjacent levels

FSR
Q  n , n  byte length
2

Source of random noise - can derive statistics


16

Quantization Error
Quantizati on error  difference between actual signal
value and quantized value
e(t )  x(t )  y (t )
Quantized
Error e(t) signal value y(t)

Q
Signal sample x(t)
17

Quantization Error
Worst case value of e(t) = 0.5Q
Q
0  e(t ) 
2
Error is uniformly distributed between -0.5Q and +0.5 Q
Mean = zero
18

Variance of Quantization Error


Q
2
  E et   e 
1
   d
2 2 2

Q Q

2
2
Q
  2

12
19

D/A Conversion
 Signal reconstructed using hold circuits
– Zero Order hold
» most commonly used - least delays
» staircase function
– Higher order holds
» interpolation between sampling instants
» delay increases with order of hold - stability
problems
20

D/A Conversion
Reconstructed Signal - Staircase
function
Original signal

Signal samples

Zero Order Hold


21

D/A Conversion
Reconstructed signal

Original signal

Signal samples

First Order Hold - Linear Interpolation


between samples - one sample delay
Operations on Discrete Time 22

Signals
 Notation
1
Assume constant sampling rate f s 
T
continuous time signal xt   discrete time signal x(kT )
or xk , where k is an integer

Note - Multi-rate sampling can occur in some systems


Operations on Discrete Time 23

Signals
 Fourier Transforms - Continuous Signal

Continuous Time FT (CFT)


 
Xf   x t e  j 2ft
dt , xt    X  f e j 2ft
df
 

Continuous in time and frequency domains


Operations on Discrete Time 24

Signals
 Fourier Transforms - Discrete time signal
– infinite length
Discrete time FT (DTFT)
 0.5
Xf   x n e  j 2nf
xn    X  f e j 2nf
df
n    0.5

Discrete in time domain, continuous and periodic in


freq. domain
Normalised frequency =frequency(Hz)/Sampling
Frequency(Hz) -0.5<f<0.5
Operations on Discrete Time 25

Signals
 Fourier Transforms - Finite time domain
sequence
Discrete FT (DFT) - Assume sample length N
N 1 2nk N 1 2nk
j
X (k )   xn e    X k e
1 j
N
xn  N

n 0 N k 0

Discrete in time and frequency domains


Efficient version of DFT - Fast Fourier Transform
(FFT)
Operations on Discrete Time 26

Signals
 Convolution Continuous time signal

y (t )   xt   h d


Discrete Time Signal



y n    xn  k hk 
k  

h(k) = discretised system impulse response


Operations on Discrete Time 27

Signals
 Basically two types of digital filters
– FIR - Finite Impulse Response
– IIR - Infinite Impulse Response

Digital Filter
x(n) = input y(n) = filtered
signal output signal
Operations on Discrete Time 28

Signals
 Filtering - Discrete time signals
– Finite Impulse Response (FIR)
N 1
y k    h(m) x(k  m)
m 0

y k   h(0) x(k )  h(1) x(k  1)  ...  h( N  1) x(k  N  1)


29

FIR Filter Example


 Low Pass Filter
– moving average based on 5 samples
y (k )  0.2 x(k )  x(k  1)  ...  x(k  4) 
or
y  x *h
h  [0.2 0.2 0.2 0.2 0.2]T
FIR Filter Example – Low Pass 30

Filter
 Simple sinusoid with random noise
10

2 8

1.5 6

y(k)
4
1
x(k)

2
0.5
0
0
-2
-0.5
-4
0 20 40 60 80 100 120
-1
0 20 40 60 80 100
Sample Number Sample Number
Filtered Signal
Raw Signal 5 point moving
average
Infinite Impulse Response (IIR) 31

Filter
 Designed to have characteristics of analog
filters
– Butterworth, Chebyshev, etc

y (n)  b0 xn   b1 x(n  1)  ...  bM 1 x(n  M  1)


 a1 y (n  1)  a2 y (n  2)  ...  aN y (n  N  1)

Function of previous output samples and present and past


input samples
32

Discrete Time signal operations


 Filtering reference
– Oppenheim & Schafer, “Discrete-Time Signal
Processing”, Prentice-Hall, 1989
 Other issues eg aliasing will be dealt with in
lecture 3
33

The Z Transform
Z transform has similar role in discrete time
systems to that of Laplace transforms in
analog systems
One sided Z transform
X  z   Z xt 

 Z xk    xk z k

k 0
34

The Z Transform
Two sided Z transform
X  z   Z xt 

 Z xk    xk z k

k  

We will mainly deal with the one sided Z Transform

We will use k to indicate a sequence index where the


sequence is not necessarily time based, kT when it is
35

Region of Convergence (ROC)


 The operator z is a complex variable
 the Z transform is basically a series which
will converge to a finite value within a
region which may only be part of the
complex z plane
– Region of convergence
Z Transform of Unit Step 36

Function
Discrete time unit step function
1 kT  0
u(kT)  
0 otherwise

Z u kT    u (kT )  z k

k 0

z k 1
 1 z  z 2 3
 z  ...
k 0
Z Transform of Unit Step 37

Function
Z u kT   1  z  z  z  ...
1 2 3

1 z
 1
 if z  1
1 z z 1

ROC is z  1
Z Transform of Unit Ramp 38

Function
kT kT  0
xkT   
0
 
X  z    kTz k
 T  kz k

k 0 k 0
Z Transform of Unit Ramp 39

Function
 
X  z    kTz k  T  kzk
k 0 k 0
1
 1 2
 T z  2 z  3z  ...  3
 Tz
1  z 
1 2

Tz

z  12
Z Transform of Polynomial 40

Function ak
a k  0
k
xk   
0 otherwise

X z    a zk k

k 0
1 2 2
 1  az  a z 
Z Transform of Polynomial 41

Function ak

X  z   1  az  1  a 2 z  2 ...
1 z
 
1  az  1 za
Z Transform of an Exponential 42

Function

e akT k  0
x kT   
0 otherwise
 
k  akT  k
X  z   x k  z  e z
k 0 k 0
Z Transform of an Exponential 43

Function

 akT  k
X  z  e z
k 0
 aT  1  2 aT  2
 X  z  1  e z e z ...
1
  aT  1
1 e z
Z Transform of an Exponential 44

Function

1 z
X  z   aT  1
  aT
1 e z ze
Z Transform of a Sinusoidal 45

Function
sin kT kT  0
x kT   
0 otherwise
Recall

sin kT=
1 jkT
2j
e e  jkT

1 1 1 
 X z   
2 j 1  e jT z  1 1  e  jT z  1 
Z Transform of a Sinusoidal 46

Function

1 1 1 
X z   
2 j 1  e jT z  1 1  e jT z  1 

 X z 
1
 e j T
 e z 
 jT  1 

 
2 j  1  e j  T  e  j T z  1  z  2 
 
Z Transform of a Sinusoidal 47

Function

X z 
1
 ejT
 e  jT  1
z  

 
2 j 1  e jT  e jT z  1  z  2 
 
z  1 sin T
 X z  1 2
1  2z cos T  z
Z Transform of a Sinusoidal 48

Function

1
z sin T
X z  1 2
1  2z cos T  z
z sin T
 X z 
z  2z cos T  1
2
49

Exercise
Find the Z transform of the cosine function

cos kT kT  0
x kT   
0 otherwise
50

Exercise
Z transform of the cosine function

z  z cosT
2
X  z 
z  2z cosT  1
2
51

Z Transform Properties
 Linearity (Superposition)
Zax ( k )  by ( k )  aX ( z )  bY ( z )
X ( z )  Zx ( k ), Y ( z )  Z y ( k )
a , b constants
Refer to text for proof
52

Z Transform Properties
 Multiplication by ak
  
Z a k x k   X a 1z 

Refer to text for proof


53

Z Transform Properties
 Shifting theorems
If X ( z )  Z x(t )
Delay n samples

Z xt  nT   z X  z 
n

 n 1
k 
Z xt  nT   z  X  z    x(kT ) z 
n

 k 0 
Advance n samples
54

Proof of Shifting Theorems


 Delay Theorem
To show Zx ( t  nT )  z  n X ( z )

Zx t  nT    
x kT  nT  z k
k 0

  k  n
 Zx t  nT   z  n  x  kT  nT  z
k 0
55

Proof of Shifting Theorems


 Delay Theorem

  k  n
Zx t  nT   z n
 x kT  nT z
k 0
Let m=k-n

 Zx t  nT   z  n  x ( mT ) z m
m  n
56

Proof of Shifting Theorems


 Delay Theorem

Zx t  nT   z n
 x ( mT ) z m
m  n
Now x ( mT )  0, m  0 i.e. A causal
signal

 Zx t  nT   z  n  x ( mT ) z m
m 0
57

Proof of Shifting Theorems


 Delay Theorem

Zx t  nT   z  n  x ( mT ) z m
m 0
 Zx t  nT   z n
X (z)
58

Proof of Shifting Theorems


 Advance Theorem
To show
 n1
k 
Zx t  nT   z  X ( z )   x kT z 
n
 k 0 

Zx t  nT    x kT  nT z k
k 0
59

Proof of Shifting Theorems


 Advance Theorem

Zx t  nT    x t  nT z k
k 0

  k  n
z n
 x kT  nT z
k 0
60

Proof of Shifting Theorems


 Advance Theorem
    k  n
n1
k 
  x kT  nT z   x kT z 
Zx t  nT   z n  k  0 k 0 
 n1 k 
  x kT z 
 k 0 
61

Proof of Shifting Theorems


 Advance Theorem

  n1
k 
Zx t  nT   z   x kT z   x kT z 
n k
k  0 k 0 
  n1
k k 
 z   x kT z   x kT z 
n
k  0 k 0 

This step can be understood by substituting values for k =


0,1,2…
62

Example
Define discretized unit step function

1 k 0
1kT   
0 otherwise
Find the Z transform of
1k 1 &1k  4
1(kT) is the discretized version of the step function u(t)
63

Example

1
Z 1k  1  z 
1 1 z
1

1 z 1  z 1
4
Z 1k  4  z 
4 1 z
1

1 z 1  z 1
64

Example

k
y k    xh   y k   x0  x1  x2  ...xk 
h 0

y (k  1)  x0  x1  x2  ...xk  1


 y k   y (k  1)  xk 
 Y  z   z 1Y  z   X  z 
65

Example

Y z   z Y z   X z 
1

Y z   X z 
1
1
1 z
66

Complex Translation Theorem

Ze  akT
 
xkT   X ze aT

67

Example

 aT 1
  X ze  
Z te at aT Te z
1  e  aT
z 1 2

Note that the z-transform of the unit ramp is
1
Tz
Z (t ) 
1  z 
1 2
68

Initial Value Theorem

x0  lim X  z 
z 
Proof

X  z    xk z  k  x0  x1z 1  x2z  2  ...
k 0

taking limit as z   result is obvious


69

Final Value Theorem


Used to define steady-state performance of system.

lim xk   lim 1  z


k  z 1
 1
X z 
Proof
 
Z xk    xk z  k , Z xk  1   xk  1z k
k 0 k 0
 

 x k  z k
  x k  1 z k
 X  z   z 1
X z 
k 0 k 0
70

Final Value Theorem


Proof (cont.)
 

 x k  z k
  x k  1 z k
 X  z   z 1
X z 
k 0 k 0

taking limits
 k 
  

lim  xk z   xk  1z   lim 1  z 1 X  z 
k
z 1
 k 0 k 0  z 1
71

Final Value Theorem


Proof (cont.)
 k 
  

lim  xk z   xk  1z   lim 1  z 1 X  z 
k
z 1
 k 0 k 0  z 1
Assuming that xk   0, k  0 LHS becomes

 xk   xk  1  x(0)  x(1)  x(1)  x(0)  x(2)  x(1)


k 0

 ...
 x   lim xk 
k 
72

Final Value Theorem

Proof (cont.)
  
 lim xk   lim 1  z 1 X  z 
k  z 1
73

Inverse Z Transform
 Four Methods
–Direct Division
–Computational
–Partial Fraction Expansion
–Inversion Integral
b0  z  z1 ... z  z m 
Assume X ( z ) 
z  p1 ...z  pn 
X(z) = ratio of two polynomials in z
74

Direct Division
 Divide
denominator polynomial into
numerator polynomial to get series of form
X z   x(0)  x(T ) z  x(2T ) z  ...
1 2
75

Example
10 z  5
X z  
z  1z  0.2
10 z 1  5 z 2
X z   1 2
1  1.2 z  0.2 z
76

Example
10 z 1  5 z 2
X z  
1  1.2 z 1  0.2 z 2
10z-1
1-1.2z-1+0.2z-2 10z-1+5z-2
10z-1-12z-2+2z-3

17z-2-2z-3
77

Example
10z-1+17z-2
1-1.2z-1+0.2z-2 10z-1+5z-2
10z-1-12z-2+2z-3

17z-2-2z-3
17z-2-20.4z-3+3.4z-4

18.4z-3-3.4z-4
78

Example
10z-1+17z-2+18.4z-3
1-1.2z-1+0.2z-2 10z-1+5z-2
10z-1-12z-2+2z-3

17z-2-2z-3
17z-2-20.4z-3+3.4z-4

18.4z-3-3.4z-4
18.4z-3-22.08z-4+3.86z-5

18.68z-4-3.68z-5
79

Computational Method
 MATLAB filter command
– determine response to Kronecker delta input
» delta function for discrete time systems

1 k 0
xk   
0 otherwise
80

Computational Method
 MATLAB filter command
1 k  0
xk   
0 otherwise
1 2
b0  b1 z  b2 z  ...
Let G ( z )  1 2
1  a1 z  a2 z  ...
Form num  [b0 b1 b2 ....], den  [1 a1 a2 ....]
g  filter (num, den, x)
81

Computational Method
 Difference Equation Approach – based on
delay theorem
– Example
Again assume Kronecker delta input
Y ( z) 0.4673z 1  0.3393z 2
G( z)  
X ( z ) 1  1.5357 z 1  0.6607 z  2
Y ( z )1  1.5357 z 1  0.6607 z  2   X ( z )0.4673z 1  0.3393z  2 
82

Computational Method
 Difference Equation Approach - Example
  
Y ( z ) 1  1.5357 z 1  0.6607 z 2  X ( z ) 0.4673z 1  0.3393z 2 
Y ( z )  1.5357 z 1Y ( z )  0.6607 z  2Y ( z )  0.4673z 1 X ( z )
 0.3393z 2 X ( z )
 y (k )  1.5357 y (k  1)  0.6607 y (k  2)  0.4673x(k  1)
 0.3393x(k  2)
83

Computational Method
 Difference Equation Approach - Example

y (k )  1.5357 y (k  1)  0.6607 y (k  2)  0.4673x(k  1)


 0.3393x(k  2)
y ( 0)  0
y (1)  0.4673, x(0)  1
84

Partial Fractions
 Similar to technique used with Laplace

X z  
N ( z)
z  p1 z  p2 ...z  pn 
(divide by z if a zero appears at origin) & expand as :
a1 a2 an
X ( z)    ... 
z  p1 z  p2 z  pn
ai  residues
85

Partial Fractions
Calculation of residues

ai  z  pi X z z  pi

Double order pole


X z  
c1 c2

z  pi  z  pi 
2


c1   z  pi 
2
 d
 
X ( z ) z  pi , c2    z  pi  X ( z ) 
 dz
2

 z  pi
86

Example
Inverse Z transform of

X z  

1  e z aT

z  1z  e   aT

Zero at origin - divide by z


X z 

1  e  aT  
1

1
z 
z  1 z  e  aT

z  1 z  e aT
87

Example

X z  1 1
 
z z  1 z  e  aT
X z  
1 1
1

1 z 1  e  aT z 1
1  1  1  1   akT
Z  1 
 1, Z   aT 1 
e
1  z  1  e z 

x(kT)=1 - e-akT
88

Inversion Integral

Let C be a circle in the z plane centre origin such that all


the poles of X ( z ) z k 1 lie inside it, then

Z X ( z )  x(k )  x(kT ) 
1

1 k 1
X ( z ) z dz
2j C
89

Inversion Integral
Can easily be computed in terms of residues of X ( z ) z k 1
x(k )  K1  K 2  ...  K m ,
K i  residue of pole zi of X ( z ) z k 1

K i  lim  z  zi  X ( z ) z k 1
z  zi

Mutiple pole order q

Ki 
1 d q 1
q  1! z  zi dz

lim q 1  z  zi  X  z z k 1
q

90

Example
Using the inversion integral method find the inverse
Z Transform of

X z  
 
z 1  e  aT

 z  1 z  e aT 
91

Example
x(k )  K1  K 2 , where K1 , K 2 are the residues of at each pole
z k 1 X  z 
K1  residue of pole at z  1

 lim  z  1 
 
z k 1  e  aT 
1
 aT 
z 1
 
z  1 z  e  
92

Example
 aT
K 2  residue of pole at z  e
 z 1  e  
k  aT
 lim  z  1    e  akT
z 1
  z  1z  e 
 aT

xkT   K1  K 2  1  e  akT
93

Next Week
 Solution of Difference Equations & Z
Transform examples
 Impulse sampling,
 signal reconstruction - aliasing
 Pulse Transfer Functions
 Realization of Digital filters and controllers

Ref. - Ogata Chapter 3

You might also like