summaryrefslogtreecommitdiff
path: root/macros/fft21.sci
diff options
context:
space:
mode:
Diffstat (limited to 'macros/fft21.sci')
-rw-r--r--macros/fft21.sci48
1 files changed, 25 insertions, 23 deletions
diff --git a/macros/fft21.sci b/macros/fft21.sci
index ee73a6b..3904be3 100644
--- a/macros/fft21.sci
+++ b/macros/fft21.sci
@@ -1,27 +1,29 @@
-/* Description
- Calculates the two-dimensional discrete Fourier transform of A using a Fast Fourier Transform algorithm.
- It performs two-dimentional FFT on the matrix A. You can use the variables m and n to specify the number of rows and columns
- of A that you want to use. If either of these variables is larger than the size of A,
- then A will be resized, and zeros will be added as padding.
- If A is a multi-dimensional matrix, the function will treat each two-dimensional sub-matrix of A separately.
- Calling Sequence
- fft21 (A)
- fft21 (A, m, n)
- Parameters
- A: input matrix
- m: number of rows of A to be used
- n: number of columns of A to be used
- Examples
- A = [1 2 3; 4 5 6; 7 8 9]
- m = 4
- n = 4
- fft21 (A, m, n)
- ans =
- 45 + 0i -6 - 15i 15 + 0i -6 + 15i
- -18 - 15i -5 + 8i -6 - 5i 5 - 4i
- 15 + 0i -2 - 5i 5 + 0i -2 + 5i
- -18 + 15i 5 + 4i -6 + 5i -5 - 8i */
+
function res = fft21 (A, m, n)
+// Description
+// Calculates the two-dimensional discrete Fourier transform of A using a Fast Fourier Transform algorithm.
+// It performs two-dimentional FFT on the matrix A. You can use the variables m and n to specify the number of rows and columns
+// of A that you want to use. If either of these variables is larger than the size of A,
+// then A will be resized, and zeros will be added as padding.
+// If A is a multi-dimensional matrix, the function will treat each two-dimensional sub-matrix of A separately.
+// Calling Sequence
+// fft21 (A)
+// fft21 (A, m, n)
+// Parameters
+// A: input matrix
+// m: number of rows of A to be used
+// n: number of columns of A to be used
+// Examples
+// A = [1 2 3; 4 5 6; 7 8 9]
+// m = 4
+// n = 4
+// fft21 (A, m, n)
+// ans =
+// 45 + 0i -6 - 15i 15 + 0i -6 + 15i
+// -18 - 15i -5 + 8i -6 - 5i 5 - 4i
+// 15 + 0i -2 - 5i 5 + 0i -2 + 5i
+// -18 + 15i 5 + 4i -6 + 5i -5 - 8i
+
funcprot(0);
lhs = argn(1)
rhs = argn(2)