c2mpir#

class diffsptk.CepstrumToMinimumPhaseImpulseResponse(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(c)[source]#

Convert cepstrum to minimum phase impulse response.

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

Cepstral coefficients.

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

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

Cepstral coefficients.

ir_lengthint >= 1

Length of impulse response, \(N\).

n_fftint >> N

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

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

Truncated minimum phase impulse response.

See also

mpir2c mgc2mgc