summaryrefslogtreecommitdiff
path: root/1592/CH9/EX9.6/example_9_6.sce
blob: 57cd4a8a9121056a7e8691697d0f711dc21dcf41 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
//Scilab Code for Example 9.6 of Signals and systems by
//P.Ramakrishna Rao
clc;
clear;
clear z x y t T;
A=1;
n=1;
wo=2*%pi;
theta=%pi/2;
for t=-5:0.01:5;
    x(n)=A*cos(wo*t+theta);
    n=n+1;
end
t=-5:0.01:5;
plot(t,x);
title('x(t)');
n=1;
for T=-5:0.1:5;
    z(n)=(A^2/2)*cos(wo*T);
    n=n+1;
end
figure(1);
T=-5:0.1:5;
plot(T,z);
title('Rxx(T)');
xlabel('t in seconds')