evalGmmModel.m
资源名称:speech.rar [点击查看]
上传用户:ay_070428
上传日期:2014-12-04
资源大小:11427k
文件大小:1k
源码类别:
语音合成与识别
开发平台:
Matlab
- % Resubstitution performance evaluation of GMM for speaker recognition
- addpath /users/jang/matlab/toolbox/dcpr
- addpath /users/jang/matlab/toolbox/cbmr
- more off
- if ~exist('speakerData'),
- fprintf('Loading speakerData.mat...n');
- load speakerData.mat
- end
- if ~exist('waveData'),
- fprintf('Loading waveData.mat...n');
- load waveData.mat
- end
- %profile on -detail builtin
- toc
- for i=1:length(speakerData),
- speaker = speakerData(i).speaker;
- index = findcell({waveData.speaker}, speaker);
- speakerData(i).gmmRank = zeros*index;
- for j = 1:length(index),
- % for j = 1:1;
- fprintf('Evaluate wave file %g/%g of %s...n', j, length(index), speaker);
- feature = waveData(index(j)).feature;
- for k=1:length(speakerData),
- logprob(k) = -sum(log(evalgmm(feature', ...
- speakerData(k).param.M, ...
- speakerData(k).param.V, ...
- speakerData(k).param.W)));
- end
- [a, b] = sort(logprob);
- % for k = 1:length(speakerData),
- % fprintf('%g: %s (log prob=%g)n', k, speakerData(b(k)).speaker, logprob(b(k)));
- % end
- speakerData(i).gmmRank(j) = findcell({speakerData(b).speaker}, speaker);
- end
- end
- fprintf('Total execution time = %gn', toc);
- %profile report
- figure;
- rank = cat(2, speakerData.gmmRank);
- plotpie(rank);
- title('Performance of GMM');
- save speakerData speakerData