MATLAB - FFT 缺少基本原理

发布于 2024-10-03 21:50:51 字数 1435 浏览 0 评论 0原文

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

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

发布评论

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

评论(4

请别遗忘我 2024-10-10 21:50:52

您在 2f、4f、6f 和 8f 处看到峰值这一事实强烈表明您的输入数据实际上比您想象的高八度,或者您误解了结果的频率范围。如果您只是缺少基频,您还会看到 3f、5f 和 7f。

建议:

  • 在 FT 之前绘制输入数据。您应该能够目测主导术语的频率。
  • 聆听 Garageband 发出的音符。是中音C之上还是之下?
  • 检查您是否了解绘图中频率刻度上的值的来源。

The fact that you see peaks at 2f, 4f, 6f and 8f strongly implies that either your input data is actually an octave above what you think it is, or that you're misinterpreting the frequency scale of your results. If you were just missing the fundamental frequency, you'd see 3f, 5f and 7f as well.

Suggestions:

  • Plot your input data before you FT it. You should be able to eyeball the frequency of the dominant term.
  • Listen to the note produced by garageband. Is it above or below middle C?
  • Check that you understand where the values on the frequency scale on your plot came from.
奢望 2024-10-10 21:50:51

这并不罕见。对于男声、大型弦乐器和许多其他音高声源来说,基音缺失或几乎缺失是很常见的。

与正弦波函数发生器相比,这使得仅使用 FFT 峰值结果在确定实际乐器的音符方面效果极差。这是因为音调与峰值频谱频率不同。音高是一种心理声学感知现象。这就是您需要阅读的内容。关于这个主题有大量的研究论文。

所以你需要看看一套完全不同的算法。尝试倒谱(倒谱分析)、谐波乘积谱、自相关和类似的(AMDF、ASDF 等滞后)、RAPT(音调跟踪的鲁棒算法)、YAAPT 等。

添加:我写了更详细的 博客文章中缺少基本原理的音高解释

This is not unusual. It's very common for the fundamental to be missing, or nearly so, for male voices, big string instruments, and many other pitched sound sources.

That makes using an FFT peak result alone extremely poor at determining musical notes from actual musical instruments, as opposed to sinewave function generators. That's because pitch is different from peak spectral frequency. Pitch is a psycho-acoustic perceptual phenomena. So that's what you need to read up on. There are tons of research papers on the subject.

So you need to look at a completely different set of algorithms. Try cepstrums (cepstral analysis), harmonic product spectrums, autocorrelation and similar (AMDF, ASDF, etc. lags), RAPT (Robust Algorithm for Pitch Tracking), YAAPT, etc.

ADDED: I wrote up a more detailed explanation of pitched sounds with missing fundamentals in a blog post.

倾城花音 2024-10-10 21:50:51

乐器音符的基频相对于谐波(也称为泛音)衰减并不罕见,并且在某些情况下,基频幅度可能远低于泛音的幅度。

看一下真实巴松管(不是合成巴松管)演奏 G3 音符的频率/幅度图。观察相对于一次谐波的衰减基波 (196.39 Hz)。但还要观察到所有整数倍谐波在 10 次谐波之前都是可见的。实际上,还存在更多谐波,但在此线性幅度图上看不到它们。

BassoonG3FrequencyMagnitude

在您的情况下,您的 G3 音符频谱仅显示 1 阶、3 阶、5 阶和 7 阶谐波表明有什么问题。您的测试声音似乎是合成的,因此问题可能在于声音的合成方式。

真实乐器的频谱通常显示基频和许多整数倍谐波,例如 1、2、3 等,如上所示。对于大多数乐器上演奏的大多数音符来说,泛音通常远高于 6KHz。

看一下真实巴松管(不是合成巴松管)演奏 G3 音符的频率/分贝幅度图。观察到总共存在 37 个整数倍谐波,直到它们在接近 -104 dB 的本底噪声处消失。

BassoonG3FrequencyDecibelMagnitude

您可以在此处聆听此巴松管样本并查看其频谱:
巴松管乐器频谱

另请阅读 自主音乐转录的分析方法

It isn't unusual for the fundamental frequency of a musical instrument note to be attenuated relative to the harmonics (also known as overtones), and in some cases the fundamental frequency magnitude may be well below the magnitude of the overtones.

Take a look at this frequency/magnitude plot of a real bassoon (not a synthesized bassoon) playing a G3 note. Observe the attenuated fundamental (196.39 Hz) relative to the first harmonic. But also observe that all the integer-multiple harmonics are visible upto the 10th harmonic. Actually, many more harmonics are present, but they aren't visible on this linear magnitude plot.

BassoonG3frequencyMagnitude

In your case, the additional fact that your G3 musical note's spectrum is showing only the 1st, 3rd, 5th and 7th harmonics suggests that something is wrong. Your test sound appears to be synthesized, so the problem could be with the way the sound was synthesized.

The spectra of real musical instruments typically show the fundamental frequency and many integer-multiple harmonics such as 1, 2, 3 and so on, as seen above. And the harmonics typically extend well above 6KHz for most notes played on most instruments.

Take a look at this frequency/decibel_magnitude plot of a real bassoon (not a synthesized bassoon) playing a G3 note. Observe that a total of 37 integer-multiple harmonics are present, until they dissappear at the noise floor near -104 dB.

BassoonG3frequencyDecibelMagnitude

You can listen to this bassoon sample and see its spectrum here:
Bassoon musical instrument spectrum

Also read this detailed post on analytical approaches to autonomous musical transcription

亚希 2024-10-10 21:50:51

您是否尝试过通过频谱图(MATLAB 中的函数频谱图)运行它来确定发生了什么?

我不知道你使用什么算法,没有这些信息,我们无法说出出了什么问题。令我震惊的是,你的第二次三次谐波(图中的第二个峰值)比你的二次谐波(图中的第一个峰值)大得多。

您确定您的采样正确吗:即您的 DFT 的频率最高为采样频率的一半(正频率范围和负频率范围)?另外:如何抑制信号的瞬态部分?

Have you tried running it through a spectrogram (function spectrogram in MATLAB) to identify what is happening?

I don't know what algorithms you use, without that information, we can't say what is going wrong. What alarms me is that your second third harmonic (second peak in the plot) is much larger than your second harmonic (first peak in the plot).

Are you sure you have all the sampling right: i.e. your DFT only has frequencies up to half the sampling frequency (both positive and negative frequency range)? Also: how do you suppress any transient part of your signal?

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