mgc2mgc#

class diffsptk.MelGeneralizedCepstrumToMelGeneralizedCepstrum(in_order, out_order, in_alpha=0, out_alpha=0, in_gamma=0, out_gamma=0, in_norm=False, out_norm=False, in_mul=False, out_mul=False, n_fft=512)[source]#

See this page for details. The conversion uses FFT instead of recursive formula.

Parameters:
in_orderint >= 0 [scalar]

Order of input cepstrum, \(M_1\).

out_orderint >= 0 [scalar]

Order of output cepstrum, \(M_2\).

in_alphafloat [-1 < in_alpha < 1]

Input alpha, \(\alpha_1\).

out_alphafloat [-1 < out_alpha < 1]

Output alpha, \(\alpha_2\).

in_gammafloat [-1 <= in_gamma <= 1]

Input gamma, \(\gamma_1\).

out_gammafloat [-1 <= out_gamma <= 1]

Output gamma, \(\gamma_2\).

in_normbool [scalar]

If True, assume normalized input.

out_normbool [scalar]

If True, assume normalized output.

in_mulbool [scalar]

If True, assume gamma-multiplied input.

out_mulbool [scalar]

If True, assume gamma-multiplied output.

n_fftint >> \(M_1, M_2\) [scalar]

Number of FFT bins. Accurate conversion requires the large value.

forward(c1)[source]#

Convert mel-generalized cepstrum to mel-generalized cepstrum.

Parameters:
c1Tensor [shape=(…, M1+1)]

Input mel-cepstrum.

Returns:
c2Tensor [shape=(…, M2+1)]

Converted mel-cepstrum.

Examples

>>> c1 = diffsptk.ramp(3)
>>> mgc2mgc = diffsptk.MelGeneralizedCepstrumToMelGeneralizedCepstrum(3, 4, 0.1)
>>> c2 = mgc2mgc(c1)
>>> c2
tensor([-0.0830,  0.6831,  1.1464,  3.1334,  0.9063])