par2lpc#

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

See this page for details.

Parameters:
lpc_orderint >= 0

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

gammafloat in [-1, 1]

The gamma parameter, \(\gamma\).

cint >= 1 or None

The number of filter stages.

forward(k: Tensor) Tensor[source]#

Convert PARCOR to LPC.

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

The PARCOR coefficients.

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

The LPC coefficients.

Examples

>>> import diffsptk
>>> lpc = diffsptk.LPC(5, 2)
>>> lpc2par = diffsptk.LinearPredictiveCoefficientsToParcorCoefficients(2)
>>> par2lpc = diffsptk.ParcorCoefficientsToLinearPredictiveCoefficients(2)
>>> x = diffsptk.ramp(1, 5) * 0.1
>>> a = lpc(x)
>>> a
tensor([ 0.5054, -0.8140,  0.1193])
>>> a2 = par2lpc(lpc2par(a))
>>> a2
tensor([ 0.5054, -0.8140,  0.1193])
diffsptk.functional.par2lpc(k: Tensor, gamma: float = 1, c: int | None = None) Tensor[source]#

Convert PARCOR to LPC.

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

The PARCOR coefficients.

gammafloat in [-1, 1]

The gamma parameter, \(\gamma\).

cint >= 1 or None

The number of filter stages.

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

The LPC coefficients.

See also

lpc2par