www.pudn.com > features.rar > print_ph_feat.cpp
// *********************************************************************
// * This file is part of RES 6.0. *
// * RES 6.0 is an original software distributed within the book *
// * *
// * |-----------------------------------------------------| *
// * | "Speech Recognition: Theory and C++ Implementation" | *
// * | John Wiley & Sons, Ltd | *
// * | by Claudio Becchetti and Lucio Prina Ricotti | *
// * |-----------------------------------------------------| *
// * *
// * See copyright.txt file for further info. on copyright *
// *********************************************************************
// _________________________________________________________________________
// |-----------------------------------------------------------------------|
// | |
// | FILE: Print_feature.cpp |
// | FUNCTIONALITY: file for print file of features |
// | PROGRAM: |
// | COMMENTS: |
// | CONTRIBUTIONS: Fabrizio |
// | ACTUAL REVISION: 6.0 |
// | DATA ACTUAL REVISION: 19/11/98 |
// | FIRST VERSION: 4.0 |
// | DATA FIRST VERSION: 25/3/98 |
// | |
// |-----------------------------------------------------------------------|
// _________________________________________________________________________
// ******************* VERSION HISTORY *******************************
// <<< version 4.0 >>>
//old version 02/04/98, 24/4/98 added Unix compatibility
#include "../features/feature.h"
#include "../ioclass/soundlab.h"
#define MAX_SIL_FRAMES 50
void main(int argc, char* argv[])
{
FeatureExtraction feature;
DbaseVoc dbase;
VetDouble sample, feature_vet;
String buffer;
char* string;
t_index separator=32;
VetULong init_symb_list;
ConfigFile conf;
Boolean not_end_of_dbase=TRUE, is_new_phone, new_line;
ofstream file_out, file_phn;
String name_fts, name_phn;
VetDoubleList pred_list, whole_fon_istance;
t_index i, num_of_symbols, act_phon, num_frames, k=0;
t_index index, dim, aux;
String config_file;
if ( argc!=2)
{
mstat<<"No configfile name specified, using: res.ini";
config_file="res.ini";
} else {
config_file=argv[1];
}
dbase.Configure(config_file,TRUE);
num_of_symbols=dbase.Get_Num_Of_Symbols();
feature.Configure(config_file);
pred_list.Destroy_And_ReDim(feature.Max_Delta_Feature_Order());
conf.Open_File(config_file);
conf.Get_String_Opt("Initialization","SymbolRange",buffer);
if(buffer=="partial")
conf.Get_Range_Opt("Initialization","SymbolList", init_symb_list);
else {
init_symb_list.Destroy_And_ReDim(num_of_symbols);
for(i=0;i')
{
k++;
new_line=TRUE;
}
if(new_line)
file_out<MAX_SIL_FRAMES)
{
whole_fon_istance.Save_And_ReDim(MAX_SIL_FRAMES);
dim=MAX_SIL_FRAMES;
}
// Print file of features
for(k=0;k