lpc2lsp

Functions

int main(int argc, char *argv[])

lpc2lsp [ option ] [ infile ]

  • -m int

    • order of coefficients \((0 \le M)\)

  • -s double

    • sampling rate \((0 < F_s)\)

  • -k int

    • output gain type

      • 0 linear gain

      • 1 log gain

      • 2 without gain

  • -o int

    • output format

      • 0 frequency in rad

      • 1 frequency in cyc

      • 2 frequency in kHz

      • 3 frequency in Hz

  • -n int

    • number of splits of unit circle quadrant \((1 \le S)\)

  • -i int

    • maximum number of iterations \((0 \le N)\)

  • -d double

    • convergence threshold \((0 \le \epsilon)\)

  • infile str

    • double-type LPC coefficients

  • stdout

    • double-type LSP coefficients

The below example extracts 10-th order LSP coefficients from data.d.

frame < data.d | window | lpc -m 10 | lpc2lsp -m 10 > data.lsp
Parameters:
  • argc[in] Number of arguments.

  • argv[in] Argument vector.

Returns:

0 on success, 1 on failure.

See also

lsp2lpc lspdf

class LinearPredictiveCoefficientsToLineSpectralPairs

Convert linear predictive coefficients to line spectral pairs.

The input is the \(M\)-th order LPC:

\[ \begin{array}{cccc} K, & a(1), & \ldots, & a(M), \end{array} \]
and the output is the \(M\)-th order LSP:
\[ \begin{array}{cccc} K, & \omega(1), & \ldots, & \omega(M). \end{array} \]
The LSP coefficients are obtained by an iterative root finding algorithm.

[1] P. Kabal and R. P. Ramachandran, “The computation of line spectral frequencies using Chebyshev polynomials,” IEEE Transactions on Acoustics, Speech, and Signal Processing, vol. 34, no. 6, pp. 1419-1426, 1986.

Public Functions

LinearPredictiveCoefficientsToLineSpectralPairs(int num_order, int num_split, int num_iteration, double convergence_threshold)
Parameters:
  • num_order[in] Order of coefficients, \(M\).

  • num_split[in] Number of splits of unit circle quadrant.

  • num_iteration[in] Number of iterations.

  • convergence_threshold[in] Convergence threshold.

inline int GetNumOrder() const
Returns:

Order of coefficients.

inline int GetNumSplit() const
Returns:

Number of splits.

inline int GetNumIteration() const
Returns:

Number of iterations.

inline double GetConvergenceThreshold() const
Returns:

Convergence threshold.

inline bool IsValid() const
Returns:

True if this object is valid.

bool Run(const std::vector<double> &linear_predictive_coefficients, std::vector<double> *line_spectral_pairs, LinearPredictiveCoefficientsToLineSpectralPairs::Buffer *buffer) const
Parameters:
  • linear_predictive_coefficients[in] \(M\)-th order LPC.

  • line_spectral_pairs[out] \(M\)-th order LSP.

  • buffer[out] Buffer.

Returns:

True on success, false on failure.

bool Run(std::vector<double> *input_and_output, LinearPredictiveCoefficientsToLineSpectralPairs::Buffer *buffer) const
Parameters:
  • input_and_output[inout] \(M\)-th order coefficients.

  • buffer[out] Buffer.

Returns:

True on success, false on failure.

class Buffer

Buffer for LinearPredictiveCoefficientsToLineSpectralPairs class.