SphinxBase 0.6
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. More...
 

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_tcmn_init (int32 veclen)
 
SPHINXBASE_EXPORT void cmn (cmn_t *cmn, mfcc_t **mfc, int32 varnorm, int32 n_frame)
 CMN for the whole sentence.
 
SPHINXBASE_EXPORT void cmn_prior (cmn_t *cmn, mfcc_t **incep, int32 varnorm, int32 nfr)
 CMN for one block of data, using prior mean.
 
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.
 

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.

Macro Definition Documentation

◆ CMN_WIN

#define CMN_WIN   500

Definition at line 152 of file cmn.h.

◆ CMN_WIN_HWM

#define CMN_WIN_HWM   800 /* #frames after which window shifted */

Definition at line 151 of file cmn.h.

Enumeration Type Documentation

◆ cmn_type_e

enum cmn_type_e

Types of cepstral mean normalization to apply to the features.

Definition at line 110 of file cmn.h.

Function Documentation

◆ cmn()

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

CMN for the whole sentence.

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

Definition at line 150 of file cmn.c.

References cmn(), E_INFO, and E_INFOCONT.

Referenced by cmn(), cmn_prior(), cmn_prior_get(), cmn_prior_set(), cmn_prior_update(), and feat_init().

◆ cmn_free()

SPHINXBASE_EXPORT void cmn_free ( cmn_t cmn)

Definition at line 216 of file cmn.c.

◆ cmn_init()

SPHINXBASE_EXPORT cmn_t * cmn_init ( int32  veclen)

Definition at line 131 of file cmn.c.

◆ cmn_prior()

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
cmnIn/Out: cmn normalization, which contains the cmn_mean and cmn_var)
incepIn/Out: mfc[f] = mfc vector in frame f
varnormThis flag should always be 0 for live
nfrNumber of incoming frames

Definition at line 146 of file cmn_prior.c.

References cmn(), cmn_prior(), and E_FATAL.

Referenced by cmn_prior().

◆ cmn_prior_get()

SPHINXBASE_EXPORT void cmn_prior_get ( cmn_t cmn,
mfcc_t *  vec 
)

Get the prior mean.

Definition at line 84 of file cmn_prior.c.

References cmn(), and cmn_prior_get().

Referenced by cmn_prior_get().

◆ cmn_prior_set()

SPHINXBASE_EXPORT void cmn_prior_set ( cmn_t cmn,
mfcc_t const *  vec 
)

Set the prior mean.

Definition at line 62 of file cmn_prior.c.

References cmn(), cmn_prior_set(), E_INFO, and E_INFOCONT.

Referenced by cmn_prior_set().

◆ cmn_prior_update()

SPHINXBASE_EXPORT void cmn_prior_update ( cmn_t cmn)

Update prior mean based on observed data.

Definition at line 113 of file cmn_prior.c.

References cmn(), cmn_prior_update(), E_INFO, and E_INFOCONT.

Referenced by cmn_prior_update().

◆ cmn_type_from_str()

SPHINXBASE_EXPORT cmn_type_t cmn_type_from_str ( const char *  str)

Convert string representation (from command-line) to cmn_type_t.

Definition at line 118 of file cmn.c.

References cmn_type_from_str(), cmn_type_str, and E_FATAL.

Referenced by cmn_type_from_str().

Variable Documentation

◆ cmn_type_str

SPHINXBASE_EXPORT const char* cmn_type_str[]
extern

String representations of cmn_type_t values.

Definition at line 110 of file cmn.c.

Referenced by cmn_type_from_str(), and feat_init().