FFT frequency bucket amplitude varies even with constant tone applied

喜欢而已 提交于 2020-12-26 18:51:39

问题


I am trying to use FFT to decode morse code, but I'm finding that when I examine the resulting frequency bin/bucket I'm interested in, the absolute value is varying quite significantly even when a constant tone is presented. This makes it impossible for me to use the rise and fall around a threshold and therefore decode audio morse. I've even tried the simple example that seems to be copied everywhere, but it also varies... I can't work out what I'm doing wrong, and my maths is not clever enough to understand all the formulas associated with FFT. I now it must be possible, but I can't find out how... can anyone help please?


回答1:


Make sure you are using the magnitude of the FFT result, not just the real or imaginary component of a complex result.

In general, when a longer constant amplitude sinusoid is fed to a series of shorter FFTs (windowed STFT), the magnitude result will only be constant if the period of the sinusoid is exactly integer periodic in the FFT length. e.g.

f_tone modulo (f_sampling_rate / FFT_length) == 0

If you are only interested in the magnitude of one selected tone frequency, the Goertzel algorithm would serve as a more efficient filter than a full FFT. And, depending on the setup and length restrictions required by your chosen FFT library, it may be easier to vary the length of a Goertzel to match the requirements for your target tone frequency, as well as the time/frequency resolution trade-off needed.



来源:https://stackoverflow.com/questions/64209499/wrong-amplitude-after-fft-matlab

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!