libsent/src/anlz/paramselect.c File Reference

Check and adjust parameter vector types. More...

#include <sent/stddefs.h>
#include <sent/htk_param.h>
#include <sent/htk_hmm.h>

Go to the source code of this file.

Functions

static void mark_exclude_vector (int loc, int len, int *vmark, int vlen)
 Put exlusion marks for vector for len elements from loc -th dimension.
static void exec_exclude_vectors (HTK_Param *p, int *vmark)
 Execute exclusion for a parameter data according to the exclusion marks.
int guess_basenum (HTK_Param *p, short qualtype)
 Guess the length of the base coefficient according to the total vector length and parameter type.
static boolean select_param_vmark (HTK_Param *src, short dst_type_arg, int *vmark, int vlen, short *new_type)
 Compare source parameter type and required type in HTK HMM, and set mark.
static boolean select_param_kind (HTK_Param *p, short dst_type_arg)
 Extracts needed parameter vector specified in dst_type_arg from src, and returns newly allocated parameter structure.
int param_check_and_adjust (HTK_HMM_INFO *hmminfo, HTK_Param *param, boolean vflag)
 Top function to adjust parameter.


Detailed Description

Check and adjust parameter vector types.

This file is to check if HMM parameter and input parameter are the same. If they are not the same, it then tries to modify the input to match the required format in HMM. Available parameter modification is only to delete some part of the parameter (ex. MFCC_E_D_Z (26 dim.) can be modified to MFCC_E_D_N_Z (25 dim.) by just deleting the absolute power). Note that no parameter generation or conversion is implemented currently.

The adjustment algorithm is as follows:

  1. Initialize mark to 0 for each input vector element.
  2. Compare parameter type and mark unnecessary element as EXCLUDE(=1).
  3. Allocate a new parameter area and copy needed (=NOT marked) element.

Author:
Akinobu LEE
Date:
Sun Feb 13 20:46:39 2005
Revision
1.1.1.1

Definition in file paramselect.c.


Function Documentation

static void mark_exclude_vector ( int  loc,
int  len,
int *  vmark,
int  vlen 
) [static]

Put exlusion marks for vector for len elements from loc -th dimension.

Parameters:
loc [in] beginning dimension to mark
len [in] number of dimension to mark from loc
vmark [in] mark buffer
vlen [in] length of vmark

Definition at line 63 of file paramselect.c.

Referenced by select_param_vmark().

static void exec_exclude_vectors ( HTK_Param p,
int *  vmark 
) [static]

Execute exclusion for a parameter data according to the exclusion marks.

Execute vector element exclusion will be done inline.

Parameters:
p [i/o] parameter
vmark [in] mark buffer

Definition at line 101 of file paramselect.c.

Referenced by 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().

static boolean select_param_vmark ( HTK_Param src,
short  dst_type_arg,
int *  vmark,
int  vlen,
short *  new_type 
) [static]

Compare source parameter type and required type in HTK HMM, and set mark.

Parameters:
src [in] input parameter
dst_type_arg [in] required parameter type
vmark [in] mark buffer
vlen [in] length of vmark
new_type [out] return the new type
Returns:
TRUE on success, FALSE on failure.

Definition at line 168 of file paramselect.c.

Referenced by select_param_kind().

static boolean select_param_kind ( HTK_Param p,
short  dst_type_arg 
) [static]

Extracts needed parameter vector specified in dst_type_arg from src, and returns newly allocated parameter structure.

Parameters:
src [in] input parameter
dst_type_arg [in] required parameter type
Returns:
newly allocated adjusted parameter, NULL on failure.

Definition at line 319 of file paramselect.c.

Referenced by param_check_and_adjust().

int param_check_and_adjust ( HTK_HMM_INFO hmminfo,
HTK_Param param,
boolean  vflag 
)

Top function to adjust parameter.

It compares the types for the given parameter param and HMM definition hmminfo. If type is not the same, adjustment will be tried.

Parameters:
hmminfo [in] HTK HMM definition
param [i/o] input parameter, will be freed if adjustment was performed in this function
vflag [in] if TRUE, output verbose messages
Returns:
1 on success, 0 if no adjustment needed, or -1 on failure (in case parameter type does not match even by the adjustment).

Definition at line 371 of file paramselect.c.


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