experiment5

# Eps d exponential respsonse kkk0110 f 2kkk

This preview shows page 1. Sign up to view the full content.

This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: jU)'¥£  " "   ¥ ©§  SUPPLEMENT: (5.67) 27 CHAPTER 5 MATLAB Solution Program % Experiment 5 % % PART 1 % z=1/2; p=[0 -1/2 1/3 -1/4]; K=1; [num,den]=zp2tf(z,p,K); % (a) Impulse respsonse k=0:1:20; h=dimpulse(num,den,k); % figure (1) plot(k,h,’*’); grid; xlabel(’Discrete time’); ylabel(’Impulse response’) print -deps figure5_1.eps % (b) Step respsonse ystep=dstep(num,den,k); % figure (2) plot(k,ystep,’*’); grid; xlabel(’Discrete time’); ylabel(’Step response’) print -deps figure5_2.eps % (c) Sinusiodal response kk=0:1:50; f=sin(2*kk); y=dlsim(num,den,f); % figure (3) plot(kk,y,’o’); grid; xlabel(’Discrete time’); ylabel(’Sinusiodal response’) print -deps figure5_3.eps % (d) Exponential respsonse kkk=0:1:10; f=(-2).ˆkkk; y=dlsim(num,den,f); % figure (4) plot(kkk,y,’*’); grid; xlabel(’Discrete time’); ylabel(’Exponential response’) print -deps figure5_4.eps % % PART 2 % % (a) Tranfer function factored form num=[1 -3 5 2 0]; den=[2 0 5 -3 1 -2 3 -1]; [zero,p,K]=tf2zp(num,den); % H(z)=K*((z-zero(1))*(z-zero(2))*...*(z-zero(4)))/((z-p(1))*...*(z-p(7))) % (b) Tranfer function partial fraction form and the impulse response num_z=[1 —3 5 2]; % H(z) divided by z [R,p,res]=residue(num,den); % H(z)/z=R(1)/(z-p(1))+R(2)/(z-p(2))+...+R(7)/(z-p(7)) + res(z) p p1=abs(p(1)) p3=abs(p(3)) p5=abs(p(5)) anglep1=angle(p(1)) anglep3=angle(p(3)) anglep5=angle(p(5)) R r1=abs(R(1)) r3=abs(R(3)) r5=abs(R(5)) r7=abs(R(7)) phi1=angle(R(1)) phi3=angle(R(3)) phi5=angle(R(5)) 28 LABORATORY EXPERIMENTS for LINEAR DYNAMIC SYSTEMS AND SIGNALS by ZORAN GAJIC h=2*r1*(abs(p(1)).ˆk).*cos(angle(p(1))*k+phi1)... +2*r3*(abs(p(3)).ˆk).*cos(...
View Full Document

{[ snackBarMessage ]}

Ask a homework question - tutors are online