marf.math
Class Algorithms.FFT

java.lang.Object
  |
  +--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

Constructor Summary
Algorithms.FFT()
           
 
Method Summary
static void doFFT(double[] InputReal, double[] InputImag, double[] OutputReal, double[] OutputImag, int direction)
          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 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[] InputReal,
                               double[] InputImag,
                               double[] OutputReal,
                               double[] OutputImag,
                               int direction)
                        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:
InputReal - InputReal is real part of input array
InputImag - InputImag is imaginary part of input array
OutputReal - OutputReal is real part of output array
OutputImag - OutputImag is imaginary part of output array
direction - Direction is 1 for normal FFT, -1 for inverse FFT
Throws:
MathException - if the sizes or direction are wrong

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