Signals and Systems (Lab) Resource Person : Hafiz Muhammad Ijaz COMSATS Institute of Information...

21
Signals and Systems (Lab) Resource Person : Hafiz Muhammad Ijaz COMSATS Institute of Information Technology Lahore Campus www.powerpointpresentationon.com

Transcript of Signals and Systems (Lab) Resource Person : Hafiz Muhammad Ijaz COMSATS Institute of Information...

Page 1: Signals and Systems (Lab) Resource Person : Hafiz Muhammad Ijaz COMSATS Institute of Information Technology Lahore Campus .

Signals and Systems (Lab)

Resource Person : Hafiz Muhammad Ijaz

COMSATS Institute of Information Technology

Lahore Campus

www.powerpointpresentationon.com

Page 2: Signals and Systems (Lab) Resource Person : Hafiz Muhammad Ijaz COMSATS Institute of Information Technology Lahore Campus .

EXPERIMENT # 11

Z-Transform and its MATLAB

implementation .

Page 3: Signals and Systems (Lab) Resource Person : Hafiz Muhammad Ijaz COMSATS Institute of Information Technology Lahore Campus .

In This Lab… Introduction to Z-TransformHow to implement Z-transform and Inverse Z-transform in

MATLAB?What is meant by Region of Convergence (ROC)

Pole Zero Plot Stable and Unstable Systems Impulse Response and Step Response

MATLAB Implementation of inverse Z-transform using Partial Fraction Expansion

How to use Z-Transform to solve Difference Equations using MATLAB?

Page 4: Signals and Systems (Lab) Resource Person : Hafiz Muhammad Ijaz COMSATS Institute of Information Technology Lahore Campus .

Introduction to Z-Transform

Bilateral Z-Transform

Unilateral Z-Transform

Inverse Z-Transform

Page 5: Signals and Systems (Lab) Resource Person : Hafiz Muhammad Ijaz COMSATS Institute of Information Technology Lahore Campus .

MATLAB Implementation of Z-Transform

Page 6: Signals and Systems (Lab) Resource Person : Hafiz Muhammad Ijaz COMSATS Institute of Information Technology Lahore Campus .

Solution of Example 1syms z

x0=3; x1=5;x2=4;x3=3;

Xz=x0*(z^0)+x1*(z^-1)+x2*(z^-2)+x3*(z^-3);

pretty(Xz)

Page 7: Signals and Systems (Lab) Resource Person : Hafiz Muhammad Ijaz COMSATS Institute of Information Technology Lahore Campus .

Solution of Example 1 Cont…

syms zx=[3 5 4 3];n=[0 1 2 3];X=sum(x.*(z.^-n));pretty(X)

Page 8: Signals and Systems (Lab) Resource Person : Hafiz Muhammad Ijaz COMSATS Institute of Information Technology Lahore Campus .

The command ztrans and iztrans

Page 9: Signals and Systems (Lab) Resource Person : Hafiz Muhammad Ijaz COMSATS Institute of Information Technology Lahore Campus .

Solution of Example 2syms n zf = 2^n ;

Z = ztrans(f)

Zt = simplify(Z)

iz=iztrans(Z)

Page 10: Signals and Systems (Lab) Resource Person : Hafiz Muhammad Ijaz COMSATS Institute of Information Technology Lahore Campus .

Discrete Time System Properties

Page 11: Signals and Systems (Lab) Resource Person : Hafiz Muhammad Ijaz COMSATS Institute of Information Technology Lahore Campus .

Pole-Zero Plot and Stability

num=[.1 .1];den=[1 -1.5 0.7]; zplane(num,den)

Is this system is STABLE??

-1 -0.5 0 0.5 1

-1

-0.8

-0.6

-0.4

-0.2

0

0.2

0.4

0.6

0.8

1

Real Part

Imag

inar

y P

art

Page 12: Signals and Systems (Lab) Resource Person : Hafiz Muhammad Ijaz COMSATS Institute of Information Technology Lahore Campus .

Pole-Zero Plot Cont…

figure(2)

H=tf(num,den,1);

pzmap(H)

-1 -0.5 0 0.5 1-1

-0.8

-0.6

-0.4

-0.2

0

0.2

0.4

0.6

0.8

1Pole-Zero Map

Real Axis

Imag

inar

y A

xis

Page 13: Signals and Systems (Lab) Resource Person : Hafiz Muhammad Ijaz COMSATS Institute of Information Technology Lahore Campus .

Step Responsefigure(3)subplot(2,1,1)num=[.1 .1];den=[1 -1.5 0.7];dstep(num,den) subplot(2,1,2)Stepz(num,den)

0 5 10 15 20 25 30 35 40 45 500

0.5

1

1.5

n (samples)

Am

plitu

deStep Response

0 5 10 15 20 25 30 350

0.5

1

1.5Step Response

Time (sec)

Am

plitu

de

Page 14: Signals and Systems (Lab) Resource Person : Hafiz Muhammad Ijaz COMSATS Institute of Information Technology Lahore Campus .

Impulse Response figure(4)subplot(2,1,1)dimpulse(num,den) subplot(2,1,2)impz(num,den)

0 5 10 15 20 25 30 35-0.2

0

0.2

0.4

0.6Impulse Response

Time (sec)

Am

plitu

de

0 5 10 15 20 25 30 35 40 45 50-0.2

0

0.2

0.4

0.6

n (samples)

Am

plitu

deImpulse Response

Page 15: Signals and Systems (Lab) Resource Person : Hafiz Muhammad Ijaz COMSATS Institute of Information Technology Lahore Campus .

Partial Fraction Expansion of a Rational Function

Page 16: Signals and Systems (Lab) Resource Person : Hafiz Muhammad Ijaz COMSATS Institute of Information Technology Lahore Campus .

The Command residue

Page 17: Signals and Systems (Lab) Resource Person : Hafiz Muhammad Ijaz COMSATS Institute of Information Technology Lahore Campus .

Solution of Example 4

num=[ 1 3 1];den=[ 1 0 -3 2][R,P,K]=residue(num,d

en)

Page 18: Signals and Systems (Lab) Resource Person : Hafiz Muhammad Ijaz COMSATS Institute of Information Technology Lahore Campus .

Solution of Difference Equation using Z-Transform

Thus

Page 19: Signals and Systems (Lab) Resource Person : Hafiz Muhammad Ijaz COMSATS Institute of Information Technology Lahore Campus .

Solution of Example 5syms n z Y X=ztrans(0.9^n,z) Y1=z^(-1)*Y;Y2=z^(-2)*Y; G=Y+0.5*Y1+2*Y2-X; SOL=solve(G,Y);pretty(SOL); y=iztrans(SOL,n);

Page 20: Signals and Systems (Lab) Resource Person : Hafiz Muhammad Ijaz COMSATS Institute of Information Technology Lahore Campus .

Tutorial Questions

Page 21: Signals and Systems (Lab) Resource Person : Hafiz Muhammad Ijaz COMSATS Institute of Information Technology Lahore Campus .

SummaryIntroduction to Z-Transformimplement Z-transform and Inverse Z-transform using

MATLAB.Region of Convergence (ROC)

Pole Zero Plot Stable and Unstable Systems Impulse Response and Step Response

MATLAB Implementation of inverse Z-transform using Partial Fraction Expansion

Solution of Difference Equations using MATLAB.