nnmnkwii.preprocessing.f0.interp1d

nnmnkwii.preprocessing.f0.interp1d(f0, kind='slinear')[source]

Coutinuous F0 interpolation from discontinuous F0 trajectory

This function generates continuous f0 from discontinuous f0 trajecoty based on scipy.interpolate.interp1d(). This is meat to be used for continuous f0 modeling in statistical speech synthesis (e.g., see [R7], [R8]).

If kind = 'slinear', then this does same thing as Merlin does.

Parameters:
  • f0 (ndarray) – F0 or log-f0 trajectory
  • kind (str) – Kind of interpolation that scipy.interpolate.interp1d() supports. Default is 'slinear', which means linear interpolation.
Returns:

Interpolated continuous f0 trajectory.

Return type:

1d array (T, ) or 2d (T x 1) array

Examples

>>> from nnmnkwii.preprocessing.f0 import interp1d
>>> import numpy as np
>>> f0 = np.random.rand(100)
>>> continuous_f0 = interp1d(f0, kind="slinear")
>>> assert f0.shape == continuous_f0.shape
[R7]Yu, Kai, and Steve Young. “Continuous F0 modeling for HMM based statistical parametric speech synthesis.” IEEE Transactions on Audio, Speech, and Language Processing 19.5 (2011): 1071-1079.
[R8]Takamichi, Shinnosuke, et al. “The NAIST text-to-speech system for the Blizzard Challenge 2015.” Proc. Blizzard Challenge workshop. 2015.