开发者

Wrong decibel result on fft data

开发者 https://www.devze.com 2023-04-09 18:23 出处:网络
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 deci开发者_如何学运维bels for each fft result.

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 deci开发者_如何学运维bels 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!


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 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)).

0

精彩评论

暂无评论...
验证码 换一张
取 消