基于Matlab编写的语音端点检测(3)

2018-11-17 20:20

guidata(hObject,handles);

% --- Executes on button press in Zeroratebutton.

function Zeroratebutton_Callback(hObject, eventdata, handles) % hObject handle to Zeroratebutton (see GCBO)

% eventdata reserved - to be defined in a future version of MATLAB % handles structure with handles and user data (see GUIDATA) framesignal=handles.framesignal;

framenumber=size(framesignal,1);%ó?ò?êy?Y??êy framelength=size(framesignal,2);%??è?ó?ò???3¤ for i=1:framenumber; Z(i)=0;

for j=2:framelength-1;

Z(i)=Z(i)+abs(sign(framesignal(i,j))-sign(framesignal(i,j-1)));%?????ìê±1yá??ê end end

axes(handles.Zerorateaxes)%??ê???1yá??ê?ú?? plot(Z) handles.Z=Z;

handles.framelength=framelength; %Update handles structure guidata(hObject,handles);

④短时过零率

短时过零率

function Zeroratebutton_Callback(hObject, eventdata, handles) % hObject handle to Zeroratebutton (see GCBO)

% eventdata reserved - to be defined in a future version of MATLAB % handles structure with handles and user data (see GUIDATA) framesignal=handles.framesignal;

framenumber=size(framesignal,1);%ó?ò?êy?Y??êy framelength=size(framesignal,2);%??è?ó?ò???3¤ for i=1:framenumber; Z(i)=0;

for j=2:framelength-1;

Z(i)=Z(i)+abs(sign(framesignal(i,j))-sign(framesignal(i,j-1)));%?????ìê±1yá??ê end end

axes(handles.Zerorateaxes)%??ê???1yá??ê?ú?? plot(Z) handles.Z=Z;

handles.framelength=framelength; %Update handles structure guidata(hObject,handles);

⑤设定门限1.2阈值

设置门限1.2(编辑框2)

function T2edit_Callback(hObject, eventdata, handles) % hObject handle to T2edit (see GCBO)

% eventdata reserved - to be defined in a future version of MATLAB % handles structure with handles and user data (see GUIDATA) clc

axes(handles.Energeaxes);cla reset;box on;

set(gca,'XTicklabel',[],'YTicklabel',[]);%?úê?è?D?μ?a,b?μê±£?òa????Energeaxesà?μ?í???

TL=get(handles.T1edit,'string');%??μ?TL?μ TH=get(handles.T2edit,'string');%??μ?TH?μ TL=str2num(TL);%??×?·?ààDí×a?ˉ3éêy?μààDí TH=str2num(TH); E=handles.E;

MeanE=mean(E(1:10));%?ó?°10??μ??üá??ù?μ axes(handles.Energeaxes) plot(E)

hold on

line([1 length(E)],[TL TL],'Color','r');%ó?oì???-3?TL?μ hold on

line([1 length(E)],[TH,TH],'Color','b');%ó?à????-3?TH?μ handles.TL=TL; handles.TH=TH;

%Update handles structure guidata(hObject,handles);

编辑框3门限3

function T3edit_Callback(hObject, eventdata, handles) % hObject handle to T3edit (see GCBO)

% eventdata reserved - to be defined in a future version of MATLAB % handles structure with handles and user data (see GUIDATA) clc

axes(handles.Zerorateaxes);cla reset;box on; set(gca,'XTickLabel',[],'YtickLabel',[]);

v=get(handles.T3edit,'string'); v=1*str2num(v); Z=handles.Z;

MeanZ=mean(Z(1:10)); VarZ=std(Z(1:10)); ZT=min(v,MeanZ+VarZ); axes(handles.Zerorateaxes) plot(Z) hold on

line([1,length(Z)],[ZT,ZT],'Color','b'); handles.ZT=ZT;

guidata(hObject,handles);

⑦端点检测


基于Matlab编写的语音端点检测(3).doc 将本文的Word文档下载到电脑 下载失败或者文档不完整,请联系客服人员解决!

下一篇:保温

相关阅读
本类排行
× 注册会员免费下载(下载后可以自由复制和排版)

马上注册会员

注:下载文档有可能“只有目录或者内容不全”等情况,请下载之前注意辨别,如果您已付费且无法下载或内容有问题,请联系我们协助你处理。
微信: QQ: