plotpath.m
资源名称:speech.rar [点击查看]
上传用户:ay_070428
上传日期:2014-12-04
资源大小:11427k
文件大小:1k
源码类别:
语音合成与识别
开发平台:
Matlab
- index1 = 555;
- index2 = 455;
- %index1 = ceil(rand*600);
- %index2 = ceil(rand*600);
- close all
- addpath mex
- if ~exist('waveData'),
- load waveData.mat
- end
- %plotwave(waveData(index1).wavepath);
- %plotwave(waveData(index2).wavepath);
- speechA = waveData(index1).feature;
- speechB = waveData(index2).feature;
- speechAnum = size(speechA, 2);
- speechBnum = size(speechB, 2);
- figure
- % Vertical yellow grid line
- for i = 1:speechAnum,
- line([i, i], [1, speechBnum], 'color', 'y');
- end
- % Horizontal yellow grid line
- for j = 1:speechBnum,
- line([1, speechAnum], [j, j], 'color', 'y');
- end
- % ====== Solution obtained by DTW
- [minDist, DTWpath] = dtwasr(speechA, speechB);
- minDist
- for i = 1:size(DTWpath,2)-1,
- line([DTWpath(1,i), DTWpath(1,i+1)], [DTWpath(2,i), DTWpath(2,i+1)], ...
- 'color', 'r', 'marker', '.');
- end
- title('DTW path (red)');
- axis image
- xlabel([waveData(index1).answer, ' by ', waveData(index1).speaker]);
- ylabel([waveData(index2).answer, ' by ', waveData(index2).speaker]);
- box on