c2mpir#

class diffsptk.CepstrumToMinimumPhaseImpulseResponse(cep_order: int, ir_length: int, n_fft: int = 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: Tensor) Tensor[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: Tensor, ir_length: int, n_fft: int = 512) Tensor[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