classifier.h
Go to the documentation of this file.00001
00002
00003 #ifndef __SPHINX3_CLASSIFIER_H
00004 #define __SPHINX3_CLASSIFIER_H
00005
00006 #include "s3types.h"
00007 #include "cont_mgau.h"
00008
00009 #ifdef __cplusplus
00010 extern "C" {
00011 #endif
00012 #if 0
00013 }
00014 #endif
00015
00016 #define CEP_LEN 13
00017 #define VOTING_LEN 5
00018 #define CLASS_LATENCY 2
00019 #define CLASS_SILENCE_PRIOR 0.4f
00020 #define CLASS_OWNER_PRIOR 0.4f
00021 #define CLASS_SECONDARY_PRIOR 0.1f
00022 #define CLASS_NOISE_PRIOR 0.1f
00023
00024
00025 enum {
00026 CLASS_NOISE = 0,
00027 CLASS_OWNER,
00028 CLASS_SECONDARY,
00029 CLASS_SILENCE,
00030 NUM_CLASSES
00031 };
00032
00033 enum {
00034 EP_MAYBE = 0,
00035 EP_SILENCE,
00036 EP_SPEECH
00037 };
00038
00039 typedef struct {
00040 mgau_model_t *gmm;
00041 s3cipid_t class_map[NUM_CLASSES];
00042 int32 frame_prob[NUM_CLASSES];
00043 int *cached_classes;
00044 int num_frames;
00045 int max_frames;
00046 int voting_frames[VOTING_LEN];
00047 int post_classify;
00048 int32 prior_prob[NUM_CLASSES] ;
00049
00050 } classifier_t;
00051
00052 typedef struct {
00053 int *endpts;
00054 int num_endpts;
00055 int max_endpts;
00056 int state;
00057 int start_counter;
00058 int cancel_counter;
00059 int end_counter;
00060 int counter;
00061
00062 int pad_cancel;
00063 int pad_leader;
00064 int pad_trailer;
00065 } endptr_t;
00066
00067 int cl_init(classifier_t *_cl, char *_mdef_file, char *_means_file, char *_vars_file,
00068 float64 _var_floor, char *_mix_weights_file,
00069 float64 _mix_weight_floor, char *_gm_type, int _post_classify);
00070 void cl_finish(classifier_t *_cl);
00071 void cl_calc_frame_prob(classifier_t *_cl, float32 *_frame);
00072 int cl_classify_frames(classifier_t *_cl, float32 **_frames, int _num_frames,
00073 int **_classes);
00074
00075 void ep_init(endptr_t *_ep, int _pad_leader, int _pad_trailer,
00076 int _pad_cancel);
00077 void ep_finish(endptr_t *_ep);
00078 int ep_endpoint(endptr_t *_ep, int *_classes, int _num_frames,
00079 int **_endpts);
00080
00081 #if 0
00082 {
00083 #endif
00084 #ifdef __cplusplus
00085 }
00086 #endif
00087
00088 #endif