TDTW2.M
资源名称:speech.rar [点击查看]
上传用户:ay_070428
上传日期:2014-12-04
资源大小:11427k
文件大小:1k
源码类别:
语音合成与识别
开发平台:
Matlab
- % Compare the time/distance difference between dtwmex0 and dtwmex1
- fprintf('This script compares the difference between "dtwmex0.dll" and "dtwmex1.dll".n');
- file1 = 'singer1.wav';
- file2 = 'singer2.wav';
- y1 = wavread(file1);
- y2 = wavread(file2);
- mfcc1 = wave2mfccmex(y1);
- mfcc2 = wave2mfccmex(y2);
- % ====== Solution obtained by DTW
- %mfcc1 = fix(mfcc1*10);
- %mfcc2 = fix(mfcc2*10);
- n = 2000;
- tic;
- for i=1:n,
- [minDist0, DTWpathLen] = dtwmex0(mfcc1, mfcc2, 2, 1);
- end
- time=toc;
- fprintf('dtwmex0(): distance = %g, path length = %gn', minDist0, DTWpathLen);
- fprintf('t time of %g runs = %gn', n, time);
- tic;
- for i=1:n,
- [minDist1, DTWpath] = dtwmex1(mfcc1, mfcc2);
- end
- time=toc;
- fprintf('dtwmex1(): distance = %g, path length = %gn', minDist1, size(DTWpath,2));
- fprintf('t time of %g runs = %gn', n, time);
- fprintf('Difference in distance = %gn', abs(minDist0-minDist1));