segcheck.m
来自「这是一个用于语音信号处理的工具箱」· M 代码 · 共 95 行
M
95 行
% Function : Create a graphical user interface (GUI) to
% (1) display the automatic segments
% (2) check those points by zooming in and manual correct them using the mouse.
%
% segchek.m is a call_function executed by "c_pb_seg" on figure(c_win_seg).
%
%-------------------------------------------------%
% plot the segments along with the speech signal %
%-------------------------------------------------%
Segchek_f=figure('Unit','Normalized',...
'Numbertitle','off',...
'Color',[.5 .5 .5],...
'Position',[.32 .45 .67 .45 ], ...
'Name','Segment Display and Manual Correction');
axes('Position',[.06 .135 .9 .6],'Box','on','Visible','off');
whitebg(Segchek_f,'w');
% get the display signal
signal=speech2;
lens=length(signal); % the length of the signal
% initial setting
left=1;
right=lens;
% plot the speech signal along with the segmentation
% build the segmentation signal
seg0=seg;
segmentation=zeros(size(signal));
for k=1:length(seg0)
segmentation(seg0(k)*(basic(5)-basic(6)))=10000;
end
plot((left:right),signal(left:right),'k',(left:right),segmentation(left:right),'b');
% provide the zooming and shifting functions
shitf_text=uicontrol('Style','text',...
'Units','normalized','Position',[0.01 .875 .10 .08],'String','Shift pts:',...
'BackGroundColor',[0.68 0.68 0.68]);
shift_left=uicontrol('Style','Pushbutton',...
'Unit','Normalized','Position',[.12 .875 .05 .08],'Visible','off','String','<',...
'Callback','sf_flag=1;shftseg');
%callback function [shftseg.m]
shift_pts=uicontrol('Style','edit', ...
'Unit','Normalized','Position',[.18 .875 .1 .08],'String',fram_len);
shift_right=uicontrol('Style','Pushbutton',...
'Unit','Normalized','Position',[.29 .875 .05 .08],'Visible','off',...
'String','>','Callback','sf_flag=-1;shftseg');
%callback function [shftseg.m]
zoom_text=uicontrol('Style','text',...
'Units','normalized','Position',[.38 .875 .20 .08],'String','Zooming factor :',...
'BackGroundColor',[.68 .68 .68]);
zoom_zscale=uicontrol('Style','edit',...
'Units','normalized','Position',[.59 .875 .05 .08],'String','2');
zoom_in=uicontrol('Style','Pushbutton', ...
'String','Zoom in','Units','normalized','Position',[.69 .875 .13 .08],'Callback', 'Zio=1;zoomiose');
%callback function [zoomiose.m]
zoom_out=uicontrol('Style','Pushbutton', ...
'String','Zoom out','Units','normalized','Position',[.84 .875 .13 .08],'Callback', 'Zio=-1;zoomiose');
%callback function [zoomiose.m]
add_pb=uicontrol('Style','Pushbutton', ...
'String','Add one seg' ,...
'Units','normalized','Position',[.15 .76 .2 .08],'BackgroundColor',[.5 .5 .5],...
'Callback','addseg');
%callback function [addseg.m]
delet_pb=uicontrol('Style','Pushbutton', ...
'String','Delete one seg' ,...
'Units','normalized','Position',[.4 .76 .2 .08],'BackgroundColor',[.5 .5 .5],...
'Callback','delseg');
%callback function [delseg.m]
app_pb=uicontrol('Style','Pushbutton', ...
'String','Apply' ,...
'Units','normalized','Position',[.65 .76 .13 .08],'BackgroundColor',[.5 .5 .5],...
'Visible','off',...
'Callback','seg=seg0;');
return_pb=uicontrol('Style','Pushbutton',...
'Units','normalized','Position',[.84 .76 .13 .08],...
'Callback','close(Segchek_f);clear right left right_r left_r seg0 signal lens ir0 lethnow segmentation; vcs1;',...
'String','Return');
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?