diff options
author | priyanka | 2015-06-24 15:03:17 +0530 |
---|---|---|
committer | priyanka | 2015-06-24 15:03:17 +0530 |
commit | b1f5c3f8d6671b4331cef1dcebdf63b7a43a3a2b (patch) | |
tree | ab291cffc65280e58ac82470ba63fbcca7805165 /2303/CH5/EX5.9/5_9.sce | |
download | Scilab-TBC-Uploads-b1f5c3f8d6671b4331cef1dcebdf63b7a43a3a2b.tar.gz Scilab-TBC-Uploads-b1f5c3f8d6671b4331cef1dcebdf63b7a43a3a2b.tar.bz2 Scilab-TBC-Uploads-b1f5c3f8d6671b4331cef1dcebdf63b7a43a3a2b.zip |
initial commit / add all books
Diffstat (limited to '2303/CH5/EX5.9/5_9.sce')
-rwxr-xr-x | 2303/CH5/EX5.9/5_9.sce | 27 |
1 files changed, 27 insertions, 0 deletions
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");
|