mc2b

Functions

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

mc2b [ option ] [ infile ]

  • -m int

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

  • -a double

    • all-pass constant \((|\alpha| < 1)\)

  • infile str

    • double-type mel-cepstral coefficients

  • stdout

    • double-type MLSA digital filter coefficients

The below example converts mel-cepstral coefficients into MLSA digital filter coefficients:

mc2b < data.mc > data.b

The converted MLSA digital filter coefficients can be reverted by

b2mc < data.b > data.mc
Parameters:
  • argc[in] Number of arguments.

  • argv[in] Argument vector.

Returns:

0 on success, 1 on failure.

See also

b2mc mgc2mgc

class MelCepstrumToMlsaDigitalFilterCoefficients

Convert mel-cepstral coefficients to MLSA digital filter coefficients.

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

\[ \begin{array}{cccc} \tilde{c}(0), & \tilde{c}(1), & \ldots, & \tilde{c}(M), \end{array} \]
and the output is the \(M\)-th order MLSA digital filter coefficients:
\[ \begin{array}{cccc} b(0), & b(1), & \ldots, & b(M). \end{array} \]
The MLSA digital filter coefficients can be obtained by the linear transformation of the mel-cepstral coefficients:
\[ \boldsymbol{b} = \boldsymbol{A}^{-1}\tilde{\boldsymbol{c}}, \]
where
\[\begin{split}\begin{eqnarray} \boldsymbol{A}^{-1} &=& \left[ \begin{array}{ccccc} 1 & -\alpha & (-\alpha)^2 & \cdots & (-\alpha)^M \\ 0 & 1 & -\alpha & \ddots & \vdots \\ 0 & 0 & 1 & \ddots & (-\alpha)^2 \\ \vdots & \vdots & \ddots & \ddots & -\alpha \\ 0 & 0 & \cdots & 0 & 1 \\ \end{array} \right], \\ \boldsymbol{b} &=& \left[ \begin{array}{cccc} b(0) & b(1) & \cdots & b(M) \end{array} \right]^{\mathsf{T}}, \\ \tilde{\boldsymbol{c}} &=& \left[ \begin{array}{cccc} \tilde{c}(0) & \tilde{c}(1) & \cdots & \tilde{c}(M) \end{array} \right]^{\mathsf{T}}. \end{eqnarray}\end{split}\]
The conversion is implemented with low computational complexity in a recursive manner as follows:
\[\begin{split} b(m) = \left\{ \begin{array}{ll} \tilde{c}(m), & m = M \\ \tilde{c}(m) - \alpha b(m + 1). & 0 \le m < M \end{array} \right. \end{split}\]

[1] K. Tokuda, T. Kobayashi, T. Chiba, and S. Imai, “Spectral estimation of speech by mel-generalized cepstral analysis,” Electronics and Communications in Japan, part 3, vol. 76, no. 2, pp. 30-43, 1993.

Public Functions

MelCepstrumToMlsaDigitalFilterCoefficients(int num_order, double alpha)
Parameters:
  • num_order[in] Order of coefficients, \(M\).

  • alpha[in] Frequency warping factor, \(\alpha\).

inline int GetNumOrder() const
Returns:

Order of coefficients.

inline double GetAlpha() const
Returns:

Frequency warping factor.

inline bool IsValid() const
Returns:

True if this object is valid.

bool Run(const std::vector<double> &mel_cepstrum, std::vector<double> *mlsa_digital_filter_coefficients) const
Parameters:
  • mel_cepstrum[in] \(M\)-th order mel-cepstral coefficients.

  • mlsa_digital_filter_coefficients[out] \(M\)-th order MLSA digital filter coefficients.

Returns:

True on success, false on failure.

bool Run(std::vector<double> *input_and_output) const
Parameters:

input_and_output[inout] \(M\)-th order coefficients.

Returns:

True on success, false on failure.