How to extract frequency information from samples from PortAudio using FFTW in C

对着背影说爱祢 提交于 2019-11-27 18:36:52
Paul R

To convert your audio samples to a power spectrum:

  • if your audio data is integer data then convert it to floating point
  • pick an FFT size (e.g. N=1024)
  • apply a window function to N samples of your data (e.g. Hanning)
  • use a real-to-complex FFT of size N to generate frequency domain data
  • calculate the magnitude of your complex frequency domain data (magnitude = sqrt(re^2 + im^2))
  • optionally convert magnitude to a log scale (dB) (magnitude_dB = 20*log10(magnitude))
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!