fftcep#

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

See this page for details.

Parameters:
cep_orderint >= 0 [scalar]

Order of cepstrum, \(M\).

fft_lengthint >= 2M [scalar]

Number of FFT bins, \(L\).

n_iterint >= 0 [scalar]

Number of iterations.

accelfloat >= 0 [scalar]

Acceleration factor.

forward(x)[source]#

Estimate cepstrum from spectrum.

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

Power spectrum.

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

Cepstrum.

Examples

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

See also

cdist stft freqt mgcep