mpir2c#
- class diffsptk.MinimumPhaseImpulseResponseToCepstrum(cep_order, ir_length, n_fft=512)[source]#
See this page for details. The conversion uses FFT instead of recursive formula.
- Parameters:
- cep_orderint >= 0 [scalar]
Order of cepstrum, \(M\).
- ir_lengthint >= 1 [scalar]
Length of impulse response, \(N\).
- n_fftint >> \(N\) [scalar]
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:
- cTensor [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])