ribbon1_main.m

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

M
271
字号
% *          	  Mind-MACHINE INTERACTION RESEARCH CENTER	         	*
% *									                                          *
% * Author : Karthik
% * Original algorithms developed and coded by Chiang Jang Wu
%   Modified by d. G. Childers 5/20/98

PV = [2 75 490 385];
s2 = 'Ribbon Model I - Control';

% Open analysis window
while exist('rbn1_con_window')==1
   try1 = 'get(rbn1_con_window,''position'');';
   eval(try1,catch2);
   if check ==0
      clear rbn1_con_window;
      check = 1;
      break;
   end
   s1 = get(rbn1_con_window,'Name');
   if ~strcmp(s1,s2)
      clear rbn1_con_window;
      break;
   end
   figure(rbn1_con_window);
   break;
end;

if exist('rbn1_con_window')~=1;
   rbn1_con_window=figure('Position',PV,...
      'Resize','on',...
      'Numbertitle','off',...
      'Name',s2 );
   
   %Controls for the various parameters
   
   %The bottom frame with the quit and go buttons
   
   rbn1_con_frame_1 = uicontrol('Style','frame',...
      'Position',[2 2 360 63],...
      'BackgroundColor',fcolor);
   
   rbn1_con_go_button = uicontrol('Style','pushbutton',...
      'Position',[20 20 140 40],...
      'String','Go(Draw)',...
      'Callback','Ribbon1_go');
   
   rbn1_con_quit_button = uicontrol('Style','pushbutton',...
      'Position',[195 20 140 40],...
      'String','Cancel',...
      'Callback','ribbon1_quit');
   
   
   %The next frame with excursion,abduction,shape and frequency controls

   rbn1_con_frame_2 = uicontrol('Style','frame', ...

      'Position',[2 70 360 150],...

      'BackgroundColor',fcolor);
   
   %Maximum Excursion
   rbn1_con_txt_1 = uicontrol( 'Style','text',...
      'Position',[4 200 100 20], ...
      'BackgroundColor',fcolor, ...
      'ForegroundColor','white' , ...
      'HorizontalAlignment','left',...
      'String','Max Excursion (Xim)');      
   
   rbn1_con_xim_edit = uicontrol('Style','edit',...
      'Position',[105 200 70 20], ...
      'String',num2str(0.898));
   
   %Fundamental Frequency
   rbn1_con_txt_2 = uicontrol('Style','text',...
      'Position',[180 200 100 20],...
      'BackgroundColor',fcolor,...
      'ForegroundColor','white',...
      'HorizontalAlignment','right',...
      'String','Fundamental freq.');
   
   rbn1_con_fo_edit = uicontrol('Style','edit',...
      'Position',[285 200 70 20], ...
      'String',num2str(333.33));
   
   %Abduction quotient
   rbn1_con_txt_3 = uicontrol( 'Style','text',...
      'Position',[4 170 100 20], ...
      'BackgroundColor',fcolor, ...
      'ForegroundColor','white' , ...
      'HorizontalAlignment','left',...
      'String','Abduction Quotient'); 
   
   rbn1_con_qa_edit = uicontrol('Style','edit',...
      'Position',[105 170 70 20], ...
      'String',num2str(0.8972));
   
   %Shape Quotient
   rbn1_con_txt_4 = uicontrol('Style','text',...
      'Position',[180 170 100 20],...
      'BackgroundColor',fcolor,...
      'ForegroundColor','white',...
      'HorizontalAlignment','right',...
      'String','Shape Quotient');
   
   rbn1_con_qs_edit = uicontrol('Style','edit',...
      'Position',[285 170 70 20], ...
      'String',num2str(5.6905));
   
   %Slider and edit box for Xio1
   rbn1_con_txt_5 = uicontrol('Style','text',...
      'Position',[4 125 70 20],...
      'BackgroundColor',fcolor,...
      'ForegroundColor','white',...
      'HorizontalAlignment','left',...
      'String','Excursion Xi01');
   
   rbn1_con_xio1_edit = uicontrol('Style','Edit',...
      'Position',[85 125 60 20],...
      'String',num2str(5.8528),...
      'Callback','xio1_edit');
   
   rbn1_con_xio1_slider = uicontrol('Style','Slider',...
      'Position',[150 125 200 20],...
      'Min',0,...
      'Max',8,...
      'Value',5.8528,...
      'Callback','xio1_slider');
   
   %Slider and edit box for Xio2
   rbn1_con_txt_6 = uicontrol('Style','text',...
      'Position',[4 85 70 20],...
      'BackgroundColor',fcolor,...
      'ForegroundColor','white',...
      'HorizontalAlignment','left',...
      'String','Excursion Xio2');

   rbn1_con_xio2_edit = uicontrol('Style','Edit',...
      'Position',[85 85 60 20],...
      'String',num2str(0.7316),...
      'Callback','xio2_edit');
   
   rbn1_con_xio2_slider = uicontrol('Style','Slider',...
      'Position',[150 85 200 20],...
      'Min',0,...
      'Max',8,...
      'Value',0.7316,...
      'Callback','xio2_slider');
   
   %The next frame with phase difference controls
   
   rbn1_con_frame_3 = uicontrol('Style','frame',...
      'Position',[2 225 360 75],...
      'BackgroundColor',fcolor);
   
   rbn1_con_txt_7 = uicontrol('Style','text',...
      'Position',[4 280 140 20],...
      'BackgroundColor',fcolor,...
      'ForegroundColor','white',...
      'String','Phase Difference in Degrees',...
      'HorizontalAlignment','left');
   
   %Vertical Phase Difference
   rbn1_con_txt_8 = uicontrol('Style','text',...
      'Position',[4 250 40 20],...
      'BackgroundColor',fcolor,...
      'ForegroundColor','white',...
      'String','Vertical',...
      'HorizontalAlignment','left');
   
   rbn1_con_vpd_edit = uicontrol('Style','edit',...
      'Position',[46 250 100 20], ...
      'String',num2str(16.3735));
   
   %Horizontal Phase Difference
   
   rbn1_con_txt_9 = uicontrol('Style','text',...
      'Position',[190 250 60 20],...
      'BackgroundColor',fcolor,...
      'ForegroundColor','white',...
      'String','Horizontal',...
      'HorizontalAlignment','right');
   
   rbn1_con_hpd_edit = uicontrol('Style','edit',...
      'Position',[255 250 100 20], ...
      'String',num2str(0.7632));
   
   %The next frame with controls for vocal fold dimensions
   rbn1_con_frame_4 = uicontrol('Style','frame',...
      'Position',[2 305 360 75],...
      'BackgroundColor',fcolor);
   
   rbn1_con_txt_10 = uicontrol('Style','text',...
      'Position',[4 355 180 20],...
      'BackgroundColor',fcolor,...
      'ForegroundColor','white',...
      'String','Vocal Fold Dimensions in mm',...
      'HorizontalAlignment','left');
   
   %Vocal fold length
   
   rbn1_con_txt_11 = uicontrol('Style','text',...
      'Position',[4 325 33 20],...
      'BackgroundColor',fcolor,...
      'ForegroundColor','white',...
      'String','Length',...
      'HorizontalAlignment','left');
   
   rbn1_con_length_edit = uicontrol('Style','edit',...
      'Position',[38 325 70 20], ...
      'String',num2str(12.0));
   
   %Vocal fold width
   rbn1_con_txt_12 = uicontrol('Style','text',...
      'Position',[113 325 28 20],...
      'BackgroundColor',fcolor,...
      'ForegroundColor','white',...
      'String','Width',...
      'HorizontalAlignment','left');
   
   rbn1_con_width_edit = uicontrol('Style','edit',...
      'Position',[142 325 70 20], ...
      'String',num2str(8.0));
   
   %Vocal Fold Thcikness
   
   rbn1_con_txt_13 = uicontrol('Style','text',...
      'Position',[225 325 50 20],...
      'BackgroundColor',fcolor,...
      'ForegroundColor','white',...
      'String','Thickness',...
      'HorizontalAlignment','left');
   
   rbn1_con_thickness_edit = uicontrol('Style','edit',...
      'Position',[276 325 70 20], ...
      'String',num2str(3.0));
   
   %The rightmost frame with controls for configuration , choice of waveform and animation
   
   rbn1_con_frame_5 = uicontrol('Style','frame',...
      'Position',[367 2 120 378],...
      'BackgroundColor',fcolor);
   
   %Warning text   
   rbn1_con_txt_14 = uicontrol('Style','text',...
      'Position',[370 310 100 50],...
      'BackgroundColor','white',...
      'ForegroundColor','red',...
      'String','NOTE!! Do Glottal Area before doing Animation',...
      'HorizontalAlignment','left');
   
      
   %Glottal Area button 
    
   rbn1_con_waveform_popup = uicontrol('Style','Pushbutton',...
      'Position',[370 250 100 35],...
      'String', 'Glottal Area',...
      'Callback','Glottal_Area_go');
   
   %Popup menu for Animation
   rbn1_con_txt_16 = uicontrol('Style','text',...
      'Position',[370 150 100 20],...
      'BackgroundColor',fcolor,...
      'ForegroundColor','white',...
      'String','Animation',...
      'HorizontalAlignment','left');
   
   rbn1_con_animation_popup = uicontrol('Style','popup',...
      'Position',[370 120 100 35],...
      'String', 'Make|Play',...
      'Callback','Animation_go');
               
end;

⌨️ 快捷键说明

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