summaryrefslogtreecommitdiff
path: root/692/CH5/EX5.11
diff options
context:
space:
mode:
Diffstat (limited to '692/CH5/EX5.11')
-rwxr-xr-x692/CH5/EX5.11/P5_11.sce22
1 files changed, 22 insertions, 0 deletions
diff --git a/692/CH5/EX5.11/P5_11.sce b/692/CH5/EX5.11/P5_11.sce
new file mode 100755
index 000000000..43a41dcae
--- /dev/null
+++ b/692/CH5/EX5.11/P5_11.sce
@@ -0,0 +1,22 @@
+//EXAMPLE 5.11
+//Circular convolution using DFT
+clc;
+clear;
+g = [1 2 0 1];
+disp(g,'g[n] = ');
+h = [2 2 1 1];
+disp(h,'h[n] = ');
+M=4;
+for n=0:M-1
+ for k=0:M-1
+ W(n+1,k+1) = exp(-(%i*2*%pi*k/M)*n);
+ end
+ end
+ G = W*g';
+ H = W*h';
+disp(G,'DFT is, G = ');
+disp(H,'DFT is, H = ');
+
+Y=G.*H;
+y=(1/4)*conj(W)*(Y);
+disp(real(y),'Circular convolution = '); \ No newline at end of file