使用 FFT 计算同一源的幅度差异

发布于 2024-08-27 21:11:59 字数 445 浏览 14 评论 0原文

我有一个关于 FFT 使用的问题。使用函数 getBand(int i)Minim 我可以提取特定频率的幅度并绘制漂亮的图。效果很好。

然而,这更多的是一个好奇的问题。当我查看使用相同频率播放同一首歌曲两次时提取的值(因此幅度应该相同),但我得到非常不同的值 - 这是为什么?

0.0,0.0,0.0,0.0,0.0,0.08706585,0.23708777,0.83046436,0.74603105,0.30447206
0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.08706585,0.4790409,0.9608221,0.83046436,0.74603105

I have a question regarding use of FFT. Using function getBand(int i) with Minim i can extract the amplitude of a specific frequency and do pretty maps of it. Works great.

However, this is a more of a curiosity question. When i look at the values extracted from playing the same song two twice using the same frequency (so the amplitude should be identical) but i get very different values - why is this?

0.0,0.0,0.0,0.0,0.0,0.08706585,0.23708777,0.83046436,0.74603105,0.30447206
0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.08706585,0.4790409,0.9608221,0.83046436,0.74603105

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

心如狂蝶 2024-09-03 21:11:59

您确定这两种情况下的输入完全相同吗?如果您只是选取歌曲的随机片段,那么对于歌曲中不同的起始点,FFT 的输出将非常不同。

Are you sure the inputs are exactly the same in both cases ? If you're just taking a random segment of a song then the output of an FFT will be very different for different starting points in the song.

躲猫猫 2024-09-03 21:11:59

mp3 解码可能不稳定和/或 fft 例程的导入缓冲可能不稳定(该系列之前的静音长度不同)。
在这种情况下,第二个输出中的引入部分大约大了 2 个步长。

然后,如果执行 fft 的时间间隔长于 fft 窗口大小,则导入中的差异可能会导致 fft 窗口落在系列中完全不同的部分,这可以解释稍后的非常不同的值在输出中。

如果您可以增加“时间分辨率”(每个给定时间执行的 fft 数量),或者增加 fft 窗口大小,那么情况应该会更清楚,这样 fft 测量就不会稀疏地进行。理想情况下,在我们期望在不同步的扫描之间匹配模式之前,它们应该重叠。

The mp3 decoding could be flaky and/or the lead-in buffering of the fft routine could be flakey, (different length of silence preceeding the series).
In this case it looks like the lead-in is around 2 steps greater in the 2nd output.

Then, if the time interval at which the ffts are performed is longer than the fft window size, a difference in the lead-in can cause the fft windows to land on quite different parts of the series, which could explain the very different values later in the outputs.

The situation should be clearer if you can increase the 'time resolution' (amount of ffts performed per given time) -or increase the fft window size, so the fft measurements arent done sparsely. Idealy they should overlap before we could expect to match a pattern between scans done out of step.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文