levdur#
- class diffsptk.LevinsonDurbin(lpc_order, eps=0)[source]#
See this page for details. The implementation is based on a simple matrix inversion.
- Parameters:
- lpc_orderint >= 0
The order of the LPC coefficients, \(M\).
- epsfloat >= 0
A small value to improve numerical stability.
- forward(r)[source]#
Solve a Yule-Walker linear system.
- Parameters:
- rTensor [shape=(…, M+1)]
The autocorrelation.
- Returns:
- outTensor [shape=(…, M+1)]
The gain and the LPC coefficients.
Examples
>>> x = diffsptk.nrand(4) >>> x tensor([ 0.8226, -0.0284, -0.5715, 0.2127, 0.1217]) >>> acorr = diffsptk.Autocorrelation(5, 2) >>> levdur = diffsptk.LevinsonDurbin(2) >>> a = levdur(acorr(x)) >>> a tensor([0.8726, 0.1475, 0.5270])