fftfast Fourier transform.ifftfast Fourier transform.Calling SequenceX=fft(A [,sign] [,option])
X=fft(A,sign,selection [,option])
X=fft(A,sign,dims,incr [,option] )
ArgumentsAa real or complex vector or real or complex array
(vector, matrix or N-D array).
X
a real or complex array with same shape as A.
sign
an integer. with possible values 1 or
-1. Select direct or inverse
transform. The default value is -1
(direct transform).
option
a character string. with possible values
"symmetric" or
"nonsymmetric". Indicates if
A is symmetric or not. If this argument
is omitted the algorithm automatically determines if
A is symmetric or not. See the
Description part for details.
selection
a vector containing index on A array
dimensions. See the Description part for details.
dims
a vector of positive numbers with integer values, or a
vector of positive integers. See the Description part for details.
Each element must be a divisor
of the total number of elements of A.
The product of the elements must be less than the total
number of elements of A.
incr
a vector of positive numbers with integer values, or a
vector of positive integers. See the Description part for
details.
incr must have the same number of
elements than dims.
Each element must be a divisor of the total number of
elements of A.
The incr elements must be in strictly
increasing order.
Description This function realizes direct or
inverse 1-D or N-D Discrete Fourier Transforms.
Short syntax directX=fft(A,-1 [,option]) or
X=fft(A [,option]) gives a direct
transform.
single variate
If A is a vector a
single variate direct FFT is computed that
is:
$x(k) = \sum_{m=1}^n {a(m)*e^{-\frac{2i*\pi}{n}(m-1) (k-1)}$
(the -1 argument refers
to the sign of the exponent..., NOT to
"inverse"),
multivariate
If A is a matrix or
a multidimensional array a multivariate direct
FFT is performed.
inverseX=fft(A,1) or
X=ifft(A)performs the inverse
normalized transform, such
thatA==ifft(fft(A)).
single variate
If A is a vector a single
variate inverse FFT is computed
$x(k) = \sum_{m=1}^n
{a(m)*e^{+\frac{2i*\pi}{n} (m-1) (k-1)}$
multivariate
If a is a matrix or or
a multidimensional array a multivariate inverse
FFT is performed.
Long syntax for FFT along specified dimensionsX=fft(A,sign,selection [,option])
allows to perform efficiently all direct or inverse
fft of the "slices" of A along
selected dimensions.
For example, if A is a 3-D array
X=fft(A,-1,2) is equivalent to:
and X=fft(A,-1,[1 3]) is equivalent to:
X=fft(A,sign,dims,incr [,option]) is
a previous syntax that also allows to perform all direct or
inverse fft of the slices of A along
selected dimensions.
For example, if A is an array with
n1*n2*n3 elements
X=fft(A,-1,n1,1) is equivalent to
X=fft(matrix(A,[n1,n2,n3]),-1,1).
and X=fft(A,-1,[n1 n3],[1 n1*n2])
is equivalent to
X=fft(matrix(A,[n1,n2,n3]),-1,[1,3]).
Using option argument This argument can be used
to inform the fft algorithm about the symmetry of
A or of all its "slices". An N-D array
B with dimensions n1,
..., np is conjugate symmetric for the fft
if and only if B==conj(B([1 n1:-1:2],[1
n2:-1:2],...,[1 np:-1:2]))
.In such a case the
result X is real and an efficient specific
algorithm can be used.
"symmetric" that value causes fft to treat
A or all its "slices" conjugate
symmetric. This option is useful to avoid automatic
determination of symmetry or if A or
all its "slices" are not exactly symmetric because of
round-off errors.
"nonsymmetric" that value causes fft not to
take care of symmetry. This option is useful to avoid
automatic determination of symmetry.
unspecified If the option is omitted the
fft algorithm automatically checks for exact symmetry.
Optimizing fft
Remark: fftw function automatically stores his last
parameters in memory to re-use it in a second time. This
improves greatly the time computation when consecutives
calls (with same parameters) are performed.
It is possible to go further in fft optimization using
get_fftw_wisdom, set_fftw_wisdom functions.
Algorithms
This function uses the fftw3 library.
Examples1-D fft2-D fftmupliple fftSee Also
corr
fftw_flags
get_fftw_wisdom
set_fftw_wisdom
fftw_forget_wisdom
Bibliography
Matteo Frigo and Steven G. Johnson, "FFTW Documentation" http://www.fftw.org/#documentation