>  Docs Center  >  IDL Reference  >  Advanced Math and Stats  >  IMSL_FFTINIT

IMSL_FFTINIT

IMSL_FFTINIT

The IMSL_FFTINIT function computes the parameters for a one-dimensional FFT to be used in the IMSL_FFTCOMP function with the keyword INIT_PARAMS.

This routine requires an IDL Advanced Math and Stats license. For more information, contact your sales or technical support representative.

The IMSL_FFTINIT function should be used when many calls are to be made to IMSL_FFTCOMP without changing the data type of the array and the length of the sequence. The default action of IMSL_FFTINIT is to compute the parameters necessary for a real FFT. If parameters for a complex FFT are needed, the keyword COMPLEX should be specified.

The IMSL_FFTINIT function is based on the routines RFFTI and RFFTI in FFTPACK, which was developed by Paul Swarztrauber at the National Center for Atmospheric Research.

Example


In this example, two distinct, real FFTs are computed by calling IMSL_FFTINIT once, then calling IMSL_FFTCOMP twice.

.RUN
n = 7
 
; Define the length of the signals.
init_params = IMSL_FFTINIT(7)
 
; Initialize the parameters by calling IMSL_FFTINIT.
FOR j = 0, 2 DO BEGIN
  p = COS(j * FINDGEN(n) * 2 * !Pi/n)
  q = IMSL_FFTCOMP(p, Init_Params = init_params)
  PM, 'p', 'q', FORMAT = '(7x, a1, 10x, a1)'
  FOR i = 0, n - 1 DO PM, p(i), q(i), FORMAT = '(f10.5, f10.2)'
ENDFOR
END
; For each pass through loop, compute a real FFT of an array of
; length n and output both original signal and computed FFT.

IDL prints:

Syntax


Result = IMSL_FFTINIT(N [, /DOUBLE] [, COMPLEX=value] [, SINE=value] [, COSINE=value])

Return Value


A one-dimensional array of length 2N + 15 that can then be used by IMSL_FFTCOMP when the optional parameter INIT_PARAMS is specified.

Arguments


N

Length of the sequence to be transformed.

Keywords


COMPLEX (optional)

If present and nonzero, the complex transform is computed.

COSINE (optional)

If present and nonzero, then parameters for a discrete Fourier cosine transformation are returned. See the IMSL_FFTCOMP keyword SINE.

DOUBLE (optional)

If present and nonzero, then double precision is used.

SINE (optional)

If present and nonzero, then parameters for a discrete Fourier cosine transformation are returned. See the IMSL_FFTCOMP keyword SINE.

Version History


6.4

Introduced



© 2019 Harris Geospatial Solutions, Inc. |  Legal
My Account    |    Store    |    Contact Us