lsp2lpc#
- class diffsptk.LineSpectralPairsToLinearPredictiveCoefficients(lpc_order, log_gain=False, sample_rate=None, in_format='radian')[source]#
See this page for details.
- Parameters:
- lpc_orderint >= 0
The order of the LPC, \(M\).
- log_gainbool
If True, assume the input gain is in logarithmic scale.
- sample_rateint >= 1 or None
The sample rate in Hz.
- in_format[‘radian’, ‘cycle’, ‘khz’, ‘hz’]
The input format.
- forward(w)[source]#
Convert LSP to LPC.
- Parameters:
- wTensor [shape=(…, M+1)]
The LSP frequencies.
- Returns:
- outTensor [shape=(…, M+1)]
The LPC coefficients.
Examples
>>> w = diffsptk.ramp(3) >>> lsp2lpc = diffsptk.LineSpectralPairsToLinearPredictiveCoefficients(3) >>> a = lsp2lpc(w) >>> a tensor([ 0.0000, 0.8658, -0.0698, 0.0335])
- diffsptk.functional.lsp2lpc(w, log_gain=False, sample_rate=None, in_format='radian')[source]#
Convert LSP to LPC.
- Parameters:
- wTensor [shape=(…, M+1)]
The LSP frequencies.
- log_gainbool
If True, assume the input gain is in logarithmic scale.
- sample_rateint >= 1 or None
The sample rate in Hz.
- in_format[‘radian’, ‘cycle’, ‘khz’, ‘hz’]
The input format.
- Returns:
- outTensor [shape=(…, M+1)]
The LPC coefficients.