From b1f5c3f8d6671b4331cef1dcebdf63b7a43a3a2b Mon Sep 17 00:00:00 2001 From: priyanka Date: Wed, 24 Jun 2015 15:03:17 +0530 Subject: initial commit / add all books --- 692/CH2/EX2.29/P2_29.sce | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100755 692/CH2/EX2.29/P2_29.sce (limited to '692/CH2/EX2.29/P2_29.sce') diff --git a/692/CH2/EX2.29/P2_29.sce b/692/CH2/EX2.29/P2_29.sce new file mode 100755 index 000000000..fc59af2a4 --- /dev/null +++ b/692/CH2/EX2.29/P2_29.sce @@ -0,0 +1,24 @@ +//Example 2.29,Convolution using Tabular method. +clear; +clc; +x=[-2 0 1 -1 3]; +h=[1 2 0 -1]; +q=length(x); +w=length(h); +z=q+w-1; +y0=0; +for i=1:z; + y(i)=0; + for k=1:i; + if k>q + x(k)=0; + else + if (i-k+1)>w + h(i-k+1)=0; + else + y(i)= y(i) + x(k)*h(i-k+1); + end + end + end +end +disp(y','The Convolution of the two sequences is =') -- cgit