lspcheck#

class diffsptk.LineSpectralPairsStabilityCheck(lsp_order, rate=0, n_iter=1, warn_type='warn')[source]#

See this page for details.

Parameters:
lsp_orderint >= 0 [scalar]

Order of LSP, \(M\).

rate[0 <= float <= 1]

Rate of distance between two adjacent LSPs.

n_iterint >= 0 [scalar]

Number of iterations for modification.

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

Behavior for unstable LSP.

forward(w1)[source]#

Check stability of LSP.

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

LSP coefficients in radians.

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

Modified LSP coefficients.

Examples

>>> w1 = torch.tensor([0, 0, 1]) * torch.pi
>>> lspcheck = diffsptk.LineSpectralPairsStabilityCheck(2, rate=0.01)
>>> w2 = lspcheck(w1)
>>> w2
tensor([0.0000, 0.0105, 3.1311])

See also

lpc2lsp