mpir2c#

class diffsptk.MinimumPhaseImpulseResponseToCepstrum(cep_order, ir_length, n_fft=512)[source]#

See this page for details.

Parameters:
cep_orderint >= 0

Order of cepstrum, \(M\).

ir_lengthint >= 1

Length of impulse response, \(N\).

n_fftint >> N

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

forward(h)[source]#

Convert minimum phase impulse response to cepstrum.

Parameters:
hTensor [shape=(…, N)]

Truncated minimum phase impulse response.

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

Cepstral coefficients.

Examples

>>> h = diffsptk.ramp(4, 0, -1)
>>> mpir2c = diffsptk.MinimumPhaseImpulseResponseToCepstrum(3, 5)
>>> c = mpir2c(h)
>>> c
tensor([1.3863, 0.7500, 0.2188, 0.0156])
diffsptk.functional.mpir2c(h, cep_order, n_fft=512)[source]#

Convert minimum phase impulse response to cepstrum.

Parameters:
hTensor [shape=(…, N)]

Minimum phase impulse response.

cep_orderint >= 0

Order of cepstrum, \(M\).

n_fftint >> N

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

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

Cepstrum.

See also

c2mpir mgc2mgc