lpc2c

Functions

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

lpc2c [ option ] [ infile ]

  • -m int

    • order of LPC coefficients \((0 \le M_1)\)

  • -M int

    • order of LPC cepstral coefficients \((0 \le M_2)\)

  • infile str

    • double-type LPC coefficients

  • stdout

    • double-type LPC cepstral coefficients

The below example extracts 15-th order LPC cepstral coefficients from data.d.

frame < data.d | window | lpc -m 10 | lpc2c -m 10 -M 15 > data.cep

Parameters
  • argc[in] Number of arguments.

  • argv[in] Argument vector.

Returns

0 on success, 1 on failure.

See also

lpc mgc2mgc

class sptk::LinearPredictiveCoefficientsToCepstrum

Convert LPC coefficients to LPC cepstral coefficients.

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

\[ \begin{array}{cccc} K, & a(1), & \ldots, & a(M_1), \end{array} \]
and the output is the \(M_2\)-th order cepstral coefficients:
\[ \begin{array}{cccc} c(0), & c(1), & \ldots, & c(M_2). \end{array} \]
The cesptral coefficients is obtained by the following recursion:
\[\begin{split} c(m) = \left\{ \begin{array}{ll} \log K, & m = 0 \\ -a(m) - \displaystyle\sum_{k=1}^{m-1} \frac{k}{m} c(k) a(m-k), & (0 < m \le M_1) \\ -\displaystyle\sum_{k=m-M_1}^{m-1} \frac{k}{m} c(k) a(m-k). & (M_1 < m \le M_2) \end{array} \right. \end{split}\]
This simple recursion does not require any DFTs.

Public Functions

LinearPredictiveCoefficientsToCepstrum(int num_input_order, int num_output_order)
Parameters
  • num_input_order[in] Order of LPC coefficients, \(M_1\).

  • num_output_order[in] Order of cepstral coefficients, \(M_2\).

inline int GetNumInputOrder() const
Returns

Order of LPC coefficients.

inline int GetNumOutputOrder() const
Returns

Order of cepstral coefficients.

inline bool IsValid() const
Returns

True if this object is valid.

bool Run(const std::vector<double> &linear_predictive_coefficients, std::vector<double> *cepstrum) const
Parameters
  • linear_predictive_coefficients[in] \(M_1\)-th order LPC coefficients.

  • cepstrum[out] \(M_2\)-th order cepstral coefficients.

Returns

True on success, false on failure.