Audio spectrum analysis using FFT algorithm in Java

无人久伴 提交于 2019-11-27 12:15:30

You need a few additional steps in addition to the FFT. This has been covered many times already in previous similar questions here on SO, and you can find additional material by searching for "dsp", "fft", "spectrum", "spectrogram", etc, but essentially you need to do the following:

  • apply a window function to the input data (e.g. Hann(ing))
  • apply FFT to windowed input data (for complex-to-complex FFT the imaginary inputs should all be zero)
  • calculate squared magnitude of first N / 2 FFT output bins (re * re + im * im)
  • convert squared magnitude to dB scale (10 * log10(squared_magnitude))
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!