segRecovSeq.c File Reference

Recovery of various sequences from the path record of each node produced by the decoder. More...

#include <stdio.h>
#include <stdlib.h>
#include "segCommon.h"
#include "segStdLib.h"
#include "segDecoder.h"

Functions

int * segRecoverStateSeq (int *numLabs, SEG_DP_ITEM **dpHist, SEG_SYNTAX *syn, int numVecs)
 Recover the optimal state sequence from the path record of node.
SEG_STATE ** segRecoverStateIds (int *stateSeq, SEG_SYNTAX *syn, int numVecs)
 Recover the sequence of state identities from a state sequence.
SEG_ANN_DATAsegRecoverRecogSeq (SEG_DP_ITEM **dpMat, SEG_SYNTAX *syn, int numVecs, int numLabs)
 Recover the model labels and their start and end times.
void segFreeStateSeq (int *stateSeq)
 Free memory space of state sequence.
int segGetDurationLimits (int *minUttDur, int *maxUttDur, SEG_MODEL_SET *models, SEG_SYNTAX *synt, int eStates)
 Find the minimum and maximum possible durations for a given syntax.


Detailed Description

Recovery of various sequences from the path record of each node produced by the decoder.

Date:
04/07/2007
Author:
Yoshinori Shiga @ CVSSP, University of Surrey
Note:
This code is written based on M Russell and P Jackson's SEGVit ver.3.4.
Revision

Function Documentation

void segFreeStateSeq ( int *  stateSeq  ) 

Free memory space of state sequence.

Parameters:
[in] stateSeq State (index) sequence
Returns:
No return value
Author:
Yoshinori Shiga @ CVSSP, University of Surrey

int segGetDurationLimits ( int *  minUttDur,
int *  maxUttDur,
SEG_MODEL_SET models,
SEG_SYNTAX synt,
int  eStates 
)

Find the minimum and maximum possible durations for a given syntax.

Parameters:
[in] minUttDur Minimum utterance duration
[in] maxUttDur Maximum utterance duration
[in] models Model set
[in] synt Syntax
[in] eStates Number of emitting states in the syntax
Return values:
RTN_ERROR Inconsistency in the models
NO_ERROR Successfully executed
Author:
Yoshinori Shiga @ CVSSP, University of Surrey
Note:
This function finds the minimum and maximum possible durations for a given syntax, based on passing through all emitting states in sequence. Thus, the minimum duration is equal to the number of emitting states' maximum duration. At present, this function does not take account of any skips or self loops, but the maximum duration of -1 is reserved for models of possibly infinite duration.

SEG_ANN_DATA* segRecoverRecogSeq ( SEG_DP_ITEM **  dpMat,
SEG_SYNTAX syn,
int  numVecs,
int  numLabs 
)

Recover the model labels and their start and end times.

This function traces back through the DP matrix to obtain the model labels and their start and end times (in frame), ready to write them out in the master label file.

Parameters:
[in] dpMat Paths in the trellis for back-tracing
[in] syn Syntax
[in] numVecs Number of frames in the sequence
[in] numLabs Number of models in the sequence
Return values:
NULL Memory allocation error
otherwise Pointer to the array of struct annData variables each of which contains a label, and start and end times.
Author:
Yoshinori Shiga @ CVSSP, University of Surrey
Note:
The first start time is always one but, for classification, the other times are as in the input label file rounded down to the nearest frame.
The purpose of this function is to create a structure in memory which corresponds to the label file which corresponds to the optimal state sequence. In other words, the i-th entry of this array consists of a structure which specifies the start time, end time and label of the i-th label (i.e., model) in the optimal decoding. This structure is the basis of the output for recognition.

SEG_STATE** segRecoverStateIds ( int *  stateSeq,
SEG_SYNTAX syn,
int  numVecs 
)

Recover the sequence of state identities from a state sequence.

This function returns the state identities (as pointers to states) of the best state sequence obtained by segRecoverStateSeq().

Parameters:
[in] stateSeq State sequence
[in] syn Syntax
[in] numVecs Number of frames in the utterance
Return values:
NULL Memory allocation error
otherwise Pointer to the array of struct stateInfo pointers
Author:
Yoshinori Shiga @ CVSSP, University of Surrey
Note:
The purpose of this function is to create an array, one entry for each observation vector, such that the t-th entry is a pointer to the HMM state which corresponds to the syntax state at this point on the optimal state sequence. This is useful for re-estimation because it sets up a correspondence between each acoustic vector and the HMM state which it will contribute to for reestimation.
The previous fuction, segRecoverStateSeq(), recovers the indices of the optimal state sequence relative to the syntax. This is stored as an array of ints. The purpose of this function is to convert this sequence of ints into a sequence of pointers to states of actual models.

int* segRecoverStateSeq ( int *  numLabs,
SEG_DP_ITEM **  dpHist,
SEG_SYNTAX syn,
int  numVecs 
)

Recover the optimal state sequence from the path record of node.

This function is used to find the best state sequence by tracing back through the DP matrix with path record of each node in the trellis.

Parameters:
[in,out] numLabs Number of models in the sequence recovered
[in] dpHist Paths in the trellis for back-tracing
[in] syn Syntax
[in] numVecs Number of frames in the utterance
Return values:
NULL Memory allocation error
Otherwise Pointer to the array of state sequence recovered
Author:
Yoshinori Shiga @ CVSSP, University of Surrey
Note:
The number of states in the recovered sequence is equal to the number of frames in the utterance. Each element in the sequence is the state number (index) of the corresponding emitting node, and all null states are discarded. This is used for training the model.
See also:
segRecoverStateIds(), segRecoverRecogSeq()


Generated on Sun Aug 5 02:40:40 2007 for SEGRec Version 1.0 by  doxygen 1.5.1