segV3Compat.c File Reference

Wrappers compatible with the functions of SEGVit ver.3.4. More...

#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <math.h>
#include "segStdLib.h"
#include "SEGRec.h"
#include "segV3Compat.h"

Functions

int ReadGrammar (char *gramFName, SEG_MODEL_SET models, double **initProb, double ***biProb, double **exitProb)
 Read bigram grammar (bigram posterior probability table).
int MLCheckModelSet (SEG_MODEL_SET *modelSet)
 Check the consistency of model parameter set.
int MLReadModelSet (char *modelList, SEG_MODEL_SET *modelSet, int *longestDur)
 Read a set of multi-level segmental-HMMs in the file of model name list.
int MLWriteModelSet (SEG_MODEL_SET *modelSet, char *dirName)
 Write a set of models to a file.
int MakeStrictLRTopology (SEG_MODEL_SET *modelSet)
 Force models to maintain strict left-to-right topology.
int WriteDump (SEG_MODEL_SET *modelSet, char *fName)
 Write dump file contents.
double ViterbiDecoder (double **spData, int sT, int eT, SEG_SYNTAX synt, SEG_MODEL_SET hmm, int maxDur, SEG_DP_ITEM ***dpMat, double *segProb, int *breakPt)
 Generic Viterbi-type decorder for segmental HMMs.
int FreeDPMat (SEG_DP_ITEM **dpMat, int numStates)
 Free memory space storing all the paths in the trellis.
int * RecoverStateSeq (SEG_SYNTAX syn, SEG_DP_ITEM **dpHist, int numVecs, int *numLabs)
 Recover the optimal state sequence from the path record of node.
SEG_STATE ** RecoverStateIds (SEG_SYNTAX syn, int *stateSeq, int numVecs)
 Recover the sequence of state identities from a state sequence.
SEG_ANN_DATARecoverRecogSeq (SEG_SYNTAX syn, SEG_DP_ITEM **dpMat, int numVecs, int numLabs)
 Recover the model labels and their start and end times.
int FreeStateSeq (int *stateSeq)
 Free memory space of state sequence.
int WriteMLFData (SEG_ANN_DATA recOp, int nLabs, int winSize, FILE *mlfFile, char *labFileName)
 Generate and write new annotations from the classification/recognition output.
int GetDurationLimits (SEG_MODEL_SET models, SEG_SYNTAX synt, int eStates, int *minUttDur, int *maxUttDur)
 Find the minimum and maximum possible durations for a given syntax.
void segSetDecoderParams (SEG_DEC_PARAM dec_param)
 Set decoding parameters.
void segGetDecoderParams (SEG_DEC_PARAM *dec_param)
 Get decoding parameters.
int MLIncrementLinearHMMAccumulators (SEG_STATE **stateId, int *stateSeq, SEG_SYNTAX syn, double **spData, int sT, int eT, int maxDur)
 Increment the reestimation bins, according to the current utterance alignment.
int MLInitialiseHMMAccumulators (SEG_MODEL_SET *hmmSet)
 Initialise reestimation accumulators for the entire set of models.
int MLReestSegModels (SEG_MODEL_SET *hmmSet, double minVar, double slopeRate, double varRate, double durRegParam)
 Reestimate linear segmental-HMM parameters.
int GetSegVitConfig (char *cFile, char *hmmListFile, char *trnFile, int *maxIt, double *stopDiff, char *logFile, char *mlfFile, int *embedTrain, int *maxDur, double *minVar, char *hmmOpDir, int *runType, double *slopeRate, double *varRate, int *verbose, char *aMatFile, char *iMatFile, char *classFile, int *opMats, char *grammarFile, int *LMScale, char **dumpPtr)
 Read SEGRec configuration.
int MakeTrainingSyntax (SEG_UTT_LIST_ITEM utt, SEG_MODEL_SET models, SEG_SYNTAX *synt, int *eStates)
 Create 'forced alignment' syntax (for supervised training and classification).
int MakeRecognitionSyntax (SEG_MODEL_SET models, SEG_SYNTAX *synt, int recogType, double *initProb, double *exitProb, double **biProb, double lmff)
 Create recognition syntax.
int CheckSyn (SEG_MODEL_SET models, SEG_SYNTAX *synt)
 Display the contents of syntax for debugging.
int FreeSyntaxMemory (SEG_SYNTAX *synt, int totStates)
 Free memory allocated to training/recognition syntax.
int CheckMasterList (SEG_UTT_LIST uL, int detail)
 Display details of the utterance list for debugging.
int Time2FrameNum (SEG_UTT_LIST uL, int winSize, int numVecs)
 Convert annotation times.
int FreeBreakPoints (int uttVecs, int **breakPt)
 Free memory allocated to break points.
int FreeMasterList (int totLabs, SEG_UTT_LIST masterList)
 Free memory space allocated to the master utterance list.
int ReadSpData (int numVecs, int vecSize, FILE *curSpFile, double ***spData)
 Read in the acoustic feature vectors.
int FreeSpData (int numVecs, double ***spData)
 Free memory space allocated to the current speech data.
int CheckSpData (int sT, int eT, int vecSize, double **spData)
 Display the speech vectors for debugging.
int JoinLabels (int *startT, int *endT, char ***labList, FILE *curLabFile, int nLabs)
 Extract overall start and end times of the utterance and loads label names.
int GetBreakPoints (int startT, int endT, FILE *curLabFile, int **breakPt, int emb, int winSize, int nLabs, int verbose)
 Identify the frames that correspond to the start of a new utterance.
int CountLabels (FILE *labFile, int numVecs, int winSize)
 Count the number of labels in an annotation file.
int WriteAlignedVectors (FILE *aMatFptr, FILE *iMatFptr, SEG_STATE **stateId, int *stateSeq, SEG_SYNTAX syn, double **spData, int sT, int eT)
 Write out aligned sets of articulatory trajectory values and acoustic vectors.


Detailed Description

Wrappers compatible with the functions of SEGVit ver.3.4.

Date:
15 Jun 2006
09 Jul 2007 (documented)
Author:
Yoshinori Shiga @ CVSSP, University of Surrey
Note:
Functions to make SEGRec's functions compatible with SEGVit's (Ver.3.4).
Revision

Function Documentation

int CheckMasterList ( SEG_UTT_LIST  uL,
int  detail 
)

Display details of the utterance list for debugging.

Parameters:
[in] uL Utterance list
[in] detail Level of debugging
Return values:
NO_ERROR Successful execution
Author:
Yoshinori Shiga @ CVSSP, University of Surrey
Note:
This function is a wrapper compatible with SEGVit ver.3.4, and calls SEGRec's segCheckMasterList() internally.
See also:
segCheckMasterList()

int CheckSpData ( int  sT,
int  eT,
int  vecSize,
double **  spData 
)

Display the speech vectors for debugging.

Parameters:
[in] sT Start time of the utterance
[in] eT End time of the utterance
[in] vecSize Length of acoustic feature vector in bytes
[in] spData Acoustic feature vectors of speech
Return values:
NO_ERROR Successful execution
Author:
Yoshinori Shiga @ CVSSP, University of Surrey
Note:
This function is a wrapper compatible with SEGVit ver.3.4, and calls SEGRec's segCheckSpData() internally.
See also:
segCheckSpData()

int CheckSyn ( SEG_MODEL_SET  models,
SEG_SYNTAX synt 
)

Display the contents of syntax for debugging.

Parameters:
[in] models Model set (pointer to a variable of struct modelSet)
[in] synt Syntax (pointer to a variable of struct syntax)
Returns:
Number of nodes in the syntax
Author:
Yoshinori Shiga @ CVSSP, University of Surrey
Note:
This function is a wrapper compatible with SEGVit ver.3.4, and calls SEGRec's segCheckSyn() internally.
See also:
segCheckSyn()

int CountLabels ( FILE *  labFile,
int  numVecs,
int  winSize 
)

Count the number of labels in an annotation file.

Parameters:
[in] labFile File pointer to the annotation file
[in] numVecs Number of frames
[in] winSize Frame shift size
Returns:
Number of labels in the utterance
Author:
Yoshinori Shiga @ CVSSP, University of Surrey
Note:
This function is a wrapper compatible with SEGVit ver.3.4, and calls SEGRec's segCountLabels() internally.
Attention:
The interface has changed, and now includes the number of frames (numVecs) and the size of frame shift (winSize) for accurate counting.
See also:
segCountLabels()

int FreeBreakPoints ( int  uttVecs,
int **  breakPt 
)

Free memory allocated to break points.

Parameters:
[in] uttVecs Number of utterances
[in] breakPt Pointer to the break point array
Return values:
NO_ERROR Successful execution
Author:
Yoshinori Shiga @ CVSSP, University of Surrey
Note:
This function is a wrapper compatible with SEGVit ver.3.4, and calls SEGRec's segFreeBreakPoints() internally.
See also:
segFreeBreakPoints()

int FreeDPMat ( SEG_DP_ITEM **  dpMat,
int  numStates 
)

Free memory space storing all the paths in the trellis.

Parameters:
[in] dpMat Paths in the trellis for back-tracing
[in] numStates Number of states
Return values:
NO_ERROR Successful execution
Author:
Yoshinori Shiga @ CVSSP, University of Surrey
Note:
This function is a wrapper compatible with SEGVit ver.3.4, and calls SEGRec's segFreeDecoder() internally.
See also:
segFreeDecoder()

int FreeMasterList ( int  totLabs,
SEG_UTT_LIST  masterList 
)

Free memory space allocated to the master utterance list.

Parameters:
[in] totLabs Number of labels in the utterance
[in] masterList Master utterance list
Return values:
NO_ERROR Successful execution
Author:
Yoshinori Shiga @ CVSSP, University of Surrey
Note:
This function is a wrapper compatible with SEGVit ver.3.4, and calls SEGRec's segFreeMasterList() internally.
See also:
segFreeMasterList()

int FreeSpData ( int  numVecs,
double ***  spData 
)

Free memory space allocated to the current speech data.

Parameters:
[in] numVecs Number of frames in the utterance
[in] spData Pointer to memory storing speech data
Return values:
NO_ERROR 
Author:
Yoshinori Shiga @ CVSSP, University of Surrey
Note:
This function is a wrapper compatible with SEGVit ver.3.4, and calls SEGRec's segFreeSpData() internally.
See also:
segFreeSpData()

int FreeStateSeq ( int *  stateSeq  ) 

Free memory space of state sequence.

Parameters:
[in] stateSeq State (index) sequence
Return values:
NO_ERROR Successful execution
Author:
Yoshinori Shiga @ CVSSP, University of Surrey
Note:
This function is a wrapper compatible with SEGVit ver.3.4, and calls SEGRec's segFreeStateSeq() internally.
See also:
segFreeStateSeq()

int FreeSyntaxMemory ( SEG_SYNTAX synt,
int  totStates 
)

Free memory allocated to training/recognition syntax.

Parameters:
[in] synt Syntax
[in] totStates Number of states in the syntax
Return values:
NO_ERROR 
Author:
Yoshinori Shiga @ CVSSP, University of Surrey
Note:
This function is a wrapper compatible with SEGVit ver.3.4, and calls SEGRec's segFreeSyntaxMemory() internally.
See also:
segFreeSyntaxMemory()

int GetBreakPoints ( int  startT,
int  endT,
FILE *  curLabFile,
int **  breakPt,
int  emb,
int  winSize,
int  nLabs,
int  verbose 
)

Identify the frames that correspond to the start of a new utterance.

Parameters:
[in] startT Start time of the utterance
[in] endT End time of the utterance
[in] curLabFile File pointer to the current label file
[in,out] breakPt Array for the break points
[in] emb Training type (supervised/embedded)
[in] winSize Frame shift size
[in] nLabs Number of labels int the utterance
[in] verbose Level of reporting during execution
Return values:
RTN_ERROR Memory allocation error / File read error
otherwise Number of elements in the break point array
Author:
Yoshinori Shiga @ CVSSP, University of Surrey
Note:
This function is a wrapper compatible with SEGVit ver.3.4, and calls SEGRec's segGetBreakPoints() internally.
Attention:
The interface has changed, and now includes the number of labels (nLabs) for the accurate identification of start frames.
See also:
segGetBreakPoints()

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

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

Parameters:
[in] models Model set
[in] synt Syntax
[in] eStates Number of emitting states in the syntax
[in] minUttDur Minimum utterance duration
[in] maxUttDur Maximum utterance duration
Return values:
RTN_ERROR Inconsistency in the models
NO_ERROR Successfully executed
Author:
Yoshinori Shiga @ CVSSP, University of Surrey
Note:
This function is a wrapper compatible with SEGVit ver.3.4, and calls SEGRec's segGetDurationLimits() internally.
See also:
segGetDurationLimits()

int GetSegVitConfig ( char *  cFile,
char *  hmmListFile,
char *  trnFile,
int *  maxIt,
double *  stopDiff,
char *  logFile,
char *  mlfFile,
int *  embedTrain,
int *  maxDur,
double *  minVar,
char *  hmmOpDir,
int *  runType,
double *  slopeRate,
double *  varRate,
int *  verbose,
char *  aMatFile,
char *  iMatFile,
char *  classFile,
int *  opMats,
char *  grammarFile,
int *  LMScale,
char **  dumpPtr 
)

Read SEGRec configuration.

Parameters:
[in] cFile Name of configuration file
[in,out] hmmListFile Name of HMM list file
[in,out] trnFile Name of speech list file
[in,out] maxIt Maximum number of iterations for training
[in,out] stopDiff Fractional threshold to stop iterations
[in,out] logFile Name of log file
[in,out] mlfFile Name of MLF file
[in,out] embedTrain Flag switching supervised or embedded decoding
[in,out] maxDur Maximal segment-duration
[in,out] minVar Variance floor
[in,out] hmmOpDir Name of directory where models are stored
[in,out] runType Flag switching recognition or training
[in,out] slopeRate Update rate for slope parameter
[in,out] varRate Update rate for variance parameter
[in,out] verbose Level of reporting displayed during execution
[in,out] aMatFile Name of file storing acoustic features
[in,out] iMatFile Name of file storing articulatory features
[in,out] classFile Name of class file
[in,out] opMats Variable specifying additional debug info to be output to certain files
[in,out] grammarFile Name of grammar file
[in,out] LMScale Weight for prob from language model against acoustic probabilities
[in,out] dumpPtr Name of dump file
Return values:
ERROR_FOPEN File open error
ERROR_ALLOC Memory allocation error
RTN_ERROR Other errors
otherwise Number of parameters read
Author:
Yoshinori Shiga @ CVSSP, University of Surrey
Note:
This function is a wrapper compatible with SEGVit ver.3.4, and calls SEGRec's segReadConfig() and segFreeConfig() internally.
See also:
segReadConfig() and segFreeConfig()

int JoinLabels ( int *  startT,
int *  endT,
char ***  labList,
FILE *  curLabFile,
int  nLabs 
)

Extract overall start and end times of the utterance and loads label names.

Parameters:
[in,out] startT Start time of the utterance
[in,out] endT End time of the utterance
[in,out] labList Pointer to the label name list
[in] curLabFile File pointer to the current label file
[in] nLabs Number of labels in the utterance
Return values:
RTN_ERROR Memory allocation error / File read error
otherwise Index of the last label in the file
Author:
Yoshinori Shiga @ CVSSP, University of Surrey
Note:
This function is a wrapper compatible with SEGVit ver.3.4, and calls SEGRec's segJoinLabels() internally.
See also:
segJoinLabels()

int MakeRecognitionSyntax ( SEG_MODEL_SET  models,
SEG_SYNTAX synt,
int  recogType,
double *  initProb,
double *  exitProb,
double **  biProb,
double  lmff 
)

Create recognition syntax.

Parameters:
[in] models Set of models with model parameters
[in,out] synt Syntax to be built
[in] recogType Type of testing (RECOGNITION or CLASSIFICATION)
[in] initProb Entry costs for the models
[in] exitProb Exit costs for the models
[in] biProb N-gram posterior probabilities table
[in] lmff Scale factor for the language model
Return values:
RTN_ERROR Memory allocation error / Inconsistency between models
otherwise Number of nodes in the syntax
Author:
Yoshinori Shiga @ CVSSP, University of Surrey
Note:
This function is a wrapper compatible with SEGVit ver.3.4, and calls SEGRec's segMakeRecognitionSyntax() internally.
Attention:
Use segMakeRecognitionSyntax() instead. The SEGVit compatible function MakeRecognitionSyntax() is no longer supplied, because the old interface cannot deal with the context-sensitive models of SEGRec.
See also:
segMakeRecognitionSyntax()

int MakeStrictLRTopology ( SEG_MODEL_SET modelSet  ) 

Force models to maintain strict left-to-right topology.

Parameters:
[in,out] modelSet Pointer to a struct variable for the model set
Return values:
NO_ERROR Successful execution
Author:
Yoshinori Shiga @ CVSSP, University of Surrey
Note:
This function is a wrapper compatible with SEGVit ver.3.4, and calls SEGRec's segMakeStrictLRTopology() internally.
See also:
segMakeStrictLRTopology()

int MakeTrainingSyntax ( SEG_UTT_LIST_ITEM  utt,
SEG_MODEL_SET  models,
SEG_SYNTAX synt,
int *  eStates 
)

Create 'forced alignment' syntax (for supervised training and classification).

Parameters:
[in] utt Utterance
[in] models Set of models with model parameters
[in,out] synt Syntax to be built
[in,out] eStates Number of emitting states
Return values:
RTN_ERROR Memory allocation error / Inconsistency between models
otherwise Number of nodes in the syntax
Author:
Yoshinori Shiga @ CVSSP, University of Surrey
Note:
This function is a wrapper compatible with SEGVit ver.3.4, and calls SEGRec's segMakeTrainingSyntax() internally.
See also:
segMakeTrainingSyntax()

int MLCheckModelSet ( SEG_MODEL_SET modelSet  ) 

Check the consistency of model parameter set.

Parameters:
[in] modelSet Pointer to a struct variable for the model set
Return values:
NO_ERROR Successful execution
RTN_ERROR Inconsistency found in the set
Author:
Yoshinori Shiga @ CVSSP, University of Surrey
Note:
This function is a wrapper compatible with SEGVit ver.3.4, and calls SEGRec's segCheckModelSet() internally.
See also:
segCheckModelSet()

int MLIncrementLinearHMMAccumulators ( SEG_STATE **  stateId,
int *  stateSeq,
SEG_SYNTAX  syn,
double **  spData,
int  sT,
int  eT,
int  maxDur 
)

Increment the reestimation bins, according to the current utterance alignment.

Parameters:
[in,out] stateId Array of state IDs of the best state-sequence
[in] stateSeq The best state sequence
[in] syn Syntax
[in] spData Acoustic feature vectors of speech data
[in] sT Start time of the utterance
[in] eT End time of the utterance
[in] maxDur Maximum segment duration
Return values:
RTN_ERROR Memory allocation error
NO_ERROR Successfully executed
Author:
Yoshinori Shiga @ CVSSP, University of Surrey
Note:
This function is a wrapper compatible with SEGVit ver.3.4, and calls SEGRec's segIncrementLinearHMMAccumulators() internally.
See also:
segIncrementLinearHMMAccumulators()

int MLInitialiseHMMAccumulators ( SEG_MODEL_SET hmmSet  ) 

Initialise reestimation accumulators for the entire set of models.

Parameters:
[in,out] hmmSet Model set
Returns:
NO_ERROR Successfully executed
Author:
Yoshinori Shiga @ CVSSP, University of Surrey
Note:
This function is a wrapper compatible with SEGVit ver.3.4, and calls SEGRec's segInitialiseHMMAccumulators() internally.
See also:
segInitialiseHMMAccumulators()

int MLReadModelSet ( char *  modelList,
SEG_MODEL_SET modelSet,
int *  longestDur 
)

Read a set of multi-level segmental-HMMs in the file of model name list.

Parameters:
[in] modelList Name of model-name list file
[in,out] modelSet Model set
[in] longestDur Maximal segment-duration
Return values:
RTN_ERROR Error
otherwise Dimension of the intermediate features
Author:
Yoshinori Shiga @ CVSSP, University of Surrey
Note:
This function is a wrapper compatible with SEGVit ver.3.4, and calls SEGRec's segReadModelSet() internally.
Logical and physical models are set to have the same labels and model parameters, because SEGVit cannot handle "tied list" for context-sensitive phones. Use segReadModelSet() instead, to deal with logical models different from physical models.
See also:
segReadModelSet()

int MLReestSegModels ( SEG_MODEL_SET hmmSet,
double  minVar,
double  slopeRate,
double  varRate,
double  durRegParam 
)

Reestimate linear segmental-HMM parameters.

Parameters:
[in,out] hmmSet Model set
[in] minVar Variance floor
[in] slopeRate Update rate of slope in comparison to the mean
[in] varRate Update rate of variance in comparison to the mean
[in] durRegParam Regularisation parameter for the durational model
Return values:
NO_ERROR Successfully executed
RTN_ERROR Too small number of samples for the model
Author:
Yoshinori Shiga @ CVSSP, University of Surrey
Note:
This function is a wrapper compatible with SEGVit ver.3.4, and calls SEGRec's segReestSegModels() internally.
See also:
segReestSegModels()

int MLWriteModelSet ( SEG_MODEL_SET modelSet,
char *  dirName 
)

Write a set of models to a file.

Parameters:
[in] modelSet Pointer to the model-set structure variable
[in] dirName Name of directory where the models are saved
Return values:
RTN_ERROR Memory allocation error / File write error
NO_ERROR Successful execution
Author:
Yoshinori Shiga @ CVSSP, University of Surrey
Note:
This function is a wrapper compatible with SEGVit ver.3.4, and calls SEGRec's segWriteModelSet() internally. It outputs the current models to the specified directory.
See also:
segWriteModelSet()

int ReadGrammar ( char *  gramFName,
SEG_MODEL_SET  models,
double **  initProb,
double ***  biProb,
double **  exitProb 
)

Read bigram grammar (bigram posterior probability table).

Parameters:
[in] gramFName Name of the grammar file
[in] models Model set
[in,out] initProb Entry costs for the models
[in,out] biProb N-gram posterior probabilities table
[in,out] exitProb Exit costs for the models
Return values:
RTN_ERROR File open/read error / Memory allocation error
NO_ERROR Successfully executed
Author:
Yoshinori Shiga @ CVSSP, University of Surrey
Note:
This function is a wrapper compatible with SEGVit ver.3.4, and calls SEGRec's segReadGrammar() internally.
See also:
segReadGrammar()

int ReadSpData ( int  numVecs,
int  vecSize,
FILE *  curSpFile,
double ***  spData 
)

Read in the acoustic feature vectors.

Parameters:
[in] numVecs Number of frames in the utterance
[in] vecSize Sample size
[in,out] curSpFile File pointer to the speech file
[in,out] spData Pointer to a 2D array used to store the vectors
Return values:
RTN_ERROR Memory allocation error
totRead Total number of items in the speech file that are read
Author:
Yoshinori Shiga @ CVSSP, University of Surrey
Note:
This function is a wrapper compatible with SEGVit ver.3.4, and calls SEGRec's segReadSpData() internally.
See also:
segReadSpData()

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

Recover the model labels and their start and end times.

Parameters:
[in] syn Syntax
[in] dpMat Paths in the trellis for back-tracing
[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 segAnnData variables each of which contains a label, and start and end times.
Author:
Yoshinori Shiga @ CVSSP, University of Surrey
Note:
This function is a wrapper compatible with SEGVit ver.3.4, and calls SEGRec's segRecoverRecogSeq() internally.
See also:
segRecoverRecogSeq()

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

Recover the sequence of state identities from a state sequence.

Parameters:
[in] syn Syntax
[in] stateSeq State sequence
[in] numVecs Number of frames in the utterance
Return values:
NULL Memory allocation error
otherwise Pointer to the array of struct segStateInfo pointers
Author:
Yoshinori Shiga @ CVSSP, University of Surrey
Note:
This function is a wrapper compatible with SEGVit ver.3.4, and calls SEGRec's segRecoverStateIds() internally.
See also:
segRecoverStateIds()

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

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

Parameters:
[in] syn Syntax
[in] dpHist Paths in the trellis for back-tracing
[in] numVecs Number of frames in the utterance
[in,out] numLabs Number of models in the sequence recovered
Return values:
NULL Memory allocation error
Otherwise Pointer to the array of state sequence recovered
Author:
Yoshinori Shiga @ CVSSP, University of Surrey
Note:
This function is a wrapper compatible with SEGVit ver.3.4, and calls SEGRec's segRecoverStateSeq() internally.
See also:
segRecoverStateSeq()

void segGetDecoderParams ( SEG_DEC_PARAM dec_param  ) 

Get decoding parameters.

Parameters:
[in] dec_param Struct variable of decoding parameters
Returns:
No return value
Author:
Yoshinori Shiga @ CVSSP, University of Surrey
Note:
This function provides the way of setting decoding parameters in the framework of SEGVit ver.3.4, where those parameters cannot be given as an input argument of the decoder.

void segSetDecoderParams ( SEG_DEC_PARAM  dec_param  ) 

Set decoding parameters.

Parameters:
[in] dec_param Struct variable of decoding parameters
Returns:
No return value
Author:
Yoshinori Shiga @ CVSSP, University of Surrey
Note:
This function provides the way of setting decoding parameters in the framework of SEGVit ver.3.4, where those parameters cannot be given as an input argument of the decoder.

int Time2FrameNum ( SEG_UTT_LIST  uL,
int  winSize,
int  numVecs 
)

Convert annotation times.

Parameters:
[in,out] uL Utterance list
[in] winSize Size of window (ms) used in processing speech data
[in] numVecs Number of frames in the utterance
Return values:
NO_ERROR Successful execution
Author:
Yoshinori Shiga @ CVSSP, University of Surrey
Note:
This function is a wrapper compatible with SEGVit ver.3.4, and calls SEGRec's segTime2FrameNum() internally.
See also:
segTime2FrameNum()

double ViterbiDecoder ( double **  spData,
int  sT,
int  eT,
SEG_SYNTAX  synt,
SEG_MODEL_SET  hmm,
int  maxDur,
SEG_DP_ITEM ***  dpMat,
double *  segProb,
int *  breakPt 
)

Generic Viterbi-type decorder for segmental HMMs.

Parameters:
[in] spData Acoustic feature vectors
[in] sT Utterance start time (frame No)
[in] eT Utterance end time (frame No)
[in] synt Syntax
[in] hmm Model set
[in] maxDur Maximum segment-duration
[out] dpMat Paths in the trellis for back-tracing
[out] segProb Output probabilities for SHMMs
[in] breakPt Break point attributes
Return values:
RTN_ERROR Memory allocation error
Otherwise The best cost (min probability) computed
Author:
Yoshinori Shiga @ CVSSP, University of Surrey
Note:
This function is a wrapper compatible with SEGVit ver.3.4, and calls SEGRec's segViterbiDecoder() internally.
See also:
segViterbiDecoder

int WriteAlignedVectors ( FILE *  aMatFptr,
FILE *  iMatFptr,
SEG_STATE **  stateId,
int *  stateSeq,
SEG_SYNTAX  syn,
double **  spData,
int  sT,
int  eT 
)

Write out aligned sets of articulatory trajectory values and acoustic vectors.

Parameters:
[in] aMatFptr File pointer to the acoustic feature file
[in] iMatFptr File pointer to the articulatory feature file
[in] stateId Array of state identities of the best state sequence
[in] stateSeq Best state-number sequence
[in] syn Syntax
[in] spData Feature vectors of actual speech
[in] sT Start time (frame) of the utterance
[in] eT End time (frame) of the utterance
Return values:
RTN_ERROR Memory allocation error
NO_ERROR Successfully executed
Author:
Yoshinori Shiga @ CVSSP, University of Surrey
Note:
This function is a wrapper compatible with SEGVit ver.3.4, and calls SEGRec's segWriteAlignedVectors() internally.
See also:
segWriteAlignedVectors()

int WriteDump ( SEG_MODEL_SET modelSet,
char *  fName 
)

Write dump file contents.

Parameters:
[in] modelSet Pointer to the model-set structure variable
[in] fName Name of dump file
Return values:
RTN_ERROR File open error
NO_ERROR Successful execution
Author:
Yoshinori Shiga @ CVSSP, University of Surrey
Note:
This function is a wrapper compatible with SEGVit ver.3.4, and calls SEGRec's segWriteDump() internally.
See also:
segWriteDump()

int WriteMLFData ( SEG_ANN_DATA  recOp,
int  nLabs,
int  winSize,
FILE *  mlfFile,
char *  labFileName 
)

Generate and write new annotations from the classification/recognition output.

Parameters:
[in] recOp Array of struct annData variables
[in] nLabs Number of labels in the utterance
[in] winSize Size of the window (ms) used in processing speech data
[in] mlfFile File pointer to a MLF file
[in] labFileName Name of the label file
Return values:
RTN_ERROR File write error
NO_ERROR Successful execution
Author:
Yoshinori Shiga @ CVSSP, University of Surrey
Note:
This function is a wrapper compatible with SEGVit ver.3.4, and calls SEGRec's segWriteMLFData() internally.
See also:
segWriteMLFData()


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