comirva.audio.util
Class FFT

java.lang.Object
  extended by comirva.audio.util.FFT

public final class FFT
extends Object

Class for computing a windowed fast Fourier transform. Implements some of the window functions for the STFT from Harris (1978), Proc. IEEE, 66, 1, 51-83.


Field Summary
static int FFT_FORWARD
          used in fft(double[], double[], int) to specify a forward Fourier transform
static int FFT_INLINE_POWER_PHASE
          used to specify a inline power phase Fourier transform
static int FFT_MAGNITUDE
          used to specify a magnitude Fourier transform
static int FFT_MAGNITUDE_PHASE
          used to specify a magnitude phase Fourier transform
static int FFT_NORMALIZED_POWER
          used to specify a normalized power Fourier transform
static int FFT_POWER
          used to specify a power Fourier transform
static int FFT_POWER_PHASE
          used to specify a power phase Fourier transform
static int FFT_REVERSE
          used in fft(double[], double[], int) to specify an inverse Fourier transform
static int WND_BH3
          used to specify a 61-dB 3-sample Blackman-Harris window function
static int WND_BH3MIN
          used to specify a minimum 3-sample Blackman-Harris window function
static int WND_BH4
          used to specify a 74-dB 4-sample Blackman-Harris window function
static int WND_BH4MIN
          used to specify a minimum 4-sample Blackman-Harris window function
static int WND_GAUSS
          used to specify a Gaussian window function
static int WND_HAMMING
          used to specify a Hamming window function
static int WND_HANNING
          used to specify a Hanning window function
static int WND_HANNINGZ
          used to specify a Hanning Z window function
static int WND_NONE
          used to specify a rectangular window function
static int WND_RECT
          used to specify a rectangular window function
static int WND_USER_DEFINED
          used to specify a Hanning window function
 
Constructor Summary
FFT(int transformationType, int windowSize)
           
FFT(int transformationType, int windowSize, double[] windowFunction)
           
FFT(int transformationType, int windowSize, int windowFunctionType)
           
FFT(int transformationType, int windowSize, int windowFunctionType, int support)
           
 
Method Summary
 int getTransformationType()
           
 int getWindowFunctionType()
           
 void setWindowFunction(int windowFunctionType, int support)
          This method allows to change the window function to one of the predefined window function types.
 void transform(double[] re, double[] im)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

FFT_FORWARD

public static final int FFT_FORWARD
used in fft(double[], double[], int) to specify a forward Fourier transform

See Also:
Constant Field Values

FFT_REVERSE

public static final int FFT_REVERSE
used in fft(double[], double[], int) to specify an inverse Fourier transform

See Also:
Constant Field Values

FFT_MAGNITUDE

public static final int FFT_MAGNITUDE
used to specify a magnitude Fourier transform

See Also:
Constant Field Values

FFT_MAGNITUDE_PHASE

public static final int FFT_MAGNITUDE_PHASE
used to specify a magnitude phase Fourier transform

See Also:
Constant Field Values

FFT_NORMALIZED_POWER

public static final int FFT_NORMALIZED_POWER
used to specify a normalized power Fourier transform

See Also:
Constant Field Values

FFT_POWER

public static final int FFT_POWER
used to specify a power Fourier transform

See Also:
Constant Field Values

FFT_POWER_PHASE

public static final int FFT_POWER_PHASE
used to specify a power phase Fourier transform

See Also:
Constant Field Values

FFT_INLINE_POWER_PHASE

public static final int FFT_INLINE_POWER_PHASE
used to specify a inline power phase Fourier transform

See Also:
Constant Field Values

WND_NONE

public static final int WND_NONE
used to specify a rectangular window function

See Also:
Constant Field Values

WND_RECT

public static final int WND_RECT
used to specify a rectangular window function

See Also:
Constant Field Values

WND_HAMMING

public static final int WND_HAMMING
used to specify a Hamming window function

See Also:
Constant Field Values

WND_BH3

public static final int WND_BH3
used to specify a 61-dB 3-sample Blackman-Harris window function

See Also:
Constant Field Values

WND_BH4

public static final int WND_BH4
used to specify a 74-dB 4-sample Blackman-Harris window function

See Also:
Constant Field Values

WND_BH3MIN

public static final int WND_BH3MIN
used to specify a minimum 3-sample Blackman-Harris window function

See Also:
Constant Field Values

WND_BH4MIN

public static final int WND_BH4MIN
used to specify a minimum 4-sample Blackman-Harris window function

See Also:
Constant Field Values

WND_GAUSS

public static final int WND_GAUSS
used to specify a Gaussian window function

See Also:
Constant Field Values

WND_HANNING

public static final int WND_HANNING
used to specify a Hanning window function

See Also:
Constant Field Values

WND_USER_DEFINED

public static final int WND_USER_DEFINED
used to specify a Hanning window function

See Also:
Constant Field Values

WND_HANNINGZ

public static final int WND_HANNINGZ
used to specify a Hanning Z window function

See Also:
Constant Field Values
Constructor Detail

FFT

public FFT(int transformationType,
           int windowSize)

FFT

public FFT(int transformationType,
           int windowSize,
           int windowFunctionType)

FFT

public FFT(int transformationType,
           int windowSize,
           int windowFunctionType,
           int support)

FFT

public FFT(int transformationType,
           int windowSize,
           double[] windowFunction)
Method Detail

transform

public void transform(double[] re,
                      double[] im)

setWindowFunction

public void setWindowFunction(int windowFunctionType,
                              int support)
This method allows to change the window function to one of the predefined window function types.

Parameters:
windowFunctionType - int the type of the window function
support - int

getTransformationType

public int getTransformationType()

getWindowFunctionType

public int getWindowFunctionType()