z-transformexample. plotting the z-transform the z-transform is a complex function of a complex...

9
1 Copyright F.L. Lewis 1999 All rights reserved Updated: Monday, September 18, 2017 Z-Transform Given a time series , , , ) ( 2 1 0 1 y y y k u y k , its Z-transform is given by 0 ) ( k k k z y z Y . The discrete time variable is k. The one-sided transform is used (i.e. lower limit of zero) since the time series is multiplied by the discrete unit step ) ( 1 k u . The Z-transform variable z is a complex variable, like the Laplace transform variable j s . In connection with finding Z-transforms it is useful to recall the series identity 1 0 1 1 N k N k a a a . If 1 a , the series converges and one has also 0 1 1 k k a a . Example. The Z-transform of the discrete-time exponential , , , ) ( 2 1 0 1 a a a k u a y k k is given by 0 0 1 1 1 1 ) ( ) ( k k k k k a z z az az z a z Y . This has a pole at z=a and a zero at z=0. Example. The discrete unit step , 1 , 1 , 1 ) ( 1 k u (i.e. a sequence of 1's which begins at time k=0) is a special case of the discrete exponential having a=1. Its Z-transform is 1 1 1 ) ( 1 z z z z Y , which has a pole at z=1 and a zero at z=0. Example. The discrete unit pulse , 0 , 0 , 1 ) ( 0 k u (i.e. a one occurring at time k=0) has transform 0 0 1 ) ( ) ( k k u z Y ,

Upload: others

Post on 14-Mar-2020

12 views

Category:

Documents


0 download

TRANSCRIPT

1

Copyright F.L. Lewis 1999

All rights reserved Updated: Monday, September 18, 2017

Z-Transform Given a time series ,,,)( 2101 yyykuyk , its Z-transform is given by

0

)(k

kk zyzY .

The discrete time variable is k. The one-sided transform is used (i.e. lower limit of zero) since the time series is multiplied by the discrete unit step )(1 ku . The Z-transform variable z is a complex variable, like the Laplace transform variable js . In connection with finding Z-transforms it is useful to recall the series identity

1

0 1

1N

k

Nk

a

aa .

If 1a , the series converges and one has also

0 1

1

k

k

aa .

Example. The Z-transform of the discrete-time exponential

,,,)( 2101 aaakuay k

k is given by

0 01

1

1

1)()(

k k

kkk

az

z

azazzazY .

This has a pole at z=a and a zero at z=0. Example. The discrete unit step ,1,1,1)(1 ku (i.e. a sequence of 1's which begins at time k=0) is a special case of the discrete exponential having a=1. Its Z-transform is

11

1)(

1

z

z

zzY ,

which has a pole at z=1 and a zero at z=0. Example. The discrete unit pulse ,0,0,1)(0 ku (i.e. a one occurring at time k=0) has

transform

0

0 1)()(k

kuzY ,

2

i.e. a constant surface which has no poles or zeros. Note that Z-transforms of causal signals beginning at k=0 generally have a z in the numerator. This is due to the fact that what appears in the summation is z-1.

Table of Z Transforms Unit pulse 1,0,0,… 1 Unit step ,...1,1,1,1)(1 ku

11

1 z

Discrete ramp k= 0,1,2,3,… 21

1

)1(

z

z

Discrete exponential ka 11

1 az

Sampled Signals, T= sampling period

tsin kTsin 21

1

cos21

sin

zTz

Tz

tcos kTcos 21

1

cos21

cos1

zTz

Tz

te t sin kTe kT sin 221

1

cos21

sin

zeTze

TzeTT

T

te t cos kTe kT cos 221

1

cos21

cos1

zeTze

TzeTT

T

Sampling of Continuous-Time Signals The continuous-time exponential is )()( tuety t

t , where for stability the real

part of the pole is negative. Selecting a SAMPLING PERIOD T, one relates the continuous and discrete time variables by

kTt . Then, the continuous exponential becomes

kkTakTt aeee )(

with Tea . This provides a mapping between continuous poles and discrete poles of time functions.

For instance, if the continuous-time pole is at s= = -2 and the sampling period is T= 10msec= 0.01 sec, then one has the discrete pole at 98.002.)01(.2 eez . Note that a continuous pole at s= 0 maps to a discrete pole at 10 ez .

3

Given this mapping, it is now instructive to compare the examples above with their continuous-time counterparts. In fact, note that the continuous unit step, which has the Laplace transform of 1/s, has a pole at s=0, while the discrete unit step has a pole at z=1. The continuous exponential te has a pole at s=, while the discrete exponential has a pole at Tez , with T the sampling period. The discrete unit pulse and the (continuous) unit impulse both have constant transforms of 1.

Inverse Z-Transform The inverse Z-transform may be found in several ways. Example. Inverse Z-Transform by Long Division

Suppose 72.07.1

)(2

zz

zzY . One can determine the associated time series yk

by writing this in the form

0

22

110)(

k

kk zyzyyzyzY

by any technique. One way to do this is by long division. In fact, one may write

21

1

1

21

2

224.189.27.172.07.1

72.07.1

7.172.07.1

zzz

zz

zzzzz

.

The inverse Z-transform appears in the quotient, so that yk= 0, 1, 1.7, … Example. Inverse Z-Transform by Partial Fraction Expansion Exactly as for the Laplace transform inverse, one may use the PFE. Thus, write

8.0

10

9.0

10

8.0

10

9.0

10

)8.0)(9.0(

1

72.07.1)(

2

z

z

z

zz

zzz

zzzz

zzY .

The residues are determined exactly as in the continuous-time case. Note, however, that one keeps the factor z out of the PFE to obtain the z in the numerators of the expansion. This is necessary since Z-transforms generally have a zero at z=0. Now, according to the examples worked above, the time series is given as

)()8.09.0(10 1 kuy kkk .

Evaluating the first few terms gives yk= 0, 1, 1.7, … This is the same result obtained by long division.

4

The PFE is generally preferable to long division since it yields closed-form solutions.

Difference Equations To simulate the continuous-time state equation ),( uxfx one must use a numerical integrator such as Runge-Kutta. This means that to implement a controller described in terms of differential equations, one needs a numerical integrator, which is inconvenient. This applies to any controller K(s) described in terms of Laplace transforms. The simulation of DIFERENCE EQUATIONS is far easier than the simulation of differential equations. This means that controllers described in terms of difference equations are very easy to implement on a digital microprocessor. This applies to controllers K(z) described in terms of Z-transforms. Before showing how to design digital controllers, we briefly discuss difference equations, and relate them to Z-transforms. A linear time-invariant system may be described in discrete time in terms of its DISCRETE TRANSFER FUNCTION H(z). Then the input U(z) and output Y(z) are related by

)()()( zUzHzY . Writing more detail in terms of the numerator and denominator polynomials, one has

)()()()(1

11

11

10 zUazazaz

bzbzbzbzUzHzY

nnnn

mmmm

where the denominator degree is n , the numerator degree is nm , and the relative degree is n-m. Dividing through by zn one may write

)(1

)()()()1(

11

1

)1(1

110 zU

zazaza

zbzbzbbzzUzHzY

nn

nn

mm

mmd

where the SYSTEM DELAY is d= n-m. Now one writes )()()()1( 1

101

1 zUzbzbbzzYzaza mm

dnn

.

We will abuse notation now and define an operator z-1 in the time domain. To see what z-1yk means, write its transform as

0 0

)1(1 )()('k k

kk

kk zyzyzzY

Now change variables to K=k+1 to see that

11)('

K

KK zyzY .

That is, z-1yk is a delayed version yk-1 of the time series.

5

The Z-transform SHIFT PROPERTY says that multiplying the Z-transform by z-1 delays the time series by one. Compare this to the Laplace transform property which says that multiplying the transform by 1/s amounts to integrating the time function. In continuous-time systems, the memory resides in the integrators 1/s. In discrete-time systems, the memory resides in the delays z-1. A series of delays is nothing but a shift register. Now one may write the input/output relation of the digital system as

mdkmdkdknknkk ubububyayay 11011

or

mdkmdkdknknkk ubububyayay 11011 .

This is a difference equation describing the digital system. Example. Let the digital transfer function be

211

2 72.07.11

1

72.07.1)(

zzz

zz

zzH .

Then one has Y(z)=H(z)U(z) or )()()72.07.11( 121 zUzzYzz

so that in the time domain one has the difference equation

121 72.07.1 kkkk uyyy .

The system delay is d=1. The meaning of the system delay is that a control uk applied at time k has no influence on the output until time k+d. In the, last example, for instance, uk affects yk+1, not yk. Example. Plotting the Z-Transform The Z-transform is a complex function of a complex variable z. As such, it is a four-dimensional object. Nevertheless, we can make various 3-D plots to get some intuition about it. This is very easy using MATLAB. Consider the transfer function

2( )

1.9 0.9425

zH z

z z

This has a zero at z=0, zero at infinity, and poles at 0.9500 + 0.2000i 0.9500 - 0.2000i The magnitude of the poles is 0.9708, which is inside the unit circle so the system is stable. The time plot of pulse response h(k) is a sampled decaying sinusoid. Function H(z) is converted to a complex function of the variable z by substituting z s j . Then it is straightforward to compute and plot the magnitude of H(z) using

6

the MATLAB code below. Various 3-D plots of the magnitude are given to provide intuition on this function. Similarly, 3-D plots of the phase can be made.

We are lucky that Hendrik Bode did not have MATLAB. As such he developed highly intuitive analysis techniques based on frequency domain plots that can be sketched by knowing properties of H(z) including pole and zero locations, rolloff frequencies, and slopes of magnitude plots. Bode worked in Bell Labs in New York city from 1929 and developed The Bode plot and the ideas of gain margin and phase margin. The importance of this work is that he showed that one does not need the entire 3-D magnitude plot of the Z-transform to study system properties. One only needs a 2-D plot generated from the 3-D plot by graphing the magnitude as frequency increases around the unit circle. This plot can be quickly sketched by engineers with some experience on Z-transform properties.

7

Matlab code w=linspace(-2,2,80); s=linspace(-2,2,80); [W,S]=meshgrid(w,s); dre=S.^2-W.^2-1.9*S+0.9425; dim=2*S.*W-1.9*W; den=dre+1i*dim; num=S+1i*W; z=abs(num)./abs(den); mesh(s,w,z) %Plot regular magnitude with unit circle hold on theta=-pi:0.01:pi; xx=cos(theta); yy=sin(theta); plot3(xx,yy,zeros(1,numel(xx)),'r','LineWidth',3) ylabel('Re') xlabel('Im') zlabel('|G(z)|') figure mesh(s,w,z) %Plot regular magnitude with unit circles as cylinder hold on for k=0:70 plot3(xx,yy,k*ones(1,numel(xx)),'r') hold on end ylabel('Re') xlabel('Im') zlabel('|G(z)|') figure mesh(s,w,z) %Plot magnitude in interval 0 to 1 axis([-2 2 -2 2 0 1]) ylabel('Re') xlabel('Im') zlabel('|G(z)|') figure logz=log(z); mesh(s,w,logz) %Plot log of magnitude ylabel('Re') xlabel('Im') zlabel('log(|G(z)|)')

8

Magnitude plots showing the unit circle in red

-2-1

01

2

-2

-1

0

1

20

20

40

60

80

100

ImRe

|G(z

)|

-2-1

01

2

-2

-1

0

1

20

20

40

60

80

100

ImRe

|G(z

)|

9

Zoomed magnitude plot and log magnitude plot

-2

0

2

-2-10120

0.2

0.4

0.6

0.8

1

ImRe

|G(z

)|

-2

0

2

-2-1

01

2-4

-2

0

2

4

6

ImRe

log(

|G(z

)|)