在 FFT 中补偿麦克风频率响应

发布于 2024-11-19 12:10:41 字数 606 浏览 1 评论 0原文

我正在制作一个显示来自麦克风的声音数据的 FFT 的应用程序。我需要支持的一件事是校准麦克风的频率响应,这将通过校准文件提供给程序。校准文件包含不同频率的 + 或 - dB 值,如下所示:

20 -2.7
50 +0.5
100 +0.7
135 +0.7
190 +1.4
250 +1
370 +0.9
550 +1
700 +0.6
1000 +0.5
1500 +0.4
2000 +0.5
2800 +0.6
2900 +0.4
3000 +0.5
4000 -0.2
4300 -0.2
5600 +0.7
6150 +0.6
12000 +3.5
13000 +3.5
20000 -1.5

我可以在 FFT 之后、在屏幕上显示之前应用校准。

我的问题是:我应该如何在这些值之间进行插值,这些值本质上只是麦克风整个频率响应的选择点?一种简单的方法可能是在这些点周围定义刚性矩形带,并针对 FFT 中的每个频率,选择一条或另一条校准线来应用于该频率。然而,这会导致 FFT 图中出现明显的跳跃。另一种解决方案可能是使用线性插值,但我仍然不确定这是最好的方法。

是否有一种“标准”方法可以做到这一点,例如 Smaart 或 FFT 设备等程序?从这几个固定点生成连续曲线的最佳方法是什么?

I'm making an application that displays an FFT of sound data from a microphone. One thing I need to be able to support is calibrating to the frequency response of the microphone, which will be given to the program via a calibration file. The calibration file contains + or - dB values for different frequencies, like this:

20 -2.7
50 +0.5
100 +0.7
135 +0.7
190 +1.4
250 +1
370 +0.9
550 +1
700 +0.6
1000 +0.5
1500 +0.4
2000 +0.5
2800 +0.6
2900 +0.4
3000 +0.5
4000 -0.2
4300 -0.2
5600 +0.7
6150 +0.6
12000 +3.5
13000 +3.5
20000 -1.5

I can just apply the calibration after the FFT and before displaying it on the screen.

My problem is this: how should I interpolate between those values, which are essentially just select points of the whole frequency response of the microphone? A naive approach might be to define rigid rectangular bands around those points and, for each frequency in an FFT, pick one or another calibration line to apply to that frequency. This would cause visible jumps in the FFT graph, however. Another solution might be to use linear interpolation, but I'm still not sure that's the best way.

Is there a "standard" way to do this, that programs like Smaart or FFT devices do? What would be the best way to generate a continuous curve from those few fixed points?

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

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

发布评论

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

评论(2

人海汹涌 2024-11-26 12:10:41

我会使用某种方法(例如 Wiener 或 LMS 方法)来近似麦克风响应的频率响应的逆滤波器,或者仅采用简单的方法(请参阅注释),并在计算 FFT 之前将其应用于记录的信号。如果这不是一个选择,我会选择线性插值点,因为我不明白为什么这会导致任何“可见的跳跃”。

I would approximate an inverse filter for the frequency response of the microphone response using some method, for example the Wiener or LMS methods, or just go with the naive approach (see comments,) and apply this to the recorded signal before calculating the FFT. If that's not an option, I would go with linearly interpolating the points, as I don't see why this would cause any "visible jumps".

放飞的风筝 2024-11-26 12:10:41

除非我对校准数据的来源或导致非线性响应的可能机制有相反的了解,否则我会在每对点之间使用线性插值。

Unless I knew something to the contrary about the source of the calibration data, or about the likely mechanisms causing the nonlinear response, I'd use linear interpolation between each pair of points.

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