fftManager
Class FFT

java.lang.Object
  extended by fftManager.FFT

Deprecated.

@Deprecated
public class FFT
extends java.lang.Object

The fft encapsulates methods to perform fast fourier transform on input of kernel and signal data.

Author:
David McLaren, Paul Redmond

Field Summary
(package private)  int ifftInitialArrayLength
          Deprecated.  
 
Constructor Summary
FFT()
          Deprecated. Simple constructer, creates an fft object which provides the methods: crossCorrelation, recursiveIFFT, and recursiveFFT.
 
Method Summary
private  double[] crossCorrelation(Complex[] signalComplex, Complex[] kernelComplex)
          Deprecated. Performs cross correlation in the frequency domain using FFT and IFFT.
 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.
private  Complex[] doubleToPaddedComplex(double[] doubleArray, int startPos, int endPos, int padToTotalLength)
          Deprecated. Takes an array of doubles and uses it to create an array of type Complex.
static int log2(int num)
          Deprecated.  
static int nextBinaryExp(int sourceNumber)
          Deprecated. Finds the next highest binary exponential of the input integer.
 Complex[] recursiveFFT(Complex[] complexIn)
          Deprecated. 
 Complex[] recursiveIFFT(Complex[] complexIn)
          Deprecated. 
private  void setIFFTInitialArrayLength(int initialArrayLength)
          Deprecated. Sets a variable used by the fft algorithm to hold intial input array length.
 boolean testCrossCorrelation()
          Deprecated. This is a test method for crossCorrelation.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

ifftInitialArrayLength

int ifftInitialArrayLength
Deprecated. 
Constructor Detail

FFT

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

Method Detail

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.

setIFFTInitialArrayLength

private void setIFFTInitialArrayLength(int initialArrayLength)
Deprecated. 
Sets a variable used by the fft algorithm to hold intial input array length.

Parameters:
initialArrayLength - .Holds the value fft input array at the start.

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.

doubleToPaddedComplex

private Complex[] doubleToPaddedComplex(double[] doubleArray,
                                        int startPos,
                                        int endPos,
                                        int padToTotalLength)
Deprecated. 
Takes an array of doubles and uses it to create an array of type Complex. The start and end position within in the input array handle the scenario where the target data is a block within unwanted array elements. The resulting Complex array can be padded to a desired length with appended Zero'd Complex type.

Parameters:
doubleArray - An array of double to be used form the 'real' part in an array of type Complex.
startPos - The index of first double to be used in forming the complex array.
endPos - The index of the last double to be used in forming the complex array.
padToTotalLength - pads the returned complex[] to have this number of elements. This is done by appending (Real: 0.0, Imag: 0.0) Complex objects to the end.
Returns:
complex[]

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.

crossCorrelation

private double[] crossCorrelation(Complex[] signalComplex,
                                  Complex[] kernelComplex)
Deprecated. 
Performs cross correlation in the frequency domain using FFT and IFFT.

Parameters:
signalComplex - An array of type Complex containing the signal.
kernelComplex - An array of type Complex containing the kernel.
Returns:
The results of cross-correlation of kenerl against signal.