319
There are several techniques of volume management for a linear volume control process.
Precise calculations involving logarithms can be employed.
A high-resolution gain table, with entries for every 0.5-dB step, can be employed.
A more coarse gain table (entries in 3 to 6-dB steps with linear interpolation between entries) can be
employed.
Or approximations involving very simple calculations can be employed.
As an example of using approximations, equations for increasing a linear 5.23 gain setting X by 0.5 dB that involve
only simple binary shift and add operations and the accuracy of these equations are given below.
20log10X + 0.5 dB ≈ X + 24X gives 0.52657877-dB steps
20log10X + 0.5 dB ≈ X + 24X 28X gives 0.49458651-dB steps
20log10X + 0.5 dB ≈ X + 24X 28X + 211X gives 0.49859199-dB steps
20log10X + 0.5 dB ≈ X[1 + 24 28 + 211 + 212 213 + 214 216 + 218] gives
0.4999997332 dBsteps
Approximations can also be found for decreasing a linear 5.23 gain setting X by 0.5 dB that involve using only simple
binary shift and add operations, but the equations differ slightly from those used to increase the gain in 0.5-dB steps.
The approximations to decrease the volume by 0.5 dB and the accuracy of these approximations are given below.
20log10X 0.5 dB ≈ X 24X gives 0.56057447 dB-steps
20log10X 0.5 dB ≈ X 24X + 27X gives 0.48849199-dB steps
20log10X 0.5 dB ≈ X 24X + 27X 210X gives 0.49746965-dB steps
20log10X 0.5 dB ≈ X[1 24 + 27 210 212 215 221] gives 0.5000006792 dB-steps
Repeated use of a set of the above approximations results in an accumulation of the errors in the approximations.
For example, if an application started at 0-dB volume, and repeatedly used the approximations to increase and
decrease the volume, the exact reference point of 0 dB would be lost. If an application does require the maintenance
of accurate reference points, it is necessary for the application to establish a set of exact gain reference settings and
command these exact settings in place of a computed gain setting whenever the current gain setting and the next
computed gain setting straddle an exact gain setting.
Table 34 lists the I2C coefficient settings to adjust volume from 24 dB to 136 dB in 0.5-dB steps. For each volume
setting, the gain in dB is presented in one column, the same gain in a floating point number
float
+ 10
Gain
dB
20
is
presented in the adjacent column, and the same gain formatted in the 32-bit hexadecimal gain coefficient format
required to enter the value into the TAS3103 via the I2C bus is presented in a third column.