4

Does anybody know the math required to convert a logarithmic decibel scale to a linear value between 0 and 1, for an automation lane?

In this particular case - the linear value 1 = +15dB, the linear value 0 = -∞dB.

4
  • 'Decibel' is a ratio, not an absolute value. To answer this we'd need to know the range of decibel values and the scale reference.
    – Jim Mack
    Commented Apr 8, 2016 at 19:47
  • Ok so the unit delivering these values actually gives -32768 for the fader right down, but 0 when it is right up. So when I have this value (call it N) it aligns exactly to the physical fader positions with this function (N / 10) + 10 - so that effectively gives the same value as shown on the fader which runs from +10dB down to - infinity with -60 the last number. The scale seems logarithmic to me on the fader. Commented Apr 8, 2016 at 20:37
  • What is the automation lane to be used for?
    – n00dles
    Commented Apr 9, 2016 at 13:28
  • @MarcW Volume on an audio track in a multi-track editor. The scale runs from +15db to -15dB in side the multitrack editor. In the session file which the multitrack editor loads, the value is stored as a linear point from 0 to 1 where 0.65 = 0dB, 0=-infinity dB and 1 = +15dB. Commented Apr 9, 2016 at 15:18

3 Answers 3

10

Practical version

  • dB → gain-multiplier:

    g = 2d / 6

  • gain-multiplier → dB:

    d = 6 · log2(g)

I find these definitions far more handy than the ones below: changing the amplitude by a factor of two is quite an intuitively relevant change. But, alas, in pre-computer times people couldn't seem to like logarithms of bases other than ten, so...

Official definition

  • dB → gain-multiplier:

    g = 10d / 20

  • gain-multiplier → dB:

    d = 20 · log10(g)

IMO base-10 is silly, but if you need to do exact calibrations, better use the official version. (Alternatively, use the base-2 version, but replace 6 with the factor 20 · log102 ≈ 6.020599913; this is then exactly equivalent to the base-10 definition.)

2

So if we set that 0 dB gain is 1.0 factor, and -∞ db gain is 0.0 factor, it means that (if we are considering voltage gain as in a mixing desk fader) :

gain = 20.0*log10(factor)

therefore :

factor = 10^(gain/20.0)

If, as described in a comment, the 0 dB gain is at 0.65 factor, it means the ref is 0.65.

gain in db = 20*log10(factor/0.65)

factor = 0.65*10^(gain/20.0)

6
  • How does this change if +15 dB gain is 1.0 factor and -∞ db gain is 0.0 factor? Commented Apr 8, 2016 at 21:04
  • 1
    @JamesHarcourt: just add / remove 15 from the dB scale. Commented Apr 8, 2016 at 21:47
  • @leftaroundabout that definitely doesn't work, the values that come out aren't anywhere near the linear values produced, i.e. 0dB = 0.65. Commented Apr 9, 2016 at 15:18
  • @JamesHarcourt er, no! 10⁽⁰⁻¹⁵⁾’²⁰ ≈ 0.1778. What did you calculate? Commented Apr 9, 2016 at 15:24
  • The application in question is Adobe Audition. Their volume automation is stored in XML, so when there is an automation point of 0dB, it is shown thus: <parameterKeyframe sampleOffset="95176" type="linear" value="0.65" />. So I actually want 0.65! Commented Apr 9, 2016 at 15:32
-1

To readers:

According to the questioner's comment:

The application in question is Adobe Audition. Their volume automation is stored in XML, so when there is an automation point of 0dB, it is shown thus: . So I actually want 0.65!

All inferences are based on the SESX file of Adobe Audition.


Try to get more values:

value dB
1 +15
0.95 +12.0095
0.9 +9.4189
0.85 +7.1339
0.8 +5.0899
0.75 +3.2409
0.7 +1.5528
0.65 +0
0.6 -1.5528
0.55 -3.2409
0.5 -5.0899
0.45 -7.1339
0.4 -9.4189
0.35 -12.0095
0.3 -15
0.25 -18.5371
0.2 -22.8661
0.15 -28.4472
0.1 -36.3132
0.05 -49.7604
0 -∞

It is easy to notice that data with non-positive dB presents in the form of dB=A+Blog(value). Using the FindFit function of Mathematica would be very helpful.

So we can easily know that dB=-15sgn(value-13/20)log(13/6,1-|20value/13-1|) and value=13(1+sgn(dB)(1-(13/6)^(-|dB|/15)))/20.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.