math.fourierTransforms.r2
Class FFT1dDouble

java.lang.Object
  extended by math.fourierTransforms.r2.FFT1dDouble

public class FFT1dDouble
extends java.lang.Object

Works. Automatically scales ouput in ifft. A 1D FFT for integral power of two FFTs


Constructor Summary
FFT1dDouble()
           
 
Method Summary
 void computeBackwardFFT(double[] in_r, double[] in_i)
           
 void computeForwardFFT(double[] in_r, double[] in_i)
           
 void fft(double[] _realPart, double[] _imaginaryPart)
          FFT engine.
 double[] getImaginaryData()
           
static double getMagnitude(double r, double imag)
          Compute the sum of the squares of a complex number
static int getMaxPSDLocation(double[] realPart, double[] imaginaryPart)
          get the location of the maximum partial
 double[] getPSD()
           
static double[] getPsd(double[] audioWaveForm)
           
static double[] getPSD(double[] in_r, double[] in_i)
          Compute the power spectral density of the input arrays
 double[] getRealData()
           
static OscopePanel getSpectrumPanel(double[] audioWaveForm)
           
static void main(java.lang.String[] args)
           
static void print(java.lang.Object[] o)
           
static void showSpectrumAnalyzer()
          A way to visually test the 1D FFT on a small amount of data.
 void swap(int i, int numBits)
          1D FFT utility functions.
static void synthesizeRamp(double[] realPart, double[] imaginaryPart)
          Destroy the input data with a linear ramp.
static void testFFT()
          Test the DFT using a small number of samples.
static void testFFT2()
           
 void timeFFT(int n)
           
 void visuallyTest()
           
static void window(double[] r, double[] w)
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FFT1dDouble

public FFT1dDouble()
Method Detail

showSpectrumAnalyzer

public static void showSpectrumAnalyzer()
A way to visually test the 1D FFT on a small amount of data.


getSpectrumPanel

public static OscopePanel getSpectrumPanel(double[] audioWaveForm)

getPsd

public static double[] getPsd(double[] audioWaveForm)

visuallyTest

public void visuallyTest()

timeFFT

public void timeFFT(int n)

print

public static void print(java.lang.Object[] o)

synthesizeRamp

public static void synthesizeRamp(double[] realPart,
                                  double[] imaginaryPart)
Destroy the input data with a linear ramp.

Parameters:
realPart - input datas real component
imaginaryPart - input datas' imaginary component.

window

public static void window(double[] r,
                          double[] w)

swap

public void swap(int i,
                 int numBits)
1D FFT utility functions.


getMaxPSDLocation

public static int getMaxPSDLocation(double[] realPart,
                                    double[] imaginaryPart)
get the location of the maximum partial

Parameters:
realPart -
imaginaryPart -
Returns:
location of max(realPart[i],imaginaryPart[i])

getMagnitude

public static double getMagnitude(double r,
                                  double imag)
Compute the sum of the squares of a complex number

Parameters:
r - real part
imag - imaginary part
Returns:
r*r + imag * imag.

computeForwardFFT

public void computeForwardFFT(double[] in_r,
                              double[] in_i)

computeBackwardFFT

public void computeBackwardFFT(double[] in_r,
                               double[] in_i)

fft

public void fft(double[] _realPart,
                double[] _imaginaryPart)
FFT engine.


getRealData

public double[] getRealData()
Returns:
gets the real component from FFT.

getImaginaryData

public double[] getImaginaryData()
Returns:
gets the imaginary component from FFT.

getPSD

public double[] getPSD()
Returns:
Power Spectral Density of the internal data

getPSD

public static double[] getPSD(double[] in_r,
                              double[] in_i)
Compute the power spectral density of the input arrays

Parameters:
in_r - real part of an fft
in_i - imaginary part of an fft
Returns:
the psd.

testFFT2

public static void testFFT2()

testFFT

public static void testFFT()
Test the DFT using a small number of samples. This is an O(N**2) algorithm.


main

public static void main(java.lang.String[] args)