applications of z-transform - kmuttwebstaff.kmutt.ac.th/~sarawan.won/inc212/oh_zapplication... ·...

12
1 Applications of z Applications of z- Transform Transform S Wongsa Dept. of Control Systems and Instrumentation Engineering, KMUTT 2 Overview Overview Applications of z-Transform • Solution of Linear Difference Equations • Discrete-Time LTI Systems • Characterisation of Discrete-Time LTI Systems • Frequency Response Analysis

Upload: others

Post on 22-Feb-2020

11 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Applications of z-Transform - KMUTTwebstaff.kmutt.ac.th/~sarawan.won/INC212/OH_ZApplication... · 2010-02-03 · 1 Applications of z-Transform S Wongsa Dept. of Control Systems and

11

Applications of zApplications of z--TransformTransform

S Wongsa

Dept. of Control Systems and Instrumentation Engineering,

KMUTT

22

OverviewOverview

Applications of z-Transform

• Solution of Linear Difference Equations

• Discrete-Time LTI Systems

• Characterisation of Discrete-Time LTI Systems

• Frequency Response Analysis

Page 2: Applications of z-Transform - KMUTTwebstaff.kmutt.ac.th/~sarawan.won/INC212/OH_ZApplication... · 2010-02-03 · 1 Applications of z-Transform S Wongsa Dept. of Control Systems and

33

Applications of z-Transform

Given the following difference equation

i) Taking z-transform to both sides and rearranging gives

)()(

)()(

...1

...)(

1

1

1

10 zXzA

zBzX

zaza

zbzbbzY

N

N

M

M =++++++

= −−

−−

where y and x are the output and the input variables, respectively.

ii) The solution of the difference equation is

y[n] = Z-1Y(z)

• Solution of linear difference equations

Mnxbn-xbnxb

Nnyanyanyany

M

N

][...]1[][

...][...]2[]1[][

10

21

−+++

+−−−−−−−=

44

Applications of z-Transform

• Solution of linear difference equations by MATLAB

For N ≥ M, the output of the system described by

can be found using the MATLAB command ‘filter’.

y=filter(b,a,x,zi) .

b = [b0 b1… bm]

a = [1 a1 a2… an ]

x is the input vector.

zi is the initial condition vector = [zi(1) zi(2) … zi(N)] and

where

)1()(

)1(...)2()1()2(

)(...)2()1()1(

32

21

−−=

+−−−−−−−=

−−−−−−−=

yaNzi

nyayayazi

nyayayazi

N

N

N

M

Mnxbn-xbnxb

Nnyanyanyany

M

N

][...]1[][

...][...]2[]1[][

10

21

−+++

+−−−−−−−=

Page 3: Applications of z-Transform - KMUTTwebstaff.kmutt.ac.th/~sarawan.won/INC212/OH_ZApplication... · 2010-02-03 · 1 Applications of z-Transform S Wongsa Dept. of Control Systems and

55

Applications of z-Transform

EXAMPLE : Zero initial conditions

]1[][]2[1.0]1[7.0][ −−=−+−− nununynyny

If u[n] is the unit step and suppose that y[n]=0, n<0, compute the output

response y[n].

−+−

−=

11.07.0)(

2

2

z

z

zz

zzzY

nnny )2.0(3

2)5.0(

3

5][ −=

2.03

2

5.03

5)(

−−

−=

z

z

z

zzY

)()()( zUzGzY =

66

Applications of z-Transform

0 2 4 6 8 10 12 14 16 18 200

0.1

0.2

0.3

0.4

0.5

0.6

0.7

0.8

0.9

1

n

y[n]

b=[1 -1];

a=[1 -0.7 0.01];

n=0:20;

x=ones(1,length(n));

y=filter(b,a,x);

Filter command:

Analytical solution:

for ii=0:length(u)-1

y1(ii+1)=5/3*(0.5^ii)-2/3*(0.2^ii);

end

Page 4: Applications of z-Transform - KMUTTwebstaff.kmutt.ac.th/~sarawan.won/INC212/OH_ZApplication... · 2010-02-03 · 1 Applications of z-Transform S Wongsa Dept. of Control Systems and

77

Applications of z-Transform

EXAMPLE : Non-zero initial conditions

]1[][]2[1.0]1[7.0][ −−=−+−− nununynyny

If u[n] is the unit step and suppose that y[-2]=0,y[-1]=1, compute the output

response y[n].

]1[]2[][1.0]1[7.0]2[ +−+=++−+ nununynyny

• Replacing n with n+2:

−−

=+−

−=

2.08.0

5.05.2

1.07.0

)1.07.1()(

2 z

z

z

z

zz

zzzY

• With y[0]=1.7 and y[1]=1.09,

nnny )2.0(8.0)5.0(5.2][ −=

88

Applications of z-Transform

b=[1 -1];

a=[1 -0.7 0.1];

n=0:20;

x=ones(1,length(n));

zi(1)=-a(2)*1;

zi(2)=-a(3);

y=filter(b,a,x,zi);

Filter command:

Analytical solution:

for ii=0:length(u)-1

y1(ii+1)=2.5*(0.5^ii)-0.8*(0.2^ii);

end

0 2 4 6 8 10 12 14 16 18 200

0.2

0.4

0.6

0.8

1

1.2

1.4

1.6

1.8

n

y[n]

Page 5: Applications of z-Transform - KMUTTwebstaff.kmutt.ac.th/~sarawan.won/INC212/OH_ZApplication... · 2010-02-03 · 1 Applications of z-Transform S Wongsa Dept. of Control Systems and

99

Discrete-Time LTI Systems

h[n] is the impulse response function. The z-transform of h[n] is referred to

as the transfer function.

)(

)()(

zX

zYzH =

1010

Difference Equation to Transfer Function

• Given a difference equation

If all initial conditions are zero, we find the transfer function to be

)(

)(

...1

...)(

1

1

1

10

zA

zB

zaza

zbzbbzH

N

N

M

M =++++++

= −−

−−

Mnxbn-xbnxb

Nnyanyanyany

M

N

][...]1[][

...][...]2[]1[][

10

21

−+++

+−−−−−−−=

Page 6: Applications of z-Transform - KMUTTwebstaff.kmutt.ac.th/~sarawan.won/INC212/OH_ZApplication... · 2010-02-03 · 1 Applications of z-Transform S Wongsa Dept. of Control Systems and

1111

EXAMPLE For the unit sample response

( ) ][1])5.0(5.0[][ nnh nn ⋅−+=

, find the transfer function H(z).

( ) ][1)5.0(][15.0)( 1 nnZzH nn ⋅−+⋅= −

25.0

2

5.05.0)(

2

2

−=

++

−=

z

z

z

z

z

zzH

Solution

1212

Gain, Poles & Zeros

))...()((

))...()(()(

21

21

p

z

n

n

pzpzpz

zzzzzzKzH

−−−

−−−=

A transfer function can be factored into

• K is called the system gain.

• zi, i=1,…,nz is called the system zeros.

• pi, i=1,…,np is called the system poles.

x

5.0)(

+=z

zzH

Page 7: Applications of z-Transform - KMUTTwebstaff.kmutt.ac.th/~sarawan.won/INC212/OH_ZApplication... · 2010-02-03 · 1 Applications of z-Transform S Wongsa Dept. of Control Systems and

1313

Characterisation of Discrete-Time LTI Systems

• Causality

A system is causal if the output sequence value at n=n0 depends only on the

input sequence values for n≤ n0, for every choice of n0.

For a causal discrete-time LTI system, we have

0,0][ <= nnh

1414

Characterisation of Discrete-Time LTI Systems

• Stability

• A system is stable in the bounded-input, bounded-output (BIBO) sense if

and only if every bounded input sequence produces a bounded output

sequence.

• It can be shown that a discrete-time LTI system is BIB0 stable if its

impulse response is absolutely summable, that is,

∞<∑∞

−∞=n

nh ][

Page 8: Applications of z-Transform - KMUTTwebstaff.kmutt.ac.th/~sarawan.won/INC212/OH_ZApplication... · 2010-02-03 · 1 Applications of z-Transform S Wongsa Dept. of Control Systems and

1515

• Stability

pnppp ,...,, 21

A discrete-time system is stable, if and only if

pi nip ,...,1for 1|| =<

• Stability condition

where are the poles of H(z).

Characterisation of Discrete-Time LTI Systems

1616

• Marginal Stability

A discrete-time system is marginally stable if and only if

poles. repeated allfor 1||

and poles dnonrepeate allfor 1||

<

i

i

p

p

• Marginal Stability Condition

Characterisation of Discrete-Time LTI Systems

Page 9: Applications of z-Transform - KMUTTwebstaff.kmutt.ac.th/~sarawan.won/INC212/OH_ZApplication... · 2010-02-03 · 1 Applications of z-Transform S Wongsa Dept. of Control Systems and

1717

Given a first-order system with a pole at z = a,

az

zzH

−=)( nanh =][

EXAMPLE

0 5 100

0.2

0.4

0.6

0.8

1

n

a=1.0

X

Stable Marginally Stable Unstable

Characterisation of Discrete-Time LTI Systems

1818

• The pulse response for various pole locations

Characterisation of Discrete-Time LTI Systems

Page 10: Applications of z-Transform - KMUTTwebstaff.kmutt.ac.th/~sarawan.won/INC212/OH_ZApplication... · 2010-02-03 · 1 Applications of z-Transform S Wongsa Dept. of Control Systems and

1919

Applications of z-Transform

• Frequency Response Analysis

Consider a DT transfer function H(z), the discrete frequency response function

(FRF) is

Ω=

Ω ==Ω jez

j zHeHH |)()()(

• is the magnitude or gain of the FRF. |)(| ΩH

• is the phase of the FRF. )(Ω∠H

where Ω is the discrete frequency in rad/sample.

2020

Applications of z-Transform

• Response to a sinusoidal input

If a DT system is stable with transfer function H(z), then in steady-state

Anx =][ )0(][ AHny =

nAnx 0sin][ Ω= ))(sin(|)(|][ 000 Ω∠+ΩΩ= HnHAny

nAnx 0cos][ Ω= ))(cos(|)(|][ 000 Ω∠+ΩΩ= HnHAny

Page 11: Applications of z-Transform - KMUTTwebstaff.kmutt.ac.th/~sarawan.won/INC212/OH_ZApplication... · 2010-02-03 · 1 Applications of z-Transform S Wongsa Dept. of Control Systems and

2121

Applications of z-Transform

• EXAMPLE

5.0)(

−=z

zzH

5.0)(

−=Ω

Ω

Ω

j

j

e

eH

Ω+−ΩΩ+Ω

=Ωsin)5.0(cos

sincos)(

j

jH

2222

Applications of z-Transform

• EXAMPLE

Ω+−ΩΩ+Ω

=Ωsin)5.0(cos

sincos)(

j

jH

• If a sinusoidal input is appliednnx3

sin][π

=

)303

1.1547sin(][ o−= nnyπ

1.1547,|)3/(| =πH o30)3/( −=∠ πH

6 8 10 12 14 16 18 20 22 24-1.5

-1

-0.5

0

0.5

1

1.5

n

u[n]

y[n]

Page 12: Applications of z-Transform - KMUTTwebstaff.kmutt.ac.th/~sarawan.won/INC212/OH_ZApplication... · 2010-02-03 · 1 Applications of z-Transform S Wongsa Dept. of Control Systems and

2323

Applications of z-Transform

• Bode plot

A Bode plot in the discrete time is a graph of |H(Ω)| and ∠H(Ω) plotted

as a function of Ω, where Ω is usually ranging from 0 to π.

10-2

10-1

100

0.5

1

1.5

2

|H( Ω)|

10-2

10-1

100

-30

-20

-10

0

Frequency (Ω) x π

∠ H( Ω)

Ω+−ΩΩ+Ω

=Ωsin)5.0(cos

sincos)(

j

jH

2424

Review Questions

1. The input x[n[ and the impulse response function h[n] are given by

10],[][],[][ <<== αα nunhnunx n

1.1 Computer y[n] using the convolution between x[n] and h[n].

1.2 Computer y[n] using the z-transform.

2. A system has the transfer function

)8.01)(5.01(

5.04.0)(

11

21

−−

−−

−−

−−=

zz

zzzH

2.1 Find the unit-pulse response h[n] for all n ≥0.

2.2 Compute an analytical expression for the step response.

2.3 Simulating the unit-pulse response and the step response by

using MATLAB to verify your result.