summaryrefslogtreecommitdiff
path: root/1592/CH5/EX5.14/Example5_14.sce
blob: 27cc4aed2e6148a7090050c1f100659bd754398a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
//Scilab Code for Example 5.14 of Signals and systems by
//P.Ramakrishna Rao
//Circular Convolution
clear;
clc;
close;
//First Causal sequence
x=[1,1,1,1;1,-%i,-1,%i;1,-1,1,-1;1,%i,-1,-%i]
y1=[1;2;3;4];
y2=[4;3;2;1];
X=x*y1;
disp(X,'Vector X(0)-->X(3)')
Y=x*y2;
disp(Y,'Vector Y(0)-->Y(3)')
for n=1:4;
    Z(n,1)=X(n,1)*Y(n,1);
end
q=4*x^-1;
disp(q,'IDFT matrix ');
z=0.25*q*Z;
disp(z,'IDFT of Vector Z(0)-->Z(3)')