marf.math
Class Algorithms.FFT

java.lang.Object
  extended by marf.math.Algorithms.FFT
Enclosing class:
Algorithms

public static final class Algorithms.FFT
extends java.lang.Object

A collection of FFT-related math.

Author:
Stephen Sinclair, Serguei Mokhov

Constructor Summary
Algorithms.FFT()
           
 
Method Summary
static void doFFT(double[] padInputReal, double[] padInputImag, double[] padOutputReal, double[] padOutputImag, int piDirection)
          FFT algorithm, translated from "Numerical Recipes in C++" that implements the Fast Fourier Transform, which performs a discrete Fourier transform in O(n*log(n)).
static void doFFT2(ComplexMatrix poInputMatrix, ComplexMatrix poOutputMatrix, int piDirection)
          Performs 2D FFT; which is merely 1D FFT for every column, and then, 1D FFT of every row of the result.
static void normalFFT(double[] padSample, double[] padMagnitude)
          Performs a normal FFT, taking a real input (supposedly an audio sample) and returns the frequency analysis in terms of "magnitude".
static void normalFFT(double[] padSample, double[] padMagnitude, double[] padPhaseAngle)
          Performs a normal FFT, taking a real input (supposedly an audio sample) and returns the frequency analysis in terms of "magnitude" and "phase angle".
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Algorithms.FFT

public Algorithms.FFT()
Method Detail

doFFT

public static final void doFFT(double[] padInputReal,
                               double[] padInputImag,
                               double[] padOutputReal,
                               double[] padOutputImag,
                               int piDirection)
                        throws MathException
FFT algorithm, translated from "Numerical Recipes in C++" that implements the Fast Fourier Transform, which performs a discrete Fourier transform in O(n*log(n)).

Parameters:
padInputReal - InputReal is real part of input array
padInputImag - InputImag is imaginary part of input array
padOutputReal - OutputReal is real part of output array
padOutputImag - OutputImag is imaginary part of output array
piDirection - Direction is 1 for normal FFT, -1 for inverse FFT
Throws:
MathException - if the sizes or direction are wrong

doFFT2

public static final void doFFT2(ComplexMatrix poInputMatrix,
                                ComplexMatrix poOutputMatrix,
                                int piDirection)
                         throws MathException
Performs 2D FFT; which is merely 1D FFT for every column, and then, 1D FFT of every row of the result.

Parameters:
poInputMatrix -
poOutputMatrix -
piDirection -
Throws:
MathException
Since:
0.3.0.6

normalFFT

public static final void normalFFT(double[] padSample,
                                   double[] padMagnitude,
                                   double[] padPhaseAngle)
                            throws MathException
Performs a normal FFT, taking a real input (supposedly an audio sample) and returns the frequency analysis in terms of "magnitude" and "phase angle".

Parameters:
padSample - must be an array of size (2^k)
padMagnitude - must be half the size of "sample"
padPhaseAngle - must be half the size of "sample"
Throws:
MathException

normalFFT

public static final void normalFFT(double[] padSample,
                                   double[] padMagnitude)
                            throws MathException
Performs a normal FFT, taking a real input (supposedly an audio sample) and returns the frequency analysis in terms of "magnitude".

Parameters:
padSample - must be an array of size (2^k)
padMagnitude - must be half the size of "sample"
Throws:
MathException


SourceForge Logo