edge_detect2.m
资源名称:speech.rar [点击查看]
上传用户:ay_070428
上传日期:2014-12-04
资源大小:11427k
文件大小:1k
源码类别:
语音合成与识别
开发平台:
Matlab
- function [region_set ,legal_frame] = edge_detect(energy)
- %EDGE_DETECT : edge detection or endpoint detection.
- % format : [region_set legal_frame] = edge_detect(energy) ,
- % region_set is a scalar or a vector. If as a scalar,
- % it means start and end of one pattern, if as a vector,
- % it means starts and ends of one more patterns.
- eng1 = find(energy==1);
- temp = diff([-100 eng1]);
- index = find(temp>10);
- index2 = find(temp>10)-1;
- start = eng1(index);
- if eng1(index2(2:end)) ~= eng1(end),
- ending = [eng1(index2(2:end)) eng1(end)];
- else
- ending = eng1(end);
- end;
- %legal_frame = [];
- legal_frame = eng1;
- region_set = [];
- for i = 1 : length(start),
- %legal_frame = [legal_frame start(i):ending(i)];
- region_set = [region_set ending(i)-start(i)+1];
- end;