c2mpir

Functions

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

c2mpir [ option ] [ infile ]

  • -m int

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

  • -M int

    • order of impulse response \((0 \le M_2)\)

  • infile str

    • double-type cepstral coefficients

  • stdout

    • double-type minimum phase impulse response

Parameters
  • argc[in] Number of arguments.

  • argv[in] Argument vector.

Returns

0 on success, 1 on failure.

See also

c2acr

class sptk::CepstrumToMinimumPhaseImpulseResponse

Convert minimum phase impulse response to cepstrum.

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

\[ \begin{array}{cccc} c(0), & c(1), & \ldots, & c(M_1), \end{array} \]
and the output is the \(M_2\)-th order impulse response:
\[ \begin{array}{cccc} h(0), & h(1), & \ldots, & h(M_2). \end{array} \]
The truncated impulse response is obtained from the following recursion formula:
\[\begin{split} h(n) = \left\{ \begin{array}{ll} \exp c(0), & n = 0 \\ \displaystyle\sum_{k=1}^{n} \frac{k}{n} c(k) h(n-k). & n > 0 \end{array} \right. \end{split}\]

[1] A. V. Oppenheim and R. W. Schafer, “Discrete-time signal processing, 3rd edition,” Prentice-Hall Signal Processing Series, pp. 985-986, 2009.

Public Functions

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

  • num_output_order[in] Order of impulse response, \(M_2\).

inline int GetNumInputOrder() const
Returns

Order of cepstral coefficients.

inline int GetNumOutputOrder() const
Returns

Order of impulse response.

inline bool IsValid() const
Returns

True if this object is valid.

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

  • minimum_phase_impulse_response[out] \(M_2\)-th order impulse response.

Returns

True on success, false on failure.