b2mc

Functions

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

b2mc [ option ] [ infile ]

  • -m int

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

  • -a double

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

  • infile str

    • double-type MLSA digital filter coefficients

  • stdout

    • double-type mel-cepstral coefficients

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

b2mc < data.b > data.mc

The converted mel-cepstral coefficients can be reverted by

mc2b < data.mc > data.b

Parameters
  • argc[in] Number of arguments.

  • argv[in] Argument vector.

Returns

0 on success, 1 on failure.

See also

mc2b mgcep

class sptk::MlsaDigitalFilterCoefficientsToMelCepstrum

Convert MLSA digital filter coefficients to mel-cepstral coefficients.

The input is the \(M\)-th order MLSA digital filter coefficients:

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

MlsaDigitalFilterCoefficientsToMelCepstrum(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> &mlsa_digital_filter_coefficients, std::vector<double> *mel_cepstrum) const
Parameters
  • mlsa_digital_filter_coefficients[in] \(M\)-th order MLSA digital filter coefficients.

  • mel_cepstrum[out] \(M\)-th order mel-cepstral 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.