par2lpc

Functions

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

par2lpc [ option ] [ infile ]

  • -m int

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

  • infile str

    • double-type PARCOR coefficients

  • stdout

    • double-type LPC coefficients

The below example converts PARCOR coefficients into LPC coefficients:

par2lpc < data.rc > data.lpc

The converted LPC coefficients can be reverted by

lpc2par < data.lpc > data.rc
Parameters:
  • argc[in] Number of arguments.

  • argv[in] Argument vector.

Returns:

0 on success, 1 on failure.

See also

lpc lpc2par

class ParcorCoefficientsToLinearPredictiveCoefficients

Convert PARCOR coefficients to LPC coefficients.

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

\[ \begin{array}{cccc} K, & k(1), & \ldots, & k(M), \end{array} \]
and the output is the \(M\)-th order LPC coefficients:
\[ \begin{array}{cccc} K, & a(1), & \ldots, & a(M), \end{array} \]
where \(K\) is the gain. The conversion is given by the following recursion formula:
\[\begin{split} a^{(i)}(m) = a^{(i-1)}(m) + k(i) a^{(i-1)}(i-m) \\ i = 2,\ldots,M \end{split}\]
with the initial condition \(a^{(i)}(i)=k(i)\) for \(i = 1,\ldots,M-1\). The outputs can then be written as
\[\begin{split} a(m) = \left\{ \begin{array}{ll} a^{(M)}(m), & 1 \le m < M \\ k(m). & m = M \end{array} \right. \end{split}\]

Public Functions

explicit ParcorCoefficientsToLinearPredictiveCoefficients(int num_order)
Parameters:

num_order[in] Order of coefficients.

inline int GetNumOrder() const
Returns:

Order of coefficients.

inline bool IsValid() const
Returns:

True if this object is valid.

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

  • linear_predictive_coefficients[out] \(M\)-th order LPC coefficients.

  • buffer[out] Buffer.

Returns:

True on success, false on failure.

bool Run(std::vector<double> *input_and_output, ParcorCoefficientsToLinearPredictiveCoefficients::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 ParcorCoefficientsToLinearPredictiveCoefficients class.