Converting Real and Imaginary FFT output to Frequency and Amplitude

前端 未结 2 1414
轻奢々
轻奢々 2021-02-11 07:18

I\'m designing a real time Audio Analyser to be embedded on a FPGA chip. The finished system will read in a live audio stream and output frequency and amplitude pairs for the X

2条回答
  •  醉梦人生
    2021-02-11 07:54

    The FFT result will give you an array of complex values. The twice the magnitude (square root of sum of the complex components squared) of each array element is an amplitude. Or do a log magnitude if you want a dB scale. The array index will give you the center of the frequency bin with that amplitude. You need to know the sample rate and length to get the frequency of each array element or bin.

    f[i] = i * sampleRate / fftLength
    

    for the first half of the array (the other half is just duplicate information in the form of complex conjugates for real audio input).

    The frequency of each FFT result bin may be different from any actual spectral frequencies present in the audio signal, due to windowing or so-called spectral leakage. Look up frequency estimation methods for the details.

提交回复
热议问题