comparison multithreshold 1.46/subjGUI_MT.m @ 38:c2204b18f4a2 tip

End nov big change
author Ray Meddis <rmeddis@essex.ac.uk>
date Mon, 28 Nov 2011 13:34:28 +0000
parents 25d53244d5c8
children
comparison
equal deleted inserted replaced
37:771a643d5c29 38:c2204b18f4a2
984 title([stimulusParameters.WRVname ' = ' ... 984 title([stimulusParameters.WRVname ' = ' ...
985 num2str(withinRuns.variableValue, '%5.1f')]) 985 num2str(withinRuns.variableValue, '%5.1f')])
986 otherwise 986 otherwise
987 title([stimulusParameters.WRVname ' = ' ... 987 title([stimulusParameters.WRVname ' = ' ...
988 num2str(withinRuns.variableValue, '%5.1f') ... 988 num2str(withinRuns.variableValue, '%5.1f') ...
989 '; TH= ' num2str(estThresh, '%5.1f')]) 989 '; TH= ' num2str(estThresh, '%5.1f') ' dB'])
990 end 990 end
991 end 991 end
992 xlim([0 experiment.maxTrials+withinRuns.beginningOfPhase2]); 992 xlim([0 experiment.maxTrials+withinRuns.beginningOfPhase2]);
993 ylim(stimulusParameters.WRVlimits) 993 ylim(stimulusParameters.WRVlimits)
994 ylabel ('dB SPL')
994 grid on 995 grid on
995 996
996 % Panel 4: Summary of threshold estimates (not used here) 997 % Panel 4: Summary of threshold estimates (not used here)
997 % Estimates from previous runs are set in 'runCompleted' 998 % Estimates from previous runs are set in 'runCompleted'
998 % It is only necessary to change title showing runs/trials remaining 999 % It is only necessary to change title showing runs/trials remaining
1273 end 1274 end
1274 hold on 1275 hold on
1275 end 1276 end
1276 xlimRM([ min(betweenRuns.variableList1) max(betweenRuns.variableList1) ]) 1277 xlimRM([ min(betweenRuns.variableList1) max(betweenRuns.variableList1) ])
1277 ylim(stimulusParameters.WRVlimits) 1278 ylim(stimulusParameters.WRVlimits)
1278 ylabel('thresholds') 1279 ylabel('thresholds (dB)')
1279 xlabel(betweenRuns.variableName1) 1280 xlabel(betweenRuns.variableName1)
1280 set(gca,'ytick', [0 20 40 60 80 100]) 1281 set(gca,'ytick', [0 20 40 60 80 100])
1281 try 1282 try
1282 % problems if only one x value 1283 % problems if only one x value
1283 set(gca,'XTick', sort(betweenRuns.variableList1)) 1284 set(gca,'XTick', sort(betweenRuns.variableList1))
1303 if ispc, wavplay(y/100,fs, 'async'), else sound(y/100,fs, 'async'), end 1304 if ispc, wavplay(y/100,fs, 'async'), else sound(y/100,fs, 'async'), end
1304 1305
1305 % update experimenter GUI 1306 % update experimenter GUI
1306 addToMsg('Experiment completed.',1) 1307 addToMsg('Experiment completed.',1)
1307 1308
1309 set(expGUIhandles.pushbuttonSave,'visible','on')
1308 printReport 1310 printReport
1309 experiment.status='endOfExperiment'; 1311 experiment.status='endOfExperiment';
1310 return 1312 return
1311 else 1313 else
1312 % No, hang on. 1314 % No, hang on.
1431 % -------------------------------------------------------MAPmodel 1433 % -------------------------------------------------------MAPmodel
1432 function [modelResponse, MacGregorResponse]=MAPmodel 1434 function [modelResponse, MacGregorResponse]=MAPmodel
1433 1435
1434 global experiment stimulusParameters audio withinRuns 1436 global experiment stimulusParameters audio withinRuns
1435 % global outerMiddleEarParams DRNLParams AN_IHCsynapseParams 1437 % global outerMiddleEarParams DRNLParams AN_IHCsynapseParams
1436 global ICoutput ANdt dt savedBFlist ANprobRateOutput expGUIhandles 1438 global ICoutput dtSpikes dt savedBFlist ANprobRateOutput expGUIhandles
1437 global paramChanges 1439 global paramChanges
1438 1440
1439 savePath=path; 1441 savePath=path;
1440 addpath(['..' filesep 'MAP'], ['..' filesep 'utilities']) 1442 addpath(['..' filesep 'MAP'], ['..' filesep 'utilities'])
1441 modelResponse=[]; 1443 modelResponse=[];
1477 if showPlotsAndDetails 1479 if showPlotsAndDetails
1478 options.printModelParameters=0; 1480 options.printModelParameters=0;
1479 options.showModelOutput=1; 1481 options.showModelOutput=1;
1480 options.printFiringRates=1; 1482 options.printFiringRates=1;
1481 options.showACF=0; 1483 options.showACF=0;
1482 options.showEfferent=1; 1484 options.showEfferent=0;
1483 options.surfProbability=0; 1485 options.surfProbability=0;
1484 showMapOptions.surfSpikes=0; 1486 showMapOptions.surfSpikes=0;
1485 UTIL_showMAP(options) 1487 UTIL_showMAP(options)
1486 end 1488 end
1487 1489
1491 end 1493 end
1492 % ---------------------------------------------------------- end model run 1494 % ---------------------------------------------------------- end model run
1493 1495
1494 if strcmp(AN_spikesOrProbability,'spikes') 1496 if strcmp(AN_spikesOrProbability,'spikes')
1495 MacGregorResponse= sum(ICoutput,1); % use IC 1497 MacGregorResponse= sum(ICoutput,1); % use IC
1496 dt=ANdt; 1498 dt=dtSpikes;
1497 time=dt:dt:dt*length(MacGregorResponse); 1499 time=dt:dt:dt*length(MacGregorResponse);
1498 else 1500 else
1499 % for one channel, ANprobResponse=ANprobRateOutput 1501 % for one channel, ANprobResponse=ANprobRateOutput
1500 % for multi channel take strongest in any epoch 1502 % for multi channel take strongest in any epoch
1501 nChannels=length(savedBFlist); 1503 nChannels=length(savedBFlist);
1506 1508
1507 % group delay on unit response - these values are iffy 1509 % group delay on unit response - these values are iffy
1508 windowOnsetDelay= 0.004; 1510 windowOnsetDelay= 0.004;
1509 windowOffsetDelay= 0.022; % long ringing time 1511 windowOffsetDelay= 0.022; % long ringing time
1510 1512
1511 % now find the response of the MacGregor model during the target presentation + group delay 1513 % now find the response of the MacGregor model during
1514 % the target presentation + group delay
1512 switch experiment.threshEstMethod 1515 switch experiment.threshEstMethod
1513 case {'2I2AFC++', '2I2AFC+++'} 1516 case {'2I2AFC++', '2I2AFC+++'}
1514 idx= time>stimulusParameters.testTargetBegins+windowOnsetDelay ... 1517 idx= time>stimulusParameters.testTargetBegins+windowOnsetDelay ...
1515 & time<stimulusParameters.testTargetEnds+windowOffsetDelay; 1518 & time<stimulusParameters.testTargetEnds+windowOffsetDelay;
1516 nSpikesTrueWindow=sum(MacGregorResponse(:,idx)); 1519 nSpikesTrueWindow=sum(MacGregorResponse(:,idx));
1548 end 1551 end
1549 disp(['level target dummy decision: ' ... 1552 disp(['level target dummy decision: ' ...
1550 num2str([withinRuns.variableValue nSpikesTrueWindow ... 1553 num2str([withinRuns.variableValue nSpikesTrueWindow ...
1551 nSpikesFalseWindow nSpikesDuringTarget], '%4.0f') ] ) 1554 nSpikesFalseWindow nSpikesDuringTarget], '%4.0f') ] )
1552 otherwise 1555 otherwise
1553 % single interval 1556
1557 % single interval up/down
1554 idx=find(time>stimulusParameters.testTargetBegins +windowOnsetDelay... 1558 idx=find(time>stimulusParameters.testTargetBegins +windowOnsetDelay...
1555 & time<stimulusParameters.testTargetEnds+windowOffsetDelay); 1559 & time<stimulusParameters.testTargetEnds+windowOffsetDelay);
1556 if strcmp(AN_spikesOrProbability,'spikes') 1560 if strcmp(AN_spikesOrProbability,'spikes')
1557 nSpikesDuringTarget=sum(MacGregorResponse(:,idx)); 1561 nSpikesDuringTarget=sum(MacGregorResponse(:,idx));
1558 timeX=time(idx); 1562 timeX=time(idx);
1745 fclose(serobj); 1749 fclose(serobj);
1746 catch 1750 catch
1747 end 1751 end
1748 1752
1749 try 1753 try
1750 serobj = serial('COM4') ; % Creating serial port object now its connected to COM4 !!! button boxes in booths are connected to COM2 1754 % !!! button boxes in booths are connected to COM2. User beware of
1755 % connection port.
1756 serobj = serial('COM2') ; % Creating serial port object
1751 serobj.Baudrate = 9600; % Set the baud rate at the specific value 1757 serobj.Baudrate = 9600; % Set the baud rate at the specific value
1752 set(serobj, 'Parity', 'none') ; % Set parity as none 1758 set(serobj, 'Parity', 'none') ; % Set parity as none
1753 set(serobj, 'Databits', 8) ; % set the number of data bits 1759 set(serobj, 'Databits', 8) ; % set the number of data bits
1754 set(serobj, 'StopBits', 1) ; % set number of stop bits as 1 1760 set(serobj, 'StopBits', 1) ; % set number of stop bits as 1
1755 set(serobj, 'Terminator', 'CR') ; % set the terminator value to carriage return 1761 set(serobj, 'Terminator', 'CR') ; % set the terminator value to carriage return