?? test2.m
字號:
function test2(testdir, n, code)
% Speaker Recognition: Testing Stage
%
% Input:
% testdir : string name of directory contains all test sound files
% n : number of test files in testdir
% code : codebooks of all trained speakers
%
% Note:
% Sound files in testdir is supposed to be:
% s1.wav, s2.wav, ..., sn.wav
%
% Example:
% >> test('C:\data\test\', 8, code);
%for k = 1:n % read test sound file of each speaker
file = sprintf('%ss%d.wav', testdir, 3);
[s fs]=wavread(file);
%[s, fs] = wavread('data\test\s3.wav');
v = mfcc(s, fs); % Compute MFCC's
distmin = 3;
% each trained codebook, compute distortion
d = disteu(v, code{3});
dist = sum(min(d,[],2)) / size(d,1);
disp('--------------------');
disp(dist);
if dist < distmin
msg = sprintf('Speaker %d is the right person',3)
disp(msg);
else
msg = sprintf('Speaker %d is not the right person',3)
disp(msg);
end
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -