nnmnkwii.preprocessing.inv_mulaw_quantize¶
-
nnmnkwii.preprocessing.
inv_mulaw_quantize
(y, mu=256)[source]¶ Inverse of mu-law companding + quantize
- Parameters
y (array-like) – Quantized signal (∈ [0, mu]).
mu (number) – Compression parameter
μ
.
- Returns
Uncompressed signal ([-1, 1])
- Return type
array-like
Examples
>>> from scipy.io import wavfile >>> import pysptk >>> import numpy as np >>> from nnmnkwii import preprocessing as P >>> fs, x = wavfile.read(pysptk.util.example_audio_file()) >>> x = (x / 32768.0).astype(np.float32) >>> x_hat = P.inv_mulaw_quantize(P.mulaw_quantize(x)) >>> x_hat = (x_hat * 32768).astype(np.int16)