# FFTPACK - Fast Fourier Transform Package

FFTPACK is a set of routines for computing Fast Fourier Transforms.

Special features include:

• real or complex data can be handled;
• separate routines for forward analysis (data => Fourier coefficients) and backward analysis (Fourier coefficients => data);
• special "easy" routines;
• sine and cosine transform routines;
• quarter wave sine and cosine transform routines;
• the amount of data is NOT required to be a power of 2.

In most cases, you will need to call several routines from FFTPACK in order to get your results. In the simplest case, you will need to call just two routines:

• an initialization routine;
• the corresponding forward or backward computational routine.

In more complicated situations, you might want to call three routines:

• an initialization routine;
• the corresponding forward or backward computational routine;
• the corresponding backward or forward computational routine.
In a few cases, a single routine may be used for both the forward and backward computation.

Sometimes, a routine has been so heavily optimized that it is impossible to determine if it is really a correct implementation of the relatively simple Fourier formulas. In some cases, a "slow" version of a transform routine has been supplied, simply to provide a simple check that the formulas are correct.

The following table shows how the routines are grouped:
InitializationForwardBackwardPurpose
CFFTICFFTFCFFTBFFT for complex data
COSQICOSQFCOSQBQuarter wave cosine FFT
COSTICOSTCOSTEven function cosine FFT
EZFFTIEZFFTFEZFFTBEasy version of RFFT routines
RFFTIRFFTFRFFTBFFT for real data
SINQISINQFSINQBQuarter wave sine FFT
SINTISINTSINTOdd function sine FFT

Reference 1:
Briggs and Henson,
The Discrete Fourier Transform,
SIAM,
QA403.5 B75
Reference 2:
B L Buzbee,
The SLATEC Common Math Library,
in Sources and Development of Mathematical Software,
edited by W. Cowell,
Prentice Hall, 1984, pages 302-318.
Reference 3:
Chu and George,
Inside the FFT Black Box,
CRC Press,
QA403.5 C5
Reference 4:
David Kahaner, Clever Moler, Steven Nash,
Numerical Methods and Software,
Prentice Hall, 1988.
Reference 5:
P N Swarztrauber,
Vectorizing the FFT's,
in Parallel Computations,
edited by G. Rodrigue,

Files you may copy include:

The list of routines includes:

• CFFTB computes the backward complex discrete Fourier transform.
• CFFTB1 is a lower-level routine used by CFFTB.
• CFFTB_2D computes a backward two dimensional complex fast Fourier transform.
• CFFTF computes the forward complex discrete Fourier transform.
• CFFTF1 is a lower level routine used by CFFTF.
• CFFTF_2D computes a two dimensional complex fast Fourier transform.
• CFFTI initializes WSAVE, used in CFFTF and CFFTB.
• CFFTI1 is a lower level routine used by CFFTI.
• COSQB computes the fast cosine transform of quarter wave data.
• COSQB1 is a lower level routine used by COSQB.
• COSQF computes the fast cosine transform of quarter wave data.
• COSQF1 is a lower level routine used by COSQF.
• COSQI initializes WSAVE, used in COSQF and COSQB.
• CVEC_PRINT_SOME prints some of a complex vector.
• CVEC_RANDOM returns a random complex vector in a given range.
• D_PI returns the value of pi.
• D_RANDOM returns a random double precision value in a given range.
• DADF2 is a lower level routine used by DFFTF1.
• DADF3 is a lower level routine used by DFFTF1.
• DADF4 is a lower level routine used by DFFTF1.
• DADF5 is a lower level routine used by DFFTF1.
• DADFG is a lower level routine used by DFFTF1.
• DCOST computes the discrete Fourier cosine transform of an even sequence.
• DCOSTI initializes WSAVE, used in DCOST.
• DFFTF computes the Fourier coefficients of a real periodic sequence.
• DFFTF1 is a lower level routine used by DFFTF and DSINT.
• DFFTI initializes WSAVE, used in DFFTF and DFFTB.
• DFFTI1 is a lower level routine used by DFFTI.
• DSCT computes a double precision "slow" cosine transform.
• DSINT computes the discrete Fourier sine transform of an odd sequence.
• DSINT1 is a lower level routine used by DSINT.
• DSINTI initializes WSAVE, used in DSINT.
• DSST computes a double precision "slow" sine transform.
• DVEC_IDENTITY sets a double precision vector to the identity vector A(I)=I.
• DVEC_PRINT_SOME prints "some" of a double precision vector.
• DVEC_RANDOM returns a random double precision vector in a given range.
• EZFFTB computes a real periodic sequence from its Fourier coefficients.
• EZFFTF computes the Fourier coefficients of a real periodic sequence.
• EZFFTI initializes WSAVE, used in EZFFTF and EZFFTB.
• EZFFTI1 is a lower level routine used by EZFFTI.
• I_FACTOR factors an integer.
• PASSB is a lower level routine used by CFFTB1.
• PASSB2 is a lower level routine used by CFFTB1.
• PASSB3 is a lower level routine used by CFFTB1.
• PASSB4 is a lower level routine used by CFFTB1.
• PASSB5 is a lower level routine used by CFFTB1.
• PASSF is a lower level routine used by CFFTF1.
• PASSF2 is a lower level routine used by CFFTF1.
• PASSF3 is a lower level routine used by CFFTF1.
• PASSF4 is a lower level routine used by CFFTF1.
• PASSF5 is a lower level routine used by CFFTF1.
• R_CAS returns the "casine" of a number.
• R_PI returns the value of pi.
• R_RANDOM returns a random real in a given range.
• R_SWAP swaps two real values.
• RADB2 is a lower level routine used by RFFTB1.
• RADB3 is a lower level routine used by RFFTB1.
• RADB4 is a lower level routine used by RFFTB1.
• RADB5 is a lower level routine used by RFFTB1.
• RADBG is a lower level routine used by RFFTB1.
• RADF2 is a lower level routine used by RFFTF1.
• RADF3 is a lower level routine used by RFFTF1.
• RADF4 is a lower level routine used by RFFTF1.
• RADF5 is a lower level routine used by RFFTF1.
• RADFG is a lower level routine used by RFFTF1.
• RANDOM_INITIALIZE initializes the FORTRAN 90 random number seed.
• RCOST computes the discrete Fourier cosine transform of an even sequence.
• RCOSTI initializes WSAVE, used in RCOST.
• RFFTB computes a real periodic sequence from its Fourier coefficients.
• RFFTB1 is a lower level routine used by RFFTB.
• RFFTF computes the Fourier coefficients of a real periodic sequence.
• RFFTF1 is a lower level routine used by RFFTF and RSINT.
• RFFTI initializes WSAVE, used in RFFTF and RFFTB.
• RFFTI1 is a lower level routine used by RFFTI.
• RSCT computes a real "slow" cosine transform.
• RSFTB computes a "slow" backward Fourier transform of real data.
• RSFTF computes a "slow" forward Fourier transform of real data.
• RSHT computes a "slow" Hartley transform of real data.
• RSST computes a real "slow" sine transform.
• RSQCTB computes a real "slow" quarter cosine transform backward.
• RSQCTF computes a real "slow" quarter cosine transform forward.
• RSQSTB computes a real "slow" quarter sine transform backward.
• RSQSTF computes a real "slow" quarter sine transform forward.
• RVEC_IDENTITY sets a real vector to the identity vector A(I)=I.
• RVEC_PRINT_SOME prints "some" of a real vector.
• RVEC_RANDOM returns a random real vector in a given range.
• RVEC_REVERSE reverses the elements of a real vector.
• SINQB computes the fast sine transform of quarter wave data.
• SINQF computes the fast sine transform of quarter wave data.
• SINQI initializes WSAVE, used in SINQF and SINQB.
• RSINT computes the discrete Fourier sine transform of an odd sequence.
• RSINT1 is a lower level routine used by RSINT.
• RSINTI initializes WSAVE, used in RSINT.
• TIMESTAMP prints the current YMDHMS date as a time stamp.
• UNIFORM_01_SAMPLE is a portable random number generator.