cmn.h File Reference

Apply Cepstral Mean Normalization (CMN) to the set of input mfc frames. More...

`#include <sphinxbase/sphinxbase_export.h>`
`#include <sphinxbase/prim_type.h>`
`#include <sphinxbase/fe.h>`

Go to the source code of this file.

## Data Structures

struct | cmn_t
| wrapper of operation of the cepstral mean normalization. More...

## Macros

#define | CMN_WIN_HWM 800 /* #frames after which window shifted */
#define | CMN_WIN 500

## Typedefs

typedef enum cmn_type_e | cmn_type_t
| Types of cepstral mean normalization to apply to the features.

## Enumerations

enum | cmn_type_e { CMN_NONE = 0, CMN_CURRENT, CMN_PRIOR }
| Types of cepstral mean normalization to apply to the features.

## Functions

SPHINXBASE_EXPORT cmn_type_t | cmn_type_from_str (const char *str)
| Convert string representation (from command-line) to cmn_type_t.
SPHINXBASE_EXPORT cmn_t * | cmn_init (int32 veclen)
SPHINXBASE_EXPORT void | cmn (cmn_t *cmn, mfcc_t **mfc, int32 varnorm, int32 n_frame)
| CMN for the whole sentence. More...
SPHINXBASE_EXPORT void | cmn_prior (cmn_t *cmn, mfcc_t **incep, int32 varnorm, int32 nfr)
| CMN for one block of data, using prior mean. More...
SPHINXBASE_EXPORT void | cmn_prior_update (cmn_t *cmn)
| Update prior mean based on observed data.
SPHINXBASE_EXPORT void | cmn_prior_set (cmn_t *cmn, mfcc_t const *vec)
| Set the prior mean.
SPHINXBASE_EXPORT void | cmn_prior_get (cmn_t *cmn, mfcc_t *vec)
| Get the prior mean.
SPHINXBASE_EXPORT void | cmn_free (cmn_t *cmn)

## Variables

SPHINXBASE_EXPORT const char * | cmn_type_str []
| String representations of cmn_type_t values. More...

## Detailed Description

Apply Cepstral Mean Normalization (CMN) to the set of input mfc frames.

By subtractingthe mean of the input from each frame. C0 is also included in this process. This function operates on an entire utterance at a time. Hence, the entire utterance must be available beforehand (batchmode).

Definition in file cmn.h.

## Function Documentation

SPHINXBASE_EXPORT void cmn | ( | cmn_t * | cmn,
|  | mfcc_t ** | mfc,
|  | int32 | varnorm,
|  | int32 | n_frame
| ) |  |

CMN for the whole sentence.

Parameters

  cmn | In/Out: cmn normalization, which contains the cmn_mean and cmn_var)
  mfc | In/Out: mfc[f] = mfc vector in frame f
  varnorm | In: if not FALSE, variance normalize the input vectors to have unit variance (along each dimension independently); Irrelevant if no cmn is performed
  n_frame | In: Number of frames of mfc vectors

Definition at line 150 of file cmn.c.

References cmn_t::cmn_mean, cmn_t::cmn_var, E_INFO, E_INFOCONT, and cmn_t::veclen.

Referenced by feat_init().

SPHINXBASE_EXPORT void cmn_prior | ( | cmn_t * | cmn,
|  | mfcc_t ** | incep,
|  | int32 | varnorm,
|  | int32 | nfr
| ) |  |

CMN for one block of data, using prior mean.

Parameters

  cmn | In/Out: cmn normalization, which contains the cmn_mean and cmn_var)
  incep | In/Out: mfc[f] = mfc vector in frame f
  varnorm | This flag should always be 0 for live
  nfr | Number of incoming frames

Definition at line 146 of file cmn_prior.c.

References cmn_t::cmn_mean, E_FATAL, cmn_t::nframe, cmn_t::sum, and cmn_t::veclen.

## Variable Documentation

SPHINXBASE_EXPORT const char* cmn_type_str[]

String representations of cmn_type_t values.

Definition at line 110 of file cmn.c.

Referenced by cmn_type_from_str(), and feat_init().