¦³Ãö©ó CHMM ªº¹ê§@¡A§Ṳ́j³¡¤À¬O±Ä¥Î HTK (Hidden Markov Model Toolket) ¨Ó¶i¦æ»y®Æªº¾ã²z©M°V½m¡C¥H¤U±N¨Ï¥Î¤@Ó²³æªº½d¨Ò¡A¨Ó»¡©ú HTK ªº¨Ï¥Î¡C¦b³oÓ½d¨Ò¤¤¡A§Ú̱N¶i¦æ¤¤¤å¼Æ¦r¿ëÃÑ¡]±q 0 ¨ì 9¡^ªº¤u§@¡A¥]§t¨Ï¥Î HTK ¶i¦æÁn¾Ç¼Ò«¬ªº°V½m¡A¨Ãpºâ¬ÛÃöªº¿ëÃѲv¡C¥»¶¨Ï¥Î¤F´XÓ¯S©wªºªþÀɦW¡]mlf¡Bscp¡Btemplate¡Bcfg¡Bpam¡Binit¡Bhmm¡Bnet¡Bgrammar µ¥¡^¡AYn¥¿½TÅã¥Ü³o¨ÇÀɮשóÂsÄý¾¹¡A½Ð¨ú®ø³o¨ÇªþÀɦW©Ò¹ïÀ³ªºÀ³¥Îµ{¦¡¡A¥H«Kª½±µ±NÀɮפº®e§e²{©óÂsÄý¾¹¡C¡]Y¤£¨ú®ø³o¨Ç¬ÛÃöªºÀ³¥Îµ{¦¡¡AÂsÄý¾¹±N¸õ¥X¹ï¸Üµøµ¡¡A¸ß°Ý¬O§_¶i¦æ¤U¸ü¡C¡^§A¥i¥H¨Ï¥Î¤U¨Òªº batch ÀɮרӨú®ø³o¨ÇªþÀɦW©MÀ³¥Îµ{¦¡ªºÃö³s¡G
±µµÛ¡A§A¥²¶·¤U¸ü¤U¦CÀɮסG
½Ð¶}±Ò DOS µøµ¡¡A¶i¤J chineseDigitRecog/training ¥Ø¿ý«á¡Aª½±µ¦b DOS µøµ¡¤U°õ¦æ goSyl13.bat¡A§Y¥i¶i¦æ°V½m¡A¨Ãpºâ¿ëÃѲv¡C§A¤]¥i¥H¦b MATLAB ¤U¡A¶i¤J¦¹¥Ø¿ý¡A¨Ã°õ¦æ goSyl13.m¡A¥i¥H±o¨ì¬Û¦Pªºµ²ªG¡C
- ¤U¸ü HTK «ü¥O¡G®i¶}«á¡A¦³¨âӥؿý bin ¤Î bin.win32¡A¸Ì±¥]§t§ÚÌ·|¥Î¨ìªº HTK «ü¥O©M¨ä¥L¸ê®Æ³B²z«ü¥O¡C½Ð¥Ñ¡u±±¨î¥x/¨t²Î/¶i¶¥/Àô¹ÒÅܼÆ/¨t²ÎÅܼơv¡A±N³o¨âӥؿý¥[¤J path ªºÀô¹ÒÅܼơA¥H«K«áÄò¥Ñ DOS µøµ¡©I¥s³o¨Ç«ü¥O¡C
- ¤U¸ü°V½m«ü¥O¤Îµ°TÀɮסG®i¶}«á¡A¦³¨âӥؿý¡G
½Ð±N¤Wz¥Ø¿ý¡A©ñ¦b¨S¦³ªÅ®æªº¸ô®|¤W¡C¡]½Ð¤Å©ñ¦b®à±¡A¦]¬°®à±ªº¸ô®|¦³¥]§tªÅ®æ¡C¡^
- training¡G°V½m©Ò¥Î¨ìªºµ{¦¡½X¡C
- waveFile¡G0 ¨ì 9 ¼Æ¦r¿ýµªºµ°TÀɮסC
¦b¶i¦æ©Ò¦³ªº¤u§@¤§«e¡A§ÚÌn¤â°Ê·Ç³Æ¨âÓÀɮסA²Ä¤@ÓÀɮ׬O digitSyl.pam¡A«ü©ú¦p¦ó±N¨C¤@ӼƦrªº«÷µ¡]Phonetic Alphabets¡^©î¸Ñ¦¨Án¾Ç¼Ò«¬¡]Acoustic Models¡^¡A§Ú̥ثeªº§@ªk¡A¬O±N¨C¤@Óµ¸`¬Ý¦¨¤@ÓÁn¾Ç¼Ò«¬¡A¦p¤U¡G
¥H¤Wªº©î¸Ñ¤èªk¡A¬OÄÝ©ó¤ñ¸û²²¤ªº¤èªk¡A©Ò±o¨ìªº¿ëÃѮĪG¤]·|¤ñ¸û®t¡C«áÄò·|¦A»¡©ú¤ñ¸ûºë²Óªº¤èªk¡A¨Ò¦p¥H Monophone ©Î¬O Biphone ¨Ó°µ¬°Án¾Ç¼Ò«¬¡C
²Ä¤GÓÀɮ׫h¬O digitSyl.mlf¡A¬ö¿ý¨C¤@Óµ°TÀɮשҹïÀ³ªº¤å¥y¤º®e¡]¥Hµ¸`¬°³æ¦ì¡^¡A¦p¤U¡G
¦b¤WzÀɮפ¤¡Asil ¥NªíÀRµ¡A¦]¦¹·í§Ú̦b ling «e«á³£·|¥[¤W sil¡A´N¥Nªí "0" ªºµoµ«e«á³£¦³ÀRµ¡C
¥H¤U±N±N°w¹ï MATLAB «ü¥OÀÉ goSyl13.m ¤Î Batch «ü¥OÀÉ goSyl13.bat ¨Ó¶i¦æ»¡©ú¡A³oÃä¦@¥]§t¤F¤T¤j¶µ¤u§@¡G
¤À§O»¡©ú¦p¤U¡C
- »yµ¯S¼xªºÂ^¨ú¡Gpºâ MFCC
- Án¾Ç¼Ò«¬ªº°V½m¡G¨Ï¥Î EM ¨Ó¨D¨ú³Ì¨Î°Ñ¼Æ
- Án¾Ç¼Ò«¬ªº®Ä¯àµû¦ô¡G¿ëÃѲvªºpºâ
- »yµ¯S¼xªºÂ^¨ú¡Gpºâ MFCC
- ²£¥Í¿é¥X¥Ø¿ý
§ÚÌ¥ý²£¥Í¤TÓ©ñ¸m¿é¥XÀɮתº¥Ø¿ý¡GMATLAB «ü¥O¦p¤U¡G
- output¡G©ñ¸m¦UºØ¿é¥XÀɮסC
- output\feature¡G©ñ¸m»yµ¯S¼xÀɮסC
- output\hmm¡G©ñ¸m°V½m¹Lµ{©Ò²£¥Íªº HMM °Ñ¼ÆÀɮסC
mkdir('output'); mkdir('output/feature'); mkdir('output/hmm');Batch «ü¥O¦p¤U¡Gfor %%i in (output output\feature output\hmm) do mkdir %%i > nul 2>&1Y¥Ø¿ý¤w¸g¦s¦b¡A«h Batch «ü¥O¤£·|¦L¥X¥ô¦óĵ§i°T®§¡C
- ²£¥Í digitSyl.mnl ¤Î digitSylPhone.mlf
¥ý²£¥Í syl2phone.scp ÀɮסAMATLAB «ü¥O¦p¤U¡Gfid=fopen('output\syl2phone.scp', 'w'); fprintf(fid, 'EX'); fclose(fid); Batch «ü¥O¦p¤U¡G@echo EX > output\syl2phone.scp ©Ò²£¥Íªº syl2phone.scp Àɮפº®e¦p¤U¡G¨ä¤¤ªº¡uEX¡v¬O¥Nªí Expand¡A¨ä·N¸q¬O¡u¥Ñµ¸`¦r¦ê®i¶}¦¨phone¦r¦ê¡v¡A±N³Q¥Î©ó HTK ªº HLEd «ü¥O¡A¸Ô¨£¤Uz¡C
±µµÛ¡A§ÚÌ¥i¥H¨Ï¥Î¤U¦C HTK ªº HLEd «ü¥O¨Ó²£¥Í digitSyl.mnl ¤Î digitSylPhone.mlf¡G
HLEd -n output\digitSyl.mnl -d digitSyl.pam -l * -i output\digitSylPhone.mlf output\syl2phone.scp digitSyl.mlf¦b¤Wz«ü¥O¤¤¡A§Ų́ϥÎÃC¦â¨Óªí¥ÜÀɮתº¥Î³~¡AÂŦâ¥Nªí¬O¿é¤JÀɮסA¬õ¦â¥Nªí¬O¿é¥XÀɮסC¿é¥XÀÉ®× digitSyl.mnl ¦C¥X©Ò¦³¥Î¨ìªºÁn¾Ç¼Ò«¬¡A¦p¤U¡G
¦Ó digitSylPhone.mlf «h¬O±N digitSyl.mlf ªºµ¸`¸ê°TÂà´«¦¨¬° phone ¸ê°Tªºµ²ªG¡A¥H«K¥Î©óÁn¾Çªº°V½m¡AÀɮצp¤U¡G
- ²£¥Í wav2fea.scp
±µµÛ§ÚÌn¶i¦æ»yµ¯S¼xÂ^¨ú¡A¤]´N¬On±N¨C¤@Ó wav ÀÉ®×Âà´«¦¨ MFCC¡Aº¥ý§ÚÌ¥ý²£¥Í wav2fea.scp¡AMATLAB «ü¥O¦p¤U¡GwavDir='..\waveFile'; waveFiles=recursiveFileList(wavDir, 'wav'); outFile='output\wav2fea.scp'; fid=fopen(outFile, 'w'); for i=1:length(waveFiles) wavePath=strrep(waveFiles(i).path, '/', '\'); [a,b,c,d]=fileparts(wavePath); fprintf(fid, '%s\t%s\r\n', wavePath, ['output\feature\', b, '.fea']); end fclose(fid);Batch «ü¥O¦p¤U¡G(for /f "delims=" %%i in ('dir/s/b wave\*.wav') do @echo %%i output\feature\%%~ni.fea)> output\wav2fea.scp©Ò²£¥Íªº wav2fea.scp ¥Î¨Ó³W½d wav ÀɮשM©Ò²£¥Íªºµ°T¯S¼xÀɮתº¹ïÀ³Ãö«Y¡A¨ä¤º®e¦p¤U¡G¥Ñ¤WzÀÉ®×¥i¥H¬Ý¥X¡A©Ò¦³²£¥Íªº»yµ¯S¼xÀɮסA±N¥H fea ¬°ªþÀɦW¡A¨Ã©ñ¸m¦b output\feature ¥Ø¿ý¤U¡C
- ¨Ï¥Î HCopy.exe ¶i¦æ»yµ¯S¼x©â¨ú
±µµÛ¡A§ÚÌ´N¥i¥H¨Ï¥Î HTK ªº hcopy.exe «ü¥O¨Ó²£¥Í MFCC ÀɮסGHCopy -C mfcc.cfg -S output\wav2fea.scp¦b¤Wz«ü¥O¤¤¡Amfcc.cfg ¬O¤@ӰѼÆÀÉ¡A¥Î¨Ó³W½d²£¥Í MFCC ªº°Ñ¼Æ¡A¨ä¤º®e¦p¤U¡G Error: D:\users\jang\books\audiosignalprocessing/example/htk/chineseDigitRecog/training/mfcc.cfg does not exist!