Calculate Frequency from sound input using FFT

后端 未结 1 1511
既然无缘
既然无缘 2021-01-27 05:03

My app. is displaying the peak frequency of input sound in RPM .. i have array of doubles contains the samples in time domain.

audioRecord.read(buffer, 0, 1024);         


        
1条回答
  •  北海茫月
    2021-01-27 05:52

    The frequency corresponding to a given FFT bin index is given by:

    f = i * Fs / N;
    

    where:

    Fs = sample rate (Hz)
    N = FFT size
    i = bin index
    

    So for your peak index maxIndex and FFT size blockSize the frequency of the peak will be:

    f = maxIndex * Fs / blockSize;
    

    See this answer for more details.

    0 讨论(0)
提交回复
热议问题