如何计算音频 dB 级别? [英] How can I calculate audio dB level?

查看:29
本文介绍了如何计算音频 dB 级别?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想用电脑的麦克风计算房间噪音水平.我将噪音记录为音频文件,但如何计算噪音分贝级别?

I want to calculate room noise level with the computer's microphone. I record noise as an audio file, but how can I calculate the noise dB level?

我不知道如何开始!

推荐答案

如果您想要一个技术上准确或科学上有价值的答案,那么前面的所有答案都是正确的.但是,如果您只是想对比较响度进行一般估计,例如您想检查狗是否在吠叫或婴儿是否在哭,并且您想以 dB 为单位指定阈值,那么这是一个相对简单的计算.

All the previous answers are correct if you want a technically accurate or scientifically valuable answer. But if you just want a general estimation of comparative loudness, like if you want to check whether the dog is barking or whether a baby is crying and you want to specify the threshold in dB, then it's a relatively simple calculation.

许多波形文件编辑器都有以分贝为单位的垂直刻度.没有校准或参考测量,只是一个简单的计算:

Many wave-file editors have a vertical scale in decibels. There is no calibration or reference measurements, just a simple calculation:

dB = 20 * log10(amplitude)

这种情况下的振幅表示为 0 到 1 之间的数字,其中 1 表示声音文件中的最大振幅.例如,如果你有一个 16 位的声音文件,振幅可以高达 32767.所以你只需将样本除以 32767.(我们使用绝对值,只使用正数.)所以如果你有一个波峰在 14731,然后:

The amplitude in this case is expressed as a number between 0 and 1, where 1 represents the maximum amplitude in the sound file. For example, if you have a 16 bit sound file, the amplitude can go as high as 32767. So you just divide the sample by 32767. (We work with absolute values, positive numbers only.) So if you have a wave that peaks at 14731, then:

amplitude = 14731 / 32767
          = 0.44

dB = 20 * log10(0.44)
   = -7.13


但是有一些非常重要的事情需要考虑,特别是其他人给出的答案.


But there are very important things to consider, specifically the answers given by the others.

1) 正如 Jörg W Mittag 所说,dB 是一种相对测量.由于我们没有校准和参考,此测量仅与自身相关.我的意思是,您将能够看到此时声音文件中的声音比当时大 3 dB,或者该尖峰比背景大 5 分贝.但是,如果没有其他人所指的校准,您就无法知道它在现实生活中的声音有多大.

1) As Jörg W Mittag says, dB is a relative measurement. Since we don't have calibrations and references, this measurement is only relative to itself. And by that I mean that you will be able to see that the sound in the sound file at this point is 3 dB louder than at that point, or that this spike is 5 decibels louder than the background. But you cannot know how loud it is in real life, not without the calibrations that the others are referring to.

2) PaulR 和 user545125 也提到了这一点:因为您是根据录制的声音进行评估,所以您只是在麦克风所在的特定位置测量声音,偏向于麦克风指向的方向,并且由硬件的频率响应过滤.几英尺外,用人耳聆听的人会听到完全不同的声级和不同的频率.

2) This was also mentioned by PaulR and user545125: Because you're evaluating according to a recorded sound, you are only measuring the sound at the specific location where the microphone is, biased to the direction the microphone is pointing, and filtered by the frequency response of your hardware. A few feet away, a human listening with human ears will get a totally different sound level and different frequencies.

3) 没有经过校准的硬件,你不能说声音是 60dB 或 89dB 或其他什么.此计算所能提供的只是声音文件中的峰值与同一声音文件中的其他峰值的比较情况.

3) Without calibrated hardware, you cannot say that the sound is 60dB or 89dB or whatever. All that this calculation can give you is how the peaks in the sound file compares to other peaks in the same sound file.

如果这就是你想要的,那也无所谓,但如果你想做一些严肃的事情,比如确定工厂的噪音水平对工人来说是否安全,那就听听 Paul、user545125 和 Jörg 的意见.

If this is all you want, then it's fine, but if you want to do something serious, like determine whether the noise level in a factory is safe for workers, then listen to Paul, user545125 and Jörg.

这篇关于如何计算音频 dB 级别?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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