Class FFTSupport

    • Constructor Detail

      • FFTSupport

        public FFTSupport()
    • 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 FFT
        sampleRate - sample rate, e.g. 44,100Hz
        index - 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 samples
        sampleRate - sample rate
        frequency - 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 samples
        sampleRate - sample rate
        Returns:
        frequency resolution in Hz