lpc2par

Functions

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

lpc2par [ option ] [ infile ]

  • -m int

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

  • -g double

    • gamma \((|\gamma| \le 1)\)

  • -c int

    • gamma \(\gamma = -1 / C\) \((1 \le C)\)

  • -e int

    • type of warning of unstable coefficients

      • 0 no warning

      • 1 output the index to stderr

      • 2 output the index to stderr and exit immediately

  • infile str

    • double-type LPC coefficients

  • stdout

    • double-type PARCOR coefficients

The below example extracts PARCOR coefficients from data.d

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

  • argv[in] Argument vector.

Returns:

0 on success, 1 on failure.

See also

par2lpc ltcdf

class LinearPredictiveCoefficientsToParcorCoefficients

Convert LPC coefficients to PARCOR coefficients.

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

\[ \begin{array}{cccc} K, & a(1), & \ldots, & a(M), \end{array} \]
and the output is the \(M\)-th order PARCOR coefficients:
\[ \begin{array}{cccc} K, & k(1), & \ldots, & k(M), \end{array} \]
where \(K\) is the gain. The conversion is given by the following recursion formula:
\[\begin{split}\begin{eqnarray} k(i) &=& a^{(i)}(i), \\ a^{(i-1)}(m) &=& \frac{a^{(i)}(m) + a^{(i)}(i) a^{(i)}(i-m)}{1-k^2(i)}, \\ && i = M,\ldots,1 \end{eqnarray}\end{split}\]
with the initial condition \(a^{(M)}(i)=a(i)\) for \(i = 1,\ldots,M\).

The input can be the \(M\)-th order normalized generalized cepstral coefficients:

\[ \begin{array}{cccc} K, & c'_\gamma(1), & \ldots, & c'_\gamma(M). \end{array} \]
In the case, the initial condition is \(a^{(M)}(i)=\gamma \, c'_\gamma(i)\) for \(i = 1,\ldots,M\).

Public Functions

LinearPredictiveCoefficientsToParcorCoefficients(int num_order, double gamma)
Parameters:
  • num_order[in] Order of coefficients.

  • gamma[in] Gamma.

inline int GetNumOrder() const
Returns:

Order of coefficients.

inline double GetGamma() const
Returns:

Gamma.

inline bool IsValid() const
Returns:

True if this object is valid.

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

  • parcor_coefficients[out] \(M\)-th order PARCOR coefficients.

  • is_stable[out] True if given coefficients are stable.

  • buffer[out] Buffer.

Returns:

True on success, false on failure.

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

  • is_stable[out] True if given coefficients are stable.

  • buffer[out] Buffer.

Returns:

True on success, false on failure.

class Buffer

Buffer for LinearPredictiveCoefficientsToParcorCoefficients class.