I have an FFT result. These are stored in two double
arrays: a real part array and an imaginary part array. How do I determine the frequencies that correspond t
I have used the following:
public static double Index2Freq(int i, double samples, int nFFT) {
return (double) i * (samples / nFFT / 2.);
}
public static int Freq2Index(double freq, double samples, int nFFT) {
return (int) (freq / (samples / nFFT / 2.0));
}
The inputs are:
i
: Bin to accesssamples
: Sampling rate in Hertz (i.e. 8000 Hz, 44100Hz, etc.)nFFT
: Size of the FFT vector