2

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!

Maya
  • 989
  • 4
  • 12
  • 19

2 Answers2

3

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.

Matt Montag
  • 7,105
  • 8
  • 41
  • 47
2

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

Paul R
  • 208,748
  • 37
  • 389
  • 560
  • I still need to understand what you and Matt wrote but anyway I cant know the range? the result its reasonable? – Maya Oct 02 '11 at 12:08
  • 1
    The range of a single bin will depend on the number of bins in your FFT, since the total energy is divided amongst N bins. Normally though you would just use a sensible range, such as say 0 dB to -120 dB and clip any values < -120 dB. – Paul R Oct 02 '11 at 14:51
  • my FFT size is 2048. I understand that I can take a sensible range but then I can't know what actually the minimum power. it can be -120 but it can be somewhere smaller. my problem that i must know when i get the minimum power. there is a way? and thanks for your explanation – Maya Oct 03 '11 at 08:41
  • see additional comment in my answer. – Matt Montag Oct 03 '11 at 09:27
  • The minimum power will depend on: (i) FFT size, (ii) noise floor of your analogue hardware, (iii) precision, rounding errors, etc in your FFT. For audio though it makes little sense to look at anything much below around -120 dB, since it's outside the normal range for human hearing end represents very small signal levels which would normally be lost in thermal noise etc. – Paul R Oct 03 '11 at 09:29