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
>>> import diffsptk >>> c2mpir = diffsptk.CepstrumToMinimumPhaseImpulseResponse(4, 5) >>> c = torch.tensor([0.5, -0.3, 0.2, -0.1, 0.05]) >>> h = c2mpir(c) >>> h tensor([ 1.6487, -0.4946, 0.4039, -0.2712, 0.1803])
- 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.