fft                  package:stats                  R Documentation

_F_a_s_t _D_i_s_c_r_e_t_e _F_o_u_r_i_e_r _T_r_a_n_s_f_o_r_m

_D_e_s_c_r_i_p_t_i_o_n:

     Performs the Fast Fourier Transform of an array.

_U_s_a_g_e:

     fft(z, inverse = FALSE)
     mvfft(z, inverse = FALSE)

_A_r_g_u_m_e_n_t_s:

       z: a real or complex array containing the values to be
          transformed.

 inverse: if 'TRUE', the unnormalized inverse transform is computed
          (the inverse has a '+' in the exponent of e, but here, we do
          _not_ divide by '1/length(x)').

_V_a_l_u_e:

     When 'z' is a vector, the value computed and returned by 'fft' is
     the unnormalized univariate Fourier transform of the sequence of
     values in 'z'. When 'z' contains an array, 'fft' computes and
     returns the multivariate (spatial) transform.  If 'inverse' is
     'TRUE', the (unnormalized) inverse Fourier transform is returned,
     i.e., if 'y <- fft(z)', then 'z' is 'fft(y, inverse = TRUE) /
     length(y)'.

     By contrast, 'mvfft' takes a real or complex matrix as argument,
     and returns a similar shaped matrix, but with each column replaced
     by its discrete Fourier transform.  This is useful for analyzing
     vector-valued series.

     The FFT is fastest when the length of the series being transformed
     is highly composite (i.e., has many factors).  If this is not the
     case, the transform may take a long time to compute and will use a
     large amount of memory.

_R_e_f_e_r_e_n_c_e_s:

     Becker, R. A., Chambers, J. M. and Wilks, A. R. (1988) _The New S
     Language_. Wadsworth & Brooks/Cole.

     Singleton, R. C. (1979) Mixed Radix Fast Fourier Transforms, in
     _Programs for Digital Signal Processing_, IEEE Digital Signal
     Processing Committee eds. IEEE Press.

_S_e_e _A_l_s_o:

     'convolve', 'nextn'.

_E_x_a_m_p_l_e_s:

     x <- 1:4
     fft(x)
     fft(fft(x), inverse = TRUE)/length(x)

