levdur

diffsptk.LevinsonDurbinRecursion

alias of diffsptk.core.levdur.PseudoLevinsonDurbinRecursion

class diffsptk.PseudoLevinsonDurbinRecursion(out_format='K,a')[source]

See this page for details. Note that the current implementation does not use the Durbin’s algorithm though the class name includes it.

Parameters
out_format[‘K’, ‘a’, ‘Ka’, ‘K,a’]

K is gain and a is LPC coefficients. If this is Ka, the two output tensors are concatenated and return the tensor instead of the tuple.

forward(r)[source]

Solve a Yule-Walker linear system.

Parameters
rTensor [shape=(…, M+1)]

Autocorrelation.

Returns
KTensor [shape=(…, 1)]

Gain.

aTensor [shape=(…, M)]

LPC coefficients.

Examples

>>> x = torch.nrand(5)
tensor([ 0.8226, -0.0284, -0.5715,  0.2127,  0.1217])
>>> acorr = diffsptk.AutocorrelationAnalysis(2, 5)
>>> levdur = diffsptk.LevinsonDurbinRecursion(out_format="K,a")
>>> a = levdur(acorr(x))
>>> a
(tensor([0.8726]), tensor([0.1475, 0.5270]))

See also

acorr lpc