lpc2lsp#
- class diffsptk.LinearPredictiveCoefficientsToLineSpectralPairs(lpc_order, log_gain=False, sample_rate=None, out_format='radian')[source]#
See this page for details.
- Parameters:
- lpc_orderint >= 0 [scalar]
Order of LPC, \(M\).
- log_gainbool [scalar]
If True, output gain in log scale.
- sample_rateint >= 1 [scalar]
Sample rate in Hz.
- out_format[‘radian’, ‘cycle’, ‘khz’, ‘hz’]
Output format.
- forward(a)[source]#
Convert LPC to LSP.
- Parameters:
- aTensor [shape=(…, M+1)]
LPC coefficients.
- Returns:
- wTensor [shape=(…, M+1)]
LSP coefficients.
Examples
>>> x = diffsptk.nrand(4) >>> x tensor([-1.5326, 1.0875, -1.5925, 0.6913, 1.6217]) >>> lpc = diffsptk.LPC(3, 5) >>> a = lpc(x) >>> a tensor([ 2.7969, 0.3908, 0.0458, -0.0859]) >>> lpc2lsp = diffsptk.LinearPredictiveCoefficientsToLineSpectralPairs(3) >>> w = lpc2lsp(a) >>> w tensor([2.7969, 0.9037, 1.8114, 2.4514])