def inv_mulaw(y, mu=256):
"""Inverse of mu-law companding (mu-law expansion)
.. math::
f^{-1}(x) = sign(y) (1 / \mu) (1 + \mu)^{|y|} - 1)
Args:
y (array-like): Compressed signal. Each value of input signal must be in
range of [-1, 1].
mu (number): Compression parameter ``?``.
Returns:
array-like: Uncomprresed signal (-1 <= x <= 1)
See also:
:func:`nnmnkwii.preprocessing.inv_mulaw`
:func:`nnmnkwii.preprocessing.mulaw_quantize`
:func:`nnmnkwii.preprocessing.inv_mulaw_quantize`
"""
return _sign(y) * (1.0 / mu) * ((1.0 + mu)**_abs(y) - 1.0)
评论列表
文章目录