summaryrefslogtreecommitdiff
path: root/macros/fft1.sci
diff options
context:
space:
mode:
Diffstat (limited to 'macros/fft1.sci')
-rw-r--r--macros/fft1.sci51
1 files changed, 26 insertions, 25 deletions
diff --git a/macros/fft1.sci b/macros/fft1.sci
index f8a27fc..7d7b23a 100644
--- a/macros/fft1.sci
+++ b/macros/fft1.sci
@@ -1,29 +1,30 @@
-/*Description
- Calculates the discrete Fourier transform of a matrix using Fast Fourier Transform algorithm.
- The FFT is calculated along the first non-singleton dimension of the array. Thus, FFT is computed for each column of D.
- The variable 'N' is an integer that determines the number of elements of 'D' to use.
- If 'N' is larger than the dimension along which the FFT is calculated,
- then 'D' is resized and padded with zeros to match the required size.On the other hand,
- if 'N' is smaller than the size of 'D', then 'D' is truncated to match the required size.
- DIM is an integer specifying the dimension of the matrix along which the FFT is performed.
-Calling Sequence
- fft1 (D)
- fft1 (D, N)
- fft1 (D, N, DIM)
-Parameters
- D: input matrix
- N: Specifies the number of elements of x to be used
- DIM: Specifies the dimention of the matrix along which the FFT is performed
-Examples
- D = [1 2 3; 4 5 6; 7 8 9]
- N = 3
- DIM = 2
- fft1 (D,N,DIM)
- ans =
- 6.0000 + 0.0000i -1.5000 + 0.8660i -1.5000 - 0.8660i
- 15.0000 + 0.0000i -1.5000 + 0.8660i -1.5000 - 0.8660i
- 24.0000 + 0.0000i -1.5000 + 0.8660i -1.5000 - 0.8660i */
function res = fft1 (D, N, DIM)
+// Description
+// Calculates the discrete Fourier transform of a matrix using Fast Fourier Transform algorithm.
+// The FFT is calculated along the first non-singleton dimension of the array. Thus, FFT is computed for each column of D.
+// The variable 'N' is an integer that determines the number of elements of 'D' to use.
+// If 'N' is larger than the dimension along which the FFT is calculated,
+// then 'D' is resized and padded with zeros to match the required size.On the other hand,
+// if 'N' is smaller than the size of 'D', then 'D' is truncated to match the required size.
+// DIM is an integer specifying the dimension of the matrix along which the FFT is performed.
+// Calling Sequence
+// fft1 (D)
+// fft1 (D, N)
+// fft1 (D, N, DIM)
+// Parameters
+// D: input matrix
+// N: Specifies the number of elements of x to be used
+// DIM: Specifies the dimention of the matrix along which the FFT is performed
+// Examples
+// D = [1 2 3; 4 5 6; 7 8 9]
+// N = 3
+// DIM = 2
+// fft1 (D,N,DIM)
+// ans =
+// 6.0000 + 0.0000i -1.5000 + 0.8660i -1.5000 - 0.8660i
+// 15.0000 + 0.0000i -1.5000 + 0.8660i -1.5000 - 0.8660i
+// 24.0000 + 0.0000i -1.5000 + 0.8660i -1.5000 - 0.8660i
+
funcprot(0);
lhs = argn(1)
rhs = argn(2)