libsent/include/sent/htk_param.h File Reference

Structures for storing input speech parameters. More...

#include <sent/stddefs.h>
#include <sent/htk_defs.h>

Go to the source code of this file.

Data Structures

struct  HTK_Param_Header
 Parameter types and extraction conditions. More...
struct  HTK_Param
 Input speech parameter. More...

Defines

#define HTK_PARAM_INCREMENT_STEP_FRAME   200
 Increment step of HTK Parameter holder in frames.

Functions

boolean rdparam (char *, HTK_Param *)
 Top function to read a HTK parameter file.
HTK_Paramnew_param ()
 Allocate a new parameter.
void free_param (HTK_Param *)
 Free the HTK parameter structure.
short param_qualstr2code (char *)
 Convert a qualifier string to a binary type code.
short param_str2code (char *)
 Convert a type string that contains basename and qualifiers to a binary type code.
char * param_qualcode2str (char *, short, boolean)
 Convert the qualifier part of a binary type code to string.
char * param_code2str (char *, short, boolean)
 Convert a binary type code to string.
int guess_basenum (HTK_Param *p, short qualtype)
 Guess the length of the base coefficient according to the total vector length and parameter type.
boolean param_strip_zero (HTK_Param *param)
 Strip zero frames from MFCC data.
void param_init_content (HTK_Param *p)
 Initialize the content of the parameter data.
boolean param_alloc (HTK_Param *p, unsigned int samplenum, short veclen)
 Allocate vector area for required length and frames.
void param_free_content (HTK_Param *p)
 Free and clear the content of the parameter data.
void put_param_head (FILE *fp, HTK_Param_Header *h)
 Output parameter header.
void put_vec (FILE *fp, VECT **p, int num, short veclen)
 Output array of vectors.
void put_param (FILE *fp, HTK_Param *pinfo)
 Output the whole parameter information, including header and all vectors.
void put_param_info (FILE *fp, HTK_Param *pinfo)
 Output the length of an input parameter by number of frames and seconds.


Detailed Description

Structures for storing input speech parameters.

This file defines a structure for holding a vector sequence of input speech parameters. The speech parameter sequence will be stored in HTK_Param. The HTK_Param also holds information about the extraction condition, i.e., frame shift length, window size and so on.

The speech input vector can be read from HTK parameter file, or Julius extracts the parameters directly from input speech. Julius supports extraction of only MFCC format of fixed dimension. More precisely, only parameter type of MFCC_{0|E}_D[_Z][_N] with {25|26} dimensions is supported.

When recognition, the parameter types of both acoustic model and input parameter should be the same. Please note that only the parameter type is checked, and other parameters such as source sampling rate, frame shift length and window sizes will not be checked.

See also:
htk_defs.h
Author:
Akinobu LEE
Date:
Fri Feb 11 02:52:52 2005
Revision
1.1.1.1

Definition in file htk_param.h.


Function Documentation

boolean rdparam ( char *  filename,
HTK_Param pinfo 
)

Top function to read a HTK parameter file.

Parameters:
filename [in] HTK parameter file name
pinfo [in] parameter data (already allocated by new_param())
Returns:
TRUE on success, FALSE on failure.

Definition at line 192 of file rdparam.c.

HTK_Param* new_param (  ) 

Allocate a new parameter.

Returns:
pointer to the newly allocated area.

Definition at line 121 of file param_malloc.c.

Referenced by j_final_fusion(), and mfcc_copy_to_rest_and_shrink().

void free_param ( HTK_Param pinfo  ) 

Free the HTK parameter structure.

Parameters:
pinfo [in] parameter data to be destroyed.

Definition at line 138 of file param_malloc.c.

Referenced by j_mfcccalc_free().

short param_qualstr2code ( char *  s  ) 

Convert a qualifier string to a binary type code.

Parameters:
s [in] a string that contains qualifier strings like "_E_D_Z"
Returns:
the converted internal binary type code, F_ERR_INVALID if failed.

Definition at line 70 of file paramtypes.c.

Referenced by param_str2code().

short param_str2code ( char *  s  ) 

Convert a type string that contains basename and qualifiers to a binary type code.

Parameters:
s [in] a string that contains base and qualifier string like "MFCC_E_D_Z"
Returns:
the converted internal binary type code, F_ERR_INVALID if failed.

Definition at line 106 of file paramtypes.c.

Referenced by read_global_opt().

char* param_qualcode2str ( char *  buf,
short  type,
boolean  descflag 
)

Convert the qualifier part of a binary type code to string.

Parameters:
buf [out] buffer to store the resulting string (must have enough length)
type [in] binary type code to convert.
descflag [in] set to TRUE if you want result in description string instead of qualifier string.
Returns:
buf on success, NULL on failure.

Definition at line 149 of file paramtypes.c.

Referenced by param_code2str(), and select_param_vmark().

char* param_code2str ( char *  buf,
short  type,
boolean  descflag 
)

Convert a binary type code to string.

Parameters:
buf [out] buffer to store the resulting string (must have enough length)
type [in] binary type code to convert.
descflag [in] set to TRUE if you want result in description string instead of base and qualifier string.
Returns:
buf on success, NULL on failure.

Definition at line 178 of file paramtypes.c.

Referenced by param_check_and_adjust(), print_hmmdef_info(), put_param_head(), and select_param_kind().

int guess_basenum ( HTK_Param p,
short  qualtype 
)

Guess the length of the base coefficient according to the total vector length and parameter type.

Parameters:
p [in] parameter data
qualtype [in] parameter type
Returns:
the guessed size of the base coefficient.

Definition at line 133 of file paramselect.c.

Referenced by guess_abs_e_location(), and select_param_vmark().

boolean param_strip_zero ( HTK_Param param  ) 

Strip zero frames from MFCC data.

Parameters:
param [in] parameter data
Returns:
TRUE on success, FALSE on failure.

Definition at line 99 of file strip_mfcc.c.

void param_init_content ( HTK_Param p  ) 

Initialize the content of the parameter data.

Parameters:
p [out] parameter data

Definition at line 35 of file param_malloc.c.

Referenced by new_param(), param_free_content(), and wav2mfcc().

boolean param_alloc ( HTK_Param p,
unsigned int  samplenum,
short  veclen 
)

Allocate vector area for required length and frames.

Allocate memory if not yet, or expand it if already allocated but not sufficient. If sufficient amount is already allocated, do nothing. The allocation are updated by HTK_PARAM_INCREMENT_STEP_FRAME step to avoid numerous re-allocation

Parameters:
p [i/o] parameter data
samplenum [in] required number of frames
veclen [in] required length of vector
Returns:
TRUE on success, FALSE on failure.

Definition at line 54 of file param_malloc.c.

Referenced by init_param(), mfcc_copy_to_rest_and_shrink(), read_param(), RealTimeParam(), RealTimePipeLine(), and wav2mfcc().

void param_free_content ( HTK_Param p  ) 

Free and clear the content of the parameter data.

Parameters:
p [out] parameter data

Definition at line 106 of file param_malloc.c.

Referenced by free_param().

void put_param_head ( FILE *  fp,
HTK_Param_Header h 
)

Output parameter header.

Parameters:
fp [in] file descriptor
h [in] pointer to a parameter header information

Definition at line 237 of file put_htkdata_info.c.

Referenced by put_param().

void put_vec ( FILE *  fp,
VECT **  p,
int  num,
short  veclen 
)

Output array of vectors.

Parameters:
fp [in] file descriptor
p [in] pointer to vector array represented as [0..num-1][0...veclen-1]
num [in] number of vectors in p
veclen [in] length of each vector

Definition at line 255 of file put_htkdata_info.c.

Referenced by put_param().

void put_param ( FILE *  fp,
HTK_Param pinfo 
)

Output the whole parameter information, including header and all vectors.

Parameters:
fp [in] file descriptor
pinfo [in] pointer to parameter structure.

Definition at line 277 of file put_htkdata_info.c.

void put_param_info ( FILE *  fp,
HTK_Param pinfo 
)

Output the length of an input parameter by number of frames and seconds.

Parameters:
fp [in] file descriptor
pinfo [in] pointer to parameter structure.

Definition at line 291 of file put_htkdata_info.c.


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