Class Complex1D

java.lang.Object
ffx.numerics.fft.Complex1D

public class Complex1D extends Object
This algorithm factors a size n FFT into nX * nY, computes nY inner FFTs of size nX and nX inner FFTs of size nY, then combines the results to get the final answer. This is incomplete.
  • Constructor Summary

    Constructors
    Constructor
    Description
    Complex1D(int n)
    Construct a Complex instance for interleaved data of length n.
    Complex1D(int n, DataLayout1D dataLayout, int imOffset)
    Construct a Complex instance for data of length n.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    fft(double[] data, int offset, int stride)
    Compute the Fast Fourier Transform of data leaving the result in data.
    void
    ifft(double[] data, int offset, int stride)
    Compute the (un-normalized) inverse FFT of data, leaving it in place.
    static void
    main(String[] args)
    Test the Complex FFT.

    Methods inherited from class Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • Complex1D

      public Complex1D(int n)
      Construct a Complex instance for interleaved data of length n. Factorization of n is designed to use special methods for small factors, and a general routine for large odd prime factors. Scratch memory is created of length 2*n, which is reused each time a transform is computed.
      Parameters:
      n - Number of complex numbers (n .GT. 1).
    • Complex1D

      public Complex1D(int n, DataLayout1D dataLayout, int imOffset)
      Construct a Complex instance for data of length n. The offset to each imaginary part relative to the real part is given by im. Factorization of n is designed to use special methods for small factors. Scratch memory is created of length 2*n, which is reused each time a transform is computed.
      Parameters:
      n - Number of complex numbers (n .GT. 1).
      dataLayout - Data layout (interleaved or blocked).
      imOffset - Offset to the imaginary part of each complex number relative to its real part.
  • Method Details

    • fft

      public void fft(double[] data, int offset, int stride)
      Compute the Fast Fourier Transform of data leaving the result in data. The array data must contain the data points in the following locations:
      Re(d[i]) = data[offset + stride*i]
      Im(d[i]) = data[offset + stride*i + im]
      

      where im is 1 for interleaved data or a constant set when the class was constructed.

      Parameters:
      data - an array of double.
      offset - the offset to the beginning of the data.
      stride - the stride between data points.
    • ifft

      public void ifft(double[] data, int offset, int stride)
      Compute the (un-normalized) inverse FFT of data, leaving it in place. The frequency domain data must be in wrap-around order, and be stored in the following locations:
      Re(D[i]) = data[offset + stride*i]
      Im(D[i]) = data[offset + stride*i + im]
      
      Parameters:
      data - an array of double.
      offset - the offset to the beginning of the data.
      stride - the stride between data points.
    • main

      public static void main(String[] args) throws Exception
      Test the Complex FFT.
      Parameters:
      args - an array of String objects.
      Throws:
      Exception - if any.
      Since:
      1.0