Converting an FFT to a spectogram

后端 未结 5 1735
日久生厌
日久生厌 2020-12-13 22:03

I have an audio file and I am iterating through the file and taking 512 samples at each step and then passing them through an FFT.

I have the data out as a block 514

5条回答
  •  星月不相逢
    2020-12-13 22:18

    The usual thing to do to get all of an FFT visible is to take the logarithm of the magnitude.

    So, the position of the output buffer tells you what frequency was detected. The magnitude (L2 norm) of the complex number tells you how strong the detected frequency was, and the phase (arctangent) gives you information that is a lot more important in image space than audio space. Because the FFT is discrete, the frequencies run from 0 to the nyquist frequency. In images, the first term (DC) is usually the largest, and so a good candidate for use in normalization if that is your aim. I don't know if that is also true for audio (I doubt it)

提交回复
热议问题