DDD.M
资源名称:speech.rar [点击查看]
上传用户:ay_070428
上传日期:2014-12-04
资源大小:11427k
文件大小:1k
源码类别:
语音合成与识别
开发平台:
Matlab
- close all
- more on
- %mex dtwmex.c
- addpath ..
- vec1 = randn(1,12);
- vec2 = randn(1, 20);
- [minDist, DTWpath] = dtwmex(vec1, vec2, 1, 1, 2);
- figure; dtwplot(vec1, vec2, DTWpath);
- fprintf('DTW distance = %gn', minDist);
- [minDist, DTWpath] = dtwmex(vec1, vec2, 1, 0, 2);
- figure; dtwplot(vec1, vec2, DTWpath);
- fprintf('DTW distance = %gn', minDist);
- [minDist, DTWpath] = dtwmex(vec1, vec2, 0, 1, 2);
- figure; dtwplot(vec1, vec2, DTWpath);
- fprintf('DTW distance = %gn', minDist);
- [minDist, DTWpath] = dtwmex(vec1, vec2, 0, 0, 2);
- figure; dtwplot(vec1, vec2, DTWpath);
- fprintf('DTW distance = %gn', minDist);
- load speech.mat
- speechBnum = size(speechB, 2);
- speechAnum = size(speechA, 2);
- % ====== Solution obtained by DTW
- [minDist, DTWpath] = dtwmex(speechA, speechB, 1, 1, 2);
- fprintf('DTW distance = %gn', minDist);
- addpath ..
- figure
- dtwplot(speechA, speechB, DTWpath);