nnmnkwii.preprocessing.inv_preemphasis

nnmnkwii.preprocessing.inv_preemphasis(x, coef=0.97)[source]

Inverse operation of pre-emphasis

Parameters
  • x (1d-array) – Input signal.

  • coef (float) – Pre-emphasis coefficient.

Returns

Output filtered signal.

Return type

array

See also

preemphasis()

Examples

>>> from nnmnkwii.util import example_audio_file
>>> from scipy.io import wavfile
>>> fs, x = wavfile.read(example_audio_file())
>>> x = x.astype(np.float64)
>>> from nnmnkwii import preprocessing as P
>>> x_hat = P.inv_preemphasis(P.preemphasis(x, coef=0.97), coef=0.97)
>>> assert np.allclose(x, x_hat)