fftcep#

class diffsptk.CepstralAnalysis(*, fft_length, cep_order, accel=0, n_iter=0)[source]#

See this page for details.

Parameters:
fft_lengthint >= 2M

The number of FFT bins, \(L\).

cep_orderint >= 0

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

accelfloat >= 0

The acceleration factor.

n_iterint >= 0

The number of iterations.

References

[1]

S. Imai et al., “Spectral envelope extraction by improved cepstral method,” IEICE trans, vol. J62-A, no. 4, pp. 217-223, 1979 (in Japanese).

forward(x)[source]#

Perform cepstral analysis.

Parameters:
xTensor [shape=(…, L/2+1)]

The power spectrum.

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

The cepstrum.

Examples

>>> x = diffsptk.ramp(19)
>>> stft = diffsptk.STFT(frame_length=10, frame_period=10, fft_length=16)
>>> fftcep = diffsptk.CepstralAnalysis(fft_length=16, cep_order=3)
>>> c = fftcep(stft(x))
>>> c
tensor([[-0.9663,  0.8190, -0.0932, -0.0152],
        [-0.8539,  4.6173, -0.5496, -0.3207]])
diffsptk.functional.fftcep(x, cep_order, accel=0, n_iter=0)[source]#

Perform cepstral analysis.

Parameters:
xTensor [shape=(…, L/2+1)]

The power spectrum.

cep_orderint >= 0

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

accelfloat >= 0

The acceleration factor.

n_iterint >= 0

The number of iterations.

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

The cepstrum.

See also

cdist stft freqt mgcep