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 --- 2303/CH5/EX5.9/5_9.sce | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100755 2303/CH5/EX5.9/5_9.sce (limited to '2303/CH5/EX5.9/5_9.sce') diff --git a/2303/CH5/EX5.9/5_9.sce b/2303/CH5/EX5.9/5_9.sce new file mode 100755 index 000000000..792417b89 --- /dev/null +++ b/2303/CH5/EX5.9/5_9.sce @@ -0,0 +1,27 @@ +//Example 5.9 +clc; +clear; +close; + +//let +x=[1 2 3 4]; +h=[5 6 7]; +M=length(x); +N=length(h); + +//Result of linear convolution of original sequences +y=conv(x,h); +disp(y,"Result of linear convolution of original sequences is"); + +L=M+N-1; +//we append zeros such that total sequence will have length 6. +x=[zeros(1:2),x]; +h=[h,zeros(1:2)]; + +//Result of circular convolution of sequence appended with 2 zeros at start +y=conv(x,h); +y(11:12)=0; +y=y(1:6)+y(7:12) +disp(y,"Result of circular convolution of sequences appended with 2 zeros at start is"); + +disp("We see that if we circularly rotate the result of circular convolution by 2 samples, we get the linear convolution result"); -- cgit