segSpData.h File Reference

Header file of functions used for the input/output of data. More...

Go to the source code of this file.

Data Structures

struct  segUttListItem
 Utterance list items. More...
struct  segUttList
 Utterance list. More...
struct  segAnnData
 An array of the structure variables represents a phone sequence recognised. More...

Defines

#define NO_BREAK   0
 Impossible frame for a phone boundary.
#define POS_BREAK   1
 Possible frame for a phone boundary.
#define FORCE_BREAK   2
 Required frame for a phone boundary.

Typedefs

typedef segUttListItem SEG_UTT_LIST_ITEM
 Utterance list items.
typedef segUttList SEG_UTT_LIST
 Utterance list.
typedef segAnnData SEG_ANN_DATA
 An array of the structure variables represents a phone sequence recognised.

Functions

int segCheckMasterList (SEG_UTT_LIST *uL, int detail)
 Display details of the utterance list for debugging.
int segTime2FrameNum (SEG_UTT_LIST *uL, int winSize, int numVecs)
 Convert annotation times.
int segFreeBreakPoints (int uttVecs, int **breakPt)
 Free memory allocated to break points.
int segFreeMasterList (int totLabs, SEG_UTT_LIST *masterList)
 Free memory space allocated to the master utterance list.
int segReadSpData (double ***spData, FILE *curSpFile, int numVecs, int vecSize)
 Read in the acoustic feature vectors.
int segFreeSpData (int numVecs, double ***spData)
 Free memory space allocated to the current speech data.
int segCheckSpData (int sT, int eT, int vecSize, double **spData)
 Display the speech vectors for debugging.
int segJoinLabels (int *startT, int *endT, char ***labList, FILE *curLabFile, int nLabs)
 Extract overall start and end times of the utterance and loads label names.
int segGetBreakPoints (int **breakPt, int startT, int endT, FILE *curLabFile, int emb, int winSize, int nLabs, int verbose)
 Identify the frames that correspond to the start of a new utterance.
int segCountLabels (FILE *labFile, int numVecs, int winSize)
 Count the number of labels in an annotation file.
int segWriteMLFData (SEG_ANN_DATA *, int, int, FILE *, char *)
 Generate and write new annotations from the classification/recognition output.


Detailed Description

Header file of functions used for the input/output of data.

Date:
05.Jul.2007
Author:
Yoshinori Shiga @ CVSSP, University of Surrey
Note:
This code was originally created on the basis of Martin Russell & P Jackson's SEGVit Ver.3.4.
Revision

Function Documentation

int segCheckMasterList ( SEG_UTT_LIST uL,
int  detail 
)

Display details of the utterance list for debugging.

The index of the utterance, its start time, end time and the number of labels in the utterance are displayed on the screen.

Parameters:
[in] uL Utterance list
[in] detail Level of debugging
Return values:
NO_ERROR Successful execution
Author:
Yoshinori Shiga @ CVSSP, University of Surrey

int segCheckSpData ( 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

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

Count the number of labels in an annotation file.

This function goes through the file for the first time to count the number of labels.

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

int segFreeBreakPoints ( 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

int segFreeMasterList ( 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

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

Free memory space allocated to the current speech data.

The memory allocated to the speech data is freed for all frames.

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

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

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

This function is used to create an array of break points for all frames in the utterance.

Parameters:
[in,out] breakPt Array for the break points
[in] startT Start time of the utterance
[in] endT End time of the utterance
[in] curLabFile File pointer to the current label file
[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:
It will be the start of each label for phone-level processing, for example.
A 'breakPoint' is the start time of a TIMIT label. This function creates an int array breakPt such that breakPt[t] = 1 if t is a breakPoint and 0 otherwise.

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

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

This function goes through the label file for the second time and process the labels.

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

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

Read in the acoustic feature vectors.

Parameters:
[in,out] spData Pointer to a 2D array used to store the vectors
[in,out] curSpFile File pointer to the speech file
[in] numVecs Number of frames in the utterance
[in] vecSize Sample size
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 returns a two dimensional array spData, where spData[t][f] contains coefficient number f of frame number t. 0 <= t < numVecs, 0 <= f < numCoefs
Function segReadAVector() is called internally.
See also:
segReadAVector()

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

Convert annotation times.

Convert the start and end times in nano seconds to appropriate frame indices.

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 converts annotation times from 100ns units (as used by HTK) to frame indeces that (rather quirkily) start from one, and therefore lie in the range of 1 to numVecs, which is the number of frames in the current speechfile.

int segWriteMLFData ( 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


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