#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_Param * | new_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. |
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.
Definition in file htk_param.h.
boolean rdparam | ( | char * | filename, | |
HTK_Param * | pinfo | |||
) |
Top function to read a HTK parameter file.
filename | [in] HTK parameter file name | |
pinfo | [in] parameter data (already allocated by new_param()) |
HTK_Param* new_param | ( | ) |
Allocate a new parameter.
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.
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.
s | [in] a string that contains qualifier strings like "_E_D_Z" |
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.
s | [in] a string that contains base and qualifier string like "MFCC_E_D_Z" |
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.
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. |
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.
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. |
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.
p | [in] parameter data | |
qualtype | [in] parameter type |
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.
param | [in] parameter data |
Definition at line 99 of file strip_mfcc.c.
void param_init_content | ( | HTK_Param * | p | ) |
Initialize the content of the parameter data.
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
p | [i/o] parameter data | |
samplenum | [in] required number of frames | |
veclen | [in] required length of vector |
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.
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.
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.
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.
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.
fp | [in] file descriptor | |
pinfo | [in] pointer to parameter structure. |
Definition at line 291 of file put_htkdata_info.c.