IMSL_FFTINIT

Syntax | Return Value | Arguments | Keywords | Discussion | Example | Version History

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.

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

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

DOUBLE

If present and nonzero, double precision is used and the returned array is double precision. This keyword does not have an effect if the initialization is being computed for a complex FFT.

COMPLEX

If present and nonzero, the parameters for a complex transform are computed.

SINE

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

COSINE

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

Discussion

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. 
       p          q 
      1.00000       7.00 
      1.00000       0.00 
      1.00000       0.00 
      1.00000       0.00 
      1.00000       0.00 
      1.00000      -0.00 
      1.00000       0.00 
       p          q 
      1.00000       0.00 
      0.62349       3.50 
     -0.22252       0.00 
     -0.90097      -0.00 
     -0.90097      -0.00 
     -0.22252       0.00 
      0.62349      -0.00 
       p          q 
      1.00000      -0.00 
     -0.22252       0.00 
     -0.90097      -0.00 
      0.62349       3.50 
      0.62349      -0.00 
     -0.90097       0.00 
     -0.22252       0.00 

Version History

6.4

Introduced