nnmnkwii.preprocessing.inv_modspec

nnmnkwii.preprocessing.inv_modspec(ms, phase, norm=None)[source]

Inverse transform of modulation spectrum computation

Given an modulation spectrum and it’s phase, it recovers original parameter trajectory.

Note

Returned parameter trajectory has shape (n x D), where n is DFT length used in modulation spectrum compuattion. You will have to trim it yourself to the actual time length if needed.

Warning

This may move in different module in future.

Parameters
Returns

Recovered parameter trajectory, shape (n x D).

Return type

numpy.ndarray

Examples

>>> import numpy as np
>>> from nnmnkwii import preprocessing as P
>>> generated = np.random.rand(10, 2)
>>> ms, phase = P.modspec(generated, n=16, return_phase=True)
>>> generated_hat = P.inv_modspec(ms, phase)[:len(generated)]
>>> assert np.allclose(generated, generated_hat)