Package com.tagtraum.audiokern.math
Class FFTSupport
- java.lang.Object
-
- com.tagtraum.audiokern.math.FFTSupport
-
public class FFTSupport extends Object
Provides support for FFT implementations.- Author:
- Hendrik Schreiber
-
-
Constructor Summary
Constructors Constructor Description FFTSupport()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static double
bandwidth(int numSamples, float sampleRate)
Computes the frequency resolution, i.e.static int
frequencyToIndex(int numSamples, float sampleRate, double frequency)
Returns the index in the fourier result that corresponds to a frequency.static double
indexToFrequency(int numSamples, float sampleRate, int index)
Returns the frequency for a particular value in the fourier result.static boolean
isNativeFFTSupport()
-
-
-
Method Detail
-
isNativeFFTSupport
public static boolean isNativeFFTSupport()
-
indexToFrequency
public static double indexToFrequency(int numSamples, float sampleRate, int index)
Returns the frequency for a particular value in the fourier result.- Parameters:
numSamples
- number of samples originally used for the FFTsampleRate
- sample rate, e.g. 44,100Hzindex
- index- Returns:
- frequency of the power at the given index of the fourier result
-
frequencyToIndex
public static int frequencyToIndex(int numSamples, float sampleRate, double frequency)
Returns the index in the fourier result that corresponds to a frequency.- Parameters:
numSamples
- number of samplessampleRate
- sample ratefrequency
- frequency- Returns:
- index
-
bandwidth
public static double bandwidth(int numSamples, float sampleRate)
Computes the frequency resolution, i.e. the distance in Hz between adjacent indices.- Parameters:
numSamples
- number of samplessampleRate
- sample rate- Returns:
- frequency resolution in Hz
-
-