Assignment Document

Ztrans -Symbolic Math Toolbox

Pages:

Preview:


  • "INLAB N1symsanz%declare are variable as symbol typef = (a^n)*cos(n*pi/2); %the function x(n) ztrans(f,z)%z-tansform code INLAB 2symsanz %variable declaration as symbol typeassume(n>0) %n must be positive during computationx(n)=heaviside(n) %compu..

Preview Container:


  • "INLAB N1symsanz%declare are variable as symbol typef = (a^n)*cos(n*pi/2); %the function x(n) ztrans(f,z)%z-tansform code INLAB 2symsanz %variable declaration as symbol typeassume(n>0) %n must be positive during computationx(n)=heaviside(n) %compute u(n)h(n)=((0.5)^n)*(heaviside(n))% h(n) declarationX(z)=ztrans(x(n))%find z-transform of x(n)H(z)=ztrans(h(n))%find z-trnsform of h(n)Y(z)=X(z)*H(z)%convolution theoremy(n)=iztrans(Y(z))%inverse z-transform INLAB 3%INLAB3omega=-pi:pi/200:pi;%give omega vector valueH = tf([1 0],[1 -0.8],0.2)%computing transfert function num=[1 0], den=[1 - 0.8] and sampling time=0.2sp=pole(H)%determine pole of the tfz1=zero(H)%determine zero of the tfx=cos(omega);%x coordinate of unit circley=sin(omega);%y coordinate of unit circleplot(x,y)%unit circle plottingaxisequal %equalizing axisgridon%show grid in the graphxlabel('Real')% title of x coordinateylabel('Imaginary')%title of y coordinateholdon%plot on same figure all curvescatter(real(p),imag(p),'*')%show in graphic all polescatter(real(z1),imag(z1),'o')%show in graphic all zeros of tffigure %create new figure omega1=0:pi/200:pi;cplx=(cos(omega1)+i*sin(omega1))./(cos(omega1)+i*sin(omega1)- 0.8);%transform the transfer function in complex form(z=cos(teta)+isin(teta))plot(omega1,abs(cplx))%plot magnitude vs omegagridontitle('graph of r1/d2')%title of the graphxlabel('omega')%x titleomega2=[0 pi/4 2*pi/4 3*pi/4 pi]%different case of omega valueom1=abs((cos(omega2)+i*sin(omega2))./(cos(omega2)+i*sin(omega2)- 0.8))%magnitude of tf;holdonstem(omega2,om1)%show in the graphic magnitude of the four value of omegatext(omega2,om1,{'omega=0','omega=pi/4','omega=2pi/4','omega=3pi/4','omega= pi'})%write legend in the curveplot(omega1,angle(cplx))%plot argument vs omega of transfert function gridontitle('phase response')%titlexlabel('omega')ylabel('phase') Unit circle and pole/zeroMagnitude vs omega specific value INLAB 4%INLAB3omega=-pi:pi/200:pi;H = tf([1 0],[1 -0.8],0.2)%transfert function a)H1= tf([1 0],[1 -0.7],0.2)%transfert function b)H2 = tf([1 0],[1 -0.5],0.2)%transfert function c)H3 = tf([1 0],[1 -0.3],0.2)%transfert function d)%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%omega1=0:pi/200:pi;cplx=1./(cos(omega1)+i*sin(omega1)-0.8);%transform tf into complex formcplx1=1./(cos(omega1)+i*sin(omega1)-0.7);cplx2=1./(cos(omega1)+i*sin(omega1)-0.5);cplx3=1./(cos(omega1)+i*sin(omega1)-0.3);plot(omega1,abs(cplx),omega1,abs(cplx1),omega1,abs(cplx2),omega1,abs(cplx3) )gridontitle('graph of amplitude')xlabel('omega')legend('h1','h2','h3','h4')omega2=[0 pi/4 2*pi/4 3*pi/4 pi]om1=abs((cos(omega2)+i*sin(omega2))./(cos(omega2)+i*sin(omega2)-0.8)); figureplot(omega1,angle(cplx),omega1,angle(cplx1),omega1,angle(cplx2),omega1,angl e(cplx3))%plot in the same graph all phases of transfert functiongridontitle('phase response')xlabel('omega')legend('h1','h2','h3','h4')ylabel('phase')H1 is for the first tf, h2 for the second, h3 third,h4 fourth INLAB5%INLAB3omega=-pi:pi/200:pi;H = tf([0 1],[1 -0.8],0.2)%tf for the first H1= tf([1 0],[1 -0.8],0.2)%tf for the secondH2 = tf([1 0.8],[1 -0.8],0.2)%tf for the third%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%omega1=0:pi/200:pi;cplx=1./(cos(omega1)+i*sin(omega1)-0.8);%complex form of the tfcplx1=(cos(omega1)+i*sin(omega1))./(cos(omega1)+i*sin(omega1)-0.7);cplx2=(cos(omega1)+i*sin(omega1)+0.8)./(cos(omega1)+i*sin(omega1)-0.5);plot(omega1,abs(cplx),omega1,abs(cplx1),omega1,abs(cplx2))gridontitle('graph of amplitude')xlabel('omega')legend('h1','h2','h3')%create legendomega2=[0 pi/4 2*pi/4 3*pi/4 pi]%specific value of omegaom1=abs((cos(omega2)+i*sin(omega2))./(cos(omega2)+i*sin(omega2)-0.8)); figureplot(omega1,angle(cplx),omega1,angle(cplx1),omega1,angle(cplx2))gridontitle('phase response')xlabel('omega')legend('h1','h2','h3')ylabel('phase') INLAB 6%INLAB3omega=-pi:pi/200:pi;H = tf([0 1],[1 -0.9],0.2)H1= tf([0 1],conv([1 -0.9],conv([1 -0.8],[1 -0.7])),0.2)%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%omega1=0:pi/200:pi;cplx=1./(exp(i*omega1)-0.8);cplx1=1./[(exp(i*omega1)-0.9).*(exp(i*omega1)-0.8).*(exp(i*omega1)-0.7)];plot(omega1,abs(cplx),omega1,abs(cplx1))gridontitle('graph of amplitude')xlabel('omega')legend('h1','h2')omega2=[0 pi/4 2*pi/4 3*pi/4 pi]om1=abs((cos(omega2)+i*sin(omega2))./(cos(omega2)+i*sin(omega2)-0.8));figureplot(omega1,angle(cplx),omega1,angle(cplx1))gridontitle('phase response')xlabel('omega')legend('h1','h2') ylabel('phase') INLAB7%INLAB3omega=-pi:pi/200:pi;H = tf([1 0],[1 0.8],0.2)H1= tf([1 0],[1 0.7],0.2)H2 = tf([1 0],[1 0.5],0.2)H3 = tf([1 0],[1 0.3],0.2)%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%omega1=0:pi/200:pi;cplx=1./(cos(omega1)+i*sin(omega1)-0.8);cplx1=1./(cos(omega1)+i*sin(omega1)-0.7);cplx2=1./(cos(omega1)+i*sin(omega1)-0.5);cplx3=1./(cos(omega1)+i*sin(omega1)-0.3);plot(omega1,abs(cplx),omega1,abs(cplx1),omega1,abs(cplx2),omega1,abs(cplx3) )gridontitle('graph of amplitude')xlabel('omega')legend('h1','h2','h3','h4') omega2=[0 pi/4 2*pi/4 3*pi/4 pi]om1=abs((cos(omega2)+i*sin(omega2))./(cos(omega2)+i*sin(omega2)-0.8));figureplot(omega1,angle(cplx),omega1,angle(cplx1),omega1,angle(cplx2),omega1,angl e(cplx3))gridontitle('phase response')xlabel('omega')legend('h1','h2','h3','h4')ylabel('phase') INLAB8%INLAB3omega=-pi:pi/200:pi;H = tf(conv([1 -1],[1 1]),conv([1 -(exp(i*pi/4))],[1 -(exp(i*(- pi/4)))]),0.2)%conv is used for multiplying two polynomeH1= tf(conv([1 -1],[1 1]),conv([1 -0.96*(exp(i*pi/4))],[1 -0.96*(exp(i*(- pi/4)))]),0.2)H2 = tf(conv([1 -1],[1 1]),conv([1 -0.83*(exp(i*pi/4))],[1 -0.83*(exp(i*(- pi/4)))]),0.2)%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%omega1=0:pi/200:pi;cplx=((exp(i*omega1)-1).*(exp(i*omega1)+1))./((exp(i*omega1)- exp(i*pi/4)).*(exp(i*omega1)-exp(-i*pi/4)));cplx1=((exp(i*omega1)-1).*(exp(i*omega1)+1))./((exp(i*omega1)- 0.96*exp(i*pi/4)).*(exp(i*omega1)-0.96*exp(-i*pi/4)));cplx2=((exp(i*omega1)-1).*(exp(i*omega1)+1))./((exp(i*omega1)- 0.83*exp(i*pi/4)).*(exp(i*omega1)-0.83*exp(-i*pi/4)));plot(omega1,abs(cplx),omega1,abs(cplx1),omega1,abs(cplx2))title('graph of amplitude')legend('gamma=1','gamma=0.96','gamma=0.83')ylim([0 35])gridon xlabel('omega')figureplot(omega1,angle(cplx),omega1,angle(cplx1),omega1,angle(cplx2))gridontitle('phase response')xlabel('omega')legend('gamma=1','gamma=0.96','gamma=0.83')ylabel('phase')"

Why US?

Because we aim to spread high-quality education or digital products, thus our services are used worldwide.
Few Reasons to Build Trust with Students.

128+

Countries

24x7

Hours of Working

89.2 %

Customer Retention

9521+

Experts Team

7+

Years of Business

9,67,789 +

Solved Problems

Search Solved Classroom Assignments & Textbook Solutions

A huge collection of quality study resources. More than 18,98,789 solved problems, classroom assignments, textbooks solutions.

Scroll to Top