运行结果
clear;fprintf('Begin \n');
FS=22050;
time=2;
y=wavrecord(time*FS,FS,1);
%fprintf('end \n');
fprintf('\n');
for i=1
fprintf('The source file is ');
fname=sprintf('test\\1.wav',i);
[y,fs,bits]=wavread(fname);
sound(y,fs,bits)
disp(fname);
[tx1,tx2,tframe]=FrameDetect(y,FS);
tvector=ones(12,tx2-tx1+1);
for i=1:tx2-tx1+1
[tA,tB,tK,tR]=Durbin(tframe(i,:));
tA=abs(lpc(tframe(i,:),12));
% tC=Cepstrum(tA',60);
% tvector(:,i)=tA';
end
distance=zeros(10,1);
for j=1
clear rvectortemp;
clear rvector;
clear rc;
filename=sprintf('model\\H1.mat',mod(j,10));
fid=fopen(filename,'r');
if fid==-1
fprintf('Can''t open the file!\n');
return;
end
rc=fread(fid,2,'int32');
[rvectortemp,count]=fread(fid,'double');
fclose('all');
if count==0
fprintf('Read Error!\n');
return;
end
rvector=reshape(rvectortemp,rc(1),rc(2));
distance(j)=dtw(tvector,rvector);
end
distance=distance/sum(distance);
[error,result]=min(distance);
fprintf('The recognition result is :\n');
fprintf('%d',mod(result,10));
fname=sprintf('test\\t1.wav \n',mod(result,10));
fprintf('\n');
disp(distance');
end
fprintf('End\n');
fprintf('\n');
运行上述程序后 结果是The source file is test\1.wav
The recognition result is:
2
1 0 0 0 0 0 0 0 0 0 0
这个结果是什么意思呢