lpc#

diffsptk.LPC#

alias of LinearPredictiveCodingAnalysis

class diffsptk.LinearPredictiveCodingAnalysis(frame_length, lpc_order)[source]#

See this page for details. This module is a simple cascade of acorr and levdur.

Parameters:
frame_lengthint > M

Frame length, \(L\).

lpc_orderint >= 0

Order of LPC, \(M\).

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(2, 5)
>>> a = lpc(x)
>>> a
tensor([0.8726, 0.1475, 0.5270])
diffsptk.functional.lpc(x, lpc_order)[source]#

Compute LPC coefficients.

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

Framed waveform.

lpc_orderint >= 0

Order of LPC, \(M\).

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

Gain and LPC coefficients.