% Compute the utterance-based recognition rates for speaker identification. % To run this program, you need to run goFrameRrWrtGaussianNum.m first to get gmmParamWrtGaussianNum.mat % Roger Jang, 20070531, 20090131 tInit=clock; addMyPath; sidOpt=sidOptSet; eval(sprintf('load %s/speakerSet.mat', sidOpt.outputDir)); if sidOpt.maxSpeakerNum ', i, caseNum, length(gmmData(i).gmm)); utterRrVec1(i)=speakerIdentify(speakerSet1, gmmData(i).gmm, sidOpt.useIntGmm); % Inside test utterRrVec2(i)=speakerIdentify(speakerSet2, gmmData(i).gmm, sidOpt.useIntGmm); % Outside test fprintf('inside RR = %.2f%%, outside RR = %.2f%%\n', utterRrVec1(i)*100, utterRrVec2(i)*100); end eval(sprintf('save %s/utterRrVec utterRrVec1 utterRrVec2', sidOpt.outputDir)); else fprintf('Loading %s/utterRrVec.mat...\n', sidOpt.outputDir); eval(sprintf('load %s/utterRrVec.mat', sidOpt.outputDir)); end for i=1:caseNum gaussianNum(i)=length(gmmData(i).gmm(1).gmmParam); end [maxRr, gaussianNumBestIndex]=max(utterRrVec2); gaussianNumBest=gaussianNum(gaussianNumBestIndex); % This is to be used in the following script subplot(2,1,2); plot(1:caseNum, utterRrVec1*100, 'square-', 1:caseNum, utterRrVec2*100, 'o-'); axis([-inf inf 0 100]); line(gaussianNumBestIndex, 100*utterRrVec2(gaussianNumBestIndex), 'marker', '*', 'color', 'r', 'linestyle', 'none'); title(sprintf('Utterance-based recognition rates (Best=%g%% when gaussianNum=%d)', 100*utterRrVec2(gaussianNumBestIndex), gaussianNumBest)); set(gca, 'xtick', 1:length(gaussianNum)); % Avoid xtick=[1, 1.5, 2, 2.5, ...] set(gca, 'xticklabel', gaussianNum); xlabel('No. of Gaussians components'); ylabel('Recognition rates (%)'); legend('Inside-test recog. rate', 'Outside-test recog. rate', 'Best setting', 4); grid on; eval(sprintf('print -dpng %s/%s', sidOpt.outputDir, mfilename)); fprintf('%s ===> %g seconds\n', mfilename, etime(clock, tInit));