ribbon1_go.m
来自「这是一个用于语音信号处理的工具箱」· M 代码 · 共 144 行
M
144 行
%Callback function for the go button of the Ribbon model 1 parameter and controls window
%Author : Karthik
%modified by D. G. Childers 5/20/98
%
%Used functions created by Wu
%
%This program reads the values for the various parameters from the
%control windows. Then the various coefficients are determined from
%these parameters. The functions for drawing the vocal fold static
%configuration are called from this program.
%
%Use the following rules for calculation of the quotients
%abduction quotient is given by the ratio of the excursion of the superior edge to
%the maximum excursion
%The shape quotient is given by the ratio of the difference between the two excursions
%to the maximum excursion
clear MODEL_PARAMETERS
Length = eval(get(rbn1_con_length_edit,'String')); %Length of the vocal fold
Width = eval(get(rbn1_con_width_edit,'String')); %Width of the vocal fold
Thickness = eval(get(rbn1_con_thickness_edit,'String')); %Thickness of the vocal fold
vert_Phase_Diff = eval(get(rbn1_con_vpd_edit,'String')); %Vertical Phase Difference
hori_Phase_Diff = eval(get(rbn1_con_hpd_edit,'String')); %Horizontal Phase Difference
fund_Frequency = eval(get(rbn1_con_fo_edit,'String')); %Fundamental Frequency
%Excursion of the inferior edge of the vocal folds from the glottal midline
excursion_1 = eval(get(rbn1_con_xio1_edit,'String'));
%Excursion of the superior edge of the vocal cords from the glottal midline
excursion_2 = eval(get(rbn1_con_xio2_edit,'String'));
%Maximum amplitude of vibration near the vocal fold center
maximum_Excursion = eval(get(rbn1_con_xim_edit,'String'));
%Calculate the values of the abduction and shape quotients and
%change the values of the control window to reflect them
abduction_Quotient = excursion_2/maximum_Excursion;
shape_Quotient = (excursion_1-excursion_2)/maximum_Excursion;
set(rbn1_con_qa_edit,'String',abduction_Quotient);
set(rbn1_con_qs_edit,'String',shape_Quotient);
%Now specify the excursions as a percentage of vocal fold width
excursion_1_percent = (excursion_1/Width)*100;
excursion_2_percent = (excursion_2/Width)*100;
%Specify the model parameters in a vector
MODEL_PARAMETERS = [Length Width Thickness vert_Phase_Diff hori_Phase_Diff maximum_Excursion fund_Frequency abduction_Quotient shape_Quotient];
%Initialize plotting windows
%This special procedure is used to initialize plotting windows to ensure
%that the window will be opened if it already exists and a new window will be
%created otherwise.
PV = [10 267 392 288];
s2 = 'Vocal Fold Configuration -1';
% Open analysis window
while exist('rbn1_output_window_1')==1
try1 = 'get(rbn1_output_window_1,''position'');';
eval(try1,catch2);
if check ==0
clear rbn1_output_window_1;
check = 1;
break;
end
s1 = get(rbn1_output_window_1,'Name');
if ~strcmp(s1,s2)
clear rbn1_output_window_1;
break;
end
figure(rbn1_output_window_1);
break;
end;
if exist('rbn1_output_window_1')~=1;
rbn1_output_window_1=figure('Position',PV,...
'Resize','on',...
'Numbertitle','off',...
'Name',s2 );
end
%Now draw the vocal fold 2D configuration
%Call the file static_config_draw to draw the configuration
%For more information type help static_config_draw at the command prompt
figure(rbn1_output_window_1);
clf;
axes('position', [0.1 0.67 0.8 0.33]) %The upper third of the figure for the 2D view
static_config_draw(excursion_1_percent,excursion_2_percent,Thickness);
view(2); %2D view of the vocal folds
axes('position',[0.1 0.1 0.9 0.6]); %The lower two thirds for the 3D view
static_config_draw(excursion_1_percent,excursion_2_percent,Thickness);
axis([0 200 0 200 0 2*Thickness]);
%Vocal fold pre phonatory shape
PV = [411 48 377 286];
s2 = 'Vocal Fold Pre-Phonatory Shape';
% Open analysis window
while exist('rbn1_output_window_2')==1
try1 = 'get(rbn1_output_window_2,''position'');';
eval(try1,catch2);
if check ==0
clear rbn1_output_window_2;
check = 1;
break;
end
s1 = get(rbn1_output_window_2,'Name');
if ~strcmp(s1,s2)
clear rbn1_output_window_2;
break;
end
figure(rbn1_output_window_2);
break;
end;
if exist('rbn1_output_window_2')~=1;
rbn1_output_window_2=figure('Position',PV,...
'Resize','on',...
'Numbertitle','off',...
'Name',s2 );
end
%Call function to draw the pre phonatory shape
%For more help type help pre_phonatory_shape_draw
clf;
prephonatory_draw(excursion_1_percent,excursion_2_percent);
clc;
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?