compare_dtw.m
资源名称:speech.rar [点击查看]
上传用户:ay_070428
上传日期:2014-12-04
资源大小:11427k
文件大小:1k
源码类别:
语音合成与识别
开发平台:
Matlab
- function minDistance = compare_dtw(wavefile)
- %COMPARE_DTW : compare two feature parameters using dtw method
- %If test pattern are not only one, for instance, it maybe 1 3 7 etc,
- %then split parameter for each pattern using a variable, region_set
- [parameter1 , region_set] = feature_extrac(wavefile);
- database = textread('train_user.txt','%s');
- database_size = size(database,1);
- SingerName = textread('singer.txt','%s');
- data_num = size(SingerName,1);
- minDistance = [];
- for k = 1 : database_size,
- minDistTemp = [];
- for i = 1 : data_num,
- databaseName = ['matdirtraindatasinger' database{k} '' num2str(i) '.mat'];
- eval(['load ' databaseName]);
- [temp unused]= dtwasr(parameter1,parameter,2);
- minDistTemp = [minDistTemp temp];
- end;
- minDistance = [minDistance ; minDistTemp];
- end;
- %save test.mat parameter1, it is for plotting comparsion figure.
- %save test.mat parameter1