summaryrefslogtreecommitdiff
path: root/1592/CH5/EX5.9.iii/Example_5_9_iii.sce
blob: 0b532366b6de8a5c03435456785fcb297c120036 (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(iii) 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(n+1)*cos(0.4*%pi*n);
    q=X(n+1)+q;
end
disp(q,'Y3(e^2j) at a=0.5');
for n=0:33;
    X(n+1)=z(n+1)*x2(n+1)*cos(0.4*%pi*n);
    q=X(n+1)+q;
end
disp(q,'Y3(e^2j) at a=-0.5');