tritestwave.m
资源名称:speech.rar [点击查看]
上传用户:ay_070428
上传日期:2014-12-04
资源大小:11427k
文件大小:1k
源码类别:
语音合成与识别
开发平台:
Matlab
- % Test triangle inequality of wave files
- % ====== Add paths
- addpath /users/jang/matlab/toolbox/dcpr -begin
- % ====== Get wave data for testing
- if ~exist('waveData')
- fprintf('Loading waveData.mat ===> ');
- tic
- load waveData.mat
- fprintf('%4.2f secondsn', toc);
- end
- waveFileNum = length(waveData);
- waveFileNum = 100;
- % ====== Compute the distance matrix
- distance = zeros(waveFileNum);
- fprintf('Building %gx%g distance matrix ===> n', waveFileNum, waveFileNum);
- tic
- for i=1:waveFileNum,
- fprintf('%g/%gn', i, waveFileNum);
- for j=(i+1):waveFileNum,
- feature1 = waveData(i).feature;
- feature2 = waveData(j).feature;
- distance(i,j) = dtwmex(feature1, feature2, 1, 1);
- % distance(i,j) = dtwmex2(feature1, feature2, 1, 1);
- % if distance(i,j)==0,
- % keyboard;
- % end
- % Transformation for fulfiling triangular inequality
- % distance(i,j) = newDistance(distance(i,j));
- % [dist, path] = dtwasr(midi1, midi2);
- % distance(i,j) = dist/size(path,2);
- end
- end
- distance = distance+distance';
- fprintf('%4.2f secondsn', toc);
- tritest;