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
Order of LPC, \(M\).
- log_gainbool
If True, output gain in log scale.
- sample_rateint >= 1 or None
Sample rate in Hz.
- out_format[‘radian’, ‘cycle’, ‘khz’, ‘hz’]
Output format.
References
[1]P. Kabal et al., “The computation of line spectral frequencies using Chebyshev polynomials,” IEEE Transactions on Acoustics, Speech, and Signal Processing, vol. 34, no. 6, pp. 1419-1426, 1986.
- forward(a)[source]#
Convert LPC to LSP.
- Parameters:
- aTensor [shape=(…, M+1)]
LPC coefficients.
- Returns:
- outTensor [shape=(…, M+1)]
LSP frequencies.
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])
- diffsptk.functional.lpc2lsp(a, log_gain=False, sample_rate=None, out_format='radian')[source]#
Convert LPC to LSP.
- Parameters:
- aTensor [shape=(…, M+1)]
LPC coefficients.
- log_gainbool
If True, output gain in log scale.
- sample_rateint >= 1 or None
Sample rate in Hz.
- out_format[‘radian’, ‘cycle’, ‘khz’, ‘hz’]
Output format.
- Returns:
- outTensor [shape=(…, M+1)]
LSP frequencies.