lpc#

diffsptk.LPC#

alias of LinearPredictiveCodingAnalysis

class diffsptk.LinearPredictiveCodingAnalysis(frame_length, lpc_order, eps=1e-06)[source]#

See this page for details. Double precision is recommended.

Parameters:
frame_lengthint > M

Frame length, \(L\).

lpc_orderint >= 0

Order of LPC, \(M\).

epsfloat >= 0

A small value to improve numerical stability.

forward(x)[source]#

Compute LPC coefficients.

Parameters:
xTensor [shape=(…, L)]

Framed waveform.

Returns:
outTensor [shape=(…, M+1)]

Gain and LPC coefficients.

Examples

>>> x = diffsptk.nrand(4)
tensor([ 0.8226, -0.0284, -0.5715,  0.2127,  0.1217])
>>> lpc = diffsptk.LPC(5, 2)
>>> a = lpc(x)
>>> a
tensor([0.8726, 0.1475, 0.5270])
diffsptk.functional.lpc(x, lpc_order, eps=1e-06)[source]#

Compute LPC coefficients.

Parameters:
xTensor [shape=(…, L)]

Framed waveform.

lpc_orderint >= 0

Order of LPC, \(M\).

epsfloat >= 0

A small value to improve numerical stability.

Returns:
outTensor [shape=(…, M+1)]

Gain and LPC coefficients.