lspcheck#

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

See this page for details.

Parameters:
lsp_orderint >= 0

Order of LSP, \(M\).

ratefloat in [0, 1]

Rate of distance between two adjacent LSPs.

n_iterint >= 0

Number of iterations for modification.

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

Warning type.

forward(w)[source]#

Check stability of LSP.

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

LSP coefficients in radians.

Returns:
outTensor [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])
diffsptk.functional.lspcheck(w, rate=0, n_iter=1, warn_type='warn')[source]#

Check stability of LSP frequencies.

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

LSP frequencies in radians.

ratefloat in [0, 1]

Rate of distance between two adjacent LSPs.

n_iterint >= 0

Number of iterations for modification.

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

Warning type.

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

Modified LSP frequencies.

See also

lpc2lsp