Classes | Macros | Functions
classify.h File Reference

Frame-by-frame classifier written by Ziad. To be replaced by Yitao's version. More...

#include "s3types.h"
#include "cont_mgau.h"

Go to the source code of this file.

Classes

struct  class_t
 class to store the classifier parameters More...

Macros

#define __FRAME_CLASSIFIER__
#define NUMCLASSES   4 /* Number of classes*/
#define DIMENSIONS   13 /* Length of the feature vector*/
#define MAXFRAMES   10000
#define CLASS_N   0 /* Noise*/
#define CLASS_O   1 /* Owner speech*/
#define CLASS_S   2 /* Secondary speech */
#define CLASS_SIL   3 /* Silence */
#define PRIOR_N   0.1 /* N */
#define PRIOR_O   0.4 /* O */
#define PRIOR_S   0.1 /* S */
#define PRIOR_SIL   0.4 /* SIL */
#define VOTEWINDOWLEN
#define CLASSLATENCY
#define POSTPROCESS
#define SWAP_INT(x)
#define SWAP_FLOAT(x)   SWAP_INT((int *) x)

Functions

void majority_class (class_t *CLASSW, int *classcount, int frame_count)
class_tclassw_initialize (char *mdeffile, char *meanfile, char *varfile, float64 varfloor, char *mixwfile, float64 mixwfloor, int32 precomp, char *senmgau)
void classw_free (class_t *CLASSW)
int classify (float *frame, mgau_model_t *g, int32 priors[NUMCLASSES], s3cipid_t *map)
int postclassify (int *window, int windowlen, int *wincap, int myclass)
int vote (int *window, int windowlen)

Detailed Description

Frame-by-frame classifier written by Ziad. To be replaced by Yitao's version.


Macro Definition Documentation

#define __FRAME_CLASSIFIER__
#define CLASS_N   0 /* Noise*/
#define CLASS_O   1 /* Owner speech*/
#define CLASS_S   2 /* Secondary speech */
#define CLASS_SIL   3 /* Silence */
#define CLASSLATENCY
Value:
2 /* Number of latency frames caused by the post processing (voting window)
*/
#define DIMENSIONS   13 /* Length of the feature vector*/
#define MAXFRAMES   10000
#define NUMCLASSES   4 /* Number of classes*/
#define POSTPROCESS
Value:
1 /* Enabling/disabling post-processing
*/
#define PRIOR_N   0.1 /* N */
#define PRIOR_O   0.4 /* O */
#define PRIOR_S   0.1 /* S */
#define PRIOR_SIL   0.4 /* SIL */
#define SWAP_FLOAT (   x)    SWAP_INT((int *) x)

Macro to byteswap a float variable. x = ptr to variable

#define SWAP_INT (   x)
Value:
*(x) = ((0x000000ff & (*(x))>>24) | \
(0x0000ff00 & (*(x))>>8) | \
(0x00ff0000 & (*(x))<<8) | \
(0xff000000 & (*(x))<<24))

Macro to byteswap an int variable. x = ptr to variable

#define VOTEWINDOWLEN
Value:
5 /* Don't change this number as the code expects 5, or you have to
change the code*/

Function Documentation

int classify ( float *  frame,
mgau_model_t g,
int32  priors[NUMCLASSES],
s3cipid_t map 
)
Parameters:
framethe frame
gmultiple mixture models
priorsThe prior of each classes
mapMap between ci phones and classes
void classw_free ( class_t CLASSW)
class_t* classw_initialize ( char *  mdeffile,
char *  meanfile,
char *  varfile,
float64  varfloor,
char *  mixwfile,
float64  mixwfloor,
int32  precomp,
char *  senmgau 
)
Parameters:
mdeffileThe model def file
meanfileThe mean file
varfileThe variance file
varfloorvariance floor
mixwfileThe mixture weight
mixwfloormixture weight floor
precomppre-computation of values, 0 not to pre-compute, 1 to precompute
senmgauwhether it is SCHMM, ".semi." or FCHMM ".cont."
void majority_class ( class_t CLASSW,
int *  classcount,
int  frame_count 
)
int postclassify ( int *  window,
int  windowlen,
int *  wincap,
int  myclass 
)
int vote ( int *  window,
int  windowlen 
)
Parameters:
windowA window of input
windowlenThe window length