calculating dB - Programmers Heaven

#### Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

# calculating dB

Posts: 2Member
Hello,

how can I calculate dB-values from the values returned by FFT, so
that the dB-values are equal to those of the mpeg II Psychoacoustic
model? Simply 10*log10(FFT-Value)??? Is there no reference-value, like
Io=10E-12W/m^2?

Why are in the psychoacoustic mpegII-model all values normalized to
96 dB?

Thank You for any help

Tim

• Posts: 35Member
In digital audio, the reference-value is always the clipping level: the maximum numeric value the data type can hold. For most digital audio this value is -32768 -> 32767 or 0 -> 65536 (a 16-bit integer).

Now see what db means: it is always a log of a division. So in audio you divide the actual level by the maximum, take the log and multiply it by 20. Easy to understand that an increase of bits by one gives us 6 db:

0 bit -> 0 db (can't calculate this)
1 bit -> 20 log (2 ^ 1) = 20 log(2) = 6 db
2 bit -> 20 log (2 ^ 2) = 20 log(4) = 12 db
...
16 bit -> 20 log (2 ^ 16) = 20 log(65536) = 96 db