summaryrefslogtreecommitdiff
path: root/1592/CH7/EX7.23/Example_7_23.sce
blob: b24378108a4fe065bd16016be6dcaf0e20631947 (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
27
28
29
30
31
32
33
34
35
36
//Scilab Code for Example 7.23 of Signals and systems by
//P.Ramakrishna Rao
//Convolution of two signals
clc;
clear;
clear x y n;
for n=0:10;
    x(n+1)=(0.5)^n*u(n-2);
end
c = gca();
c.y_location = "origin";
c.x_location = "origin";
n=0:10;
plot2d3(n,x,-4);
title('x(n)')
xlabel('n')
for n=0:10;
    y(n+1)=u(n);
end
figure(1);
n=0:10;
c = gca();
c.y_location = "origin";
c.x_location = "origin";
plot2d3(n,y,-4);
title('y(k)')
xlabel('k')
z=conv(x,y);
figure(2);
n=0:20;
c = gca();
c.y_location = "origin";
c.x_location = "origin";
plot2d3(n,z,-4);
title('Convoluted signal     z(t)')
xlabel('t')