What is Float Samples to DB Relationship?


#1

Hi, I was wondering what the relationship was between the floating point value of a sample (such as those used by AudioSampleBuffer) and the dB level one would see in a DAW.

Is there a specific float value that corresponds to 0 dB? How much louder is .2 than .1?

I’ve been working on a plugin that uses internal compression to control feedback, and I feel like knowing this would be really useful for making informed decisions about how to set control parameters.


#2

Check out the Decibels class. That will let you do a conversion to dBfs

BTW - 0dB is arbitrary… unless you use some nomenclature after the dB to indicate the reference.

http://www.sengpielaudio.com/calculator-db-volt.htm

Rail


#3

Is there a specific float value that corresponds to 0 dB?

Yes (-)1.0 will equal 0 dBFS
(-)2.0 is ~+6 dBFS
(-)4.0 is ~+12 dBFS
(-)8.0 is ~+18 dBFS
(-)0.5 is ~-6 dBFS
(-)0.25 is ~-12 dBFS
(-)0.125 is ~-18dBFS

How much louder is .2 than .1?

~6 dBFS (log10(0.2) * 20 - log10(0.1) * 20)
Doubling a value will always add ~6 dBFS (if I’m not mistaken).

See Decibels::decibelsToGain() and Decibels::gainToDecibels() in Juce for how to do the conversions in the code.

Gain to dBFS: log10 (<gain>) * 20
dBFS back to gain: 10 ^ (<decibels> * 0.05)