lsp2lpc#
- class diffsptk.LineSpectralPairsToLinearPredictiveCoefficients(lpc_order: int, log_gain: bool = False, sample_rate: int | None = None, in_format: str | int = 'radian')[source]#
See this page for details.
- Parameters:
- lpc_orderint >= 0
The order of the LPC,
.- 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: Tensor) Tensor [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: Tensor, log_gain: bool = False, sample_rate: int | None = None, in_format: str = 'radian') Tensor [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.