maad.util.dB2power

maad.util.dB2power(x, db_gain=0)[source]

Transform data in dB scale into power (amplitude²) A gain (db_gain) could be added at the end.

Parameters:
xarray-like or scalar

data in dB to rescale in power

db_gainscalar, optional, default is 0

Gain that was added to the result –> 10*log10(x) + db_gain

Returns:
yarray-like or scalar

output in power unit

Examples

>>> a = np.array([ 0.        ,  6.02059991,  9.54242509, 12.04119983, 13.97940009])
>>> maad.util.dB2power(a)
    array([ 1.        ,  4.        ,  8.99999999, 16.00000001, 25.00000002])