mpir2c#

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

See this page for details.

Parameters:
ir_lengthint >= 1

The length of the impulse response, \(N\).

cep_orderint >= 0

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

n_fftint >> N

The number of FFT bins used for conversion. The accurate conversion requires the large value.

forward(h)[source]#

Convert minimum-phase impulse response to cepstrum.

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

The truncated minimum-phase impulse response.

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

The 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)]

The truncated minimum-phase impulse response.

cep_orderint >= 0

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

n_fftint >> N

The number of FFT bins used for conversion. The accurate conversion requires the large value.

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

The cepstral coefficients.

See also

c2mpir mgc2mgc