lpc2par#
- class diffsptk.LinearPredictiveCoefficientsToParcorCoefficients(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(a: Tensor) Tensor [source]#
Convert LPC to PARCOR.
- Parameters:
- aTensor [shape=(…, M+1)]
The LPC coefficients.
- Returns:
- outTensor [shape=(…, M+1)]
The PARCOR coefficients.
Examples
>>> x = diffsptk.nrand(4) >>> x tensor([ 0.7829, -0.2028, 1.6912, 0.1454, 0.4861]) >>> lpc = diffsptk.LPC(5, 3) >>> a = lpc(x) >>> a tensor([ 1.6036, 0.0573, -0.5615, -0.0638]) >>> lpc2par = diffsptk.LinearPredictiveCoefficientsToParcorCoefficients(3) >>> k = lpc2par(a) >>> k tensor([ 1.6036, 0.0491, -0.5601, -0.0638])
- diffsptk.functional.lpc2par(a: Tensor, gamma: float = 1, c: int | None = None) Tensor [source]#
Convert LPC to PARCOR.
- Parameters:
- aTensor [shape=(…, M+1)]
The LPC coefficients.
- gammafloat in [-1, 1]
The gamma parameter, \(\gamma\).
- cint >= 1 or None
The number of filter stages.
- Returns:
- outTensor [shape=(…, M+1)]
The PARCOR coefficients.