inverse_db()

audmath.inverse_db(y, *, bottom=-120)[source]

Convert decibels to amplitude value.

The inverse of a value yRy \in \R provided in decibel is given by

inverse_db(y)={10y20,if y>bottom0,else\text{inverse\_db}(y) = \begin{cases} 10^\frac{y}{20}, & \text{if } y > \text{bottom} \\ 0, & \text{else} \end{cases}

where bottom\text{bottom} is provided by the argument of same name.

Parameters
  • y (Union[int, float, Sequence, ndarray]) – input signal in decibels

  • bottom (Union[int, float]) – minimum decibel value which should be converted. Lower values will be set to 0. If set to None it will return 0 only for input values of -np.Inf

Return type

Union[floating, ndarray]

Returns

input signal

Examples

>>> inverse_db(0)
np.float64(1.0)
>>> inverse_db(-120)
np.float64(0.0)
>>> inverse_db(-3)
np.float64(0.7079457843841379)
>>> inverse_db([-120, 0])
array([0., 1.])