music.db_to_amp

music.db_to_amp(db_difference)[source]

Converts a difference in decibels to a difference in amplitude.

This function takes a difference in decibels as input and returns the corresponding difference in amplitude.

Parameters:
db_differencefloat

The difference in decibels to be converted.

Returns:
float

The difference in amplitude corresponding to the input difference in decibels.

Parameters:

db_difference (float)

Return type:

float

Notes

The article’s relation between a level and an amplitude [1]:

\[A = 10^{V_{dB} / 20},\]

so 6 dB is about twice the amplitude and 20 dB exactly ten times it.

References

[1]

Fabbri, Renato, et al. “Musical elements in the discrete-time representation of sound.” arXiv preprint arXiv:abs/1412.6853 (2017)

Examples

>>> db_to_amp(6)
1.9952623149688795
>>> db_to_amp(-6)
0.5011872336272722