subglo.m

来自「这是一个用于语音信号处理的工具箱」· M 代码 · 共 169 行

M
169
字号
% subglo.m
% modified by D. G. Childers 7/16/98

Nfft = 64;


subglot_h=figure('Position',[56 90 422 332], 'NumberTitle','off',...
		'Resize','off','Name','Subglottal model parameters', ...
		'color',BACK_COLOR);
   axis('off');
   
ss=sprintf('Resistance:');
text(-0.06,1.0,ss,'color',TEXT_COLOR,'FontSize',9);
subresi_h=uicontrol('Style','Slider','Min',100,'Max',800,'Value',367,...
	'Position',[177 299 90 18],'Callback','setsbre1');
subresi_e_h=uicontrol('Style','edit','Position',[120 299 50 18], ...
	'Callback','setsbre');
ss=sprintf('*0.1 (dyne)(s)/(cm^5)');
text(0.67,1.0,ss,'color',TEXT_COLOR,'FontSize',9);
set(subresi_e_h,'String',367);

ss=sprintf('Inductance:');
text(-0.06,0.89,ss,'color',TEXT_COLOR,'FontSize',9);
subindu_h=uicontrol('Style','Slider','Min',1,'Max',500,'Value',380,...
	'Position',[177 269 90 18],'Callback','setsbin1');
subindu_e_h=uicontrol('Style','edit','Position',[120 269 50 18], ...
	'Callback','setsbin');
ss=sprintf('(10^-5)(g)/(cm^4)');
text(0.67,0.89,ss,'color',TEXT_COLOR,'FontSize',9);
set(subindu_e_h,'String',380);

ss=sprintf('Capacitance:');
text(-0.07,0.79,ss,'color',TEXT_COLOR,'FontSize',9);
subcapa_h=uicontrol('Style','Slider','Min',10,'Max',500,'Value',176,...
	'Position',[177 242 90 18],'Callback','setsbca1');
subcapa_e_h=uicontrol('Style','edit','Position',[120 242 50 18], ...
	'Callback','setsbca');
ss=sprintf('(10^-7)(cm^4)(s^2)/g');
text(0.67,0.79,ss,'color',TEXT_COLOR,'FontSize',9);
set(subcapa_e_h,'String',176);

ss=sprintf('Pole:');
text(0.03,0.68,ss,'color',TEXT_COLOR,'FontSize',9);
pole_e_h=uicontrol('Style','edit','Position',[100 214 55 18]);
ss=sprintf('Hz');
text(0.33,0.68,ss,'color',TEXT_COLOR,'FontSize',9);
ss=sprintf('BW:');
text(0.60,0.68,ss,'color',TEXT_COLOR,'FontSize',9);
bw_e_h=uicontrol('Style','edit','Position',[282 214 55 18]);
ss=sprintf('Hz');
text(0.89,0.68,ss,'color',TEXT_COLOR,'FontSize',9);
%%%%%%%%
Re=get(subresi_h,'Value')*0.1;
In=get(subindu_h,'Value')*1e-5;
Ca=get(subcapa_h,'Value')*1e-7;
b=1.0/(Re*Ca);
c=1.0/(In*Ca);
d=1.0/Ca;
pole=round(sqrt(c)/(2*pi));
set(pole_e_h,'String',pole);
A = 2*c + 2*d^2 / Re^2 - b^2;
x1 =(A + sqrt(A^2-4*c^2)) / 2.0;
x2 =(A - sqrt(A^2-4*c^2)) / 2.0;
BW =round(abs(sqrt(x1)-sqrt(x2))/(2.0*pi));
set(bw_e_h,'String',BW);

%%%%%%%%
%curres_h=uicontrol('Style','slider','Position',...
%   [118 186 75 18],'Min',1,'Max',1,'Value',1,'Callback', 'setcurres1');
curres_e_h=uicontrol('Style','edit','Position',[95 186 20 18],...
   'Value',1);
ss=sprintf('Cur. Res. No.:');
text(-0.13,0.57,ss,'color',TEXT_COLOR,'FontSize',9);
set(curres_e_h,'String',1);

%totres_h=uicontrol('Style','slider','Position',...
%   [343 186 75 18],'Min',1,'Max',1,'Value',1,'Callback', 'settotres1');
totres_e_h=uicontrol('Style','edit','Position',[320 186 20 18],...
   'Value',1);
%totres_e_h=uicontrol('Style','edit','Position',[357 186 40 18],...
%   'Value',1);
ss=sprintf('Tot. Res. No.(max 1):');
text(0.45,0.57,ss,'color',TEXT_COLOR,'FontSize',9);
set(totres_e_h,'String',1);
%%%%%%%%%%%%%%%
% Note that the software is designed to accommodate a maximum
% of 5 subglottal resonances, but there was a problem accommodating
% a vector of subglottal resonances while the other excitation values
% are scalars.  I'm sure this can be resolved later.  But for now I
% am restricting the number of subglottal resonances to none (0) or 1.
% I am also commenting out the next and previous commands that allowed
% the user to review the subglottal resonance parameter values after
% they were set.  This feature can be added later if desired.
%%%%%%%%%%%%%%%

%uicontrol('Style','pushbutton','Position',[20 155 60 20], ...
%'String','Create');
%uicontrol('Style','pushbutton','Position',[86 155 60 20], ...
%'String','Delete');
%uicontrol('Style','pushbutton','Position',[152 155 60 20], ...
%'String','Default');
%%%%%%%%%%%
% The next and previous features below have been commented out for now.
% Also the apply button for the subglottal parameters was commented out.
% See my comments following the total subglottal resonance section above.
%%%%%%%%%%%
%uicontrol('Style','pushbutton','Position',[294 155 50 20], ...
%'String','Next','Callback','nextsubg');
%uicontrol('Style','pushbutton','Position',[218 155 70 20], ...
%'String','Previous','Callback','prevsubg');
%uicontrol('Style','pushbutton','Position',[350 155 60 20], ...
%'String','Apply','Callback','subapply');

ss=sprintf('Glottal area model:');
text(-0.06,0.36,ss,'color',TEXT_COLOR,'FontSize',9);
gloaream_h=uicontrol('Style','Popup','Position',[160 125 120 20], ...
'String','Triangle|Sine|Raised cosine','Value',1);

ss=sprintf('Glottal area model parameters:');
text(-0.06,0.27,ss,'color',TEXT_COLOR,'FontSize',9);

ss=sprintf('Max. Glottal Area :');
text(0.04,0.195,ss,'color',TEXT_COLOR,'FontSize',9);
maxglo_area_h=uicontrol('Style','Slider','Min',0,'Max',50,'Value',20,...
	'Position',[240 81 90 18],'Callback', ...
	'set(maxglo_area_e_h,''String'',round(get(maxglo_area_h,''Value'')))');
maxglo_area_e_h=uicontrol('Style','edit','Position',[192 81 40 18], ...
	'Callback', ...
	'set(maxglo_area_h,''Value'',eval(get(maxglo_area_e_h,''String'')))');
ss=sprintf('mm^2');
text(0.87,0.19,ss,'color',TEXT_COLOR,'FontSize',9);
set(maxglo_area_e_h,'String',20);

ss=sprintf('Waveform duration Td :');
text(-0.06,0.11,ss,'color',TEXT_COLOR,'FontSize',9);
wavedur_h=uicontrol('Style','Slider','Min',0,'Max',100,'Value',90,...
	'Position',[240 58 90 18],'Callback', ...
	'set(wavedur_e_h,''String'',round(get(wavedur_h,''Value'')))');
wavedur_e_h=uicontrol('Style','edit','Position',[192 58 40 18], ...
	'Callback', ...
	'set(wavedur_h,''Value'',eval(get(wavedur_e_h,''String'')))');
ss=sprintf('%% of T0');
text(0.87,0.105,ss,'color',TEXT_COLOR,'FontSize',9);
set(wavedur_e_h,'String',90);

ss=sprintf('Opening duration :');
text(0.042,0.0245,ss,'color',TEXT_COLOR,'FontSize',9);
opendur_h=uicontrol('Style','Slider','Min',0,'Max',100,'Value',50,...
	'Position',[240 35 90 18],'Callback', ...
	'set(opendur_e_h,''String'',round(get(opendur_h,''Value'')))');
opendur_e_h=uicontrol('Style','edit','Position',[192 35 40 18], ...
	'Callback', ...
	'set(opendur_h,''Value'',eval(get(opendur_e_h,''String'')))');
ss=sprintf('%% of Td');
text(0.87,0.024,ss,'color',TEXT_COLOR,'FontSize',9);
set(opendur_e_h,'String',50);

ss=sprintf('Closing duration :');
text(0.06,-0.065,ss,'color',TEXT_COLOR,'FontSize',9);
closedur_h=uicontrol('Style','Slider','Min',0,'Max',100,'Value',50,...
	'Position',[240 12 90 18],'Callback', ...
	'set(closedur_e_h,''String'',round(get(closedur_h,''Value'')))');
closedur_e_h=uicontrol('Style','edit','Position',[192 12 40 18], ...
	'Callback', ...
	'set(closedur_h,''Value'',eval(get(closedur_e_h,''String'')))');
ss=sprintf('%% of Td');
text(0.87,-0.065,ss,'color',TEXT_COLOR,'FontSize',9);
set(closedur_e_h,'String',50);

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?