linear convolution in scilab
Program for linear using direct formula not using inbuilt function
//Program for Linear Convolution
clc;
clear all
;
close ;
x
= input('enter x seq');
h
= input('enter h seq');
m
= length(x
);
n
= length(h
);
//Method : Using Direct Convolution Sum Formula
for i
= 1:n
+m
-1
conv_sum
= 0;
for j
= 1:i
if (((i
-j
+1) <= n
)&(j
<= m
))
conv_sum
= conv_sum
+ x
(j
)*h
(i
-j
+1);
end;
y
(i
) = conv_sum
;
end;
end;
disp(y
,'y=')
Rate this code snippet:
0
Rating: 0 | Votes: 0
posted by Senthilkumar R