vtset.m
来自「这是一个用于语音信号处理的工具箱」· M 代码 · 共 93 行
M
93 行
% Function : Create a graphical user interface (GUI) to
% (1) display the voicetypes of the speech signal
% (2) change the voicetypes using the mouse.
%
% Vtset.m is a call_function executed by "m_pb_vt" on figure(m_win_f).
%
%--------------------------------------------------%
% plot the voivetype along with the speech signal %
%--------------------------------------------------%
cfram=1; % the frame number of currently displaying
clear sf_flag;
Vtset_f=figure('Unit','Normalized',...
'Numbertitle','off',...
'Color',[.5 .5 .5],...
'Position',[.35 .5 .65 .4], ...
'Name','Voicetype Display and Manual Modification');
axes('Position',[.06 .13 .88 .7],'Box','on','Visible','off');
whitebg(Vtset_f,'w');
% provide the shifting functions
shitf_text=uicontrol('Style','text',...
'Units','normalized','Position',[0.01 .875 .11 .08],'String','Shift frames',...
'BackGroundColor',[0.68 0.68 0.68]);
shift_left=uicontrol('Style','Pushbutton',...
'Unit','Normalized','Position',[.13 .875 .04 .08],'String','<',...
'Callback','sf_flag=1;vt_plt;');
%callback function [vt_plt.m]
frame_pts=uicontrol('Style','edit', ...
'Unit','Normalized','Position',[.18 .875 .06 .08],'String',num2str(cfram),...
'Callback','sf_flag=2;vt_plt');
%callback function [vt_plt.m]
vt_text=uicontrol('Style','text',...
'Unit','Normalized','Position',[.25 .875 .09 .08],'String','unvoiced');
shift_right=uicontrol('Style','Pushbutton',...
'Unit','Normalized','Position',[.36 .875 .04 .08],...
'String','>','Callback','sf_flag=-1;vt_plt');
%callback function [vt_plt.m]
chg_vtp=uicontrol('Style','Pushbutton', ...
'String','Change voicetype' ,...
'Units','normalized','Position',[.43 .875 .17 .08],'BackgroundColor',[.5 .5 .5],...
'ForegroundColor','black',...
'Callback','vtchg;');
%callback function [vtchg.m]
undo_pb=uicontrol('Style','Pushbutton', ...
'String','Undo' ,...
'Units','normalized','Position',[.62 .875 .1 .08],'Callback','App=0;vtapp;');
%callback function [vtapp.m]
app_pb=uicontrol('Style','Pushbutton', ...
'String','Apply' ,...
'Units','normalized','Position',[.74 .875 .1 .08],'Callback','App=1;vtapp;');
%callback function [vtapp.m]
return_pb=uicontrol('Style','Pushbutton',...
'Units','normalized','Position',[.86 .875 .1 .08],...
'Callback','close(Vtset_f);clear cfram vctyp1;',...
'String','Return');
%--------------------%
% plot the voicetype %
%--------------------%
% get the display signal
clear signal vctyp0 sf_flag;
% set the temporary value
if exist('vctyp3')==0
vctyp1=vctyp;
else
vctyp1=vctyp3;
end
axes('Position',[.06 .1 .88 .6],'Box','on','Visible','off');
plot(vctyp1,'b');
xlabel('frame');
title('blue line is the old-voicetype & red ''+'' is the new-voicetype');
nfram=length(vctyp1);
text(nframe/2,1.3, '1=Voiced');
text(nframe/2,-0.3,'0=Unvoiced');
axis([1 nfram -0.5 1.5]);
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?