summaryrefslogtreecommitdiff
path: root/1592/CH2/EX2.38.a/example_2_38_i_.sce
blob: 74a4d079de5f8c4eda1268a9a84bd8521ff672cd (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
//Scilab Code for Example 2.38(i) of Signals and systems by
//P.Ramakrishna Rao
//Inverse Z Transform:ROC |z|>2
clear;
clc;
z = %z;
syms n z1;
//To find out Inverse z transform z must be linear z = z1
X  =z^2/(z^2+3*z+2);
X1 = denom(X);
zp = roots(X1)
X1 = z1^2/(z1^2+3*z1+2);
F1 = X1*(z1^(n-1))*(z1-zp(1));
F2 = X1*(z1^(n-1))*(z1-zp(2));
h1 = limit(F1,z1,zp(1));
disp(h1*'u(n)','h1[n]=')
h2 = limit(F2,z1,zp(2));
disp((h2)*'u(n)','h2[n]=');
disp((h1)*'u(n)'+(h2)*'u(n)','h[n]=');
////Result
//  h[n]= (2(- 2)^n+1 - (- 1)^n)*u(n)