## MP3 programming

Moderators: Sephiroth
Number of posts: 403

This Forum Only

calculating dB Posted by Timkognito on 12 Mar 2002 at 8:44 AM
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
Re: calculating dB Posted by Tomy on 5 Apr 2002 at 1:34 AM
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

## Recent Jobs

Official Programmer's Heaven Blogs
Web Hosting | Browser and Social Games | Gadgets

Popular resources on Programmersheaven.com
Assembly | Basic | C | C# | C++ | Delphi | Flash | Java | JavaScript | Pascal | Perl | PHP | Python | Ruby | Visual Basic