c2mpir#

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

See this page for details.

Parameters:
cep_orderint >= 0

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

ir_lengthint >= 1

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

n_fftint >> N

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

forward(c)[source]#

Convert cepstrum to minimum-phase impulse response.

Parameters:
cTensor [shape=(…, M+1)]

The cepstral coefficients.

Returns:
outTensor [shape=(…, N)]

The truncated minimum-phase impulse response.

Examples

>>> c = diffsptk.ramp(3)
>>> c2mpir = diffsptk.CepstrumToMinimumPhaseImpulseResponse(3, 5)
>>> h = c2mpir(c)
>>> h
tensor([1.0000, 1.0000, 2.5000, 5.1667, 6.0417])
diffsptk.functional.c2mpir(c, ir_length, n_fft=512)[source]#

Convert cepstrum to minimum phase impulse response.

Parameters:
cTensor [shape=(…, M+1)]

The cepstral coefficients.

ir_lengthint >= 1

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

n_fftint >> N

The number of FFT bins used for conversion.

Returns:
outTensor [shape=(…, N)]

The truncated minimum phase impulse response.

See also

mpir2c mgc2mgc