SphinxBase  5prealpha
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_BATCH, CMN_LIVE }
 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_tcmn_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_live (cmn_t *cmn, mfcc_t **incep, int32 varnorm, int32 nfr)
 CMN for one block of data, using live mean. More...
 
SPHINXBASE_EXPORT void cmn_live_update (cmn_t *cmn)
 Update live mean based on observed data.
 
SPHINXBASE_EXPORT void cmn_live_set (cmn_t *cmn, mfcc_t const *vec)
 Set the live mean.
 
SPHINXBASE_EXPORT void cmn_live_get (cmn_t *cmn, mfcc_t *vec)
 Get the live 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
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 100 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_live ( cmn_t cmn,
mfcc_t **  incep,
int32  varnorm,
int32  nfr 
)

CMN for one block of data, using live 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 145 of file cmn_live.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 59 of file cmn.c.

Referenced by cmn_type_from_str(), and feat_init().