summaryrefslogtreecommitdiff
path: root/1592/CH7/EX7.19/Example_7_19.sce
blob: e188cc9aa44d9f6e6286335d2e24dbf215df8f3c (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
//Scilab Code for Example 7.19 of Signals and systems by
//P.Ramakrishna Rao
//Convolution of two signals
clc;
clear;
clear x y n;
x=[2,-1,1,0,2];
y=[1,0,-1,2];
n=-1:3;
c = gca();
c.y_location = "origin";
c.x_location = "origin";
plot2d3(n,x,-5);
title('x(k)')
xlabel('k')
figure(1);
n=0:3;
c = gca();
c.y_location = "origin";
c.x_location = "origin";
plot2d3(n,y,-5);
title('y(k)')
xlabel('k')
z=conv(x,y);
figure(2);
n=-1:6;
c = gca();
c.y_location = "origin";
c.x_location = "origin";
plot2d3(n,z,-5);
title('Convoluted signal     z(t)')
xlabel('t')