from_decibel

ketos.audio.utils.misc.from_decibel(y)[source]
Convert any data array, y, typically a spectrogram, from decibel scale

to linear scale by applying the operation 10^{y/20}.

Args:
ynumpy array

Input array

Returns:
xnumpy array

Converted array

Example:
>>> import numpy as np
>>> from ketos.audio.utils.misc import from_decibel 
>>> img = np.array([[10., 20.],[30., 40.]])
>>> img_db = from_decibel(img)
>>> img_db = np.around(img_db, decimals=2) # only keep up to two decimals
>>> print(img_db)
[[  3.16  10.  ]
 [ 31.62 100.  ]]