# Mapping decibel range to linear audible intervals

I am working in an engine that encodes sound as decibels (dB). Let's assume the decibel range of human hearing is -60dB to 0dB.

Audibility is not linear across this range.

So my question is...

How does one map a decibel range to a set of numbers (for example, 1-10), such that each number corresponds to (roughly) one linear step up in audibility?

• I have updated my answer. I hope it helps. – Vaillancourt Dec 6 '19 at 16:21
• Are you asking simply for a mathematical formula to convert a number from (1, 10) to (-60, 0)? – TomTsagk Dec 6 '19 at 16:23
• @TomTsagk, no. That would help if audibility was linear across (-60, 0) dB, but it is not. – GrimGrom Dec 7 '19 at 5:39

We use dBvalue = 20 * log10( volumeAsPercent ) where volumeAsPercent is in the range of [0.001 .. 1]. dbValue will be in the range of [-60 .. 0].
(That's a bit annoying because the actual engine - OpenAL - uses 0..1 for its gain, so we have to convert that back using volumeAsPercent = 2^(dBvalue/6). It will not exactly give the same result as the input but will give an approximation to volumeAsPercent = 10^(dBvalue/20) which is close enough (I don't know why we use that formula, and we can't change it at this point).)