如何转换的声音pressure -1.0到+1.0之间的浮动,以分贝(A)? [英] How to convert a float between -1.0 and +1.0 to dB(A) of sound pressure?

查看:299
本文介绍了如何转换的声音pressure -1.0到+1.0之间的浮动,以分贝(A)?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

使用

WaveFileReader wfr = new WaveFileReader(file); 
float[] d = wfr.ReadNextSampleFrame();

我得到一个float数组 D 。当通过 D迭代使用的foreach(浮点S IN D)我得到-1.0到+1.0之间浮动。我该如何将它们转换为声音pressure的分贝(A)?

I get a float array d. When iterating through d using foreach (float s in d) I get floats between -1.0 and +1.0. How do I convert them to dB(A) of sound pressure?

编辑:我解决它使用双DB = 20 * Math.Log10(Math.Abs​​(S));

推荐答案

DBA的规模是相对的空气pressure的措施。

The dBA scale is a measure of relative air-pressure.

在此背景下,我们正在谈论的还音系统,在其输入需要样品和设备,导致声音pressure波具有某种类型的。

In this context, we are talking about an audio reproduction system that takes samples at its input and has some type of apparatus that results in sound pressure waves.

假设系统是一个线性系统时,会有增益为单个值整个系统,并且这将取决于电和物理设计特性。

Assuming the system is a linear system, there will be a single value of gain for the whole system, and it will depend on electrical and physical design characteristics.

输出=增益*输入

为了计算任何给定的输入声音pressure价值,你需要做一个实验来测量系统的输出pressure,对输入的给定值。

In order to compute a sound pressure value for any given input you will need to conduct an experiment to measure the output pressure of the system, for a given value of Input.

考虑到一个采样值成为在DAC的输出的输出电压,并且,该系统的输出功率成正比的声音pressure:

Considering that a sample-value becomes an output voltage at the output of a DAC, and that the output power of the system is proportional to the sound pressure:

(1)V = IR (2)P = IV ,有一点重排,我们发现, p = V * V / R

(1) V=IR and (2) P = IV, with a little rearrangement we find that P=V*V/R

因此​​功率与电压的平方(或样品的值)而变化。

Therefore Power varies with the square of voltage (or the sample value).

一个分贝值是相对测量:

A decibel value is a relative measurement:

SDB = 10 * log10的(S / SREF)

其中, SREF 基准测量点。

由于我们的输入和输出之间的权力关系,我们得到

Since we have a power relationship between input and output, we get

SDB = 10 * log10的(S * S / SREF)== 20 * log10的(S / SREF)

现在,分贝也恰好是频率加权的规模,所以你将需要申请中描述的过滤器的这里样品进行真正精确的值。

Now, dBA also happens to be a frequency weighted scale, so you will need to apply the filter described here to the samples for truly accurate values.

这篇关于如何转换的声音pressure -1.0到+1.0之间的浮动,以分贝(A)?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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