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