music.amp_to_db

music.amp_to_db(amplitude_difference)[source]

Converts a difference in amplitude to a difference in decibels.

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

Parameters:
amplitude_differencefloat

The difference in amplitude to be converted.

Returns:
float

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

Parameters:

amplitude_difference (float)

Return type:

float

Examples

>>> amp_to_db(2.0)
6.0
>>> amp_to_db(0.5)
-6.0