.BG
.FN fft
.TL
Fast Fourier Transform
.CS
fft(z, inverse=FALSE)
.AG z
numeric or complex.
.AG inverse
flag saying whether the inverse of the
transform should be computed.
.RT
the unnormalized discrete Fourier transform of the input
data `z' (or the inverse transform if `inverse=TRUE').
The Fast Fourier Transform algorithm is used.
No padding of the input data is done; `length(z)' is factored,
if possible, and the factorization is used in the algorithm.
Therefore, if `length(z)' is prime, there will be no advantage
in using `fft' over computing the transform explicitly.
.PP
If `z' is an array, `fft' will return the multi-dimensional
unnormalized discrete Fourier transform of `z'\(ema complex array with the
same shape as `z'.
.Tr
If `z' is not an array, the definition of the transform `w <- fft(z)' is:
.sp
.EQ
delim $$
w sub j ~=~ sum from t=1 to n { z sub t exp ( -i omega sub j-1 (t-1) ) } ,~~~
1 ~<=~ j ~<=~ n ,
.EN
.sp
where $n$ is `length(z)' and
$omega sub j$ is the $j sup th$ Fourier frequency $2 pi j / n$.
The initial sign in the exponential is reversed for the inverse transform.
This formula is actually also valid when `z' is an array, by
interpreting $n$ as `dim(z)' and the subscripts $j$ and $t$
as vectors of subscripts.
The formula for the $j sup th$ Fourier frequency is to be taken
componentwise and the product $omega sub j-1 (t-1)$ as an inner product.
.En
.KW complex
.KW ts
.EQ
delim off
.EN
.WR
