ca.uol.aig.fftpack
Class RealDoubleFFT

java.lang.Object
  extended by ca.uol.aig.fftpack.RealDoubleFFT

public class RealDoubleFFT
extends java.lang.Object

FFT transform of a real periodic sequence.

Author:
Baoshe Zhang, Astronomical Instrument Group of University of Lethbridge.

Field Summary
 double norm_factor
          norm_factor can be used to normalize this FFT transform.
 
Constructor Summary
RealDoubleFFT(int n)
          Construct a wavenumber table with size n.
 
Method Summary
 void bt(Complex1D x, double[] y)
          Backward real FFT transform.
 void bt(double[] x)
          Backward real FFT transform.
 void ft(double[] x)
          Forward real FFT transform.
 void ft(double[] x, Complex1D y)
          Forward real FFT transform.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

norm_factor

public double norm_factor
norm_factor can be used to normalize this FFT transform. This is because a call of forward transform (ft) followed by a call of backward transform (bt) will multiply the input sequence by norm_factor.

Constructor Detail

RealDoubleFFT

public RealDoubleFFT(int n)
Construct a wavenumber table with size n. The sequences with the same size can share a wavenumber table. The prime factorization of n together with a tabulation of the trigonometric functions are computed and stored.

Parameters:
n - the size of a real data sequence. When n is a multiplication of small numbers (4, 2, 3, 5), this FFT transform is very efficient.
Method Detail

ft

public void ft(double[] x)
Forward real FFT transform. It computes the discrete transform of a real data sequence.

The x parameter is both input and output data. After the FFT, x contains the transform coefficients used to construct n complex FFT coefficients.

The real part of the first complex FFT coefficients is x[0]; its imaginary part is 0. If n is even set m = n/2, if n is odd set m = (n+1)/2, then for k = 1, ..., m-1:

If n is even, the real of part of (n/2)-th complex FFT coefficient is x[n - 1]; its imaginary part is 0.

The remaining complex FFT coefficients can be obtained by the symmetry relation: the (n-k)-th complex FFT coefficient is the conjugate of n-th complex FFT coefficient.

Parameters:
x - An array which contains the sequence to be transformed.

ft

public void ft(double[] x,
               Complex1D y)
Forward real FFT transform. It computes the discrete transform of a real data sequence.

Parameters:
x - an array which contains the sequence to be transformed. After FFT, x contains the transform coeffients used to construct n complex FFT coeffients.
y - the first complex (n+1)/2 (when n is odd) or (n/2+1) (when n is even) FFT coefficients. The remaining complex FFT coefficients can be obtained by the symmetry relation: the (n-k)-th complex FFT coefficient is the conjugate of n-th complex FFT coeffient.

bt

public void bt(double[] x)
Backward real FFT transform. It is the unnormalized inverse transform of ft(double[]).

Parameters:
x - an array which contains the sequence to be transformed. After FFT, x contains the transform coeffients. Also see the comments of ft(double[]) for the relation between x and complex FFT coeffients.

bt

public void bt(Complex1D x,
               double[] y)
Backward real FFT transform. It is the unnormalized inverse transform of ft(Complex1D, double[]).

Parameters:
x - an array which contains the sequence to be transformed. When n is odd, it contains the first (n+1)/2 complex data; when n is even, it contains (n/2+1) complex data.
y - the real FFT coeffients.
Also see the comments of ft(double[]) for the relation between x and complex FFT coeffients.