summaryrefslogtreecommitdiff
path: root/125/DEPENDENCIES/dft_mtx.sce
diff options
context:
space:
mode:
Diffstat (limited to '125/DEPENDENCIES/dft_mtx.sce')
-rwxr-xr-x125/DEPENDENCIES/dft_mtx.sce18
1 files changed, 18 insertions, 0 deletions
diff --git a/125/DEPENDENCIES/dft_mtx.sce b/125/DEPENDENCIES/dft_mtx.sce
new file mode 100755
index 000000000..aaee76368
--- /dev/null
+++ b/125/DEPENDENCIES/dft_mtx.sce
@@ -0,0 +1,18 @@
+function [D] = dft_mtx(n)
+f = 2*%pi/n; // Angular increment.
+w = (0:f:2*%pi-f/2).' *%i; //Column.
+//disp(w)
+x = 0:n-1; // Row.
+D = exp(-w*x); // Exponent of outer product.
+for i = 1:n
+ for j = 1:n
+ if((abs(real(D(i,j)))<0.0001)&(abs(imag(D(i,j)))<0.0001))
+ D(i,j)=0;
+ elseif(abs(real(D(i,j)))<0.0001)
+ D(i,j)= 0+%i*imag(D(i,j));
+ elseif(abs(imag(D(i,j)))<0.0001)
+ D(i,j)= real(D(i,j))+0;
+ end
+ end
+end
+endfunction \ No newline at end of file