Package com.tagtraum.audiokern.math
Class NativeFFT
- java.lang.Object
-
- com.tagtraum.audiokern.math.NativeFFT
-
- All Implemented Interfaces:
Transform
public class NativeFFT extends Object implements Transform
Native implementation of FFT.- Author:
- Hendrik Schreiber
-
-
Constructor Summary
Constructors Constructor Description NativeFFT(int numberOfSamples)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
finalize()
float[][]
inverseTransform(float[] real, float[] imaginary)
static float[][]
realFFT(long pointer, boolean forward, int numberOfSamples, float[] realIn, float[] imagIn)
Perform real FFT.float[][]
transform(float[] real)
float[][]
transform(float[] real, float[] imaginary)
-
-
-
Method Detail
-
inverseTransform
public float[][] inverseTransform(float[] real, float[] imaginary) throws UnsupportedOperationException
- Specified by:
inverseTransform
in interfaceTransform
- Throws:
UnsupportedOperationException
-
transform
public float[][] transform(float[] real) throws UnsupportedOperationException
- Specified by:
transform
in interfaceTransform
- Throws:
UnsupportedOperationException
-
transform
public float[][] transform(float[] real, float[] imaginary) throws UnsupportedOperationException
- Specified by:
transform
in interfaceTransform
- Throws:
UnsupportedOperationException
-
realFFT
public static float[][] realFFT(long pointer, boolean forward, int numberOfSamples, float[] realIn, float[] imagIn) throws IllegalArgumentException
Perform real FFT.- Parameters:
forward
- indicates whether this is a forward or inverse DFTnumberOfSamples
- number of samplesrealIn
- input array of floatsimagIn
- imaginary input needed for inverse transform- Returns:
- real and imaginary part of the FFT's result
- Throws:
IllegalArgumentException
- if the number of samples is less than 4 or not a power of 2
-
-