par2lpc#

class diffsptk.ParcorCoefficientsToLinearPredictiveCoefficients(lpc_order, gamma=1, c=None)[source]#

See this page for details.

Parameters:
lpc_orderint >= 0

Order of LPC, \(M\).

gammafloat in [-1, 1]

Gamma, \(\gamma\).

cint >= 1 or None

Number of stages.

forward(k)[source]#

Convert PARCOR to LPC.

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

PARCOR coefficients.

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

LPC coefficients.

Examples

>>> x = diffsptk.nrand(4)
>>> x
tensor([ 0.7829, -0.2028,  1.6912,  0.1454,  0.4861])
>>> lpc = diffsptk.LPC(3, 5)
>>> a = lpc(x)
>>> a
tensor([ 1.6036,  0.0573, -0.5615, -0.0638])
>>> lpc2par = diffsptk.LinearPredictiveCoefficientsToParcorCoefficients(3)
>>> par2lpc = diffsptk.ParcorCoefficientsToLinearPredictiveCoefficients(3)
>>> a2 = par2lpc(lpc2par(a))
>>> a2
tensor([ 1.6036,  0.0573, -0.5615, -0.0638])
diffsptk.functional.par2lpc(k, gamma=1, c=None)[source]#

Convert PARCOR to LPC.

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

PARCOR coefficients.

gammafloat in [-1, 1]

Gamma, \(\gamma\).

cint >= 1 or None

Number of stages.

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

LPC coefficients.

See also

lpc2par