marf.FeatureExtraction.FFT
Class FFT

java.lang.Object
  extended bymarf.FeatureExtraction.FeatureExtraction
      extended bymarf.FeatureExtraction.FFT.FFT
All Implemented Interfaces:
StorageManager

public class FFT
extends FeatureExtraction

Class FFT

Implements Fast Fourier Transform

$Header: /cvsroot/marf/marf/src/marf/FeatureExtraction/FFT/FFT.java,v 1.34 2004/04/20 16:38:35 mokhov Exp $

Author:
Stephen Sinclair

Field Summary
static int DEFAULT_CHUNK_SIZE
          Default number (1024) of doubles per chunk in the window.
 
Fields inherited from class marf.FeatureExtraction.FeatureExtraction
adFeatures, oPreprocessing
 
Fields inherited from interface marf.Storage.StorageManager
DUMP_BINARY, DUMP_CSV_TEXT, DUMP_GZIP_BINARY, DUMP_XML
 
Constructor Summary
FFT(Preprocessing poPreprocessing)
          FFT Constructor
 
Method Summary
static void DoFFT(double[] InputReal, double[] InputImag, double[] OutputReal, double[] OutputImag, int direction)
          FFT algorithm, translated from "Numerical Recipes in C++" Implements the Fast Fourier Transform, which performs a discrete Fourier transform in O(n*log(n)).
 void dump()
          Not Implemented
 boolean extractFeatures()
          FFT Implementation of extractFeatures()
static void NormalFFT(double[] sample, double[] magnitude)
          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[] sample, double[] magnitude, double[] phaseAngle)
          Performs a normal FFT, taking a real input (supposedly an audio sample) and returns the frequency analysis in terms of "magnitude" and "phase angle".
 void restore()
          Not Implemented
 
Methods inherited from class marf.FeatureExtraction.FeatureExtraction
getFeaturesArray, hamming, hamming
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DEFAULT_CHUNK_SIZE

public static final int DEFAULT_CHUNK_SIZE
Default number (1024) of doubles per chunk in the window. Feature vector will be half of the chunk size.

See Also:
Constant Field Values
Constructor Detail

FFT

public FFT(Preprocessing poPreprocessing)
FFT Constructor

Parameters:
poPreprocessing - Preprocessing module reference
Method Detail

extractFeatures

public final boolean extractFeatures()
                              throws FeatureExtractionException
FFT Implementation of extractFeatures()

Specified by:
extractFeatures in class FeatureExtraction
Returns:
true if there were features extracted, false otherwise
Throws:
FeatureExtractionException

dump

public void dump()
          throws java.io.IOException
Not Implemented

Throws:
java.io.IOException

restore

public void restore()
             throws java.io.IOException
Not Implemented

Throws:
java.io.IOException

DoFFT

public static final void DoFFT(double[] InputReal,
                               double[] InputImag,
                               double[] OutputReal,
                               double[] OutputImag,
                               int direction)
                        throws FeatureExtractionException

FFT algorithm, translated from "Numerical Recipes in C++" 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:
FeatureExtractionException

NormalFFT

public static final void NormalFFT(double[] sample,
                                   double[] magnitude,
                                   double[] phaseAngle)
                            throws FeatureExtractionException

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:
sample - must be an array of size (2^k)
magnitude - must be half the size of "sample"
phaseAngle - must be half the size of "sample"
Throws:
FeatureExtractionException

NormalFFT

public static final void NormalFFT(double[] sample,
                                   double[] magnitude)
                            throws FeatureExtractionException

Performs a normal FFT, taking a real input (supposedly an audio sample) and returns the frequency analysis in terms of "magnitude".

Parameters:
sample - must be an array of size (2^k)
magnitude - must be half the size of "sample"
Throws:
FeatureExtractionException