#include <sent/stddefs.h>
#include <sent/htk_hmm.h>
#include <sent/htk_param.h>
Include dependency graph for hmm.h:
This graph shows which files directly or indirectly include this file:
Go to the source code of this file.
Data Structures | |
struct | _a_cell |
Transition arc of HMM state. More... | |
struct | HMM_STATE |
HMM State More... | |
struct | HMM |
HMM state sequence More... | |
struct | _seg_token |
Typedefs | |
typedef _a_cell | A_CELL |
Transition arc of HMM state. | |
typedef _seg_token | SEGTOKEN |
Functions | |
HMM * | new_make_word_hmm (HTK_HMM_INFO *, HMM_Logical **, int) |
HMM * | new_make_word_hmm_with_lm (HTK_HMM_INFO *, HMM_Logical **, int, LOGPROB *) |
void | free_hmm (HMM *) |
LOGPROB | viterbi_segment (HMM *hmm, HTK_Param *param, int *endstates, int ulen, int **id_ret, int **seg_ret, LOGPROB **uscore_ret, int *retlen) |
Perform Viterbi alignment. | |
void | make_log_tbl () |
Generate a value tables of ![]() | |
LOGPROB | addlog (LOGPROB x, LOGPROB y) |
LOGPROB | addlog_array (LOGPROB *x, int n) |
boolean | outprob_init (HTK_HMM_INFO *hmminfo, HTK_HMM_INFO *gshmm, int gms_num, int gprune_method, int gprune_mixnum) |
boolean | outprob_prepare (int framenum) |
void | outprob_free () |
boolean | outprob_cache_init () |
boolean | outprob_cache_prepare () |
void | outprob_cache_free () |
LOGPROB | outprob_state (int t, HTK_HMM_State *stateinfo, HTK_Param *param) |
Compute output probability of a state. | |
void | outprob_cd_nbest_init (int num) |
void | outprob_cd_nbest_free () |
LOGPROB | outprob_cd (int t, CD_State_Set *lset, HTK_Param *param) |
LOGPROB | outprob (int t, HMM_STATE *hmmstate, HTK_Param *param) |
boolean | gms_init (int nbest) |
boolean | gms_prepare (int framelen) |
void | gms_free () |
LOGPROB | gms_state () |
void | gms_gprune_init (HTK_HMM_INFO *hmminfo, int gsset_num) |
void | gms_gprune_prepare () |
void | gms_gprune_free () |
void | compute_gs_scores (GS_SET *gsset, int gsset_num, LOGPROB *scores_ret) |
LOGPROB | calc_mix () |
Compute the output probability of current state OP_State. | |
boolean | calc_tied_mix_init () |
boolean | calc_tied_mix_prepare (int framenum) |
void | calc_tied_mix_free () |
LOGPROB | calc_tied_mix () |
Compute the output probability of current state OP_State on tied-mixture model. | |
void | put_hmm_arc (HMM *d) |
void | put_hmm_outprob (HMM *d) |
void | put_hmm (HMM *d) |
Definition in file hmm.h.
typedef struct _seg_token SEGTOKEN |
Token definition for viterbi segmentation.
HMM* new_make_word_hmm | ( | HTK_HMM_INFO * | hmminfo, | |
HMM_Logical ** | hdseq, | |||
int | hdseqlen | |||
) |
Make a HMM instance for recognition from phoneme sequence.
hmminfo | [in] HTK HMM definitions data | |
hdseq | [in] phoneme sequence as given by pointer list of logical HMM | |
hdseqlen | [in] length of above |
Definition at line 362 of file mkwhmm.c.
Referenced by do_align(), and scan_word().
HMM* new_make_word_hmm_with_lm | ( | HTK_HMM_INFO * | hmminfo, | |
HMM_Logical ** | hdseq, | |||
int | hdseqlen, | |||
LOGPROB * | lscore | |||
) |
Make a HMM instance for recognition from phoneme sequence, with connection probabiliry given for each phoneme.
hmminfo | [in] HTK HMM definitions data | |
hdseq | [in] phoneme sequence as given by pointer list of logical HMM | |
hdseqlen | [in] length of above | |
lscore | [in] list of log probability to be added at the emitting transition of each phoneme, or NULL if not needed. |
Definition at line 102 of file mkwhmm.c.
Referenced by new_make_word_hmm().
void free_hmm | ( | HMM * | d | ) |
LOGPROB viterbi_segment | ( | HMM * | hmm, | |
HTK_Param * | param, | |||
int * | endstates, | |||
int | ulen, | |||
int ** | id_ret, | |||
int ** | seg_ret, | |||
LOGPROB ** | uscore_ret, | |||
int * | slen_ret | |||
) |
Perform Viterbi alignment.
This function performs viterbi alignment for the given sentence HMM, input parameter and unit definition. Any segmentatino unit (word, phoneme state, etc.) is allowed: the segmentation unit should be specified by specifying a list of state id which are the end of each unit. For example, if you want to obtain phoneme alignment, the list of state number that exist at the end of phones should be specified by endstates.
hmm | [in] sentence HMM to be matched | |
param | [in] input parameter data | |
endstates | [in] list of state id that corrsponds to the ends of units | |
ulen | [in] total number of units in the hmm | |
id_ret | [out] Pointer to store the newly allocated array of the resulting id sequence of units on the best path. | |
seg_ret | [out] Pointer to store the newly allocated array of the resulting end frame of each unit on the best path. | |
uscore_ret | [out] Pointer to store the newly allocated array of the resulting score at the end frame of each unit on the best path. | |
slen_ret | [out] Pointer to store the total number of units on the best path. |
Definition at line 50 of file vsegment.c.
Referenced by do_align().
void make_log_tbl | ( | ) |
Generate a value tables of .
is from 0 to (- VRANGE), and table size is TBLSIZE.
Definition at line 41 of file addlog.c.
Referenced by outprob_init().
Rapid computation of .
a | [in] array of log values | |
n | [in] length of above |
Definition at line 102 of file addlog.c.
Referenced by calc_mix(), calc_tied_mix(), and gmm_calc_mix().
boolean outprob_init | ( | HTK_HMM_INFO * | hmminfo, | |
HTK_HMM_INFO * | gshmm, | |||
int | gms_num, | |||
int | gprune_method, | |||
int | gprune_mixnum | |||
) |
Initialize and setup acoustic computation functions.
select functions
Definition at line 62 of file outprob_init.c.
Referenced by final_fusion().
boolean outprob_prepare | ( | int | framenum | ) |
Prepare for the next input of given frame length.
framenum | [in] input length in frame. |
Definition at line 158 of file outprob_init.c.
Referenced by main_recognition_loop(), and RealTimePipeLinePrepare().
void outprob_free | ( | ) |
Free all work area for outprob computation.
Definition at line 177 of file outprob_init.c.
boolean outprob_cache_init | ( | ) |
Initialize the cache data, should be called once on startup.
Definition at line 82 of file outprob.c.
Referenced by outprob_init().
boolean outprob_cache_prepare | ( | ) |
Prepare cache for the next input, by clearing the existing cache.
Definition at line 100 of file outprob.c.
Referenced by outprob_prepare().
void outprob_cache_free | ( | ) |
LOGPROB outprob_state | ( | int | t, | |
HTK_HMM_State * | stateinfo, | |||
HTK_Param * | param | |||
) |
Compute output probability of a state.
Set the needed values to the global variables that begins with "OP_", and call calc_outprob_state(). The calc_outprob_state() is actually a function pointer, and the entity is either calc_tied_mix() for tied-mixture model and calc_mix() for others. (If you use GMS, the entity will be gms_state() instead.)
The state-level cache is also consulted here.
Definition at line 180 of file outprob.c.
Referenced by outprob(), outprob_cd_avg(), outprob_cd_max(), outprob_cd_nbest(), outprob_style(), and start_word().
void outprob_cd_nbest_init | ( | int | num | ) |
Initialize work area for outprob_cd_nbest().
num | [in] number of top states to be calculated. |
Definition at line 217 of file outprob.c.
Referenced by outprob_init().
void outprob_cd_nbest_free | ( | ) |
Free work area for outprob_cd_nbest().
Definition at line 228 of file outprob.c.
Referenced by outprob_free().
LOGPROB outprob_cd | ( | int | t, | |
CD_State_Set * | lset, | |||
HTK_Param * | param | |||
) |
Compute the log output probability of a pseudo state set.
t | [in] input frame | |
lset | [in] pseudo state set | |
param | [in] input parameter data |
Definition at line 335 of file outprob.c.
Referenced by outprob(), outprob_style(), and start_word().
Top function to compute the output probability of a HMM state.
t | [in] input frame | |
hmmstate | [in] HMM state | |
param | [in] input parameter data |
Definition at line 369 of file outprob.c.
Referenced by scan_word(), and viterbi_segment().
boolean gms_init | ( | int | nbest | ) |
Initialize the GMS related functions and data.
nbest | [in] N-best state to compute the precise triphone. |
Definition at line 282 of file gms.c.
Referenced by outprob_init().
boolean gms_prepare | ( | int | framenum | ) |
Setup GMS parameters for next input.
framenum | [in] length of next input in frames |
Definition at line 332 of file gms.c.
Referenced by outprob_prepare().
void gms_free | ( | ) |
LOGPROB gms_state | ( | ) |
Get HMM State probability of current state with Gaussiam Mixture Selection.
If the GMS HMM score of the corresponding basephone is below the N-best, the triphone score will not be computed, and the score of the GMS HMM will be returned instead as a fallback score. Else, the precise triphone will be computed and returned.
Definition at line 392 of file gms.c.
Referenced by outprob_init().
void gms_gprune_init | ( | HTK_HMM_INFO * | hmminfo, | |
int | gsset_num | |||
) |
Initialization of GMS HMM likelihood computation.
hmminfo | [in] GMS HMM definition | |
gsset_num | [in] number of states in GMS HMM |
Definition at line 60 of file gms_gprune.c.
Referenced by gms_init().
void gms_gprune_prepare | ( | ) |
Prepare GMS HMM computation for the next speech input.
Definition at line 75 of file gms_gprune.c.
Referenced by gms_prepare().
void gms_gprune_free | ( | ) |
Main function to compute all the GMS HMM states in a frame with the input vectore specified by OP_vec. This function assumes that this will be called for sequencial frame, since it utilizes the result of previous frame for faster pruning.
gsset | [in] list of GMS HMM state set. | |
gsset_num | [in] length of above | |
scores_ret | [out] array of scores for each GMS HMM state |
Definition at line 306 of file gms_gprune.c.
Referenced by do_gms().
LOGPROB calc_mix | ( | ) |
Compute the output probability of current state OP_State.
No codebook-level cache is done.
Definition at line 39 of file calc_mix.c.
Referenced by outprob_init().
boolean calc_tied_mix_init | ( | ) |
Initialize codebook cache area.
Definition at line 57 of file calc_tied_mix.c.
Referenced by outprob_init().
boolean calc_tied_mix_prepare | ( | int | framenum | ) |
Setup codebook cache for the next incoming input.
framenum | [in] length of the next input. |
Definition at line 73 of file calc_tied_mix.c.
Referenced by outprob_prepare().
void calc_tied_mix_free | ( | ) |
Free work area for tied-mixture calculation.
Definition at line 113 of file calc_tied_mix.c.
Referenced by outprob_free().
LOGPROB calc_tied_mix | ( | ) |
Compute the output probability of current state OP_State on tied-mixture model.
This function assumes that the OP_state is assigned to a tied-mixture codebook. Here the output probability of Gaussian mixture component referred by OP_state is consulted to the book level cache, and if not computed yet on that input frame time, it will be computed here.
Definition at line 138 of file calc_tied_mix.c.
Referenced by outprob_init().
void put_hmm_arc | ( | HMM * | d | ) |
Output transition arcs of an HMM instance.
d | [in] pointer to a HMM instance. |
Definition at line 160 of file put_htkdata_info.c.
Referenced by put_hmm().
void put_hmm_outprob | ( | HMM * | d | ) |
Output output probability information of an HMM instance.
d | [in] pointer to a HMM instance. |
Definition at line 183 of file put_htkdata_info.c.
Referenced by put_hmm().
void put_hmm | ( | HMM * | d | ) |
Output an HMM instance.
d | [in] pointer to a HMM instance. |
Definition at line 204 of file put_htkdata_info.c.