mcpf#

class diffsptk.MelCepstrumPostfiltering(cep_order: int, alpha: float = 0, beta: float = 0, onset: int = 2, ir_length: int = 128, device: device | None = None, dtype: dtype | None = None)[source]#

See this page for details.

Parameters:
cep_orderint >= 0

The order of the mel-cepstrum, \(M\).

alphafloat in (-1, 1)

The frequency warping factor, \(\alpha\).

betafloat

The intensity parameter, \(\beta\).

onsetint >= 0

The onset index.

ir_lengthint >= 1

The length of the impulse response.

devicetorch.device or None

The device of this module.

dtypetorch.dtype or None

The data type of this module.

References

[1]

T. Yoshimura et al., “Incorporating a mixed excitation model and postfilter into HMM-based text-to-speech synthesis,” Systems and Computers in Japan, vol. 36, no. 12, pp. 43-50, 2005.

forward(mc: Tensor) Tensor[source]#

Perform mel-cesptrum postfiltering.

Parameters:
mcTensor [shape=(…, M+1)]

The input mel-cepstral coefficients.

Returns:
outTensor [shape=(…, M+1)]

The postfiltered mel-cepstral coefficients.

Examples

>>> import diffsptk
>>> import torch
>>> mcep = diffsptk.MelCepstralAnalysis(
...     fft_length=8, cep_order=3, alpha=0.1, n_iter=1
... )
>>> mcpf = diffsptk.MelCepstrumPostfiltering(3, 0.1, 0.2)
>>> X = torch.tensor([1.2, 0.9, 0.2, 0.1, 0.3])
>>> mc1 = mcep(X)
>>> mc1
tensor([-0.4989,  0.5941,  0.1558, -0.2130])
>>> mc2 = mcpf(mc1)
>>> mc2
tensor([-0.5097,  0.5941,  0.1869, -0.2556])
diffsptk.functional.mcpf(mc: Tensor, alpha: float = 0, beta: float = 0, onset: int = 2, ir_length: int = 128) Tensor[source]#

Perform mel-cesptrum postfiltering.

Parameters:
mcTensor [shape=(…, M+1)]

The input mel-cepstral coefficients.

alphafloat in (-1, 1)

The frequency warping factor, \(\alpha\).

betafloat

The intensity parameter, \(\beta\).

onsetint >= 0

The onset index.

ir_lengthint >= 1

The length of the impulse response.

Returns:
outTensor [shape=(…, M+1)]

The postfiltered mel-cepstral coefficients.

See also

mgcep