twomass_main.m
来自「这是一个用于语音信号处理的工具箱」· M 代码 · 共 307 行
M
307 行
% Mind-MACHINE INTERACTION RESEARCH CENTER
%
% Author : Karthik
% Original algorithms developed and coded by Chiang Jang Wu
%Modified by D. G. Childers 5/19/98
PV = [2 75 490 385];
s2 = 'Two Mass Model - Control';
% Open analysis window
while exist('twomass_con_window')==1
try1 = 'get(twomass_con_window,''position'');';
eval(try1,catch2);
if check ==0
clear twomass_con_window;
check = 1;
break;
end
s1 = get(twomass_con_window,'Name');
if ~strcmp(s1,s2)
clear twomass_con_window;
break;
end
figure(twomass_con_window);
break;
end;
if exist('twomass_con_window')~=1;
twomass_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
uicontrol('Style','frame',...
'Position',[2 2 360 45],...
'BackgroundColor',fcolor);
uicontrol('Style','pushbutton',...
'Position',[20 10 140 25],...
'String','Draw',...
'Callback','twomass_go');
uicontrol('Style','pushbutton',...
'Position',[195 10 140 25],...
'String','Cancel',...
'Callback','twomass_quit');
%The next frame with excursion,abduction,shape and frequency controls
uicontrol('Style','frame', ...
'Position',[2 52 360 170],...
'BackgroundColor',fcolor);
%Fundamental Frequency
uicontrol('Style','text',...
'Position',[4 195 70 20],...
'BackgroundColor',fcolor,...
'ForegroundColor','white',...
'HorizontalAlignment','left',...
'String','Tension (Q)');
twomass_con_Q_edit = uicontrol('Style','Edit',...
'Position',[75 195 70 20],...
'String',num2str(0.3),...
'Callback','twomass_Q_edit');
twomass_con_Q_slider = uicontrol('Style','Slider',...
'Position',[150 195 200 20],...
'Min',0.01,...
'Max',2,...
'Value',0.3,...
'Callback','twomass_Q_slider');
%Source Pressure
uicontrol( 'Style','text',...
'Position',[4 165 70 20], ...
'BackgroundColor',fcolor, ...
'ForegroundColor','white' , ...
'HorizontalAlignment','left',...
'String','Pressure');
twomass_con_Ps_edit = uicontrol('Style','edit',...
'Position',[75 165 70 20], ...
'String',num2str(9000));
%Vocal Tract Area
uicontrol('Style','text',...
'Position',[180 165 100 20],...
'BackgroundColor',fcolor,...
'ForegroundColor','white',...
'HorizontalAlignment','right',...
'String','Vocal Tract Area');
twomass_con_A_edit = uicontrol('Style','edit',...
'Position',[285 165 70 20], ...
'String',num2str(1));
%Slider and edit box for excur1
uicontrol('Style','text',...
'Position',[4 125 70 20],...
'BackgroundColor',fcolor,...
'ForegroundColor','white',...
'HorizontalAlignment','left',...
'String','Excursion 1');
twomass_con_excur1_edit = uicontrol('Style','Edit',...
'Position',[75 125 70 20],...
'String',num2str(0.03),...
'Callback','twomass_excur1_edit');
twomass_con_excur1_slider = uicontrol('Style','Slider',...
'Position',[150 125 200 20],...
'Min',0,...
'Max',1,...
'Value',0.03,...
'Callback','twomass_excur1_slider');
%Slider and edit box for Xio2
uicontrol('Style','text',...
'Position',[4 85 70 20],...
'BackgroundColor',fcolor,...
'ForegroundColor','white',...
'HorizontalAlignment','left',...
'String','Excursion 2');
twomass_con_excur2_edit = uicontrol('Style','Edit',...
'Position',[75 85 70 20],...
'String',num2str(0.03),...
'Callback','twomass_excur2_edit');
twomass_con_excur2_slider = uicontrol('Style','Slider',...
'Position',[150 85 200 20],...
'Min',0,...
'Max',1,...
'Value',0.03,...
'Callback','twomass_excur2_slider');
uicontrol('Style','text',...
'Position',[4 60 170 15],...
'BackgroundColor',fcolor,...
'ForegroundColor','white',...
'String','Number of Vocal tract Segments',...
'HorizontalAlignment','left');
twomass_con_segments_edit = uicontrol('Style','edit',...
'Position',[180 60 70 18], ...
'String',num2str(10));
%The next frame with Vocal fold mass and other details
uicontrol('Style','frame',...
'Position',[2 225 360 75],...
'BackgroundColor',fcolor);
uicontrol('Style','text',...
'Position',[4 280 140 20],...
'BackgroundColor',fcolor,...
'ForegroundColor','white',...
'String','Mass of the vocal folds',...
'HorizontalAlignment','left');
%Mass 1
uicontrol('Style','text',...
'Position',[4 255 60 20],...
'BackgroundColor',fcolor,...
'ForegroundColor','white',...
'String','Mass 1',...
'HorizontalAlignment','left');
twomass_con_m1_edit = uicontrol('Style','edit',...
'Position',[66 255 80 20], ...
'String',num2str(0.125));
uicontrol('Style','text',...
'Position',[4 230 60 20],...
'BackgroundColor',fcolor,...
'ForegroundColor','white',...
'String','Thickness',...
'HorizontalAlignment','left');
%Mass 2
uicontrol('Style','text',...
'Position',[190 255 60 20],...
'BackgroundColor',fcolor,...
'ForegroundColor','white',...
'String','Mass _2',...
'HorizontalAlignment','right');
twomass_con_m2_edit = uicontrol('Style','edit',...
'Position',[255 255 80 20], ...
'String',num2str(0.025));
uicontrol('Style','text',...
'Position',[190 230 60 20],...
'BackgroundColor',fcolor,...
'ForegroundColor','white',...
'String','Thickness',...
'HorizontalAlignment','right');
twomass_con_d1_edit = uicontrol('Style','edit',...
'Position',[66 230 80 20], ...
'String',num2str(0.25));
twomass_con_d2_edit = uicontrol('Style','edit',...
'Position',[255 230 80 20], ...
'String',num2str(0.05));
%The next frame with controls for vocal fold dimensions and number of segments
uicontrol('Style','frame',...
'Position',[2 305 360 75],...
'BackgroundColor',fcolor);
uicontrol('Style','text',...
'Position',[4 355 180 20],...
'BackgroundColor',fcolor,...
'ForegroundColor','white',...
'String','Vocal Fold Dimensions in cm',...
'HorizontalAlignment','left');
%Vocal fold length
uicontrol('Style','text',...
'Position',[4 330 33 20],...
'BackgroundColor',fcolor,...
'ForegroundColor','white',...
'String','Length',...
'HorizontalAlignment','left');
twomass_con_length_edit = uicontrol('Style','edit',...
'Position',[38 330 70 20], ...
'String',num2str(1.5));
%Vocal fold width
uicontrol('Style','text',...
'Position',[113 330 28 20],...
'BackgroundColor',fcolor,...
'ForegroundColor','white',...
'String','Width',...
'HorizontalAlignment','left');
twomass_con_width_edit = uicontrol('Style','edit',...
'Position',[142 330 70 20], ...
'String',num2str(0.8));
%Vocal Fold Thickness
uicontrol('Style','text',...
'Position',[225 330 50 20],...
'BackgroundColor',fcolor,...
'ForegroundColor','white',...
'String','Thickness',...
'HorizontalAlignment','left');
twomass_con_thickness_edit = uicontrol('Style','edit',...
'Position',[276 330 70 20], ...
'String',num2str(0.3));
%The rightmost frame with controls for configuration , choice of waveform and animation
uicontrol('Style','frame',...
'Position',[367 2 120 378],...
'BackgroundColor',fcolor);
%Warning text
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
uicontrol('Style','Pushbutton',...
'Position',[370 250 100 35],...
'String', 'Glottal Area',...
'Callback','twomass_Glottal_Area');
%Popup menu for Animation
uicontrol('Style','text',...
'Position',[370 150 100 20],...
'BackgroundColor',fcolor,...
'ForegroundColor','white',...
'String','Animation',...
'HorizontalAlignment','left');
twomass_con_animation_popup = uicontrol('Style','popup',...
'Position',[370 120 100 35],...
'String', 'Make|Play',...
'Callback','twomass_Animation_go');
end;
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?