lsp2sp#
- class diffsptk.LineSpectralPairsToSpectrum(lsp_order, fft_length, alpha=0, gamma=-1, log_gain=False, out_format='power')[source]#
See this page for details.
- Parameters:
- lsp_orderint >= 0
Order of line spectral pairs, \(M\).
- fft_lengthint >= 1
Number of FFT bins, \(L\).
- alphafloat in (-1, 1)
Warping factor, \(\alpha\).
- gammafloat in [-1, 0)
Gamma, \(\gamma\).
- log_gainbool
If True, assume input gain is in log scale.
- out_format[‘db’, ‘log-magnitude’, ‘magnitude’, ‘power’]
Output format.
References
[1]A. V. Oppenheim et al., “Discrete representation of signals,” Proceedings of the IEEE, vol. 60, no. 6, pp. 681-691, 1972.
[2]N. Sugamura et al., “Speech data compression by LSP speech analysis-synthesis technique,” IEICE trans, vol. J64-A, no. 8, pp. 599-606, 1981.
- forward(w)[source]#
Convert line spectral pairs to spectrum.
- Parameters:
- wTensor [shape=(…, M+1)]
Line spectral pairs in radians.
- Returns:
- outTensor [shape=(…, L/2+1)]
Spectrum.
Examples
>>> x = diffsptk.nrand(4) >>> x tensor([ 2.1110, -1.4767, 1.2490, 2.4201, 1.5429]) >>> lpc = diffsptk.LPC(3, 5) >>> a = lpc(x) >>> lpc2lsp = diffsptk.LinearPredictiveCoefficientsToLineSpectralPairs(3) >>> w = lpc2lsp(a) >>> lsp2sp = diffsptk.LineSpectralPairsToSpectrum(3, 8) >>> sp = lsp2sp(w) >>> sp tensor([31.3541, 13.7932, 14.7454, 16.9510, 10.4759])
- diffsptk.functional.lsp2sp(w, fft_length, alpha=0, gamma=-1, log_gain=False, out_format='power')[source]#
Convert line spectral pairs to spectrum.
- Parameters:
- wTensor [shape=(…, M+1)]
Line spectral pairs in radians.
- fft_lengthint >= 1
Number of FFT bins, \(L\).
- alphafloat in (-1, 1)
Warping factor, \(\alpha\).
- gammafloat in [-1, 0)
Gamma, \(\gamma\).
- log_gainbool
If True, assume input gain is in log scale.
- out_format[‘db’, ‘log-magnitude’, ‘magnitude’, ‘power’]
Output format.
- Returns:
- outTensor [shape=(…, L/2+1)]
Spectrum.
See also