summaryrefslogtreecommitdiff
path: root/1592/CH5/EX5.9.i/Example5_9_i.sce
blob: 27f2ce0b9bebe5aba5f92a5fe292815df7ea4eb8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
//Scilab Code for Example 5.9(i) of Signals and systems by
//P.Ramakrishna Rao
clc;
clear;
q=0;
a1=0.5
a2=-0.5;
n=1:101;
x1=a1^n;
x2=a2^n;
w=2;
n=0:100;
z=(exp(-%i*w*n));
for n=0:33;
    X(n+1)=z(n+1)*x1(3*n+1);
    q=X(n+1)+q;
end
disp(q,'Y1(e^2j) at a=0.5');
for n=0:33;
    X(n+1)=z(n+1)*x2(3*n+1);
    q=X(n+1)+q;
end
disp(q,'Y1(e^2j) at a=-0.5');