1
\$\begingroup\$

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?

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

1 Answer 1

1
\$\begingroup\$

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

I'm not a sound engineer, I don't play music and I don't have a sound studio to test this, but testing this formula with increments of 10%, seems to give a nice progression in making the sound louder (from completely muted at 0, up to what is in the original wav file at 1).

Here are the plotted curves.

\$\endgroup\$
0

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.