diff -Nur htk.org/HTKLib/HParm.c htk/HTKLib/HParm.c --- htk.org/HTKLib/HParm.c Fri Sep 15 20:54:05 2000 +++ htk/HTKLib/HParm.c Wed Jan 9 15:49:08 2002 @@ -802,6 +802,9 @@ case DISCRETE: cf->style = VQbased; break; + case ANON: case USER: + cf->style = MAX_INT; + break; default: HError(6321,"SetCodeStyle: Unknown style %s",ParmKind2Str(tgt,buf)); } @@ -815,9 +818,9 @@ if (cf->srcSampRate<=0.0 || cf->srcSampRate>10000000.0) HError(6371,"ValidCodeParms: src frame rate %f unlikely",cf->srcSampRate); - if (cf->tgtSampRate<=cf->srcSampRate || cf->tgtSampRate>10000000.0) + if (cf->tgtSampRatesrcSampRate || cf->tgtSampRate>10000000.0) HError(6371,"ValidCodeParms: parm frame rate %f unlikely",cf->tgtSampRate); - if (cf->winDurtgtSampRate || cf->winDur>cf->tgtSampRate*100.0) + if (cf->winDurtgtSampRate || cf->winDur>cf->tgtSampRate*200.0) HError(6371,"ValidCodeParms: window duration %f unlikely",cf->winDur); if (cf->preEmph<0.0 || cf->preEmph>1.0) HError(6371,"ValidCodeParms: preEmph %f illegal",cf->preEmph); @@ -1424,6 +1427,8 @@ if (btgt == MFCC) cf->c = CreateVector(x,cf->numCepCoef); break; + case MAX_INT: + break; default: HError(6321,"SetUpForCoding: target %s is not a parameterised form", ParmKind2Str(cf->tgtPK,buf)); @@ -2780,7 +2785,6 @@ /* Just need to count available frames */ break; case ch_ext_wave: - case ch_ext_parm: /* Count samples and convert to frames */ n=pbuf->ext->fNumSamp(pbuf->ext->xInfo,pbuf->in.i); /* Find out if we need extra samples because this is the first frame */ @@ -2794,6 +2798,10 @@ else /* Will not block and we want to find end of file */ r=((n-x)/cf->frRate)+1; break; + case ch_ext_parm: + /* Count samples and convert to frames */ + n=pbuf->ext->fNumSamp(pbuf->ext->xInfo,pbuf->in.i); + break; } if (r==-1) pbuf->chClear=TRUE; return(r); @@ -2884,7 +2892,8 @@ r=GetParm(pbuf,1,vp); break; case ch_ext_parm: - break; + r = pbuf->ext->fGetData(pbuf->ext->xInfo,pbuf->in.i,1,vp /*cf->s+1*/); /* added by iba */ + break; case ch_hrfe: /* Just need to read in the converted frame */ break; @@ -3130,7 +3139,10 @@ /* First determine channel type */ /* Determine source ie wave or parm file & fill table */ if (pbuf->ext!=NULL) - chType=ch_ext_wave; + if ((pbuf->ext->pk&BASEMASK)==WAVEFORM) + chType=ch_ext_wave; + else + chType=ch_ext_parm; else if (fname==NULL || ff==HAUDIO || (ff==UNDEFF && pbuf->cf->srcFF==HAUDIO)) chType = ch_haudio; @@ -3225,23 +3237,20 @@ case ch_hrfe: break; case ch_ext_wave: - if ((pbuf->ext->pk&BASEMASK)==WAVEFORM) - pbuf->chType = ch_ext_wave; - else - pbuf->chType = ch_ext_parm; - /* Set up info first */ - if (pbuf->ext->sampPeriod!=0.0 && cf->srcSampRate!=0.0 && - pbuf->ext->sampPeriod!=cf->srcSampRate!=0.0) - HRError(-6371,"OpenAsChannel: External sample rate does not match configuration"); - if (cf->srcSampRate==0.0) - cf->srcSampRate=pbuf->ext->sampPeriod; - /* Setup remaining size information in IOConfig record */ - ValidCodeParms(cf); - cf->frSize = (int) (cf->winDur/cf->srcSampRate); - cf->frRate = (int) (cf->tgtSampRate/cf->srcSampRate); - SetUpForCoding(pbuf->mem,cf,cf->frSize); - cf->rawBuffer=(char *) New(pbuf->mem,cf->frSize*(pbuf->ext->size&0xff)* - ((pbuf->ext->size&0xff00)>>16)); + pbuf->chType = ch_ext_wave; + /* Set up info first */ + if (pbuf->ext->sampPeriod!=0.0 && cf->srcSampRate!=0.0 && + pbuf->ext->sampPeriod!=cf->srcSampRate!=0.0) + HRError(-6371,"OpenAsChannel: External sample rate does not match configuration"); + if (cf->srcSampRate==0.0) + cf->srcSampRate=pbuf->ext->sampPeriod; + /* Setup remaining size information in IOConfig record */ + ValidCodeParms(cf); + cf->frSize = (int) (cf->winDur/cf->srcSampRate); + cf->frRate = (int) (cf->tgtSampRate/cf->srcSampRate); + SetUpForCoding(pbuf->mem,cf,cf->frSize); + cf->rawBuffer=(char *) New(pbuf->mem,cf->frSize*(pbuf->ext->size&0xff)* + ((pbuf->ext->size&0xff00)>>16)); /* Call user defined Open routine */ GetBufferInfo(pbuf,&info); pbuf->in.i = pbuf->ext->fOpen(pbuf->ext->xInfo,fname,&info); @@ -3252,6 +3261,18 @@ initRows=0; pbuf->main.maxRows = maxObs; break; + case ch_ext_parm: + pbuf->chType = ch_ext_parm; + cf->frSize = 1; + cf->frRate = 1; + cf->rawBuffer=(char *) New(pbuf->mem,cf->frSize*(pbuf->ext->size&0xff)*((pbuf->ext->size&0xff00)>>16)); + /* Call user defined Open routine */ + GetBufferInfo(pbuf,&info); + pbuf->in.i = pbuf->ext->fOpen(pbuf->ext->xInfo,fname,&info); + /* Treat as buffer */ + initRows=0; + pbuf->main.maxRows = maxObs; + break; default: HRError(6320,"OpenAsChannel: Channel type not yet supported"); return(FAIL); diff -Nur htk.org/HTKLib/HParm.h htk/HTKLib/HParm.h --- htk.org/HTKLib/HParm.h Thu Sep 7 02:00:48 2000 +++ htk/HTKLib/HParm.h Wed Jan 9 15:49:08 2002 @@ -190,6 +190,26 @@ will perform measurement if it is needed by config). */ +ParmBuf OpenExtBuffer(MemHeap *x, char *fn, int maxObs, + FileFormat ff, HParmSrcDef ext, + TriState enSpeechDet, TriState silMeasure); +/* + (comment by iba) Same as OpenBuffer, but you can define your own + external source and access functions (c.f. HParmScrDef ext) by giving + pointers to the functions for fOpen, fClose, fStart, fStop, fNumSamp and + fGetData, as described in HParm.c:296-362. Call this function from + HVite::ProcessFile, instead of OpenBuffer() if you need external source. +*/ + +HParmSrcDef CreateSrcExt(Ptr xInfo, ParmKind pk, int size, HTime sampPeriod, + Ptr (*fOpen)(Ptr xInfo,char *fn,BufferInfo *info), + void (*fClose)(Ptr xInfo,Ptr bInfo), + void (*fStart)(Ptr xInfo,Ptr bInfo), + void (*fStop)(Ptr xInfo,Ptr bInfo), + int (*fNumSamp)(Ptr xInfo,Ptr bInfo), + int (*fGetData)(Ptr xInfo,Ptr bInfo,int n,Ptr data)); +/* Used before OpenExtBuffer, to open and return input buffer using extended source */ + PBStatus BufferStatus(ParmBuf pbuf); /* Return current status of buffer. diff -Nur htk.org/HTKLib/Makefile htk/HTKLib/Makefile --- htk.org/HTKLib/Makefile Mon Sep 25 19:18:06 2000 +++ htk/HTKLib/Makefile Wed Jan 9 15:49:08 2002 @@ -26,7 +26,7 @@ HLIBS = $(hlib)/HTKLib.$(CPU).a CC = $(HTKCC) -CFLAGS = $(HTKCF) -D'ARCH="$(CPU)"' -I. +CFLAGS = -g $(HTKCF) -D'ARCH="$(CPU)"' -I. modules = HShell.o HMath.o HSigP.o HWave.o HAudio.o HParm.o HVQ.o HGraf.o\ HLabel.o HModel.o HUtil.o HTrain.o HDict.o HLM.o HRec.o HNet.o \ diff -Nur htk.org/HTKTools/HMyFuncs.c htk/HTKTools/HMyFuncs.c --- htk.org/HTKTools/HMyFuncs.c Thu Jan 1 09:00:00 1970 +++ htk/HTKTools/HMyFuncs.c Wed Jan 9 15:48:27 2002 @@ -0,0 +1,110 @@ +/* + HMyFuncs.c: (iba 01/08/2002) + + sample external functions +*/ + +#include "HShell.h" +#include "HMem.h" +#include "HMath.h" +#include "HSigP.h" +#include "HAudio.h" +#include "HWave.h" +#include "HVQ.h" +#include "HParm.h" +#include "HLabel.h" +#include "HModel.h" +#include "HUtil.h" +#include "HTrain.h" +#include "HAdapt.h" +#include "HFB.h" +#include "HDict.h" +#include "HNet.h" +#include "HRec.h" + +Boolean Continue=TRUE; + +Ptr MyOpen(Ptr xInfo,char *fn,BufferInfo *info){ /* Open new buffer */ +/* + Return: Pointer to buffer specific data + + Connect to source and allocate necessary structures. + Each buffer is associated with a specific pointer that is assigned + to the return value of this function. All other buffer operations + are passed to this pointer. Typically it will be used to access a + source specific data structure containing the necessary information + for operating the source. +*/ + Continue = TRUE; + return NULL; +} + +void MyClose(Ptr xInfo,Ptr bInfo){ /* Close buffer and free resources */ +/* + Ptr bInfo: Pointer returned by fOpen for this buffer + + Free all the resources associated with the buffer (including if + necessary the info block itself). +*/ +} + +void MyStart(Ptr xInfo,Ptr bInfo){ /* Start data capture for real-time sources */ +/* + Ptr bInfo: Pointer returned by fOpen for this buffer + + Start data capture. Offline sources can ignore this call. +*/ + Continue = TRUE; +} + +void MyStop(Ptr xInfo,Ptr bInfo){ /* Stop data capture for real-time sources */ +/* + Ptr bInfo: Pointer returned by fOpen for this buffer + + Stop data capture. Offline sources can ignore this call. +*/ + Continue = FALSE; +} + +int MyNumSamp(Ptr xInfo,Ptr bInfo){ /* Query samples readable without blocking */ +/* + Ptr bInfo: Pointer returned by fOpen for this buffer + Return: Samples readable without blocking + + Used to determine size of next read. Offline sources can specify the + whole utterance whereas real-time sources should return the number of + buffered data samples once data capture has finished or -1 minus the + number of samples that can be read without blocking. +*/ + return Continue?1:0; +} + +int MyGetData(Ptr xInfo,Ptr bInfo,int n,Ptr data){ /* Read samples */ +/* + Ptr bInfo: Pointer returned by fOpen for this buffer + int n: Number of samples required + Ptr data: Buffer for returned samples + Return: Samples read correctly + + Read samples from the source. + In general will only read one frame at a time (either frSize samples + for the first frame or frRate samples for the rest). + Will only request a frame that fNumSamp indicates will block when the + next thing to do is process the frame. Normally only non-blocking + data will be requested (unless the decoder is keeping up with the + source). +*/ + int i; + float *f = (float *)data; + + for (i=0; i "); + scanf("%f",f+i); + if (f[i]==-1) { + Continue = FALSE; + return 0; + } + } + + return i; +} diff -Nur htk.org/HTKTools/HMyFuncs2.c htk/HTKTools/HMyFuncs2.c --- htk.org/HTKTools/HMyFuncs2.c Thu Jan 1 09:00:00 1970 +++ htk/HTKTools/HMyFuncs2.c Wed Jan 9 15:48:27 2002 @@ -0,0 +1,118 @@ +/* + HMyFuncs.c: (iba 01/08/2002) + + sample external functions +*/ + +#include "HShell.h" +#include "HMem.h" +#include "HMath.h" +#include "HSigP.h" +#include "HAudio.h" +#include "HWave.h" +#include "HVQ.h" +#include "HParm.h" +#include "HLabel.h" +#include "HModel.h" +#include "HUtil.h" +#include "HTrain.h" +#include "HAdapt.h" +#include "HFB.h" +#include "HDict.h" +#include "HNet.h" +#include "HRec.h" + +float MyFloatArray[30]; +int MyFloatArrayIndex; + +Ptr MyOpen(Ptr xInfo,char *fn,BufferInfo *info){ /* Open new buffer */ +/* + Return: Pointer to buffer specific data + + Connect to source and allocate necessary structures. + Each buffer is associated with a specific pointer that is assigned + to the return value of this function. All other buffer operations + are passed to this pointer. Typically it will be used to access a + source specific data structure containing the necessary information + for operating the source. +*/ + int i; + + /* yama */ + /* + for (i=0; i<15; i++) MyFloatArray[i] = (float)i/3.0f + 1.0f; + for (i=15; i<30; i++) MyFloatArray[i] = MyFloatArray[30-(i+1)]; + */ + + /* tani */ + for (i=0; i<15; i++) MyFloatArray[i] = 5.0f - (float)i/3.0f; + for (i=15; i<30; i++) MyFloatArray[i] = MyFloatArray[30-(i+1)]; + + + MyFloatArrayIndex = 0; + return NULL; +} + +void MyClose(Ptr xInfo,Ptr bInfo){ /* Close buffer and free resources */ +/* + Ptr bInfo: Pointer returned by fOpen for this buffer + + Free all the resources associated with the buffer (including if + necessary the info block itself). +*/ +} + +void MyStart(Ptr xInfo,Ptr bInfo){ /* Start data capture for real-time sources */ +/* + Ptr bInfo: Pointer returned by fOpen for this buffer + + Start data capture. Offline sources can ignore this call. +*/ + MyFloatArrayIndex = 0; +} + +void MyStop(Ptr xInfo,Ptr bInfo){ /* Stop data capture for real-time sources */ +/* + Ptr bInfo: Pointer returned by fOpen for this buffer + + Stop data capture. Offline sources can ignore this call. +*/ + MyFloatArrayIndex = 0; +} + +int MyNumSamp(Ptr xInfo,Ptr bInfo){ /* Query samples readable without blocking */ +/* + Ptr bInfo: Pointer returned by fOpen for this buffer + Return: Samples readable without blocking + + Used to determine size of next read. Offline sources can specify the + whole utterance whereas real-time sources should return the number of + buffered data samples once data capture has finished or -1 minus the + number of samples that can be read without blocking. +*/ + return 30-MyFloatArrayIndex; +} + +int MyGetData(Ptr xInfo,Ptr bInfo,int n,Ptr data){ /* Read samples */ +/* + Ptr bInfo: Pointer returned by fOpen for this buffer + int n: Number of samples required + Ptr data: Buffer for returned samples + Return: Samples read correctly + + Read samples from the source. + In general will only read one frame at a time (either frSize samples + for the first frame or frRate samples for the rest). + Will only request a frame that fNumSamp indicates will block when the + next thing to do is process the frame. Normally only non-blocking + data will be requested (unless the decoder is keeping up with the + source). +*/ + int i; + float *f = (float *)data; + + for (i=0; i! yama1 + 3.2 3 3 3 4.1 4 4 5.3 5.2 5.2 5.5 5.1 5.2 4 4.2 4 4 3.5 3.7 3 3 3.1 + ^D + % cat >! yama2 + 2.8 3.2 3.8 3.3 3.5 4.1 4 4.7 5.1 5.2 5.2 5.2 4.7 4.2 4 4 3.5 3.7 3 3 3.1 3.2 2.7 + ^D + % HAscii2Bin yama1 1 (データが一次元なので'1'。HTKバイナリ形式のファイルには .ext が付く) + opening for data 4 yama1.ext + number of frames 23 + % HAscii2Bin yama2 1 + opening for data 4 yama2.ext + number of frames 24 + % HList -h yama1.ext (データ確認には HList を使う) + ---------------------------------- Source: yama1.ext ----------------------------------- + Sample Bytes: 4 Sample Kind: USER + Num Comps: 1 Sample Period: 200.0 us + Num Samples: 23 File Format: HTK + ------------------------------------ Samples: 0->-1 ------------------------------------ + 0: 3.200 + 1: 3.000 + 2: 3.000 + 3: 3.000 + 4: 4.100 + 5: 4.000 + 6: 4.000 + 7: 5.300 + 8: 5.200 + 9: 5.200 + 10: 5.500 + 11: 5.100 + 12: 5.200 + 13: 4.000 + 14: 4.200 + 15: 4.000 + 16: 4.000 + 17: 3.500 + 18: 3.700 + 19: 3.000 + 20: 3.000 + 21: 3.100 + 22: 3.100 + ----------------------------------------- END ------------------------------------------ + + この調子で yama3,4 も作成し、変換。tani1,2 は谷とする。 + + % cat >! tani1 + 3.2 3.1 3 3.1 2.7 2.3 2.1 2.1 1.9 1.5 1.6 1.1 1.3 2.0 2.8 2.3 2.9 2.9 3 3.3 3 3 + ^D + % cat >! tani2 + 3.0 3.1 3 3.1 2.7 2.5 2.3 2.1 2.1 1.9 1.5 1.6 1.3 1.3 1.1 1.3 2.0 2.8 2.3 2.7 2.9 2.9 3 3.3 3 3 3.2 + ^D + % HAscii2Bin tani1 1 + opening for data 4 tani1.ext + number of frames 23 + % HAscii2Bin tani2 1 + opening for data 4 tani2.ext + number of frames 28 + + 同様に tani3,4 も作成後、変換。トレーニングファイルのリストも作成。 + + % cat >! ~/htk/work/trfiles + tr/tani1.ext + tr/tani2.ext + tr/tani3.ext + tr/tani4.ext + tr/yama1.ext + tr/yama2.ext + tr/yama3.ext + tr/yama4.ext + ^D + +・トレーニング用ラベルファイルの作成 + + データ毎に yama1.lab, yama2.lab などと作っていっても良いが、ここでは一つのファイルに + まとめて記述する。 + + % cd ~/htk/work + % cat >! yamatani.mlf + #!MLF!# + "*/yama*.lab" + YAMA + . + "*/tani*.lab" + TANI + . + ^D + +・HMM の初期化 + + まず入れ場所を用意。 + + % cd ~/htk/work + % mkdir hmm0 hmm1 hmm2 hmm3 hmm4 hmm5 hmm6 + + 次ににプロトタイプ HMM を作る。 + + % cd ~/htk/work + % cat >! proto + ~o 1 + ~h "proto" + + 5 + 2 + 1 + 0.0 + 1 + 1.0 + 3 + 1 + 0.0 + 1 + 1.0 + 4 + 1 + 0.0 + 1 + 1.0 + 5 + 0.0 1.0 0.0 0.0 0.0 + 0.0 0.6 0.4 0.0 0.0 + 0.0 0.0 0.6 0.4 0.0 + 0.0 0.0 0.0 0.7 0.3 + 0.0 0.0 0.0 0.0 0.0 + + ^D + % cd ~/htk/work + % cat >! trfiles + tr/yama1.ext + tr/yama2.ext + tr/yama3.ext + tr/yama4.ext + tr/tani1.ext + tr/tani2.ext + tr/tani3.ext + tr/tani4.ext + ^D + % HCompV -o YAMA -S trfiles -f 0.01 -m -M hmm0 proto (全データから mean と variance を求める) + % HCompV -o TANI -S trfiles -f 0.01 -m -M hmm0 proto + % HRest -v 0.01 -S trfiles -M hmm1 -I yamatani.mlf hmm0/YAMA + % HRest -v 0.01 -S trfiles -M hmm1 -I yamatani.mlf hmm0/TANI + % HERest -v 0.01 -S trfiles -d hmm1 -I yamatani.mlf -M hmm2 wlist (エンベデッドトレーニング) + % HERest -v 0.01 -S trfiles -H hmm2/newMacros -I yamatani.mlf -M hmm3 wlist + % HERest -v 0.01 -S trfiles -H hmm3/newMacros -I yamatani.mlf -M hmm4 wlist + % HERest -v 0.01 -S trfiles -H hmm4/newMacros -I yamatani.mlf -M hmm5 wlist + % HERest -v 0.01 -S trfiles -H hmm5/newMacros -I yamatani.mlf -M hmm6 wlist + + 計算結果は hmm6/newMacros に現れる + +・HMMを使って認識テスト(バッチモード) + + まず認識用のデータを作る + + % mkdir ~/htk/work/te + % cat >! ~/htk/work/te/yama5 + 3 3 3 3 3 4 4 4 5 5 5 4 4 4 4 4 4 4 4 3 3 3 3 3 3 3 3 + ^D + % cat >! ~/htk/work/te/tani5 + 3 3 3 3 3 3 2 2 2 2 2 2 2 2 1 1 1 1 1 1 1 1 1 1 1 2 2 2 2 2 2 3 3 3 + ^D + % HAscii2Bin tani5 1 + opening for data 4 tani5.ext + number of frames 35 + % HAscii2Bin yama5 1 + opening for data 4 yama5.ext + number of frames 28 + % cat >! ~/htk/work/tefiles + te/yama5.ext + te/tani5.ext + ^D + + 認識用の文法からラティス(wdnet)を作成 + + % cd ~/htk/work + % cat >! grammar + ( YAMA | TANI) + ^D + % HParse grammar wdnet + + HMMラベルと言葉の対応表を作る(今回のシンプルな例だとあまり意味は無い) + + % cat >! ~/htk/work/dict + YAMA YAMA + TANI TANI + ^D + + tefiles 内のデータ(tani5, yama5)を viterbi にかけ、結果を見る + + % cd ~/htk/work + % HVite -T 1 -S tefiles -H hmm6/newMacros -i results -w wdnet dict wlist + Read 2 physical / 2 logical HMMs + Read lattice with 5 nodes / 5 arcs + Created network with 9 nodes / 9 links + File: te/yama5.ext + YAMA == [28 frames] -0.4559 [Ac=-12.8 LM=0.0] (Act=6.6) + File: te/tani5.ext + TANI == [35 frames] -1.2518 [Ac=-43.8 LM=0.0] (Act=6.7) + + HVite の結果を HResult で yamatani.mlf と照らし合わせることができる。 + + % HResults -t -I yamatani.mlf wlist results + ====================== HTK Results Analysis ======================= + Date: Wed Jan 9 16:21:40 2002 + Ref : yamatani.mlf + Rec : results + ------------------------ Overall Results -------------------------- + SENT: %Correct=100.00 [H=2, S=0, N=2] + WORD: %Corr=100.00, Acc=100.00 [H=2, D=0, S=0, I=0, N=2] + =================================================================== + + ということで、バッチ認識は成功。 + +・HMMを使って認識テスト(ライブモード) + + 元々 HTK には Audio を対象としたライブモードしか存在しないので、 + HParm.c, HVite.c に手を加えた。HTK 自体に external function を + 組み込むための仕組みが存在しているので (HParm.c:296-362行参照) + 基本的には HMyFuncs.c で記述したように自分の関数をいくつか + 書いて、HVite.c や HParm.c を調整すれば良い。例として出した + HMyFuncs.c は scanf で一つづつ float 数字を拾いながら認識を + 行っている。 + + HVite で認識を行う前に config ファイルを作る(バッチの様に、 + へッダーからデータの情報を得られないため)。 + + % cd ~/htk/work + % cat >! config + SOURCEKIND = USER + TARGETKIND = USER + ^D + + 後はライブ認識。-h でライブモードが音声ではなくデータであることを + 指定して、-T (トレースレベル)を1か7に設定。1 の時はデータを全て + 読み込んでから結果を表示、7 だとその時点でもっとも正しいと思われる + 結果(その時点のトークンの所在)を逐一表示する。 + + % > HVite -h -D -T 7 -C config -H hmm6/newMacros -i results -w wdnet dict wlist + HTK Configuration Parameters[2] + Module/Tool Parameter Value + # TARGETKIND USER + # SOURCEKIND USER + + Read 2 physical / 2 logical HMMs + Read lattice with 5 nodes / 5 arcs + Created network with 9 nodes / 9 links + + READY[1]> + numer? (-1 to exit)> 3 + 0: 3.000 + Optimum @1 HMM: YAMA (YAMA) 2 -0.284 + numer? (-1 to exit)> 3.4 + 1: 3.400 + Optimum @2 HMM: YAMA (YAMA) 2 -0.541 + numer? (-1 to exit)> 3.4 + 2: 3.400 + Optimum @3 HMM: YAMA (YAMA) 7 -0.627 + numer? (-1 to exit)> 3.5 + 3: 3.500 + Optimum @4 HMM: YAMA (YAMA) 7 -0.713 + numer? (-1 to exit)> 4 + 4: 4.000 + Optimum @5 HMM: YAMA (YAMA) 7 -1.041 + numer? (-1 to exit)> 4.3 + 5: 4.300 + Optimum @6 HMM: YAMA (YAMA) 7 -0.973 + numer? (-1 to exit)> 4.5 + 6: 4.500 + Optimum @7 HMM: YAMA (YAMA) 7 -0.907 + numer? (-1 to exit)> 4.6 + 7: 4.600 + Optimum @8 HMM: YAMA (YAMA) 7 -0.862 + numer? (-1 to exit)> 5 + 8: 5.000 + Optimum @9 HMM: YAMA (YAMA) 7 -0.867 + numer? (-1 to exit)> 5 + 9: 5.000 + Optimum @10 HMM: YAMA (YAMA) 7 -0.871 + numer? (-1 to exit)> 5.3 + 10: 5.300 + Optimum @11 HMM: YAMA (YAMA) 7 -0.923 + numer? (-1 to exit)> 4.32 + 11: 4.320 + Optimum @12 HMM: YAMA (YAMA) 7 -0.891 + numer? (-1 to exit)> 3.4 + 12: 3.400 + Optimum @13 HMM: YAMA (YAMA) 7 -0.969 + numer? (-1 to exit)> 2 + 13: 2.000 + Optimum @14 HMM: YAMA (YAMA) 7 -1.484 + numer? (-1 to exit)> -1 + 14: 2.000 + Optimum @15 HMM: YAMA (YAMA) 7 -1.930 + YAMA == [15 frames] -3.0803 [Ac=-46.2 LM=0.0] (Act=6.3) + + READY[2]> + numer? (-1 to exit)> + % + + 追記:後は自分の HMyFuncs.c を書いたり、データに differencial + 属性をつけて認識の精度を上げたり、トレーニング量や文法に時間を + かけて楽しむと良いでしょう。 + +- soshi \ No newline at end of file diff -Nur htk.org/contrib/HAscii2Bin.c htk/contrib/HAscii2Bin.c --- htk.org/contrib/HAscii2Bin.c Thu Jan 1 09:00:00 1970 +++ htk/contrib/HAscii2Bin.c Tue Jan 8 22:35:27 2002 @@ -0,0 +1,174 @@ +/* + + HAscii2Bin: + + Written based on Nurio Oliver's data conversion program on + http://vismod.www.media.mit.edu/~nuria/HTKV2.0/C_prog.html + + Byte order swapping is added for compatibility between VAXorder + (intel, etc.), and non-VAXorder (motorola) binary numbers. + HTK prefers non-VAXorder. + + iba (01/08/2002) +*/ + +/* gcc HAscii2Bin.c -g -o ../bin/bin.linux/HAscii2Bin -lm */ + +/* rerun splitter */ +#include +#include +#include +#include + +int IsVAXOrder(void) +{ + short x, *px; + unsigned char *pc; + + px = &x; + pc = (unsigned char *) px; + *pc = 1; *(pc+1) = 0; /* store bytes 1 0 */ + if (x==1) return 1; /* does it read back as 1? */ + else return 0; +} + +/* SwapInt32: swap byte order of int32 data value p */ +int SwapInt32(int p) +{ + char temp; + char *q = (char*) &p; + + temp = *q; *q = *(q+3); *(q+3) = temp; + temp = *(q+1); *(q+1) = *(q+2); *(q+2) = temp; + + return p; +} + +/* SwapFloat: swap byte order of Float32 data value p */ +float SwapFloat(float p) +{ + char tmp; + char *ptr = (char *)&p; + + tmp = ptr[0]; + ptr[0] = ptr[3]; + ptr[3] = tmp; + tmp = ptr[1]; + ptr[1] = ptr[2]; + ptr[2] = tmp; + + return p; +} + +/* SwapShort: swap byte order of short data value p */ +short SwapShort(short p) +{ + char temp,*q; + + q = (char*) &p; + temp = *q; *q = *(q+1); *(q+1) = temp; + + return p; +} + +int main (int argc, char *argv[]) +{ + int scanf_value; + int counter, old_counter = 0, sampPeriod = 2000; + int i, j; + float points[100]; + float fp[100][10000]; + + char *filename, *dirname, data_out[40]; + short type, size; + FILE *fpdata; + int dout, num_points; + + int scounter, ssampPeriod; /* used for swapping */ + short ssize, stype; + + if (argc == 1 || argc == 2) { + fprintf(stderr, "usage: %s input_file_name dimension_of_vector [directory_name]\n",argv[0]); + exit(1); + } + + counter = 0; + filename = argv[1]; + sscanf(argv[2], "%d",&num_points); + if (argc == 4){ + dirname=argv[3]; + sprintf(data_out, "%s/%s.ext", dirname, filename); + } else { + sprintf(data_out, "%s.ext", filename); + } + + if ((fpdata = fopen(filename, "r")) == NULL) { printf("%s not found\n",filename); } + if ((dout = open(data_out, O_RDWR | O_CREAT, S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH )) == -1) { printf("%s not found\n",data_out); }; + fprintf(stderr, "opening for data %d %s\n", dout, data_out); + + /* FEATURES: num_points is the dimension of the feature vector */ + for (i=0; i< num_points; i++) { + scanf_value = fscanf(fpdata, "%f", &(points[i])); + } + + for (i=0; i< num_points; i++) { + fp[i][counter]=(float) points[i]; + } + counter++; + + while (scanf_value > 0) + { + for (i=0; i< num_points; i++) { + scanf_value = fscanf(fpdata, "%f", &(points[i])); + } + for (i=0; i< num_points; i++) { + fp[i][counter]=(float) points[i]; + } + counter++; + } + + + /* HEADER */ + /* float data */ + size = (short) (num_points * sizeof(float)); + /* user type */ + type = (short) 9; + /* write header */ + if (counter > 0 ) { + /* Write label */ + if (IsVAXOrder()){ + scounter = SwapInt32(counter); + ssampPeriod = SwapInt32(sampPeriod); + ssize = SwapShort(size); + stype = SwapShort(type); + write(dout, &scounter, 4); + write(dout, &ssampPeriod, 4); + write(dout, &ssize, 2); + write(dout, &stype, 2); + } else { + write(dout, &counter, 4); + write(dout, &sampPeriod, 4); + write(dout, &size, 2); + write(dout, &type, 2); + } + + fprintf(stderr, "number of frames %d\n", counter); + /* write data */ + for (i=0; i < counter; i++) + { + for (j=0;j----- + by Guillaume Gravier +*/ + +/* -------------------------------------------------- */ +/* ----- Private type definition for HTKWrite() ----- */ +/* -------------------------------------------------- */ +typedef struct { + long nSamples; + long sampPeriod; + short sampSize; + short parmKind; +} htk_header_t; + +#define H_LPC 1 +#define H_LPREFC 2 +#define H_LPCEPSTRA 3 +#define H_MFCC 6 +#define H_FBANK 7 +#define H_USER 9 + +#define HASENERGY 0x0040 +#define HASNOE 0x0080 +#define HASDELTA 0x0100 +#define HASZMEAN 0x0800 + +/* ----------------------------------------------------- */ +/* ----- err_t HTKWrite(data_t *,float,int,FILE *) ----- */ +/* ----------------------------------------------------- */ +/* + * Write data (structure containing feature vectors) to output + * stream in HTK 1.* or 2.* format (HTK 3.0 format is the same + * as the HTK 2.* format). + */ +err_t HTKWrite(data_t *data,float period,int hversion,FILE *f) +{ + htk_header_t header; + short htk_kind; + int nelem; + float *ptr; + int i; + + if(sizeof(param_t) != sizeof(float)) { + /* + if param_t is double, should copy to a vector of float + since HTK needs float, not double + */ + gerror(HCOMPAT_ERR,"HTKWrite(): sizeof(param_t) != sizeof(float)"); + return(HCOMPAT_ERR); + } + + nelem=DataVecSize(data); /* set feature vector dimension */ + header.nSamples=(long)(data->n); /* set number of samples */ + header.sampSize=(short)(nelem*sizeof(float)); /* set sample size */ + header.sampPeriod=(long)(period*10000.0); /* set sample period */ + + if(hversion == 1) /* HTK 1.* format --> try to find a sample kind equivalence */ + switch(data->kind) { + case FBANK: htk_kind=(short)H_FBANK; break; + case FBCEPSTRA: htk_kind=(short)H_MFCC; break; + case LPCEPSTRA: htk_kind=(short)H_LPCEPSTRA; break; + case LPCOEFF: htk_kind=(short)H_LPC; break; + case PARCOR: htk_kind=(short)H_LPREFC; break; + default: + gerror(NO_HFORMAT_ERR,"HTKWrite(): No equivalent format in HTK 1.4 for %s", + kind2str(data->kind)); + return(NO_HFORMAT_ERR); + } + else /* HTK 2.* --> write USER defined data */ + htk_kind=(short)H_USER; + + if(data->flag & WITHE) htk_kind |= HASENERGY; /* set header flags */ + if(data->flag & WITHD) htk_kind |= HASDELTA; + if(data->flag & WITHN) htk_kind |= HASNOE; + if(hversion == 2 && (data->flag & WITHZ)) htk_kind |= HASZMEAN; + header.parmKind=htk_kind; + + if(fwrite(&header,sizeof(htk_header_t),1,f) != 1) { + gerror(DUMP_ERR,"HTKWrite(): cannot write HTK header (%d bytes)", + sizeof(htk_header_t)); + return(DUMP_ERR); + } + for(i=0;in;i++) { + ptr=(float *)DataGetVec(data,i,nelem); + /* now, ptr points to the i'th feature vector! Write it! */ + if(fwrite(ptr,sizeof(float),nelem,f) != nelem) { + gerror(DUMP_ERR,"HTKWrite(): cannot write %d'th vector (%d bytes)", + i+1,nelem*sizeof(float)); + return(DUMP_ERR); + } + } + + DONE; +} diff -Nur htk.org/contrib/htk_prepare.c htk/contrib/htk_prepare.c --- htk.org/contrib/htk_prepare.c Thu Jan 1 09:00:00 1970 +++ htk/contrib/htk_prepare.c Wed Jan 9 16:30:55 2002 @@ -0,0 +1,188 @@ +/* + + htk_prepare: + + Written based on Nurio Oliver's data conversion program on + http://vismod.www.media.mit.edu/~nuria/HTKV2.0/C_prog.html + + Byte order swapping is added for compatibility between VAXorder + (intel, etc.), and non-VAXorder (motorola) binary numbers. + HTK prefers non-VAXorder. You need an ASCII data file, and + a sentence file. See her webpage.. + + iba (01/08/2002) +*/ + +/* gcc htk_prepare.c -g -o ../bin/htk_prepare -lm */ + +/* rerun splitter */ +#include +#include +#include +#include + +int IsVAXOrder(void) +{ + short x, *px; + unsigned char *pc; + + px = &x; + pc = (unsigned char *) px; + *pc = 1; *(pc+1) = 0; /* store bytes 1 0 */ + if (x==1) return 1; /* does it read back as 1? */ + else return 0; +} + +/* SwapInt32: swap byte order of int32 data value p */ +int SwapInt32(int p) +{ + char temp; + char *q = (char*) &p; + + temp = *q; *q = *(q+3); *(q+3) = temp; + temp = *(q+1); *(q+1) = *(q+2); *(q+2) = temp; + + return p; +} + +/* SwapFloat: swap byte order of Float32 data value p */ +float SwapFloat(float p) +{ + char tmp; + char *ptr = (char *)&p; + + tmp = ptr[0]; + ptr[0] = ptr[3]; + ptr[3] = tmp; + tmp = ptr[1]; + ptr[1] = ptr[2]; + ptr[2] = tmp; + + return p; +} + +/* SwapShort: swap byte order of short data value p */ +short SwapShort(short p) +{ + char temp,*q; + + q = (char*) &p; + temp = *q; *q = *(q+1); *(q+1) = temp; + + return p; +} + +int main (int argc, char *argv[]) +{ + int scanf_value; + int counter, old_counter = 0, sampPeriod = 2000; + float p1, p2, p3, p4, p5, p6, p7, p8, p9; + float p10, p11, p12, p13, p14, p15, p16, p17, p18, p19; + float p20, p21, p22, p23, p24; + int i, j; + float points[100]; + float fp[100][10000]; + + char *filename, *dirname, sentence_filename[40], data_out[40], label_out[40]; + short type, size; + FILE *fpdata, *fpsent, *fplout; + int dout, num_points; + char word[40]; + + int scounter, ssampPeriod; /* used for swapping */ + short ssize, stype; + + + if (argc == 1) { + fprintf(stderr, "usage: %s input_file_name dimension_of_vector [directory_name]\n",argv[0]); + exit(1); + } + counter = 0; + filename = argv[1]; + sscanf(argv[2], "%d",&num_points); + if (argc == 4){ + dirname=argv[3]; + sprintf(data_out, "%s/%s.ext", dirname,filename); + sprintf(label_out, "%s/%s.lab", dirname,filename); + } else { + sprintf(data_out, "%s.ext", filename); + sprintf(label_out, "%s.lab", filename); + } + sprintf(sentence_filename, "%s.sent", filename); + + if ((fpdata = fopen(filename, "r")) == NULL) { printf("%s not found\n",filename); } + if ((fpsent = fopen(sentence_filename, "r")) == NULL) { printf("%s not found\n",sentence_filename); } + if ((dout = open(data_out, O_RDWR | O_CREAT, S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH )) == -1) { printf("%s not found\n",data_out); }; + fprintf(stderr, "opening for data %d %s\n", dout, data_out); + fplout = fopen(label_out, "w"); + + /* FEATURES: num_points is the dimension of the feature vector */ + for (i=0; i< num_points; i++) { + scanf_value = fscanf(fpdata, "%f", &(points[i])); + } + + for (i=0; i< num_points; i++) { + fp[i][counter]=(float) points[i]; + } + counter++; + + while (scanf_value > 0) + { + for (i=0; i< num_points; i++) { + scanf_value = fscanf(fpdata, "%f", &(points[i])); + } + for (i=0; i< num_points; i++) { + fp[i][counter]=(float) points[i]; + } + counter++; + } + + + /* HEADER */ + /* float data */ + size = (short) (num_points * sizeof(float)); + /* user type */ + type = (short) 9; + /* write header */ + if (counter > 0 ) { + /* Write label */ + fscanf(fpsent, "%s", word); + fprintf(fplout, "0 %d %s\n",counter*sampPeriod,word); + if (IsVAXOrder()){ + scounter = SwapInt32(counter); + ssampPeriod = SwapInt32(sampPeriod); + ssize = SwapShort(size); + stype = SwapShort(type); + write(dout, &scounter, 4); + write(dout, &ssampPeriod, 4); + write(dout, &ssize, 2); + write(dout, &stype, 2); + } else { + write(dout, &counter, 4); + write(dout, &sampPeriod, 4); + write(dout, &size, 2); + write(dout, &type, 2); + } + + fprintf(stderr, "number of frames %d\n", counter); + /* write data */ + for (i=0; i < counter; i++) + { + for (j=0;j 1 1 + 1 +~h "TANI" + + 5 + 2 + 1 + 3.165879e+00 + 1 + 1.140148e+00 + 1.969035e+00 + 3 + 1 + 3.165879e+00 + 1 + 1.140148e+00 + 1.969035e+00 + 4 + 1 + 3.165879e+00 + 1 + 1.140148e+00 + 1.969035e+00 + 5 + 0.000000e+00 1.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 + 0.000000e+00 6.000000e-01 4.000000e-01 0.000000e+00 0.000000e+00 + 0.000000e+00 0.000000e+00 6.000000e-01 4.000000e-01 0.000000e+00 + 0.000000e+00 0.000000e+00 0.000000e+00 7.000000e-01 3.000000e-01 + 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 + diff -Nur htk.org/work/hmm0/YAMA htk/work/hmm0/YAMA --- htk.org/work/hmm0/YAMA Thu Jan 1 09:00:00 1970 +++ htk/work/hmm0/YAMA Wed Jan 9 12:46:05 2002 @@ -0,0 +1,31 @@ +~o + 1 1 + 1 +~h "YAMA" + + 5 + 2 + 1 + 3.165879e+00 + 1 + 1.140148e+00 + 1.969035e+00 + 3 + 1 + 3.165879e+00 + 1 + 1.140148e+00 + 1.969035e+00 + 4 + 1 + 3.165879e+00 + 1 + 1.140148e+00 + 1.969035e+00 + 5 + 0.000000e+00 1.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 + 0.000000e+00 6.000000e-01 4.000000e-01 0.000000e+00 0.000000e+00 + 0.000000e+00 0.000000e+00 6.000000e-01 4.000000e-01 0.000000e+00 + 0.000000e+00 0.000000e+00 0.000000e+00 7.000000e-01 3.000000e-01 + 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 + diff -Nur htk.org/work/hmm0/vFloors htk/work/hmm0/vFloors --- htk.org/work/hmm0/vFloors Thu Jan 1 09:00:00 1970 +++ htk/work/hmm0/vFloors Wed Jan 9 12:46:10 2002 @@ -0,0 +1,3 @@ +~v varFloor1 + 1 + 1.140148e-02 diff -Nur htk.org/work/hmm1/TANI htk/work/hmm1/TANI --- htk.org/work/hmm1/TANI Thu Jan 1 09:00:00 1970 +++ htk/work/hmm1/TANI Wed Jan 9 12:46:16 2002 @@ -0,0 +1,31 @@ +~o + 1 1 + 1 +~h "TANI" + + 5 + 2 + 1 + 2.323588e+00 + 1 + 4.424386e-01 + 1.022423e+00 + 3 + 1 + 4.252027e+00 + 1 + 5.712353e-01 + 1.277923e+00 + 4 + 1 + 3.044191e+00 + 1 + 2.301752e-02 + -1.933623e+00 + 5 + 0.000000e+00 1.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 + 0.000000e+00 9.128893e-01 8.711070e-02 0.000000e+00 0.000000e+00 + 0.000000e+00 0.000000e+00 8.948036e-01 1.051963e-01 0.000000e+00 + 0.000000e+00 0.000000e+00 0.000000e+00 8.144479e-01 1.855521e-01 + 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 + diff -Nur htk.org/work/hmm1/YAMA htk/work/hmm1/YAMA --- htk.org/work/hmm1/YAMA Thu Jan 1 09:00:00 1970 +++ htk/work/hmm1/YAMA Wed Jan 9 12:46:13 2002 @@ -0,0 +1,31 @@ +~o + 1 1 + 1 +~h "YAMA" + + 5 + 2 + 1 + 2.323588e+00 + 1 + 4.424386e-01 + 1.022423e+00 + 3 + 1 + 4.252027e+00 + 1 + 5.712353e-01 + 1.277923e+00 + 4 + 1 + 3.044191e+00 + 1 + 2.301752e-02 + -1.933623e+00 + 5 + 0.000000e+00 1.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 + 0.000000e+00 9.128893e-01 8.711070e-02 0.000000e+00 0.000000e+00 + 0.000000e+00 0.000000e+00 8.948036e-01 1.051963e-01 0.000000e+00 + 0.000000e+00 0.000000e+00 0.000000e+00 8.144479e-01 1.855521e-01 + 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 + diff -Nur htk.org/work/hmm2/newMacros htk/work/hmm2/newMacros --- htk.org/work/hmm2/newMacros Thu Jan 1 09:00:00 1970 +++ htk/work/hmm2/newMacros Wed Jan 9 12:46:21 2002 @@ -0,0 +1,59 @@ +~o + 1 1 + 1 +~h "YAMA" + + 5 + 2 + 1 + 2.797138e+00 + 1 + 2.398828e-01 + 4.102721e-01 + 3 + 1 + 4.346828e+00 + 1 + 4.556851e-01 + 1.051924e+00 + 4 + 1 + 3.024391e+00 + 1 + 2.370895e-02 + -1.904026e+00 + 5 + 0.000000e+00 1.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 + 0.000000e+00 7.552988e-01 2.447012e-01 0.000000e+00 0.000000e+00 + 0.000000e+00 0.000000e+00 9.439978e-01 5.600217e-02 0.000000e+00 + 0.000000e+00 0.000000e+00 0.000000e+00 8.115674e-01 1.884326e-01 + 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 + +~h "TANI" + + 5 + 2 + 1 + 2.222661e+00 + 1 + 4.279468e-01 + 9.891206e-01 + 3 + 1 + 2.779640e+00 + 1 + 6.706785e-02 + -8.641734e-01 + 4 + 1 + 3.063677e+00 + 1 + 2.158906e-02 + -1.997692e+00 + 5 + 0.000000e+00 1.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 + 0.000000e+00 9.471203e-01 5.287969e-02 0.000000e+00 0.000000e+00 + 0.000000e+00 0.000000e+00 1.107724e-01 8.892276e-01 0.000000e+00 + 0.000000e+00 0.000000e+00 0.000000e+00 8.170031e-01 1.829969e-01 + 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 + diff -Nur htk.org/work/hmm3/newMacros htk/work/hmm3/newMacros --- htk.org/work/hmm3/newMacros Thu Jan 1 09:00:00 1970 +++ htk/work/hmm3/newMacros Wed Jan 9 12:46:24 2002 @@ -0,0 +1,59 @@ +~o + 1 1 + 1 +~h "YAMA" + + 5 + 2 + 1 + 2.884755e+00 + 1 + 2.508847e-01 + 4.551152e-01 + 3 + 1 + 4.400169e+00 + 1 + 4.159929e-01 + 9.607899e-01 + 4 + 1 + 3.024677e+00 + 1 + 2.369999e-02 + -1.904403e+00 + 5 + 0.000000e+00 1.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 + 0.000000e+00 7.972263e-01 2.027738e-01 0.000000e+00 0.000000e+00 + 0.000000e+00 0.000000e+00 9.411367e-01 5.886327e-02 0.000000e+00 + 0.000000e+00 0.000000e+00 0.000000e+00 8.123782e-01 1.876218e-01 + 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 + +~h "TANI" + + 5 + 2 + 1 + 2.214592e+00 + 1 + 4.288623e-01 + 9.912577e-01 + 3 + 1 + 2.741179e+00 + 1 + 5.787171e-02 + -1.011650e+00 + 4 + 1 + 3.062951e+00 + 1 + 2.164590e-02 + -1.995062e+00 + 5 + 0.000000e+00 1.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 + 0.000000e+00 9.463561e-01 5.364390e-02 0.000000e+00 0.000000e+00 + 0.000000e+00 0.000000e+00 1.762397e-01 8.237603e-01 0.000000e+00 + 0.000000e+00 0.000000e+00 0.000000e+00 8.228398e-01 1.771602e-01 + 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 + diff -Nur htk.org/work/hmm4/newMacros htk/work/hmm4/newMacros --- htk.org/work/hmm4/newMacros Thu Jan 1 09:00:00 1970 +++ htk/work/hmm4/newMacros Wed Jan 9 12:46:27 2002 @@ -0,0 +1,59 @@ +~o + 1 1 + 1 +~h "YAMA" + + 5 + 2 + 1 + 2.936106e+00 + 1 + 2.660739e-01 + 5.138959e-01 + 3 + 1 + 4.427107e+00 + 1 + 3.999868e-01 + 9.215534e-01 + 4 + 1 + 3.025785e+00 + 1 + 2.388420e-02 + -1.896661e+00 + 5 + 0.000000e+00 1.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 + 0.000000e+00 8.142729e-01 1.857271e-01 0.000000e+00 0.000000e+00 + 0.000000e+00 0.000000e+00 9.394160e-01 6.058400e-02 0.000000e+00 + 0.000000e+00 0.000000e+00 0.000000e+00 8.134243e-01 1.865757e-01 + 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 + +~h "TANI" + + 5 + 2 + 1 + 2.210582e+00 + 1 + 4.310577e-01 + 9.963636e-01 + 3 + 1 + 2.715823e+00 + 1 + 6.237608e-02 + -9.366963e-01 + 4 + 1 + 3.061771e+00 + 1 + 2.169880e-02 + -1.992621e+00 + 5 + 0.000000e+00 1.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 + 0.000000e+00 9.457970e-01 5.420297e-02 0.000000e+00 0.000000e+00 + 0.000000e+00 0.000000e+00 2.661781e-01 7.338219e-01 0.000000e+00 + 0.000000e+00 0.000000e+00 0.000000e+00 8.241943e-01 1.758057e-01 + 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 + diff -Nur htk.org/work/hmm5/newMacros htk/work/hmm5/newMacros --- htk.org/work/hmm5/newMacros Thu Jan 1 09:00:00 1970 +++ htk/work/hmm5/newMacros Wed Jan 9 12:46:30 2002 @@ -0,0 +1,59 @@ +~o + 1 1 + 1 +~h "YAMA" + + 5 + 2 + 1 + 2.962048e+00 + 1 + 2.752702e-01 + 5.478749e-01 + 3 + 1 + 4.440001e+00 + 1 + 3.931241e-01 + 9.042471e-01 + 4 + 1 + 3.026435e+00 + 1 + 2.399998e-02 + -1.891825e+00 + 5 + 0.000000e+00 1.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 + 0.000000e+00 8.217444e-01 1.782556e-01 0.000000e+00 0.000000e+00 + 0.000000e+00 0.000000e+00 9.385162e-01 6.148383e-02 0.000000e+00 + 0.000000e+00 0.000000e+00 0.000000e+00 8.139756e-01 1.860244e-01 + 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 + +~h "TANI" + + 5 + 2 + 1 + 2.205131e+00 + 1 + 4.347216e-01 + 1.004827e+00 + 3 + 1 + 2.680941e+00 + 1 + 6.804851e-02 + -8.496573e-01 + 4 + 1 + 3.059795e+00 + 1 + 2.179423e-02 + -1.988233e+00 + 5 + 0.000000e+00 1.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 + 0.000000e+00 9.449555e-01 5.504451e-02 0.000000e+00 0.000000e+00 + 0.000000e+00 0.000000e+00 3.664691e-01 6.335309e-01 0.000000e+00 + 0.000000e+00 0.000000e+00 0.000000e+00 8.262208e-01 1.737792e-01 + 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 + diff -Nur htk.org/work/hmm6/newMacros htk/work/hmm6/newMacros --- htk.org/work/hmm6/newMacros Thu Jan 1 09:00:00 1970 +++ htk/work/hmm6/newMacros Wed Jan 9 12:46:33 2002 @@ -0,0 +1,59 @@ +~o + 1 1 + 1 +~h "YAMA" + + 5 + 2 + 1 + 2.974218e+00 + 1 + 2.802410e-01 + 5.657717e-01 + 3 + 1 + 4.445625e+00 + 1 + 3.904116e-01 + 8.973233e-01 + 4 + 1 + 3.026747e+00 + 1 + 2.405662e-02 + -1.889468e+00 + 5 + 0.000000e+00 1.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 + 0.000000e+00 8.249441e-01 1.750559e-01 0.000000e+00 0.000000e+00 + 0.000000e+00 0.000000e+00 9.380976e-01 6.190243e-02 0.000000e+00 + 0.000000e+00 0.000000e+00 0.000000e+00 8.142328e-01 1.857672e-01 + 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 + +~h "TANI" + + 5 + 2 + 1 + 2.199116e+00 + 1 + 4.389011e-01 + 1.014396e+00 + 3 + 1 + 2.649366e+00 + 1 + 7.178517e-02 + -7.962003e-01 + 4 + 1 + 3.057599e+00 + 1 + 2.188270e-02 + -1.984182e+00 + 5 + 0.000000e+00 1.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 + 0.000000e+00 9.439967e-01 5.600325e-02 0.000000e+00 0.000000e+00 + 0.000000e+00 0.000000e+00 4.480472e-01 5.519528e-01 0.000000e+00 + 0.000000e+00 0.000000e+00 0.000000e+00 8.285364e-01 1.714636e-01 + 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 + diff -Nur htk.org/work/proto htk/work/proto --- htk.org/work/proto Thu Jan 1 09:00:00 1970 +++ htk/work/proto Wed Jan 9 16:24:00 2002 @@ -0,0 +1,26 @@ +~o 1 +~h "proto" + + 5 + 2 + 1 + 0.0 + 1 + 1.0 + 3 + 1 + 0.0 + 1 + 1.0 + 4 + 1 + 0.0 + 1 + 1.0 + 5 + 0.0 1.0 0.0 0.0 0.0 + 0.0 0.6 0.4 0.0 0.0 + 0.0 0.0 0.6 0.4 0.0 + 0.0 0.0 0.0 0.7 0.3 + 0.0 0.0 0.0 0.0 0.0 + diff -Nur htk.org/work/results htk/work/results --- htk.org/work/results Thu Jan 1 09:00:00 1970 +++ htk/work/results Wed Jan 9 16:20:38 2002 @@ -0,0 +1,7 @@ +#!MLF!# +"te/yama5.rec" +0 56000 YAMA -12.763847 +. +"te/tani5.rec" +0 70000 TANI -43.812759 +. diff -Nur htk.org/work/te/tani5 htk/work/te/tani5 --- htk.org/work/te/tani5 Thu Jan 1 09:00:00 1970 +++ htk/work/te/tani5 Wed Jan 9 12:44:37 2002 @@ -0,0 +1 @@ +3 3 3 3 3 3 2 2 2 2 2 2 2 2 1 1 1 1 1 1 1 1 1 1 1 2 2 2 2 2 2 3 3 3 Binary files htk.org/work/te/tani5.ext and htk/work/te/tani5.ext differ diff -Nur htk.org/work/te/yama5 htk/work/te/yama5 --- htk.org/work/te/yama5 Thu Jan 1 09:00:00 1970 +++ htk/work/te/yama5 Wed Jan 9 12:44:53 2002 @@ -0,0 +1 @@ +3 3 3 3 3 4 4 4 5 5 5 4 4 4 4 4 4 4 4 3 3 3 3 3 3 3 3 Binary files htk.org/work/te/yama5.ext and htk/work/te/yama5.ext differ diff -Nur htk.org/work/tefiles htk/work/tefiles --- htk.org/work/tefiles Thu Jan 1 09:00:00 1970 +++ htk/work/tefiles Wed Jan 9 01:24:51 2002 @@ -0,0 +1,2 @@ +te/yama5.ext +te/tani5.ext diff -Nur htk.org/work/tr/data9 htk/work/tr/data9 --- htk.org/work/tr/data9 Thu Jan 1 09:00:00 1970 +++ htk/work/tr/data9 Tue Jan 8 17:42:25 2002 @@ -0,0 +1,35 @@ +8.37e+01 7.36e+01 1.15e+03 3.39e+00 -4.36e+01 -1.00e+00 2.29e-02 1.58e+01 8.56e+00 +1.38e+02 1.29e+02 1.40e+03 2.54e+00 -2.59e+01 -9.99e-01 3.85e-02 1.55e+01 9.70e+00 +1.31e+02 1.29e+02 1.31e+03 2.06e+00 -8.39e+00 -9.93e-01 1.18e-01 1.61e+01 1.12e+01 +1.22e+02 1.29e+02 1.18e+03 1.31e+00 2.53e+00 -9.30e-01 -3.67e-01 1.36e+01 1.19e+01 +1.17e+02 1.24e+02 1.19e+03 1.19e+00 2.17e+00 -9.09e-01 -4.18e-01 1.32e+01 1.21e+01 +1.12e+02 1.20e+02 1.13e+03 1.39e+00 9.25e-01 6.79e-01 7.34e-01 1.36e+01 1.15e+01 +1.09e+02 1.15e+02 1.04e+03 1.62e+00 4.88e-01 4.39e-01 8.99e-01 1.39e+01 1.09e+01 +1.06e+02 1.10e+02 9.54e+02 2.05e+00 5.54e-01 4.85e-01 8.75e-01 1.41e+01 9.84e+00 +1.05e+02 1.03e+02 8.77e+02 2.90e+00 6.91e-01 5.68e-01 8.23e-01 1.48e+01 8.70e+00 +1.04e+02 9.68e+01 7.62e+02 4.17e+00 6.12e-01 5.22e-01 8.53e-01 1.52e+01 7.44e+00 +1.04e+02 9.05e+01 7.19e+02 4.63e+00 5.46e-01 4.80e-01 8.78e-01 1.50e+01 6.99e+00 +1.00e+02 8.48e+01 6.62e+02 4.42e+00 4.92e-01 4.42e-01 8.97e-01 1.41e+01 6.72e+00 +1.01e+02 7.77e+01 6.22e+02 4.31e+00 4.27e-01 3.93e-01 9.20e-01 1.31e+01 6.30e+00 +9.81e+01 7.10e+01 6.07e+02 4.37e+00 3.11e-01 2.97e-01 9.55e-01 1.24e+01 5.91e+00 +9.87e+01 6.59e+01 5.62e+02 3.91e+00 2.20e-01 2.15e-01 9.77e-01 1.17e+01 5.93e+00 +1.00e+02 6.03e+01 5.49e+02 4.77e+00 1.67e-01 1.65e-01 9.86e-01 1.14e+01 5.20e+00 +1.02e+02 5.76e+01 5.49e+02 3.82e+00 1.56e-01 1.54e-01 9.88e-01 1.12e+01 5.74e+00 +1.01e+02 5.47e+01 5.56e+02 4.01e+00 1.17e-01 1.17e-01 9.93e-01 1.13e+01 5.64e+00 +1.02e+02 5.40e+01 5.47e+02 3.80e+00 1.13e-01 1.13e-01 9.94e-01 1.11e+01 5.71e+00 +1.03e+02 5.32e+01 5.59e+02 3.38e+00 8.51e-02 8.47e-02 9.96e-01 1.12e+01 6.12e+00 +1.03e+02 5.32e+01 5.36e+02 4.19e+00 9.72e-02 9.67e-02 9.95e-01 1.14e+01 5.56e+00 +1.04e+02 5.33e+01 5.20e+02 4.08e+00 5.74e-02 5.73e-02 9.98e-01 1.08e+01 5.34e+00 +1.04e+02 5.29e+01 5.13e+02 3.64e+00 5.43e-02 5.42e-02 9.99e-01 1.08e+01 5.64e+00 +1.04e+02 5.29e+01 5.27e+02 4.15e+00 9.55e-02 9.51e-02 9.95e-01 1.08e+01 5.31e+00 +1.04e+02 5.28e+01 5.31e+02 4.15e+00 1.13e-01 1.13e-01 9.94e-01 1.11e+01 5.46e+00 +1.04e+02 5.37e+01 5.25e+02 4.34e+00 1.29e-01 1.28e-01 9.92e-01 1.08e+01 5.19e+00 +1.03e+02 5.38e+01 5.27e+02 3.74e+00 1.45e-01 1.44e-01 9.90e-01 1.07e+01 5.52e+00 +1.02e+02 5.48e+01 5.14e+02 3.68e+00 2.37e-01 2.31e-01 9.73e-01 1.03e+01 5.38e+00 +1.01e+02 5.62e+01 5.02e+02 3.96e+00 3.40e-01 3.22e-01 9.47e-01 1.02e+01 5.13e+00 +1.01e+02 5.65e+01 5.15e+02 3.40e+00 5.11e-01 4.55e-01 8.91e-01 1.01e+01 5.50e+00 +1.01e+02 6.00e+01 5.13e+02 3.57e+00 7.39e-01 5.94e-01 8.04e-01 1.03e+01 5.43e+00 + + + + Binary files htk.org/work/tr/data9.ext and htk/work/tr/data9.ext differ diff -Nur htk.org/work/tr/data9.lab htk/work/tr/data9.lab --- htk.org/work/tr/data9.lab Thu Jan 1 09:00:00 1970 +++ htk/work/tr/data9.lab Tue Jan 8 23:39:11 2002 @@ -0,0 +1 @@ +0 64000 Hello diff -Nur htk.org/work/tr/data9.sent htk/work/tr/data9.sent --- htk.org/work/tr/data9.sent Thu Jan 1 09:00:00 1970 +++ htk/work/tr/data9.sent Tue Jan 8 23:39:09 2002 @@ -0,0 +1 @@ +Hello World diff -Nur htk.org/work/tr/tani1 htk/work/tr/tani1 --- htk.org/work/tr/tani1 Thu Jan 1 09:00:00 1970 +++ htk/work/tr/tani1 Wed Jan 9 12:39:15 2002 @@ -0,0 +1 @@ +3.2 3.1 3 3.1 2.7 2.3 2.1 2.1 1.9 1.5 1.6 1.1 1.3 2.0 2.8 2.3 2.9 2.9 3 3.3 3 3 Binary files htk.org/work/tr/tani1.ext and htk/work/tr/tani1.ext differ diff -Nur htk.org/work/tr/tani2 htk/work/tr/tani2 --- htk.org/work/tr/tani2 Thu Jan 1 09:00:00 1970 +++ htk/work/tr/tani2 Wed Jan 9 12:39:50 2002 @@ -0,0 +1 @@ +3.0 3.1 3 3.1 2.7 2.5 2.3 2.1 2.1 1.9 1.5 1.6 1.3 1.3 1.1 1.3 2.0 2.8 2.3 2.7 2.9 2.9 3 3.3 3 3 3.2 Binary files htk.org/work/tr/tani2.ext and htk/work/tr/tani2.ext differ diff -Nur htk.org/work/tr/tani3 htk/work/tr/tani3 --- htk.org/work/tr/tani3 Thu Jan 1 09:00:00 1970 +++ htk/work/tr/tani3 Wed Jan 9 12:40:25 2002 @@ -0,0 +1 @@ +3.1 3.2 3.1 3 3.1 2.7 2.3 2.3 2.1 2.1 1.9 1.5 1.6 1.3 1.1 1.3 1.7 2.0 2.8 2.3 2.9 2.9 3 3.3 Binary files htk.org/work/tr/tani3.ext and htk/work/tr/tani3.ext differ diff -Nur htk.org/work/tr/tani4 htk/work/tr/tani4 --- htk.org/work/tr/tani4 Thu Jan 1 09:00:00 1970 +++ htk/work/tr/tani4 Wed Jan 9 12:41:38 2002 @@ -0,0 +1 @@ +3 3.1 3 2.7 3.1 2.7 2.5 2.3 2.1 2.1 1.9 1.4 1.5 1.6 1.1 1.3 1.7 2.0 2.8 2.3 2.9 2.9 3 3.3 3 Binary files htk.org/work/tr/tani4.ext and htk/work/tr/tani4.ext differ diff -Nur htk.org/work/tr/yama1 htk/work/tr/yama1 --- htk.org/work/tr/yama1 Thu Jan 1 09:00:00 1970 +++ htk/work/tr/yama1 Wed Jan 9 12:42:12 2002 @@ -0,0 +1 @@ +3.2 3 3 3 4.1 4 4 5.3 5.2 5.2 5.5 5.1 5.2 4 4.2 4 4 3.5 3.7 3 3 3.1 Binary files htk.org/work/tr/yama1.ext and htk/work/tr/yama1.ext differ diff -Nur htk.org/work/tr/yama2 htk/work/tr/yama2 --- htk.org/work/tr/yama2 Thu Jan 1 09:00:00 1970 +++ htk/work/tr/yama2 Wed Jan 9 12:42:40 2002 @@ -0,0 +1 @@ +2.8 3.2 3.8 3.3 3.5 4.1 4 4.7 5.1 5.2 5.2 5.2 4.7 4.2 4 4 3.5 3.7 3 3 3.1 3.2 2.7 Binary files htk.org/work/tr/yama2.ext and htk/work/tr/yama2.ext differ diff -Nur htk.org/work/tr/yama3 htk/work/tr/yama3 --- htk.org/work/tr/yama3 Thu Jan 1 09:00:00 1970 +++ htk/work/tr/yama3 Wed Jan 9 12:43:08 2002 @@ -0,0 +1 @@ +2.8 3.2 3 3.7 3.9 4.1 4 4.7 5.1 5.2 5.3 5.2 5.2 4.7 4.4 4.2 4 4 3.5 3.7 3.3 3 3.1 3.2 2.9 Binary files htk.org/work/tr/yama3.ext and htk/work/tr/yama3.ext differ diff -Nur htk.org/work/tr/yama4 htk/work/tr/yama4 --- htk.org/work/tr/yama4 Thu Jan 1 09:00:00 1970 +++ htk/work/tr/yama4 Wed Jan 9 12:43:28 2002 @@ -0,0 +1 @@ +2 2 2 2 2.8 3.2 3 3.3 3 3.7 3.2 3.9 4.1 4 4.7 5.1 5 5 5 5.2 5.3 5.2 5.2 4.7 4.4 4.2 4 4 3.5 3.7 3.3 3 3.1 3.2 2.9 Binary files htk.org/work/tr/yama4.ext and htk/work/tr/yama4.ext differ diff -Nur htk.org/work/trfiles htk/work/trfiles --- htk.org/work/trfiles Thu Jan 1 09:00:00 1970 +++ htk/work/trfiles Wed Jan 9 00:38:20 2002 @@ -0,0 +1,8 @@ +tr/tani1.ext +tr/tani2.ext +tr/tani3.ext +tr/tani4.ext +tr/yama1.ext +tr/yama2.ext +tr/yama3.ext +tr/yama4.ext \ No newline at end of file diff -Nur htk.org/work/wdnet htk/work/wdnet --- htk.org/work/wdnet Thu Jan 1 09:00:00 1970 +++ htk/work/wdnet Wed Jan 9 01:24:27 2002 @@ -0,0 +1,12 @@ +VERSION=1.0 +N=5 L=5 +I=0 W=!NULL +I=1 W=!NULL +I=2 W=YAMA +I=3 W=!NULL +I=4 W=TANI +J=0 S=0 E=2 +J=1 S=0 E=4 +J=2 S=2 E=3 +J=3 S=3 E=1 +J=4 S=4 E=3 diff -Nur htk.org/work/wlist htk/work/wlist --- htk.org/work/wlist Thu Jan 1 09:00:00 1970 +++ htk/work/wlist Wed Jan 9 00:35:11 2002 @@ -0,0 +1,2 @@ +YAMA +TANI diff -Nur htk.org/work/yamatani.mlf htk/work/yamatani.mlf --- htk.org/work/yamatani.mlf Thu Jan 1 09:00:00 1970 +++ htk/work/yamatani.mlf Wed Jan 9 14:44:10 2002 @@ -0,0 +1,7 @@ +#!MLF!# +"*/yama*.lab" +YAMA +. +"*/tani*.lab" +TANI +.