Package fftManager

Class FFT

java.lang.Object
fftManager.FFT

@Deprecated public class FFT extends Object
Deprecated.
The fft encapsulates methods to perform fast fourier transform on input of kernel and signal data.
Author:
David McLaren, Paul Redmond
  • Constructor Summary

    Constructors
    Constructor
    Description
    FFT()
    Deprecated.
    Simple constructer, creates an fft object which provides the methods: crossCorrelation, recursiveIFFT, and recursiveFFT.
  • Method Summary

    Modifier and Type
    Method
    Description
    double[]
    crossCorrelation(double[] signal, int signalStart, int signalEnd, double[] kernel, int kernelStart, int kernelEnd)
    Deprecated.
    Performs cross correlation in the frequency domain using FFT and IFFT.
    static int
    log2(int num)
    Deprecated.
     
    static int
    nextBinaryExp(int sourceNumber)
    Deprecated.
    Finds the next highest binary exponential of the input integer.
    recursiveFFT(Complex[] complexIn)
    Deprecated.
    recursiveIFFT(Complex[] complexIn)
    Deprecated.
    boolean
    Deprecated.
    This is a test method for crossCorrelation.

    Methods inherited from class java.lang.Object

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

    • FFT

      public FFT()
      Deprecated.
      Simple constructer, creates an fft object which provides the methods: crossCorrelation, recursiveIFFT, and recursiveFFT.
  • Method Details

    • testCrossCorrelation

      public boolean testCrossCorrelation()
      Deprecated.
      This is a test method for crossCorrelation. It applies the crossCorellation method to predefined test signal and kernel data and compares to a predefined result. If the actual result does not match the predefined result an error could have been introduced in the crossCorrelation method or any called method e.g. recursiveFFT and recursiveIFFT.
      Returns:
      Indicates whether the crossCorellation result matches the prefined result, true = match, false = mismatch.
    • nextBinaryExp

      public static int nextBinaryExp(int sourceNumber)
      Deprecated.
      Finds the next highest binary exponential of the input integer. If the input is itself a binary exponential, then the result is itself. E.g. given 7 returns 8, 8 returns 8, 9 returns 16. Notes has limit of 2^100. Matlab calls this function nextpow2; it's also akin to frexp in C.
      Parameters:
      sourceNumber -
      Returns:
      The next highest 2^ of the input, unless input is itself a binary exponential.
    • log2

      public static int log2(int num)
      Deprecated.
    • recursiveFFT

      @Deprecated public Complex[] recursiveFFT(Complex[] complexIn)
      Deprecated.
      Performs a recursive radix 2 FFT. TODO add exception throw for errors, e.g. input length not recursively divisable by 2. Better to use FastFFT.rfft which is several times faster.
      Parameters:
      complexIn - The data array of type Complex.
      Returns:
      The resulting array after FFT is applied.
    • recursiveIFFT

      @Deprecated public Complex[] recursiveIFFT(Complex[] complexIn)
      Deprecated.
      Performs a recursive radix 2 Inverse FFT. TODO add exception throw for errors, e.g. input length not recursively divisable by 2.
      Better to use FastFFT.ifft which is several times faster !
      Parameters:
      complexIn - The data array of type Complex.
      Returns:
      The resulting array after FFT is applied.
    • crossCorrelation

      public double[] crossCorrelation(double[] signal, int signalStart, int signalEnd, double[] kernel, int kernelStart, int kernelEnd)
      Deprecated.
      Performs cross correlation in the frequency domain using FFT and IFFT.
      Parameters:
      signal - An array of type double containing the signal.
      signalStart - The index of where the signal starts within the array.
      signalEnd - The index of where the signal ends within the array.
      kernel - An array of type double containing the kernel.
      kernelStart - The index of where the kernel starts within the array.
      kernelEnd - The index of where the kernel ends within the array.
      Returns:
      The results of cross-correlation of kernel against signal.