nnmnkwii.postfilters.merlin_post_filter

nnmnkwii.postfilters.merlin_post_filter(mgc, alpha, minimum_phase_order=511, fftlen=1024, coef=1.4, weight=None)[source]

Post-filter used in Merlin.

This is a pysptk translation of Merlin’s post filter written with SPTK CLI tools. Details can be found at CSTR-Edinburgh/merlin/issues/241 and [1].

1

Yoshimura, Takayoshi, et al. “Incorporating a mixed excitation model and postfilter into HMM‐based text‐to‐speech synthesis.” Systems and Computers in Japan 36.12 (2005): 43-50.

Parameters
  • mgc (2darray) – mel-generalized cepstrum

  • alpha (float) – all-pass constant

  • minimum_phase_order (int) – Order of minimum phase sequence

  • fftlen (int) – FFT length used to convert cepstrum to autocorrelation.

  • coef (float) – Weight coefficient to build weight vector. Default is 1.4.

  • weight ([optional]1darray) – Weight vector for scaling mel-generalized cepstrum. If None, set automatically by coef as in Merlin.

Returns

Post-filtered mel-generalized cepstrum.

Return type

2darray

Examples

>>> from nnmnkwii.postfilters import merlin_post_filter
>>> import numpy as np
>>> mgc = np.random.rand(100, 60)
>>> mgc_filtered = merlin_post_filter(mgc, 0.58)
>>> assert mgc.shape == mgc_filtered.shape