home *** CD-ROM | disk | FTP | other *** search
/ Big Green CD 8 / BGCD_8_Dev.iso / NEXTSTEP / UNIX / Educational / R-0.49-MI / R-0.49-I / help / base / fft < prev    next >
Encoding:
Text File  |  1997-04-23  |  1.8 KB  |  56 lines

  1.     
  2.     _D_i_s_c_r_e_t_e _F_o_u_r_i_e_r _T_r_a_n_s_f_o_r_m
  3.     
  4.          fft(z, inverse=F)
  5.          mvfft(z, inverse=F)
  6.     
  7.     _A_r_g_u_m_e_n_t_s:
  8.     
  9.                z : a real or complex value array containing the
  10.                    values to be transformed
  11.     
  12.          inverse : if TRUE, the inverse transform is computed
  13.                    (the inverse has a + in the exponent of e and
  14.                    divides the values by 1/length(x) before
  15.                    transforming).
  16.     
  17.     _V_a_l_u_e:
  18.     
  19.          When z is a vector, the value computed and returned by
  20.          fft is the univariate Fourier transform of the sequence
  21.          of values in z.  When z contains an array, fft computes
  22.          and returns the multivariate (spatial) transform.
  23.     
  24.          By contrast, mvfft takes a real or complex matrix as
  25.          argument, and returns a similar shaped matrix, but with
  26.          each column replaced by its discrete Fourier transform.
  27.          This is useful for analysing vector-valued series.
  28.     
  29.          The FFT is fastest when the length of of the series
  30.          being transformed is highly composite (i.e. has many
  31.          factors).  If this is not the case, the transform may
  32.          take a long time to compute and will use a large amount
  33.          of memory.
  34.     
  35.     _R_e_f_e_r_e_n_c_e_s:
  36.     
  37.          Singleton, R. C. (1979).  Mixed Radix Fast Fourier
  38.          Transforms, in Programs for Digital Signal Processing,
  39.          IEEE Digital Signal Processing Committee eds.  IEEE
  40.          Press.
  41.     
  42.     _S_e_e _A_l_s_o:
  43.     
  44.          convolve, nextn.
  45.     
  46.     _E_x_a_m_p_l_e_s:
  47.     
  48.          plot(fft(c(9:0,0:13, numeric(301))),type='l')
  49.          periodogram <- function(x) { ##-- simple periodogram of x[]
  50.               n <- length(x)
  51.               Mod(fft(unclass(x)))[1:(n%/%2 + 1)]^2 / (2*pi*n)
  52.          }
  53.          data(sunspots)
  54.          plot(10*log10(periodogram(sunspots)),type='b', col='blue')
  55.     
  56.