summaryrefslogtreecommitdiff
path: root/692/CH5/EX5.4/P5_4.sce
diff options
context:
space:
mode:
authorpriyanka2015-06-24 15:03:17 +0530
committerpriyanka2015-06-24 15:03:17 +0530
commitb1f5c3f8d6671b4331cef1dcebdf63b7a43a3a2b (patch)
treeab291cffc65280e58ac82470ba63fbcca7805165 /692/CH5/EX5.4/P5_4.sce
downloadScilab-TBC-Uploads-b1f5c3f8d6671b4331cef1dcebdf63b7a43a3a2b.tar.gz
Scilab-TBC-Uploads-b1f5c3f8d6671b4331cef1dcebdf63b7a43a3a2b.tar.bz2
Scilab-TBC-Uploads-b1f5c3f8d6671b4331cef1dcebdf63b7a43a3a2b.zip
initial commit / add all books
Diffstat (limited to '692/CH5/EX5.4/P5_4.sce')
-rwxr-xr-x692/CH5/EX5.4/P5_4.sce37
1 files changed, 37 insertions, 0 deletions
diff --git a/692/CH5/EX5.4/P5_4.sce b/692/CH5/EX5.4/P5_4.sce
new file mode 100755
index 000000000..960f1dafd
--- /dev/null
+++ b/692/CH5/EX5.4/P5_4.sce
@@ -0,0 +1,37 @@
+//EXAMPLE 5.4
+//DETERMINE IDFT OF GIVEN SEQUENCE
+clc;
+clear;
+K = input(" value of K ");
+disp('input M > K');
+M = input(" value of M ");
+k1 = 0:K-1;
+V1 = k1./K;//DFT
+k=0:M-1;
+
+N = length(V1);
+V = [V1,zeros(1,M-N)];
+v = dft(V,1);//IDFT
+
+clf();
+subplot(1,2,1)
+
+a = gca();
+plot2d3(k,real(v),2);
+plot(k,real(v),'r.');
+a.x_location = 'origin';
+a.y_location = 'origin';
+poly1 = a . children (1) . children (1) ;
+poly1.thickness = 2;
+xtitle('real part','N','v');
+
+subplot(1,2,2)
+a = gca();
+plot2d3(k,imag(v),2)
+plot(k,imag(v),'r.');
+a.x_location = 'origin';
+a.y_location = 'origin';
+poly1 = a . children (1) . children (1) ;
+poly1.thickness = 2;
+xtitle('imaginary part','N','v');
+v = disp(v);