lpc#

diffsptk.LPC#

alias of LinearPredictiveCodingAnalysis

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

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

Parameters:
lpc_orderint >= 0 [scalar]

Order of LPC, \(M\).

frame_lengthint > M [scalar]

Frame length, \(L\).

forward(x)[source]#

Perform LPC analysis.

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

Framed waveform.

Returns:
aTensor [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])