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/gprune.h>
#include "globalvars.h"

Include dependency graph for outprob.c:

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 ()
boolean outprob_cache_prepare ()
static void outprob_cache_extend (int reqframe)
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 ()
static LOGPROB outprob_cd_nbest (int t, CD_State_Set *lset, HTK_Param *param)
static LOGPROB outprob_cd_max (int t, CD_State_Set *lset, HTK_Param *param)
static LOGPROB outprob_cd_avg (int t, CD_State_Set *lset, HTK_Param *param)
LOGPROB outprob_cd (int t, CD_State_Set *lset, HTK_Param *param)
LOGPROB outprob (int t, HMM_STATE *hmmstate, HTK_Param *param)

Variables

static int statenum
 Local work area that holds total number of HMM states in the HMM definition data.
static LOGPROB ** outprob_cache = NULL
 State-level cache [t][stateid].
static int allocframenum
 Allocated frames of the cache.
static int allocblock
 Allocation block size per allocateion of the cache.
static BMALLOC_BASEcroot
 Root alloc pointer to state outprob cache.
static LOGPROBlast_cache
 Local work are to hold cache list of current time.
static LOGPROBmaxprobs
 Work area that holds N-best state scores for pseudo state set.
static int maxn
 Allocated length of above.


Detailed Description

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

Author:
Akinobu LEE
Date:
Fri Feb 18 18:45:21 2005
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.

Revision
1.5

Definition in file outprob.c.


Function Documentation

boolean outprob_cache_init (  ) 

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

Returns:
TRUE on success, FALSE on failure.

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.

Returns:
TRUE on success, FALSE on failure.

Definition at line 100 of file outprob.c.

Referenced by outprob_prepare().

static void outprob_cache_extend ( int  reqframe  )  [static]

Expand the cache to time axis if needed.

Parameters:
reqframe [in] required frame length

Definition at line 120 of file outprob.c.

Referenced by outprob_state().

void outprob_cache_free (  ) 

Free work area for cache.

Definition at line 159 of file outprob.c.

Referenced by outprob_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.

Returns:
output log probability.

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().

Parameters:
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().

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

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

Parameters:
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 243 of file outprob.c.

Referenced by outprob_cd().

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

Return maximum outprob of the pseudo state set.

Parameters:
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 287 of file outprob.c.

Referenced by outprob_cd().

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

Return average outprob of the pseudo state set.

Parameters:
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 309 of file outprob.c.

Referenced by outprob_cd().

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

Compute the log output probability of a pseudo state set.

Parameters:
t [in] input frame
lset [in] pseudo state set
param [in] input parameter data
Returns:
the computed log output probability.

Definition at line 335 of file outprob.c.

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

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

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

Parameters:
t [in] input frame
hmmstate [in] HMM state
param [in] input parameter data
Returns:
the computed log output probability.

Definition at line 369 of file outprob.c.

Referenced by scan_word(), and viterbi_segment().


Generated on Tue Dec 26 12:55:04 2006 for Julian by  doxygen 1.5.0