libsent/src/phmm/outprob.c File Reference

Computation of acoustic likelihood in HMM state, with state-level cache. More...

#include <sent/stddefs.h>
#include <sent/speech.h>
#include <sent/htk_hmm.h>
#include <sent/htk_param.h>
#include <sent/hmm.h>
#include <sent/hmm_calc.h>

Go to the source code of this file.

Defines

#define LOG_UNDEF   (LOG_ZERO - 1)
 Value to be used as the initial cache value.

Functions

boolean outprob_cache_init (HMMWork *wrk)
 Initialize the cache data, should be called once on startup.
boolean outprob_cache_prepare (HMMWork *wrk)
 Prepare cache for the next input, by clearing the existing cache.
static void outprob_cache_extend (HMMWork *wrk, int reqframe)
 Expand the cache to time axis if needed.
void outprob_cache_free (HMMWork *wrk)
 Free work area for cache.
LOGPROB outprob_state (HMMWork *wrk, int t, HTK_HMM_State *stateinfo, HTK_Param *param)
 Compute output probability of a state.
void outprob_cd_nbest_init (HMMWork *wrk, int num)
 Initialize work area for outprob_cd_nbest().
void outprob_cd_nbest_free (HMMWork *wrk)
 Free work area for outprob_cd_nbest().
static LOGPROB outprob_cd_nbest (HMMWork *wrk, int t, CD_State_Set *lset, HTK_Param *param)
 Return average of N-beat outprob for pseudo state set.
static LOGPROB outprob_cd_max (HMMWork *wrk, int t, CD_State_Set *lset, HTK_Param *param)
 Return maximum outprob of the pseudo state set.
static LOGPROB outprob_cd_avg (HMMWork *wrk, int t, CD_State_Set *lset, HTK_Param *param)
 Return average outprob of the pseudo state set.
LOGPROB outprob_cd (HMMWork *wrk, int t, CD_State_Set *lset, HTK_Param *param)
 Compute the log output probability of a pseudo state set.
LOGPROB outprob (HMMWork *wrk, int t, HMM_STATE *hmmstate, HTK_Param *param)
 Top function to compute the output probability of a HMM state.


Detailed Description

Computation of acoustic likelihood in HMM state, with state-level cache.

This file defines functions to compute output log probability of HMM state. Several functions are defined for each state type (whether it is on word edge and a part of pseudo HMM), and all of them calls outprob_state() to get the log probability of a HMM state. The outprob_state() will 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 scores will be cached here. The 2-dimension cache array of state and input frame are used to store the computed scores. They will be expanded when needed. Thus the scores will be cached for all input frame because they will also be used in the 2nd pass of recognition process.

When using a tied-mixture model, codebook-level cache will be also done in addition to this state-level cache. See calc_tied_mix.c for details.

Author:
Akinobu LEE
Date:
Fri Feb 18 18:45:21 2005
Revision
1.1.1.1

Definition in file outprob.c.


Function Documentation

boolean outprob_cache_init ( HMMWork wrk  ) 

Initialize the cache data, should be called once on startup.

Parameters:
wrk [i/o] HMM computation work area
Returns:
TRUE on success, FALSE on failure.

Definition at line 78 of file outprob.c.

Referenced by outprob_init().

boolean outprob_cache_prepare ( HMMWork wrk  ) 

Prepare cache for the next input, by clearing the existing cache.

Parameters:
wrk [i/o] HMM computation work area
Returns:
TRUE on success, FALSE on failure.

Definition at line 96 of file outprob.c.

Referenced by outprob_prepare().

static void outprob_cache_extend ( HMMWork wrk,
int  reqframe 
) [static]

Expand the cache to time axis if needed.

Parameters:
wrk [i/o] HMM computation work area
reqframe [in] required frame length

Definition at line 117 of file outprob.c.

Referenced by outprob_state().

void outprob_cache_free ( HMMWork wrk  ) 

Free work area for cache.

Parameters:
wrk [i/o] HMM computation work area

Definition at line 158 of file outprob.c.

Referenced by outprob_free().

LOGPROB outprob_state ( HMMWork wrk,
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.

Parameters:
wrk [i/o] HMM computation work area
t [in] time frame
stateinfo [in] state information to compute the output probability
param [in] input parameter vectors
Returns:
output log probability.

Definition at line 184 of file outprob.c.

Referenced by next_word(), outprob(), outprob_cd_avg(), outprob_cd_max(), outprob_cd_nbest(), and start_word().

void outprob_cd_nbest_init ( HMMWork wrk,
int  num 
)

Initialize work area for outprob_cd_nbest().

Parameters:
wrk [i/o] HMM computation work area
num [in] number of top states to be calculated.

Definition at line 219 of file outprob.c.

Referenced by outprob_init().

void outprob_cd_nbest_free ( HMMWork wrk  ) 

Free work area for outprob_cd_nbest().

Parameters:
wrk [i/o] HMM computation work area

Definition at line 232 of file outprob.c.

Referenced by outprob_free().

static LOGPROB outprob_cd_nbest ( HMMWork wrk,
int  t,
CD_State_Set lset,
HTK_Param param 
) [static]

Return average of N-beat outprob for pseudo state set.

Parameters:
wrk [i/o] HMM computation work area
t [in] input frame
lset [in] pseudo state set
param [in] input parameter data
Returns:
outprob log probability, average of top N states in lset.

Definition at line 248 of file outprob.c.

Referenced by outprob_cd().

static LOGPROB outprob_cd_max ( HMMWork wrk,
int  t,
CD_State_Set lset,
HTK_Param param 
) [static]

Return maximum outprob of the pseudo state set.

Parameters:
wrk [i/o] HMM computation work area
t [in] input frame
lset [in] pseudo state set
param [in] input parameter data
Returns:
maximum output log probability among states in lset.

Definition at line 293 of file outprob.c.

Referenced by outprob_cd().

static LOGPROB outprob_cd_avg ( HMMWork wrk,
int  t,
CD_State_Set lset,
HTK_Param param 
) [static]

Return average outprob of the pseudo state set.

Parameters:
wrk [i/o] HMM computation work area
t [in] input frame
lset [in] pseudo state set
param [in] input parameter data
Returns:
average output log probability of states in lset.

Definition at line 317 of file outprob.c.

Referenced by outprob_cd().

LOGPROB outprob_cd ( HMMWork wrk,
int  t,
CD_State_Set lset,
HTK_Param param 
)

Compute the log output probability of a pseudo state set.

Parameters:
wrk [i/o] HMM computation work area
t [in] input frame
lset [in] pseudo state set
param [in] input parameter data
Returns:
the computed log output probability.

Definition at line 344 of file outprob.c.

Referenced by next_word(), outprob(), and start_word().

LOGPROB outprob ( HMMWork wrk,
int  t,
HMM_STATE hmmstate,
HTK_Param param 
)

Top function to compute the output probability of a HMM state.

Parameters:
wrk [i/o] HMM computation work area
t [in] input frame
hmmstate [in] HMM state
param [in] input parameter data
Returns:
the computed log output probability.

Definition at line 375 of file outprob.c.

Referenced by scan_word(), and viterbi_segment().


Generated on Tue Dec 18 16:01:40 2007 for Julius by  doxygen 1.5.4