Home > fcn > DIVA_GUI_callbacks > gui_auditory_cbk.m

gui_auditory_cbk

PURPOSE ^

SYNOPSIS ^

function gui_auditory_cbk(src,eventdata,options)

DESCRIPTION ^

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SUBFUNCTIONS ^

SOURCE CODE ^

0001 function gui_auditory_cbk(src,eventdata,options)
0002   switch(get(src,'tag'))
0003    case 'go',
0004     target = DIVA('GUI','FmtValues')';
0005     moveArtics(target);
0006    case 'fmt',
0007     set(src,'value',str2num(get(src,'string')));
0008    case 'fmt_space',
0009     F=[662 1251 2278;  % aa
0010        660 1720 2410;  % ae
0011        677 1419 2241;  % ah %591 1533.5 2419
0012        519 1619 2411;  % eh
0013        490 1350 1690;  % er
0014        390 1990 2550;  % ih
0015        270 2290 3010;  % iy %similar: 256 2292 2927
0016        392 964 2233;   % oo %272 876.5 2301
0017        526 910.5 2108; % ow %OLD not as good: 570 840 2410;
0018        541 1097 2239]; % uh
0019     
0020     % oh [478.5 848 2097]
0021     % iw [329.5 1520.5 2337]
0022     % ew [404 1480.5 2361]
0023     % oe [478.5 1606.5 2421.5]
0024     % ey [404.5 2001.5 2497.5]
0025     
0026     
0027     if(strcmp(get(src,'Type'),'axes'))
0028       x=get(src,'CurrentPoint');
0029     else
0030       x=get(get(src,'parent'),'CurrentPoint');
0031     end
0032     %f=inv_mel([x(1,1),x(1,2)]);
0033     f=[x(1,1), x(1,2)];
0034     [err,idx]=min(sqrt(sum((F(:,[1,2])-repmat(f,size(F,1),1)).^2,2)));
0035     f = [f,F(idx,3)]';
0036     moveArtics(f);
0037   end
0038   
0039 function moveArtics(target),
0040   SE = 10;
0041   iter = 1;
0042   DIVA('GUI','VTAction','disable');
0043   while(SE > 0.010 & iter < 30)
0044     iter = iter+1;
0045     artic = DIVA('GUI','artic_slider',[]);
0046     temp = DIVA('VocalTract','motor',artic);
0047     current = temp{1};
0048     dCurrent = target - current;
0049     dArtic = calculateInverse(artic,current,dCurrent,size(current,1));
0050     SE = sum(dArtic.^2);
0051     dArtic = 0.8*dArtic;
0052     newArtic = artic+dArtic;
0053     % Add integration constants???
0054     % Save iteration, SE and newFmt for each time point for overlaying plot
0055     %   Need new Line object for crosshair plot
0056     %   Visible with right click
0057 
0058     newArtic=max(min(newArtic,DIVA('VocalTract','MaedaSpread')),...
0059                  -DIVA('VocalTract','MaedaSpread'));
0060     
0061     DIVA('GUI','artic_slider',newArtic);
0062     DIVA('GUI','artic_edit',newArtic);
0063     DIVA('GUI','VT_Configuration','update');
0064     temp = DIVA('VocalTract','motor',newArtic);
0065     newFmt = temp{1};
0066     %DIVA('GUI','FmtSpace_crosshairs',mel(newFmt));
0067     DIVA('GUI','FmtSpace_crosshairs',(newFmt));
0068     DIVA('GUI','FmtValues',newFmt);
0069   end
0070   DIVA('GUI','VTAction','enable');

Generated on Tue 27-Mar-2007 12:06:24 by m2html © 2003