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.
- Parameters:
- in_orderint >= 0
The order of the input cepstrum, \(M_1\).
- out_orderint >= 0
The order of the output cepstrum, \(M_2\).
- in_alphafloat in (-1, 1)
The input alpha, \(\alpha_1\).
- out_alphafloat in (-1, 1)
The output alpha, \(\alpha_2\).
- in_gammafloat in [-1, 1]
The input gamma, \(\gamma_1\).
- out_gammafloat in [-1, 1]
The output gamma, \(\gamma_2\).
- in_normbool
If True, the input is assumed to be normalized.
- out_normbool
If True, the output is assumed to be normalized.
- in_mulbool
If True, the input is assumed to be gamma-multiplied.
- out_mulbool
If True, the output is assumed to be gamma-multiplied.
- n_fftint >> M1, M2
The number of FFT bins. Accurate conversion requires a large value.
References
[1]K. Tokuda et al., “Mel-generalized cepstral analysis - A unified approach to speech spectral estimation”, Proceedings of ICSLP, pp. 1043-1046, 1996.
- forward(mc)[source]#
Convert mel-generalized cepstrum to mel-generalized cepstrum.
- Parameters:
- mcTensor [shape=(…, M1+1)]
The input mel-cepstrum.
- Returns:
- outTensor [shape=(…, M2+1)]
The output 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])
- diffsptk.functional.mgc2mgc(mc, 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]#
Convert mel-generalized cepstrum to mel-generalized cepstrum.
- Parameters:
- mcTensor [shape=(…, M1+1)]
The input mel-cepstrum.
- out_orderint >= 0
The order of the output cepstrum, \(M_2\).
- in_alphafloat in (-1, 1)
The input alpha, \(\alpha_1\).
- out_alphafloat in (-1, 1)
The output alpha, \(\alpha_2\).
- in_gammafloat in [-1, 1]
The input gamma, \(\gamma_1\).
- out_gammafloat in [-1, 1]
The output gamma, \(\gamma_2\).
- in_normbool
If True, the input is assumed to be normalized.
- out_normbool
If True, the output is assumed to be normalized.
- in_mulbool
If True, the input is assumed to be gamma-multiplied.
- out_mulbool
If True, the output is assumed to be gamma-multiplied.
- n_fftint >> M1, M2
The number of FFT bins.
- Returns:
- outTensor [shape=(…, M2+1)]
The converted mel-cepstrum.