gnorm

Functions

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

gnorm [ option ] [ infile ]

  • -m int

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

  • -g double

    • gamma \((|\gamma| \le 1)\)

  • -c int

    • gamma \(\gamma = -1 / C\) \((1 \le C)\)

  • infile str

    • double-type generalized cepstral coefficients

  • stdout

    • double-type normalized generalized cepstral coefficients

The below example normalizes generalized cepstral coefficients:

gnorm -g -0.5 < data.gc > data.ngc

The normalized generalized cepstral coefficients can be reverted by

ignorm -g -0.5 < data.ngc > data.gc
Parameters:
  • argc[in] Number of arguments.

  • argv[in] Argument vector.

Returns:

0 on success, 1 on failure.

See also

ignorm freqt mgc2mgc

class GeneralizedCepstrumGainNormalization

Convert generalized cepstral coefficients to normalized generalized cepstral coefficients.

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

\[ \begin{array}{cccc} c_\gamma(0), & c_\gamma(1), & \ldots, & c_\gamma(M), \end{array} \]
and the output is the \(M\)-th order normalized generalized cepstral coefficients:
\[ \begin{array}{cccc} K, & c'_\gamma(1), & \ldots, & c'_\gamma(M), \end{array} \]
where \(K\) is the gain represented as
\[\begin{split} K = \left\{ \begin{array}{ll} (1 + \gamma\,c_\gamma(0))^{1/\gamma}, \quad & 0 < |\gamma| \le 1 \\ \exp \, c_\gamma(0). & \gamma = 0 \end{array} \right. \end{split}\]
The normalized generalized cepstral coefficients are obtained as follows:
\[ c'_\gamma(m) = \frac{c_\gamma(m)}{1 + \gamma \, c_\gamma(0)}. \]

[1] T. Kobayashi and S. Imai, “Spectral analysis using generalized cepstrum,” IEEE Transactions on Acoustics, Speech, and Signal Processing, vol. 32, no. 5, pp. 1087-1089, 1984.

Public Functions

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

  • gamma[in] Exponent parameter, \(\gamma\).

inline int GetNumOrder() const
Returns:

Order of coefficients.

inline double GetGamma() const
Returns:

Exponent parameter.

inline bool IsValid() const
Returns:

True if this object is valid.

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

  • normalized_generalized_cepstrum[out] \(M\)-th order normalized 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.