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

The frame length, \(L\).

lpc_orderint >= 0

The order of the LPC coefficients, \(M\).

epsfloat >= 0

A small value to improve numerical stability.

forward(x)[source]#

Perform LPC analysis.

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

The framed waveform.

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

The 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]#

Perform LPC analysis.

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

The famed waveform.

lpc_orderint >= 0

The order of the LPC coefficients, \(M\).

epsfloat >= 0

A small value to improve numerical stability.

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

The gain and LPC coefficients.