mpir2c#
- class diffsptk.MinimumPhaseImpulseResponseToCepstrum(ir_length: int, cep_order: int, n_fft: int = 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: Tensor) Tensor [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(5, 3) >>> c = mpir2c(h) >>> c tensor([1.3863, 0.7500, 0.2188, 0.0156])
- diffsptk.functional.mpir2c(h: Tensor, cep_order: int, n_fft: int = 512) Tensor [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.