You are on page 1of 9

# PROGRAM 1

clc;
clear all;
close all;
a = input('Enter the sequence, x(n): ');
syms z;
r = poly2sym(a,z);
disp('The z transform of the given sequence is, X(z): ');
disp(r);

OUTPUT 1
Enter the sequence, x(n): [1 2 3 4 5]
The z transform of the given sequence is, X(z):
z^4 + 2*z^3 + 3*z^2 + 4*z + 5

X(z): '). clear all. disp('The z transform is. syms z. r = poly2sym(a. a =[3 -2 0 0 1 4 5 7]. x(n): '). disp(p). OUTPUT 2 The given sequence is.z). X(z): (3*z^7 .PROGRAM 2 clc. p = r*(z^-4). close all. disp(a). x(n): 3 -2 0 0 1 4 5 7 The z transform is.2*z^6 + z^3 + 4*z^2 + 5*z + 7)/z^4 . disp('The given sequence is.

zplane(z. disp(' '). disp('The zeros are at. D = (z^3)*(z-exp(-a)). disp('The poles are at. syms z. grid on.p). N = 2*((1+exp(-a))-z). OUTPUT 3 The given polynomial is: 2[(z^-4)-(z^-3)*(1-exp(-a)(z^-1))] -----------------------------------(1-exp(-a)(z^-1)) Please enter a value for the variable "a": 0. disp(' ------------------------------------'). d = sym2poly(D). disp('The given polynomial is: 2[(z^-4)-(z^-3)*(1-exp(-a)(z^-1))]'). disp(' '). a=input('Please enter a value for the variable "a": '). disp(z). z = roots(n).4 . disp(' (1-exp(-a)(z^-1))'). p = roots(d).PROGRAM 3 clc. n = sym2poly(N). disp(p). z= '). close all. clear all. z= ').

6703 PLOT . z= 1.6703 The poles are at.The zeros are at. z= 0 0 0 0.

PROGRAM 4 clc. for(i=1:1:n) Quotient(i)=a(1)/b(1). b=input('Please enter the coefficients of denominator: '). X(z)= 1').5(z^-1)+0. disp(' (1-1.0000 1. disp(' '). end.7500 1.5(z^-2))'). a=input('Please enter the coefficients of numerator: '). disp(' ------------------------').5(z^-2)) Please enter the coefficients of numerator: [1] Please enter the coefficients of denominator: [1 -1. OUTPUT 4 The given function. close all. end. end.8750 . for(k=2:1:length(b)) a(k)=a(k)-b(k)*(Quotient(i)). clear all. disp(Quotient).5 0. disp(' ').5] Please enter the number of terms in quotient: 4 The inverse z transformed sequence is: 1. disp('The given function. for (i=length(a)+1:1:n) a(i)=0. for(j=1:1:length(a)-1) a(j)=a(j+1). end. X(z)= 1 -----------------------(1-1. disp('The inverse z transformed sequence is: ').5000 1. n=input('Please enter the number of terms in quotient: ').5(z^-1)+0.

disp(p). c=length(k). disp('The residues are at: '). T=iztrans(t). disp('The inverse z transformed sequence is: '). disp('The given function. close all. end. U=U+iztrans(u(i)). disp(' -------------------------------'). b=input('Please enter the coefficients of denominator: '). disp(k). for(i=1:1:length(U)) e=e+U. disp('The poles are at: '). syms z. disp(' '). disp(r). . end. d=length(r).b). for(i=1:1:d) u(i)=r(i)/(z-p(i)). disp(' (1+5/6(z^-1)+1/6(z^-2))'). a=input('Please enter the coefficients of numerator: '). clear all. [r. disp('The direct terms are: ').PROGRAM 5 clc. end. syms U U =0. for(i=1:1:length(T)) e=e+T(i).k]=residue(a. disp(' '). disp(e). end. X(z)= 1+3(z^-1)+11/6(z^-2)+1/3(z^-3)').p. e=0. for(i=1:1:c) t(i)=k(i)*(z^(-i+1)).

5000 -0. 0))/6 . X(z)= 1+3(z^-1)+11/6(z^-2)+1/3(z^-3) ------------------------------(1+5/6(z^-1)+1/6(z^-2)) Please enter the coefficients of numerator: [1 3 11/6 1/3] Please enter the coefficients of denominator: [1 5/6 1/6] The residues are at: -0.0000 2.OUTPUT 5 The given function.3333 The direct terms are: 1.(-1/3)^n/3 + (5*kroneckerDelta(n.1111 The poles are at: -0.1.1667 The inverse z transformed sequence is: (13*kroneckerDelta(n .2500 0. 0))/6 + (-1/2)^n/2 .

clear all. disp(['and '. end. syms z. A=sym2poly(a). B=sym2poly(b). Z=roots(A). c=a/b. P=roots(B). else e=1.num2str(d)]). b=(z-0.5). e=0. d=min(P).5)^(10))*((z+1. end. end. zplane(Z. d f=min(p).num2str(d)]).P).num2str(real(f))]). end. end. else e=-1.5)*(z+3. a=z^10. elseif(e==-1) disp(['The ROC is the region outside the circle of radius : '.5)^(2))*(z+2. xn=iztrans(c) %polyval(xn. elseif(e==0) disp(['The ROC is the region inside the circles of radii : '.num2str(d)]). if(d<1) if(length(P)>1) for(i=1:1:length(P)) if(P(i)>1||P(i)< -1) p(i)=P(i).5)*((z-1. if(e==1) disp(['The ROC is the region inside the circle of radius : '. close all.PROGRAM 7 clc. -8) .

8))/2400 + ((3/2)^n*binomial(n .4498 xn = (9005352289*(3/2)^n*binomial(n .1.1.(13*(-3/2)^n)/18432 + (5910537885233*(3/2)^n)/47185920000000000 + (1953125*(-5/2)^n)/1610612736 (40353607*(-7/2)^n)/80000000000 . 6))/11520000 + (31649*(3/2)^n*binomial(n . 3))/737280000000 (19331799781*(3/2)^n*binomial(n .1.1. 9))/180 + (1/2)^n/24576 . 7))/288000 + (91*(3/2)^n*binomial(n .5 and 1.1))/9216 + (72912370241*(3/2)^n*(n . 2))/9830400000000 + (1360727153*(3/2)^n*binomial(n . 4))/18432000000 + (7950009*(3/2)^n*binomial(n . 5))/51200000 + (1992337*(3/2)^n*binomial(n .1))/1179648000000000 PLOT .5000 The ROC is the region inside the circles of radii : 0.((-3/2)^n*(n .1.OUTPUT 7 d= 0.1.1.1.