获取分贝从一个Android麦克风 [英] Getting decibel from an android microphone

查看:466
本文介绍了获取分贝从一个Android麦克风的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我一直在寻找了一段时间了,我一直没能找到一种方法来实际获得对Android的麦克风的SPL / dB值。该线程数和文章,我发现,讨论它处理它像什么太明显了,任何人都应该是能够做到这一点,而更关心的是让他们的转换算法是正确的。有谁知道如何做到这一点?

I have been searching for quite some time now, and I haven't been able to find a way to actually get an SPL/db value from a microphone on android. The few threads and articles that I have found that discussed it treated it like something SO obvious that anyone should be able to do it, and were more concerned with getting their conversion algorithms correct. Does anyone know how to do this?

推荐答案

您必须先禁用任何自动电平控制。我认为你要么知道,或者知道去哪里找,找出如何记录从麦克风采样,无ALC。

You would have to first disable any automatic level control. I assume you either know, or know where to look to find out how to record samples from the microphone without ALC.

从此,它基本上所有关于校准和记录幅度。本质上,你会乘或卷积由一个频率相关的校准,然后取10 *在所有或一些的频率范围的。对数幅度

From then on, its basically all about the calibration and log magnitude. Essentially you will multiply or convolve by a frequency-dependent calibration and then take 10 * the log magnitude over all or some of the frequency range.

然后,你就必须采取一些校准测量,例如频率扫描的控制,已知的spl的实验室源并记录所得到的振幅与频率(其如果扫慢慢是基本上相同的幅度对时间),或你会打它一个宽带的伪脉冲(如电火花,发令枪,等等),你也会在频率测量具有良好的实验室设备在辐射对称的位置,或者作为最后的手段,使用一些已知的物理源的属性来估算SPL,只是希望它的平面度不佳跨越感兴趣的频率。

Then you'd have to take some calibration measurements, for example frequency sweeping a lab source of controlled, known spl and recording the resulting amplitude vs frequency (which if you sweep slowly is essentially the same as amplitude vs. time) or you'd hit it with a wideband pseudo impulse (such as an electric spark, starter pistol, whatever) that you are also measuring across frequency with good lab equipment in a radiation-symmetric position, or as a last resort you use some known physical property of the source to estimate the SPL and just hope it's flat enough across frequencies of interest.

您那么有两种选择如何应用修正。

You then have two choices for how to apply the correction.

一种选择是颠倒的传递函数,计算时域脉冲响应,然后使用,作为通过卷积它与输入信号施加的频率平坦性校正的数字滤波器。然后,你可以把结果的数幅度在单位时间确定宽带SPL。

One option is to invert the transfer function, calculate the time domain impulse response, and then use that as a digital filter by convolving it with an input signal to apply a frequency-flatness-correction. You can then take the log magnitude of the result per unit time to determine wideband spl.

或者你也可以做到对输入数据进行FFT以生成频谱,并乘上你的频率响应的倒数,并采取一切(的总和)的数幅度仓(S)很有趣。

Or you can do an FFT on the input data to generate a frequency spectrum, and multiply that by the inverse of your frequency response, and take the log magnitude of whatever (sum of) bin(s) is interesting.

不幸的是,几乎没有理由,甚至相同型号的承担超过从装置原油一致性设备。

Unfortunately, there's little reason to assume more than crude consistency from device to device, even of the same model.

这篇关于获取分贝从一个Android麦克风的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆