gcset.m
来自「这是一个用于语音信号处理的工具箱」· M 代码 · 共 155 行
M
155 行
% Script : Create a graphical user interface (GUI) to
% (1) display the gain contour of the speech signal.
% (2) manually modify the gain contour using the mouse.
%
% Gcset.m is a call_function executed by "m_pb_gc" on figure(m_win_f).
%
% set the temporary value
if exist('ngm3')==1
ngm1=ngm3;
else
ngm1=ngm;
end
[nframe,dum]=size(ngm1);
Left=1;
Rite=nframe;
% estimate the factors of the gain contour
[genv1,gb1,gntour1]=gaintr(ngm1);
%--------------------------------------------%
% create the Pset_f Graphical User Interface %
%--------------------------------------------%
Gcset_f=figure('Units','Normalized',...
'Numbertitle','off',...
'Color','white',...
'Position',[.165 .35 .15 .55 ],...
'Name','Gain Contour Modification');
%----------------------------------------------------%
% provide zooming, shifting and correcting functions %
%----------------------------------------------------%
env_text=uicontrol('Style','text',...
'Units','Normalized','Position',[0.05 .93 .9 .07],'String','Gain Envelope:',...
'BackGroundColor','white','ForeGroundColor','black');
env_dsp=uicontrol('Style','Popup', ...
'String','label grossly|label finely',...
'Units','Normalized','Position',[.05 .86 .9 .07],...
'Callback', 'gcdsp');
%callback function [gcdsp.m]
env_lbl=uicontrol('Style','Popup', ...
'String','add knob|delete knob',...
'Units','Normalized','Position',[.05 .77 .9 .07],...
'Callback', 'gclbl');
%callback function [gclbl.m]
env_zoom=uicontrol('Style','Popup', ...
'String','zoom in|zoom out',...
'Units','Normalized','Position',[.05 .77 .9 .07],'Visible','off',...
'Callback', 'gczom');
%callback function [gczom.m]
env_fit=uicontrol('Style','Popup', ...
'String','line-fit|parabola-fit(1)|parabola-fit(2)|cubic-fit|default',...
'Units','Normalized','Position',[.05 .68 .9 .07],...
'Callback', 'gcfit;');
%callback function [gcfit.m]
env_shl=uicontrol('Style','Pushbutton', ...
'String','<',...
'Units','Normalized','Position',[.05 .68 .4 .07],'Visible','off',...
'Callback', 'gcshf;LEFT=1;');
%callback function [gcshf.m]
env_shr=uicontrol('Style','Pushbutton', ...
'String','>',...
'Units','Normalized','Position',[.55 .68 .4 .07],'Visible','off',...
'Callback', 'gcshf;LEFT=-1;');
%callback function [gcshf.m]
env_chg=uicontrol('Style','Pushbutton', ...
'String','select knob','Units','Normalized','Position',[0.05 .59 .9 .07],...
'Callback', 'gcchg;');
%callback function [gcchg.m]
env_up=uicontrol('Style','Pushbutton', ...
'String','up','Units','Normalized','Position',[0.05 .50 .4 .07],'Visible','off',...
'Callback', 'UP=1;gcdra;');
%callback function [gcdra.m]
env_down=uicontrol('Style','Pushbutton', ...
'String','down','Visible','off',...
'Units','Normalized','Position',[.55 .50 .4 .07],...
'Callback', 'UP=-1;gcdra');
%callback function [gcdra.m]
pertb_text=uicontrol('Style','text',...
'Units','Normalized','Position',[0.05 .40 .9 .07],'String','Perturbation:',...
'BackGroundColor','white','ForeGroundColor','red');
pertb_val=uicontrol('Style','text', ...
'Unit','Normalized','Position',[0.05 .36 .9 .05],'String',num2str(gb1),...
'BackGroundColor','white');
pertb_cg=uicontrol('Style','Slider', ...
'Units','Normalized','Position',[.05 .29 .9 .07],...
'Value',gb1,'Min',0,'Max',2*gb1,...
'Callback', 'gcturb;');
%callback function [gcturb.m]
undo_pb=uicontrol('Style','Pushbutton', ...
'String','Undo',...
'Units','Normalized','Position',[.2 .20 .6 .07],...
'Callback','App=0;gcapp');
%callback function [gcapp.m]
apply_pb=uicontrol('Style','Pushbutton', ...
'String','Apply' ,...
'Units','Normalized','Position',[.2 .11 .6 .07],...
'Callback','App=1;gcapp');
%callback function [gcapp.m]
return_pb=uicontrol('Style','Pushbutton',...
'Units','Normalized','Position',[.2 .02 .6 .07],...
'Callback','close(Gcset_f);close(Gcdis_f);close(Gcontour_f);clear ngm1 gntour1 genv1 gb1 vcbound Left Rite gcpert knob_xx knob_yy menv;',...
'String','Return');
%--------------------------------------------------------------------%
% create Gcdis_f figure for displaying the gain envelope and jitter %
%--------------------------------------------------------------------%
Gcdis_f=figure('Units','Normalized',...
'Numbertitle','off',...
'Color',[.5 .5 .5],...
'Position',[.315 .43 .68 .50 ],...
'Name','Gain Envelope and Perturbation Display');
whitebg(Gcdis_f,'w');
%-----------------------------------------------------------------%
% create Gcontour_f figure for displaying the gain contour %
%-----------------------------------------------------------------%
Gcontour_f=figure('Units','Normalized',...
'Numbertitle','off',...
'Color',[.5 .5 .5],...
'Position',[.315 .08 .68 .35 ],...
'Name','Gain Contour Display');
whitebg(Gcontour_f,'w');
% find the voicing transition
vcbound=diff(vctyp);
vcbound=find( vcbound~=0 );
vcbound=vcbound+1;
clear menv knob_xx knob_yy o_yy;
gcplt;
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?