summaryrefslogtreecommitdiff
path: root/macros/ifft2.sci
diff options
context:
space:
mode:
authorBrijeshcr2017-11-30 20:21:36 +0530
committerBrijeshcr2017-11-30 20:21:36 +0530
commit9d18f39d1775acd7f96e2388b186bb15068ff910 (patch)
tree7dc4d248208dd3ea7dac6e4ffb056f9b16a601eb /macros/ifft2.sci
parentc257cd7a7e766fb89332cca4fb367904767362ed (diff)
parent14d0ad8d846d12b3c82b0b5bc4ffd4d1360ec288 (diff)
downloadFOSSEE-Signal-Processing-Toolbox-9d18f39d1775acd7f96e2388b186bb15068ff910.tar.gz
FOSSEE-Signal-Processing-Toolbox-9d18f39d1775acd7f96e2388b186bb15068ff910.tar.bz2
FOSSEE-Signal-Processing-Toolbox-9d18f39d1775acd7f96e2388b186bb15068ff910.zip
Merge and solve ifft2 conflict
Diffstat (limited to 'macros/ifft2.sci')
-rw-r--r--macros/ifft2.sci45
1 files changed, 45 insertions, 0 deletions
diff --git a/macros/ifft2.sci b/macros/ifft2.sci
new file mode 100644
index 0000000..8ecb1a5
--- /dev/null
+++ b/macros/ifft2.sci
@@ -0,0 +1,45 @@
+function res = ifft2 (A, m, n)
+//Calculates the inverse two-dimensional discrete Fourier transform of A using a Fast Fourier Transform algorithm.
+//Calling Sequence
+//ifft2 (A, m, n)
+//ifft2 (A)
+//Parameters
+//A: input matrix
+//m: number of rows of A to be used
+//n: number of columns of A to be used
+//Description
+//This is an Octave function.
+//It performs inverse two-dimensional FFT on the matrix A. m and n may be used specify the number of rows and columns of A to use. If either of these is larger than the size of A, A is resized and padded with zeros.
+//If A is a multi-dimensional matrix, each two-dimensional sub-matrix of A is treated separately.
+//Examples
+//x = [1 2 3; 4 5 6; 7 8 9]
+//m = 4
+//n = 4
+//ifft2 (A, m, n)
+//ans =
+//
+// 2.81250 + 0.00000i -0.37500 + 0.93750i 0.93750 + 0.00000i -0.37500 - 0.93750i
+// -1.12500 + 0.93750i -0.31250 - 0.50000i -0.37500 + 0.31250i 0.31250 + 0.25000i
+// 0.93750 + 0.00000i -0.12500 + 0.31250i 0.31250 + 0.00000i -0.12500 - 0.31250i
+// -1.12500 - 0.93750i 0.31250 - 0.25000i -0.37500 - 0.31250i -0.31250 + 0.50000i
+
+funcprot(0);
+lhs = argn(1)
+rhs = argn(2)
+if (rhs < 1 | rhs > 3)
+error("Wrong number of input arguments.")
+end
+
+select(rhs)
+
+ case 1 then
+ res = callOctave("ifft2", A)
+
+ case 2 then
+ error("Wrong number of input arguments.")
+
+ case 3 then
+ res = callOctave("ifft2", A, m, n)
+
+ end
+endfunction