rlevdur
Functions
-
int main(int argc, char *argv[])
rlevdur [ option ] [ infile ]
-m int
order of coefficients \((0 \le M)\)
infile str
double-type linear predictive coefficients
stdout
double-type autocorrelation
The below example converts LPC coefficients in
data.lpc
to CSM parameters.rlevdur -m 10 < data.lpc | acr2csm -m 10 > data.csm
- Parameters:
argc – [in] Number of arguments.
argv – [in] Argument vector.
- Returns:
0 on success, 1 on failure.
See also
-
class ReverseLevinsonDurbinRecursion
Calculate linear predictive coefficients from autocorrelation.
The input is the \(M\)-th order LPC coefficients:
\[ \begin{array}{cccc} K, & a(1), & \ldots, & a(M), \end{array} \]where \(K\) is the gain, and the output is the \(M\)-th order autocorrelation:\[ \begin{array}{cccc} r(0), & r(1), & \ldots, & r(M). \end{array} \]The autocorrelation matrix can be represented as\[\begin{split} \boldsymbol{R} = \left[ \begin{array}{cccc} r(0) & r(1) & \cdots & r(M) \\ r(1) & r(0) & \cdots & r(M-1) \\ \vdots & \vdots & \ddots & \vdots \\ r(M) & r(M-1) & \cdots & r(0) \end{array} \right]. \end{split}\]The autocorrelation is derived by using the matrix decomposition\[ \boldsymbol{R}^{-1} = \boldsymbol{U} \boldsymbol{E}^{-1} \boldsymbol{U}^{\mathsf{T}}. \]The \(\boldsymbol{U}\) is the following upper triangular matrix:\[\begin{split} \boldsymbol{U} = \left[ \begin{array}{cccc} a^{(0)}(0) & a^{(1)}(1) & \cdots & a^{(M)}(M) \\ 0 & a^{(1)}(0) & \cdots & a^{(M)}(M-1) \\ \vdots & \vdots & \ddots & \vdots \\ 0 & 0 & \cdots & a^{(M)}(0) \end{array} \right], \end{split}\]where \(a^{(i)}(j)\) is the \(j\)-th coefficient of the \(i\)-th order prediction filter polynomial. The \(\boldsymbol{E}\) is the following diagonal matrix:\[\begin{split} \boldsymbol{E} = \left[ \begin{array}{cccc} e^{(0)}(0) & 0 & \cdots & 0 \\ 0 & e^{(1)}(1) & \cdots & 0 \\ \vdots & \vdots & \ddots & \vdots \\ 0 & 0 & \cdots & e^{(M)}(M) \end{array} \right], \end{split}\]where \(e^{(i)}(i)\) is the prediction error from \(i\)-th order filter. This decomposition allows us the efficient evaluation of the inverse of the autocorrelation matrix.Public Functions
-
explicit ReverseLevinsonDurbinRecursion(int num_order)
- Parameters:
num_order – [in] Order of coefficients, \(M\).
-
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> &linear_predictive_coefficients, std::vector<double> *autocorrelation, ReverseLevinsonDurbinRecursion::Buffer *buffer) const
- Parameters:
linear_predictive_coefficients – [in] \(M\)-th order LPC coefficients.
autocorrelation – [out] \(M\)-th order autocorrelation.
buffer – [out] Buffer.
- Returns:
True on success, false on failure.
-
bool Run(std::vector<double> *input_and_output, ReverseLevinsonDurbinRecursion::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 ReverseLevinsonDurbinRecursion class.
-
explicit ReverseLevinsonDurbinRecursion(int num_order)