lpccheck#

class diffsptk.LinearPredictiveCoefficientsStabilityCheck(lpc_order: int, margin: float = 1e-16, warn_type: str = 'warn')[source]#

See this page for details.

Parameters:
lpc_orderint >= 0

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

marginfloat in (0, 1)

The margin to guarantee the stability of LPC.

warn_type[‘ignore’, ‘warn’, ‘exit’]

The warning type.

forward(a: Tensor) Tensor[source]#

Check the stability of the input LPC coefficients.

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

The input LPC coefficients.

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

The modified LPC coefficients.

Examples

>>> import diffsptk
>>> import torch
>>> lpccheck = diffsptk.LinearPredictiveCoefficientsStabilityCheck(
...     4, warn_type="ignore"
... )
>>> a = torch.tensor([1.0, -2.5, 2.8, -1.5, 0.4])
>>> a2 = lpccheck(a)
>>> a2
tensor([ 1.0000, -2.4825,  2.7743, -1.4930,  0.4000])
diffsptk.functional.lpccheck(a: Tensor, margin: float = 1e-16, warn_type: str = 'warn') Tensor[source]#

Check stability of LPC coefficients.

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

The input LPC coefficients.

marginfloat in (0, 1)

The margin to guarantee the stability of LPC.

warn_type[‘ignore’, ‘warn’, ‘exit’]

The warning type.

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

The modified LPC coefficients.

See also

lpc lpc2par par2lpc