Package jnt.FFT

This package defines various classes for carrying out Fast Fourier Transforms (NOTE: See licencing issues).

See:
          Description

Class Summary
ComplexDouble2DFFT Computes the FFT of 2 dimensional complex, double precision data.
ComplexDoubleFFT Abstract Class representing FFT's of complex, double precision data.
ComplexDoubleFFT_Mixed Computes FFT's of complex, double precision data of arbitrary length n.
ComplexDoubleFFT_Radix2 Computes FFT's of complex, double precision data where n is an integer power of 2.
ComplexFloat2DFFT Computes the FFT of 2 dimensional complex, single precision data.
ComplexFloatFFT Abstract Class representing FFT's of complex, single precision data.
ComplexFloatFFT_Mixed Computes FFT's of complex, single precision data of arbitrary length n.
ComplexFloatFFT_Radix2 Computes FFT's of complex, single precision data where n is an integer power of 2.
Factorize Supplies static methods for factoring integers needed by various FFT classes.
RealDoubleFFT Abstract Class representing FFT's of real, double precision data.
RealDoubleFFT_Even Computes FFT's of real, double precision data when n is even, by computing complex FFT.
RealDoubleFFT_Radix2 Computes FFT's of real, double precision data where n is an integral power of 2.
RealFloat2DFFT_Even EXPERIMENTAL! (till I think of something better): Computes the FFT of 2 dimensional real, single precision data.
RealFloatFFT Abstract Class representing FFT's of real, single precision data.
RealFloatFFT_Radix2 Computes FFT's of real, single precision data where n is an integral power of 2.
 

Package jnt.FFT Description

This package defines various classes for carrying out Fast Fourier Transforms (NOTE: See licencing issues). There are classes to handle: real and complex data; single and double precision; 1 and 2 dimensions; various FFT methods -- although not all combinations are provided.

Although it would be attractive to define a single API, the variety of data types forbids this. The general API, however, is :

  FFTclass fft = new FFTclass(n)
creates an instance of FFTclass appropriate for computing FFT's of n data points. This allows it to pre-compute any twiddle factors it may need. Each class defines (at least) these methods to transform, backtransform (inverse transform without normalization) and inverse.
public void transform(double|float data[]);
Fourier transforms data, in place. It leaves the complex result of transforming data in a (possibly) class-specific layout. See the class's documentation for details.
public double|float[] toWraparoundOrder(double|float data[]);
Creates an array containing the result of transform in wraparound order. If transform already leaves the result in that order, data is returned as is.
public void backtransform(double|float data[]);
Compute the inverse (unnormalized) transform of data. Each class's backtransform method understands the storage format of its transform. The transformation is carried out in place.
public float|double normalization();
Return the normalization constant to be multiplied by the elements of the backtransform to obtain the normalized inverse.
public void inverse(double|float data[]);
Compute the inverse (normalized) transform of data. Each class's backtransform method understands the storage format of its transform. The transformation is carried out in place.

Complex

Complex data is represented by 2 double values in sequence: the real and imaginary parts. Thus, in the default case, N data points is represented by a double array dimensioned to 2*N.

Wraparound Order

The result of a Fourier transform of either real or complex data is always complex, although in the real case, there is an extra symmetry. All transform methods in this package strive to carry out the transform in place: the transformed data is left in the same array as the initial data. Some algorithms, particularly those of real data, leave the transformed data in unusual arrangements with the real parts at one location and the imaginary parts implied, or at another location.

To the extent that one needs a standard order at all, we have arbitrarily chosen `wrap-around' order as the preferred one. For testing purposes, or when you dont want to have to understand a peculiar format, you may use the toWraparoundOrder method to convert the data to the following format. If D[i] is the transform of d[i], where delta is the time spacing between points in the orignal data d[i]:

IndexTime domainFrequency domain
0d[t=0]D[f=0]
1d[t=delta]D[f=+1/(n delta)]
2d[t=2*delta]D[f=+2/(n delta)]
......
n/2d[t=n*delta/2]D[f=+1/(2 delta)]=D[f=-1/(2 delta)]
......
n-3d[t=(n-3)delta]D[f=-3/(n delta)]
n-2d[t=(n-2)delta]D[f=-2/(n delta)]
n-1d[t=(n-1)delta]D[f=-1/(n delta)]
Of course, if n is odd, the middle line doesn't apply.

Author and License

This subpackage was developed by Bruce Miller at NIST. However, several routines in this subpackage were derived from Brian Gough's FFT routines in the Gnu Scientific Library (GSL). GSL is released under the Gnu General Public License; As such, this package must also be released under GPL.

The modifications I have made to port the routines from C to Java, and the additional classes developed were developed as part of my official duties as a U.S. government employee, and are therefore not subject to copyright.

Furthermore, this software is under development, and is in no way certified or guaranteed.