在這一節中,我們將嘗試改變 Mixture 的個數,並同時改變 MFCC 的維度。

首先我們看一個範例,使用13維MFCC,並畫出 Inside & Outside 辨識率對 Mixture 個數的變化,如下:

Example 1: htk/chineseDigitRecog/training/htkMixture01.mhtkPrm=htkParamSet; maxMixNum=8; for i=1:maxMixNum htkPrm.mixtureNum=i; fprintf('====== %d/%d\n', i, maxMixNum); [trainRR(i), testRR(i)]=htkTrainTest(htkPrm); end plot(1:maxMixNum, trainRR, 'o-', 1:maxMixNum, testRR, 'o-'); xlabel('No. of mixtures'); ylabel('Recog. rate (%)'); legend('Inside test', 'Outside test');====== 1/8 Pruning-Off Pruning-Off Pruning-Off Pruning-Off Pruning-Off ====== 2/8 Pruning-Off Pruning-Off Pruning-Off Pruning-Off Pruning-Off ====== 3/8 Pruning-Off Pruning-Off Pruning-Off Pruning-Off Pruning-Off ====== 4/8 Pruning-Off Pruning-Off Pruning-Off Pruning-Off Pruning-Off ====== 5/8 Pruning-Off Pruning-Off Pruning-Off Pruning-Off Pruning-Off ====== 6/8 Pruning-Off Pruning-Off Pruning-Off Pruning-Off Pruning-Off ====== 7/8 Pruning-Off Pruning-Off Pruning-Off Pruning-Off Pruning-Off ====== 8/8 Pruning-Off Pruning-Off Pruning-Off Pruning-Off Pruning-Off

上述範例中,我們把 HTK 的訓練和辨識都包在一個函數 htkTrainTest.m,以方便反覆呼叫。事實上我們可以不必重複MFCC的計算,只需要算一次就好了,這樣比較能夠減少計算時間。

我們也可以使用 13/26/39 維MFCC,並畫出 Inside & Outside 辨識率對 Mixture 個數的變化,如下:

Example 2: htk/chineseDigitRecog/training/htkMixtureMfcc01.m% Get the RR when feature dim. and mixture no. are changing htkPrm=htkParamSet; maxMixNum=8; for i=1:maxMixNum htkPrm.mixtureNum=i; fprintf('====== %d/%d\n', i, maxMixNum); [trainRR(i,1), testRR(i,1)]=htkTrainTest(htkPrm); end htkPrm.feaCfgFile='mfcc26.cfg'; htkPrm.feaType='MFCC_E_D_Z'; htkPrm.feaDim=26; htkPrm.streamWidth=[26]; for i=1:maxMixNum htkPrm.mixtureNum=i; fprintf('====== %d/%d\n', i, maxMixNum); [trainRR(i,2), testRR(i,2)]=htkTrainTest(htkPrm); end htkPrm.feaCfgFile='mfcc39.cfg'; htkPrm.feaType='MFCC_E_D_A_Z'; htkPrm.feaDim=39; htkPrm.streamWidth=[39]; for i=1:maxMixNum htkPrm.mixtureNum=i; fprintf('====== %d/%d\n', i, maxMixNum); [trainRR(i,3), testRR(i,3)]=htkTrainTest(htkPrm); end plot( 1:maxMixNum, trainRR(:,1), '^-b', 1:maxMixNum, testRR(:,1), 'o-b', ... 1:maxMixNum, trainRR(:,2), '^-g', 1:maxMixNum, testRR(:,2), 'o-g', ... 1:maxMixNum, trainRR(:,3), '^-r', 1:maxMixNum, testRR(:,3), 'o-r'); xlabel('No. of mixtures'); ylabel('Recog. rate (%)'); legend('13D, Inside test', '13D, Outside Test', '26D, Inside Test', '26D, Outside test', '39D, Inside test', '39D, Outside test', 'Location', 'BestOutside');====== 1/8 Pruning-Off Pruning-Off Pruning-Off Pruning-Off Pruning-Off ====== 2/8 Pruning-Off Pruning-Off Pruning-Off Pruning-Off Pruning-Off ====== 3/8 Pruning-Off Pruning-Off Pruning-Off Pruning-Off Pruning-Off ====== 4/8 Pruning-Off Pruning-Off Pruning-Off Pruning-Off Pruning-Off ====== 5/8 Pruning-Off Pruning-Off Pruning-Off Pruning-Off Pruning-Off ====== 6/8 Pruning-Off Pruning-Off Pruning-Off Pruning-Off Pruning-Off ====== 7/8 Pruning-Off Pruning-Off Pruning-Off Pruning-Off Pruning-Off ====== 8/8 Pruning-Off Pruning-Off Pruning-Off Pruning-Off Pruning-Off ====== 1/8 Pruning-Off Pruning-Off Pruning-Off Pruning-Off Pruning-Off ====== 2/8 Pruning-Off Pruning-Off Pruning-Off Pruning-Off Pruning-Off ====== 3/8 Pruning-Off Pruning-Off Pruning-Off Pruning-Off Pruning-Off ====== 4/8 Pruning-Off Pruning-Off Pruning-Off Pruning-Off Pruning-Off ====== 5/8 Pruning-Off Pruning-Off Pruning-Off Pruning-Off Pruning-Off ====== 6/8 Pruning-Off Pruning-Off Pruning-Off Pruning-Off Pruning-Off ====== 7/8 Pruning-Off Pruning-Off Pruning-Off Pruning-Off Pruning-Off ====== 8/8 Pruning-Off Pruning-Off Pruning-Off Pruning-Off Pruning-Off ====== 1/8 Pruning-Off Pruning-Off Pruning-Off Pruning-Off Pruning-Off ====== 2/8 Pruning-Off Pruning-Off Pruning-Off Pruning-Off Pruning-Off ====== 3/8 Pruning-Off Pruning-Off Pruning-Off Pruning-Off Pruning-Off ====== 4/8 Pruning-Off Pruning-Off Pruning-Off Pruning-Off Pruning-Off ====== 5/8 Pruning-Off Pruning-Off Pruning-Off Pruning-Off Pruning-Off ====== 6/8 Pruning-Off Pruning-Off Pruning-Off Pruning-Off Pruning-Off ====== 7/8 Pruning-Off Pruning-Off Pruning-Off Pruning-Off Pruning-Off ====== 8/8 Pruning-Off Pruning-Off Pruning-Off Pruning-Off Pruning-Off

上述範例的計算時間比較久,請耐心等候。
Audio Signal Processing and Recognition (音訊處理與辨識)