如何对大块数据使用 FFT 来绘制幅频响应?

发布于 2024-11-01 17:21:28 字数 732 浏览 5 评论 0原文

我是一名程序员,而不是一名优秀的数学家,所以 FFT 对我来说就像一些黑匣子,我想将一些数据放入一些 FFT 库中,并得到可绘制的 AFR(幅频响应)数据,就像 Rightmark 音频等一些软件一样是:

http://www.ixbt.com/proaudio/behringer/3031a/fr-hf.png

现在我有一个播放对数扫频正弦波的系统(带有短淡入/淡出以避免尖锐边缘)并记录音频系统的响应。

据我了解,我需要将输入用零填充到 2^n,使用音频样本作为复数的实部,设置虚数 = 0,然后我将从 FFT 中返回频率仓数组,其中一半输入数据的长度。

但是,如果我不需要像几秒音频缓冲区给我的那样大的频率分辨率,那么正确的方法是什么,例如,1024 大小的 FFT 窗口,馈送音频块并返回考虑到的 512 个频率点我传入的所有数据?或者也许这是不可能的,我需要一次馈送整个正弦扫频以取回我需要的所有 AFR 数据?

还有需要平滑处理吗?我发现 FFT 的原始输出可能非常嘈杂。尽早避免噪声的正确方法是什么,所以我只看到噪声来自 AFR 本身,而不是来自 FFT 计算(就像我给出的链接中的图像 - 看起来相当平滑)?

我是一名 C++/C# 程序员。我将不胜感激任何展示如何处理扫频正弦端块并取回 AFR 数据的示例。目前我只找到了实时处理小块数据的示例,但这不是我需要的。

I am a programmer and not a good mathematician so FFT is like some black box to me, I would like t throw some data into some FFT library and get out a plottable AFR (amplitude-frequency response) data, like some software like Rightmark audio does:

http://www.ixbt.com/proaudio/behringer/3031a/fr-hf.png

Now I have a system which plays back a logarithmic swept sine (with short fade-in/fade-out to avoid sharp edges) and records the response from the audio system.

As far as I understand, I need to pad the input with zeros to 2^n, use audio samples as a real part of a complex numbers, set imaginary=0, and I'll get back from FFT the frequency bins array whith half length of input data.

But if I do not need as big frequency resolution as some seconds audio buffer give to me, then what is the right way to make, lets say, 1024 size FFT window, feed chunks of audio and get back 512 frequency points which take into account all the data I passed in? Or maybe it is not possible and I need to feed entire swept sine at once to get back all the AFR data I need?

Also is there any smoothing needed? I have seen that the raw output from FFT may be really noisy. What is the right way to avoid the noise as early as possible, so I see the noise only as it comes from the AFR itself and not from FFT calculations (like the image in the link I have given - it seems pretty smooth)?

I am a C++/C# programmer. I would be grateful for any examples which show how to process chunks of swept sine end get back AFR data. For now I have found only examples which process data in small chunks in realtime, and that is not what I need.

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

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

发布评论

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

评论(1

九局 2024-11-08 17:21:28

窗口函数应该可以帮助您减少噪音

您所需要做的就是将输入数据乘以 w (n) :

在此处输入图像描述

Window function should help you reducing the noise

All you need to do is multiply your input data by w(n) :

enter image description here

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