fft 数据的分贝结果错误
如果我记得分贝范围是位深度 * 6。
我播放位深度 = 16 的 wav 文件(使用 NAudio lib),然后得到 fft 结果,然后计算每个 fft 结果的分贝。 20 * Math.log10(fftData[i]) 我得到了奇怪的结果(-109...) 它怎么能超过-96(对于16位)?
(我使用 .net 4)
谢谢!
If i remember the decibel range is bit depth * 6.
I play wav file that his bit depth = 16 (using NAudio lib) and I get the fft result then i'm calc the decibels for each fft result. 20 * Math.log10(fftData[i]) and i've got strange results (-109...)
how it can be over -96 (for 16 bit)?
(i work with .net 4)
Thanks!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
时域中幅度的动态范围的限制不会延续到频域中分量的幅度。方波可以用分辨率仅为 1 位的音频信号来表示,没有任何动态范围。但在频域中,它的定义为 sin(x) + 1/3 sin(3x) + 1/5 sin(5x) ...分数系数说明了这一点。高次谐波是一个无限级数,其系数越来越小,动态范围没有限制。
另外,为了回应您的后续行动:是的,出于显示和可视化的目的,您应该选择一些限制,例如 -120 dB 并忽略下面的内容。我认为忽略-120 dB以下内容的理由是人类听觉的动态范围约为120 dB。您可能还会考虑低于 -96 dB 量化噪声的内容,但我对此不确定。
The limit of the dynamic range of amplitude in time domain does not carry over to magnitude of components in the frequency domain. A square wave can be represented by an audio signal with a resolution of only 1 bit, no dynamic range whatsoever. But in the frequency domain, it is defined by sin(x) + 1/3 sin(3x) + 1/5 sin(5x) ... The fractional coefficients illustrate this point. The upper harmonics are an infinite series with ever smaller coefficients, with no limit on their dynamic range.
Also, to respond to your follow up: yes, for display and visualization purposes, you should pick some limit like -120 dB and ignore the content below. I think the rationale for ignoring content below -120 dB is that the dynamic range of human hearing is about 120 dB. You might also consider the content below -96 dB quantization noise, but I'm not certain about that.
dB 是比率的度量,而不是绝对幅度。您的 -109 dB 数字是相对于某个任意 0 dB 参考点的比率,在您的情况下,该参考点可能对应也可能不对应于满量程。
同样重要的是要注意,正如 Matt M 已经提到的,仅一个频率仓中的能量可能比对应于 1 位信号的能量小很多,因为它代表相对较小带宽中的能量(单位为
V / sqrt(Hz)
)。dB is a measure of ratio, not absolute amplitude. Your figure of -109 dB is a ratio relative to some arbitrary 0 dB reference point, which may or may not correspond to full scale in your case.
It's also important to note that the energy in just one frequency bin may be a lot smaller than the energy corresponding to a 1 bit signal, as already mentioned by Matt M, since it represents energy in a relatively small bandwidth (units are
V / sqrt(Hz)
).