Revision 29:b51bf546ca3f multithreshold 1.46

View differences:

multithreshold 1.46/expGUI_MT.m
1 1
% expGUI_MT = 'experimenter GUI for multiThreshold
2 2
% allows the experimenter to design experiments.
3 3
% The *running* of experiments is left to subjGUI.m
4
% 
4
%
5 5
% There are three kinds of experiments known as 'earOptions':
6
% 1. Measurements using real listeners 
6
% 1. Measurements using real listeners
7 7
%  'left', 'right',  'diotic', 'dichoticLeft', 'dichoticRight'
8 8
% 2. Measurements using the MAP model as the subject
9 9
%   'MAPmodelListen',  'MAPmodelMultiCh', 'MAPmodelSingleCh'
......
88 88
setLocationOfGUIs(handles)
89 89

  
90 90
function setLocationOfGUIs(handles)
91
global checkForPreviousGUI  % holds screen positioning across repeated calls 
91
global checkForPreviousGUI  % holds screen positioning across repeated calls
92 92
scrnsize=get(0,'screensize');
93 93
checkForPreviousGUI=[];
94 94
% if isstruct(checkForPreviousGUI)...
......
140 140
% addpath (['..' filesep 'modules'], ['..' filesep 'utilities'], ...
141 141
%     ['..' filesep 'parameterStore'],  ['..' filesep 'wavFileStore'],...
142 142
%     ['..' filesep 'testPrograms'])
143
addpath (['..' filesep 'testPrograms'])
143 144

  
144 145
% specify all variables that  need to be set on the GUI
145 146
variableNames={'stimulusDelay','maskerDuration','maskerLevel',...
......
314 315
paradigm=paradigmNames{chosenOption};
315 316
experiment.paradigm=paradigm;
316 317

  
317
        %Paradigm: read in all relevant parameters
318
%Paradigm: read in all relevant parameters
318 319
% a file must exist with this name 'paradigm_<paradigm>'
319 320
% 'handles' are only occasionally used
320 321
addpath ('paradigms')
......
347 348
eval (cmd);
348 349

  
349 350
% establish popup menus on the basis of the paradigm file
350
set(handles.popupmenuRandomize,'value', betweenRuns.randomizeSequence)	
351
set(handles.popupmenuRandomize,'value', betweenRuns.randomizeSequence)
351 352
set(handles.popupmenuPhase,'string', stimulusParameters.maskerPhase)
352 353
if stimulusParameters.includeCue
353 354
    set(handles.popupmenuCueNoCue,'value', 1)
......
383 384

  
384 385
% ------------------------------------------------------ aResetPopupMenus
385 386
function aResetPopupMenus(handles)
386
global   stimulusParameters betweenRuns variableNames 
387
global   stimulusParameters betweenRuns variableNames
387 388
global targetTypes maskerTypes experiment backgroundTypes
388 389

  
389 390
switch experiment.threshEstMethod
390 391
    case {'MaxLikelihood','oneIntervalUpDown'}
391 392
        set(handles.editstopCriteriaBox, 'string', ...
392 393
            num2str(experiment.singleIntervalMaxTrials))
393
        
394

  
394 395
    case {'2I2AFC++','2I2AFC+++'}
395 396
        set(handles.editstopCriteriaBox, 'string', ...
396 397
            num2str(experiment.stopCriteria2IFC))
......
410 411
for i=1:length(variableNames)
411 412
    if strcmp(variableNames{i},betweenRuns.variableName1)
412 413
        variableParameter1ID=i;
413
    end   
414
    end
414 415
    if strcmp(variableNames{i},betweenRuns.variableName2)
415 416
        variableParameter2ID=i;
416 417
    end
......
453 454
        set(handles.editStatsModel, 'visible', 'on')
454 455
        set(handles.textStatsModel, 'visible', 'on')
455 456
        set(handles.pushbuttonStop, 'visible', 'on')
456
showModelPushButtons(handles, 0)
457
        showModelPushButtons(handles, 0)
457 458
        set(handles.editCatchTrialRate, 'visible', 'off')
458 459
        set(handles.textCatchTrials, 'visible', 'off')
459 460
        set(handles.editcalibrationdB, 'visible', 'off')
......
462 463
        set(handles.textCue, 'visible', 'off')
463 464
        set(handles.editMusicLevel,'visible', 'off')
464 465
        set(handles.textMusicLevel,'visible', 'off')
465
        
466

  
466 467
    case {'MAPmodel',  'MAPmodelListen', 'MAPmodelMultiCh', 'MAPmodelSingleCh'}
467 468
        set(handles.popupmenuCueNoCue, 'visible', 'off')
468 469
        set(handles.editStatsModel, 'visible', 'off')
469 470
        set(handles.textStatsModel, 'visible', 'off')
470 471
        set(handles.pushbuttonStop, 'visible', 'on')
471
showModelPushButtons(handles, 1)
472
        showModelPushButtons(handles, 1)
472 473
        set(handles.editcalibrationdB, 'visible', 'off')
473 474
        set(handles.textcalibration, 'visible', 'off')
474 475
        set(handles.textCue, 'visible', 'off')
475 476
        set(handles.editMusicLevel,'visible', 'off')
476 477
        set(handles.textMusicLevel,'visible', 'off')
477
        
478

  
478 479
    otherwise
479 480
        % i.e. using real subjects (left, right, diotic, dichotic)
480 481
        set(handles.editStatsModel, 'visible', 'off')
481 482
        set(handles.textStatsModel, 'visible', 'off')
482 483
        set(handles.pushbuttonStop, 'visible', 'off')
483
showModelPushButtons(handles, 0)
484
        showModelPushButtons(handles, 0)
484 485
        set(handles.editCatchTrialRate, 'visible', 'on')
485 486
        set(handles.textCatchTrials, 'visible', 'on')
486 487
        set(handles.editcalibrationdB, 'visible', 'on')
......
497 498
        set(handles.textCue,'visible', 'on')
498 499
        set(handles.editstopCriteriaBox, 'string', ...
499 500
            num2str(experiment.singleIntervalMaxTrials))
500
        
501

  
501 502
        if stimulusParameters.includeCue==0
502 503
            set(handles.editcueTestDifference,'visible', 'off')
503 504
            set(handles.textcueTestDifference,'visible', 'off')
......
505 506
            set(handles.editcueTestDifference,'visible', 'on')
506 507
            set(handles.textcueTestDifference,'visible', 'on')
507 508
        end
508
        
509

  
509 510
    case {'2I2AFC++','2I2AFC+++'}
510 511
        set(handles.editCatchTrialRate, 'visible', 'off')
511 512
        set(handles.textCatchTrials, 'visible', 'off')
......
609 610

  
610 611
% ------------------------------------------------ pushbuttonRun_Callback
611 612
function pushbuttonRun_Callback(hObject, eventdata, handles)
612
global checkForPreviousGUI % holds screen positioning across repeated calls 
613
global checkForPreviousGUI % holds screen positioning across repeated calls
613 614
global experiment betweenRuns paradigmNames errormsg
614 615
checkForPreviousGUI.GUIposition=get(handles.figure1,'position');
615 616
experiment.singleShot=0;
......
621 622
        set(handles.edittargetDuration,'string', num2str(0.25))
622 623
        set(handles.editstopCriteriaBox,'string','10') % nTrials
623 624
        run (handles)
624
        
625
        if ~isempty(errormsg)
625

  
626
        if strcmp(errormsg,'manually stopped')
626 627
            disp(errormsg)
627 628
            optionNo=strmatch('profile',paradigmNames);
628 629
            set(handles.popupmenuParadigm,'value',optionNo);
......
630 631
            aParadigmSelection(handles)
631 632
            return
632 633
        end
633
        
634

  
634 635
        global resultsTable
635 636
        longTone=resultsTable(2:end,2:end);
636
        
637

  
637 638
        set(handles.edittargetDuration,'string', num2str(0.016))
638 639
        set(handles.editstopCriteriaBox,'string','10') % nTrials
639 640
        run (handles)
640
        if ~isempty(errormsg)
641
        if strcmp(errormsg,'manually stopped')
641 642
            disp(errormsg)
642 643
            optionNo=strmatch('profile',paradigmNames);
643 644
            set(handles.popupmenuParadigm,'value',optionNo);
......
646 647
            aParadigmSelection(handles)
647 648
            return
648 649
        end
649
        
650

  
650 651
        shortTone=resultsTable(2:end,2:end);
651 652

  
652 653
        % use these threshold for TMC
......
656 657
        aParadigmSelection(handles)
657 658
        set(handles.edittargetLevel,'string', thresholds16ms+10);
658 659
        set(handles.editstopCriteriaBox,'string','10')  % nTrials
659
        pause(.1) 
660
        pause(.1)
660 661
        run (handles)
661
        
662
        if ~isempty(errormsg)
662

  
663
        if strcmp(errormsg,'manually stopped')
663 664
            disp(errormsg)
664 665
            optionNo=strmatch('profile',paradigmNames);
665 666
            set(handles.popupmenuParadigm,'value',optionNo);
......
672 673
        TMC=resultsTable(2:end,2:end);
673 674
        gaps=resultsTable(2:end,1);
674 675
        BFs=resultsTable(1, 2:end);
675
        
676

  
676 677
        % use these threshold for IFMC
677 678
        optionNo=strmatch('IFMC',paradigmNames);
678 679
        set(handles.popupmenuParadigm,'value',optionNo);
679 680
        aParadigmSelection(handles)
680 681
        set(handles.edittargetLevel,'string', thresholds16ms+10);
681 682
        set(handles.editstopCriteriaBox,'string','10')  % nTrials
682
        pause(.1) 
683
        pause(.1)
683 684
        run (handles)
684 685

  
685
        if ~isempty(errormsg)
686

  
687
        IFMCs=resultsTable(2:end,2:end);
688
        offBFs=resultsTable(2:end,1);
689

  
690
        % reset original paradigm
691
        optionNo=strmatch('profile',paradigmNames);
692
        set(handles.popupmenuParadigm,'value',optionNo);
693
        aParadigmSelection(handles)
694

  
695
        save profile longTone shortTone gaps BFs TMC offBFs IFMCs
696
        plotProfile(longTone,shortTone,gaps,BFs,TMC,offBFs,IFMCs)
697

  
698
        if strcmp(errormsg,'manually stopped')
686 699
            disp(errormsg)
687 700
            optionNo=strmatch('profile',paradigmNames);
688 701
            set(handles.popupmenuParadigm,'value',optionNo);
......
690 703
            experiment.stop=-0;
691 704
            aParadigmSelection(handles)
692 705
            return
693
        end       
694

  
695
        IFMCs=resultsTable(2:end,2:end);
696
        offBFs=resultsTable(2:end,1);
697
        
698
        % reset original paradigm
699
        optionNo=strmatch('profile',paradigmNames);
700
        set(handles.popupmenuParadigm,'value',optionNo);
701
        aParadigmSelection(handles)
702

  
703
        save profile longTone shortTone gaps BFs TMC offBFs IFMCs
704
        plotProfile(longTone,shortTone,gaps,BFs,TMC,offBFs,IFMCs)
705
        
706
        end
706 707
    otherwise
707 708
        run (handles)
708 709
        experiment.stop=0;
......
713 714
tic
714 715
expGUIhandles=handles;
715 716
set(handles.pushbuttonStop, 'backgroundColor', [.941 .941 .941])
716
set(handles.editparamChanges,'visible','off')
717
% set(handles.editparamChanges,'visible','off')
717 718

  
718 719
% message box white (removes any previous error message)
719 720
set(handles.textMSG,...
......
742 743

  
743 744
% --- Executes on button press in pushbuttonSingleShot.
744 745
function pushbuttonSingleShot_Callback(hObject, eventdata, handles)
745
global experiment 
746
global experiment
746 747
experiment.singleShot=1;
747 748

  
748 749
% special test for spontaneous activity
......
764 765
% ------------------------------------------aReadAndCheckParameterBoxes
765 766
function errorMsg=aReadAndCheckParameterBoxes(handles)
766 767
global experiment  stimulusParameters betweenRuns  statsModel
767
global variableNames  LevittControl
768
global variableNames  LevittControl paramChanges
768 769
% When the program sets the parameters all should be well
769 770
% But when the user changes them...
770 771

  
......
780 781

  
781 782
switch experiment.ear
782 783
    case { 'MAPmodel', 'MAPmodelMultiCh', ...
783
            'MAPmodelSingleCh', 'MAPmodelListen'}         
784
        % MAPmodel writes forced parameter settings to the screen 
784
            'MAPmodelSingleCh', 'MAPmodelListen'}
785
        % MAPmodel writes forced parameter settings to the screen
785 786
        %  so that they can be read from there
786 787
        set(handles.popupmenuRandomize,'value',2)       % fixed sequence
787 788
        set(handles.editstimulusDelay,'string','0.01')  % no stimulus delay
......
840 841
end
841 842

  
842 843
% calibration
843
%  this is used to *reduce* the output signal from what it otherwise 
844
%  this is used to *reduce* the output signal from what it otherwise
844 845
%  would be
845 846
% signal values are between 1 - 2^23
846 847
%  these are interpreted as microPascals between -29 dB and 128 dB SPL
847
% calibrationdB adjusts these values to compensate for equipment 
848
% calibrationdB adjusts these values to compensate for equipment
848 849
%  characteristics
849
%  this will change the range. e.g. a 7 dB calibration will yield 
850
%  this will change the range. e.g. a 7 dB calibration will yield
850 851
%   a range of -36 to 121 dB SPL
851 852
% Calibration is not used when modelling. Values are treated as dB SPL
852 853
stimulusParameters.calibrationdB=...
......
946 947
        % start value for step until reduced
947 948
        LevittControl.startLevelStep= stimulusParameters.WRVsteps(1);
948 949
        % reduced step size
949
        LevittControl.steadyLevittStep= stimulusParameters.WRVsteps(2); 
950
        LevittControl.steadyLevittStep= stimulusParameters.WRVsteps(2);
950 951
        LevittControl.TurnsToSmallSteps= 2;
951 952
        LevittControl.useLastNturns= 2*experiment.peaksUsed;
952 953
        LevittControl.minReversals= ...
......
1006 1007

  
1007 1008
% Check WRVstartValues for length and compatibility with randomization
1008 1009
% only one start value supplied so all start values are the same
1009
if length(stimulusParameters.WRVstartValues)==1     
1010
if length(stimulusParameters.WRVstartValues)==1
1010 1011
    stimulusParameters.WRVstartValues= ...
1011 1012
        repmat(stimulusParameters.WRVstartValues, 1, ...
1012 1013
        length(betweenRuns.variableList1)...
......
1051 1052
                stimulusParameters.maskerDuration)
1052 1053
            addToMsg(...
1053 1054
                'Warning: masker and target duration not the same.',1,1)
1054
        end        
1055
        end
1055 1056
        if ~isequal(stimulusParameters.maskerLevel, ...
1056 1057
                stimulusParameters.targetLevel)
1057 1058
            addToMsg(['Warning: masker and target level different.'...
......
1059 1060
        end
1060 1061
end
1061 1062

  
1063
% identify model parameter changes if any
1064
paramChanges=get(handles.editparamChanges,'string');
1065
eval(paramChanges);
1066

  
1062 1067
% -------------------------------------------- aSetSampleRate
1063 1068
function aSetSampleRate(sampleRate, handles)
1064 1069
global  stimulusParameters
......
1106 1111
    case {'statsModelLogistic', 'statsModelRareEvent'}
1107 1112
        set(handles.editStatsModel, 'visible', 'off')
1108 1113
        set(handles.textStatsModel, 'visible', 'off')
1109
        
1114

  
1110 1115
        % default psychometric bin size and logistic slopes
1111 1116
        set(handles.popupmenuRandomize,'value',2)   % fixed sequence
1112 1117
        set(handles.editName,'string', 'statsModel')
1113 1118
        %         experiment.headphonesUsed=0;
1114
        
1119

  
1115 1120
    case {'MAPmodelListen', 'MAPmodelMultiCh', 'MAPmodelSingleCh'}
1116 1121
        stimulusParameters.includeCue=0;						 % no cue
1117 1122
        set(handles.popupmenuCueNoCue,'value', 2)
1118
        
1123

  
1119 1124
        set(handles.editCatchTrialRate,'string','0 0  2 ');%no catch trials
1120 1125
        set(handles.editName,'string', 'Normal')			% force name
1121 1126
        experiment.name=get(handles.editName,'string');	% read name back
1122
        set(handles.editcalibrationdB,'string','0')	
1123
        
1127
        set(handles.editcalibrationdB,'string','0')
1128

  
1124 1129
        set(handles.popupmenuRandomize,'value',2)       % fixed sequence
1125 1130
        set(handles.editstimulusDelay,'string','0')
1126
        
1131

  
1127 1132
        set(handles.editSaveData,'string', '0')
1128 1133
        set(handles.editSubjectFont,'string', '10');
1129 1134
        experiment.MacGThreshold=0; % num MacG spikes to exceed threshold
......
1178 1183
            case 'training'
1179 1184
                experiment.possLogSlopes=0.5;
1180 1185
        end
1181
        
1186

  
1182 1187
    case 'oneIntervalUpDown'
1183 1188
        experiment.functionEstMethod='logisticLS';
1184 1189
        set(handles.textstopCriteria,'string', 'stop criteria \ maxTrials')
......
1189 1194
            otherwise
1190 1195
                experiment.allowCatchTrials= 1;
1191 1196
        end
1192
        
1197

  
1193 1198
    case {'2I2AFC++',  '2I2AFC+++'}
1194 1199
        LevittControl.rule='++'; %  e.g. '++' or '+++'
1195 1200
        experiment.singleIntervalMaxTrials=experiment.stopCriteria2IFC;
......
1209 1214
% NB responsibility for this is now transferred to the paradigm file
1210 1215
switch experiment.threshEstMethod
1211 1216
    % only one value required for level change
1212
    case {'2I2AFC++', '2A2AIFC+++'}		
1217
    case {'2I2AFC++', '2A2AIFC+++'}
1213 1218
        stimulusParameters.subjectText=...
1214 1219
            'did the tone occur in window 1 or 2?';
1215 1220
    case {'MaxLikelihood',  'oneIntervalUpDown'};
......
1399 1404
drawnow
1400 1405

  
1401 1406
function pushbuttonOME_Callback(hObject, eventdata, handles)
1402
global experiment
1407
global experiment paramChanges
1403 1408
aReadAndCheckParameterBoxes(handles);
1404
testOME(experiment.name);
1409
testOME(experiment.name, paramChanges);
1405 1410

  
1406 1411
function pushbuttonBM_Callback(hObject, eventdata, handles)
1407
global  stimulusParameters experiment
1412
global  stimulusParameters experiment paramChanges
1408 1413
aReadAndCheckParameterBoxes(handles);
1409 1414
relativeFrequencies=[0.25    .5   .75  1  1.25 1.5    2];
1410

  
1415
AN_spikesOrProbability='probability';
1411 1416
testBM(stimulusParameters.targetFrequency, ...
1412
    experiment.name,relativeFrequencies);
1417
    experiment.name,relativeFrequencies, AN_spikesOrProbability, ...
1418
    paramChanges);
1413 1419

  
1414 1420
function pushbuttonAN_Callback(hObject, eventdata, handles)
1415
global stimulusParameters
1421
global stimulusParameters experiment paramChanges
1416 1422
aReadAndCheckParameterBoxes(handles);
1417 1423
% now carry out tests
1418 1424
showPSTHs=0;
1419 1425
targetFrequency=stimulusParameters.targetFrequency(1);
1420 1426
BFlist=targetFrequency;
1421 1427

  
1422
testAN(targetFrequency,BFlist);
1428
testAN(targetFrequency,BFlist,-10:10:90,experiment.name, paramChanges);
1423 1429

  
1424 1430
function pushbuttonPhLk_Callback(hObject, eventdata, handles)
1431
global experiment
1425 1432
aReadAndCheckParameterBoxes(handles);
1426
testPhaseLocking
1433
testPhaseLocking(experiment.name)
1427 1434

  
1428 1435
function pushbuttonSYN_Callback(hObject, eventdata, handles)
1436
global stimulusParameters experiment paramChanges
1429 1437
aReadAndCheckParameterBoxes(handles);
1430
testSynapse
1438
% now carry out tests
1439
showPSTHs=0;
1440
targetFrequency=stimulusParameters.targetFrequency(1);
1441
BFlist=targetFrequency;
1442
testSynapse(BFlist,experiment.name, paramChanges)
1431 1443

  
1432 1444
function pushbuttonFM_Callback(hObject, eventdata, handles)
1433
global stimulusParameters experiment
1445
global stimulusParameters experiment paramChanges
1434 1446
aReadAndCheckParameterBoxes(handles);
1435 1447
showPSTHs=1;
1436
testFM(stimulusParameters.targetFrequency(1),experiment.name, showPSTHs)
1448
testFM(stimulusParameters.targetFrequency(1),experiment.name, ...
1449
    showPSTHs, paramChanges)
1437 1450

  
1438 1451
function popupmenuPhase_Callback(hObject, eventdata, handles)
1439 1452
global stimulusParameters
......
1447 1460
function pushbuttonParams_Callback(hObject, eventdata, handles)
1448 1461
global experiment stimulusParameters
1449 1462
aReadAndCheckParameterBoxes(handles);
1450
% print model parameters using the 'name' box (e.g. CTa -> MAPparamsCTa)
1451 1463
showParams=1; BFlist=-1;
1452 1464
paramChanges=get(handles.editparamChanges,'string');
1453
eval(paramChanges)
1465
eval(paramChanges);
1454 1466

  
1455 1467
paramFunctionName=['method=MAPparams' experiment.name ...
1456 1468
    '(BFlist, stimulusParameters.sampleRate, showParams,paramChanges);'];
......
1459 1471

  
1460 1472
% --- Executes on button press in pushbuttonRP.
1461 1473
function pushbuttonRP_Callback(hObject, eventdata, handles)
1462
global experiment stimulusParameters
1474
global experiment stimulusParameters paramChanges
1463 1475
aReadAndCheckParameterBoxes(handles);
1464 1476
% now carry out test
1465
testRP(stimulusParameters.targetFrequency,experiment.name)
1477
testRP(stimulusParameters.targetFrequency,experiment.name, paramChanges)
1466 1478

  
1467 1479
% function handles % ??
1468 1480

  
......
1755 1767
end
1756 1768

  
1757 1769

  
1758
    
1770

  
1759 1771

  
1760 1772

  
1761 1773
function editparamChanges_Callback(hObject, eventdata, handles)
multithreshold 1.46/nextStimulus.m
7 7
errormsg='';
8 8

  
9 9
% interrupt by 'stop' button
10
if experiment.stop
11
    disp('******** experiment manually stopped  *****************')
12
    experiment.status= 'waitingForStart';
13
    errormsg='manually stopped';
14
    addToMsg(errormsg,1)
15
    return
16
end
10
% if experiment.stop
11
%     disp('******** experiment manually stopped  *****************')
12
%     experiment.status= 'waitingForStart';
13
%     errormsg='manually stopped';
14
%     addToMsg(errormsg,1)
15
%     return
16
% end
17 17

  
18 18
% -----------------------------------------choose catch trials at random
19 19
% catch trials are for subject threshold measurements only
multithreshold 1.46/old files/MAPmodel.m
4 4
global outerMiddleEarParams DRNLParams AN_IHCsynapseParams
5 5

  
6 6
savePath=path;
7
addpath('..\MAP')
7
addpath(['..' filesep 'MAP'], ['..' filesep 'utilities'])
8 8
modelResponse=[];
9 9
MacGregorResponse=[];
10 10

  
......
25 25
        MAPparamsName, AN_spikesOrProbability);
26 26
    
27 27
if showPlotsAndDetails
28
    options.showModelParameters=0;
28
    options.printModelParameters=0;
29 29
    options.showModelOutput=1;
30 30
    options.printFiringRates=1;
31 31
    options.showACF=0;
32 32
    options.showEfferent=1;
33
    UTIL_showMAP(options, paramChanges)
33
    UTIL_showMAP(options)
34 34
end
35 35

  
36 36
% No response,  probably caused by hitting 'stop' button
multithreshold 1.46/paradigms/paradigm_IFMC.m
4 4
paradigm_training(handles) % default
5 5

  
6 6
stimulusParameters.WRVname='maskerLevel';
7
stimulusParameters.WRVstartValues=-10;
7
stimulusParameters.WRVstartValues=50;
8 8
stimulusParameters.WRVsteps= [-10 -2];
9 9
stimulusParameters.WRVlimits=[-30 110];
10 10

  
multithreshold 1.46/paradigms/paradigm_TMC.m
4 4
paradigm_training(handles) % default
5 5

  
6 6
stimulusParameters.WRVname='maskerLevel';
7
stimulusParameters.WRVstartValues=-10;
7
stimulusParameters.WRVstartValues=50;
8 8
stimulusParameters.WRVsteps= [-10 -4];
9 9
stimulusParameters.WRVlimits=[-30 110];
10 10

  
multithreshold 1.46/paradigms/paradigm_profile.m
5 5

  
6 6
betweenRuns.variableName1='targetFrequency';
7 7
betweenRuns.variableList1=[250 500 1000 2000 4000 8000 ];
8
betweenRuns.variableList1=str2num(get(handles.edittargetFrequency,'string'));
9 8
betweenRuns.variableName2='targetDuration';
10 9
betweenRuns.variableList2=0.016;
11 10
betweenRuns.randomizeSequence=1; % 'random sequence'
......
15 14

  
16 15
stimulusParameters.targetType='tone';
17 16
stimulusParameters.targetPhase='sin';
18
stimulusParameters.targetFrequency=1000;
17
stimulusParameters.targetFrequency=[250 500 1000 2000 4000 8000 ];
19 18
stimulusParameters.targetDuration=0.016;
20 19
stimulusParameters.targetLevel=stimulusParameters.WRVstartValues(1);
21 20

  
multithreshold 1.46/plotProfile.m
5 5
    load profile
6 6
end
7 7

  
8
normLongTone=[	11.4	1.55	-13.5	-6.35	-6.4	7.45];
9
normShortTone=[	23.85	18.9	9.85	10.6	9.55	21.9];
8
% comparison data (e.g. participants)
9
% rows are BFs
10 10

  
11
normGaps=0.01:0.01:0.09;
12
normTMC=	[
13
28.5	35.0	49.3	70.1	80.5	85.5    NaN      NaN    NaN;			
14
31.1	44.3	48.4	59.5	56.4	76.7	70.2	82.4	76.3;
15
33.4	38.4	48.8	55.8	64.5	78.7	84.2	88.3	90.3;
16
25.4	37.0	49.2	49.7	58.2	69.6	87.7	95.8	93.0;
17
18.2	23.5	27.4	41.5	64.3	82.1	86.7	91.2	NaN;
18
32.5	35.8	43.5	52.1	69.1	78.6	86.6	86.0	NaN;
19
    ];
20
normTMC=normTMC';
11
% -------------------------------------------JSan
12
compareBFs=[250	500	1000	2000	3000
13
];
14
compareLongTone=  [67.46485	56.95655	65.01985	61.46655	73.33265
15
];
16
compareShortTone=[	72.3185	63.2818	69.0373	65.2853	76
17
];
21 18

  
22
normIFMC=[
23
50	42	34	35	34	33	37;
24
58	51	38	33	28	41	49;
25
57	41	27	20	28	37	66;
26
61	49	27	20	34	68	79;
27
67	45	27	22	46	74	87;
28
62	62	43	22	47	56	83;
19
compareGaps=[0.02 0.05 0.08];
20
compareTMC=	[
21
    84	69	77	75	93
22
88	73	81	79	97
23
95	79	85	83	98
29 24
];
30
normIFMC=normIFMC';
25

  
26
compareMaskerFreqs=[0.7  0.9 1 1.1  1.3 ];
27
compareIFMCs=[83.1698	77.3165	79.8474	82.9074	82.3294
28
80.9667	73.6653	80.9446	80.7005	79.0022
29
82.0135	71.2284	78.7345	74.3342	84.126
30
79.3348	70.3347	78.5769	79.7274	91.9849
31
79.2308	76.3164	83.6881	86.2105	NaN
32
  ];
33

  
34
% % -------------------------------------------JE
35
% BFs=[250 500 1000 2000 4000 8000];
36
% compareLongTone=  [32 30	31	40	54 NaN];
37
% compareShortTone=[	49	50	47	56	63	NaN];
38
% 
39
% compareGaps=0.01:0.01:0.09;
40
% compareTMC=	[
41
%     69	83	82	NaN	NaN	NaN	NaN	NaN	NaN
42
%     61	68	79	88	93	NaN	NaN	NaN	NaN
43
%     63	69	79	84	92	NaN	NaN	NaN	NaN
44
%     67	71	75	80	82	84	88	93	NaN
45
%     82	82	86	86	NaN	83	88	90	75
46
%     NaN	NaN	NaN	NaN	NaN	NaN	NaN	NaN	NaN
47
%     ];
48
% compareTMC=compareTMC';
49
% 
50
% compareMaskerFreqs=[0.5	0.7	0.9	1	1.1	1.3	1.6];
51
% compareIFMCs=[
52
%     64	60	58	58	57	60	64
53
%     65	63	58	55	54	59	69
54
%     68	64	60	59	62	73	79
55
%     76	75	71	67	68	71	77
56
%     79	71	68	69	73	75	77
57
%     76	73	75	75	76	80	NaN
58
%     ];
59
% compareIFMCs=compareIFMCs';
60

  
61
% -------------------------------------------CMR
62
% CMR 
63
% BFs=[250 500 1000 2000 4000 8000];
64
% compareLongTone=[	11.4	1.55	-13.5	-6.35	-6.4	7.45];
65
% compareShortTone=[	23.85	18.9	9.85	10.6	9.55	21.9];
66
% 
67
% compareGaps=0.01:0.01:0.09;
68
% compareTMC=	[
69
%     28.5	35.0	49.3	70.1	80.5	85.5    NaN      NaN    NaN;
70
%     31.1	44.3	48.4	59.5	56.4	76.7	70.2	82.4	76.3;
71
%     33.4	38.4	48.8	55.8	64.5	78.7	84.2	88.3	90.3;
72
%     25.4	37.0	49.2	49.7	58.2	69.6	87.7	95.8	93.0;
73
%     18.2	23.5	27.4	41.5	64.3	82.1	86.7	91.2	NaN;
74
%     32.5	35.8	43.5	52.1	69.1	78.6	86.6	86.0	NaN;
75
%     ];
76
% compareTMC=compareTMC';
77
% 
78
% compareMaskerFreqs=[0.5	0.7	0.9	1	1.1	1.3	1.6];
79
% compareIFMCs=[
80
%     50	42	34	35	34	33	37;
81
%     58	51	38	33	28	41	49;
82
%     57	41	27	20	28	37	66;
83
%     61	49	27	20	34	68	79;
84
%     67	45	27	22	46	74	87;
85
%     62	62	43	22	47	56	83;
86
%     ];
87
% compareIFMCs=compareIFMCs';
31 88

  
32 89
% absolute thresholds
33 90
figure(90), clf
34 91
subplot(2,1,2)
35 92
semilogx(BFs,longTone,'ko-','lineWidth',2); hold on
36 93
semilogx(BFs,shortTone,'bo-','lineWidth',2); hold on
37
semilogx(BFs,normLongTone,'ko:'); hold on
38
semilogx(BFs,normShortTone,'bo:'); hold on
94
semilogx(compareBFs,compareLongTone,'ko:'); hold on
95
semilogx(compareBFs,compareShortTone,'bo:'); hold on
39 96
ylim([0 100])
40 97

  
41 98
% TMC
42 99
for BFno=1:length(BFs)
43 100
    subplot(2,6,BFno)
44 101
    plot(gaps,TMC(:,BFno)-longTone(BFno),'r','lineWidth',3), hold on
45
    plot(normGaps,normTMC(:,BFno)-longTone(BFno),'k:')
46
    ylim([-10 90])
102
    plot(gaps,TMC(:,BFno),'b','lineWidth',3), hold on
103
    ylim([-10 110])
47 104
    xlim([0.01 0.1])
48
    grid on    
105
    grid on
49 106
    if BFno==1
50 107
        ylabel('masker dB SL')
51 108
        xlabel('gap')
52
        text(0.02,80,' TMC','backgroundColor','w')
109
%         text(0.02,80,' TMC','backgroundColor','w')
53 110
    end
54
        title([num2str(BFs(BFno)) ' Hz'])
55
        set(gca,'XTick',[ 0.1],'xTickLabel', { '0.1'})
111
    title([num2str(BFs(BFno)) ' Hz'])
112
    set(gca,'XTick',[ 0.1],'xTickLabel', { '0.1'})
56 113
end
57 114

  
58 115
% IFMCs
59 116
for BFno=1:length(BFs)
60
    BF=BFs(BFno);
61 117
    freq=offBFs'*BFs(BFno);
62 118
    subplot(2,1,2)
63 119
    semilogx(freq,IFMCs(:,BFno),'r','lineWidth',3), hold on
64
    semilogx(freq,normIFMC(:,BFno),'k:')
65 120
    ylim([0 100])
66 121
    xlim([100 12000])
67 122
    grid on
......
69 124
xlabel('frequency (Hz)')
70 125
ylabel('masker dB / probe dB')
71 126
set(gca,'XTick',BFs)
127

  
128
for BFno=1:length(compareBFs)
129
    subplot(2,6,BFno)
130
    plot(compareGaps,compareTMC(:,BFno)-longTone(BFno),'k:')
131
    plot(compareGaps,compareTMC(:,BFno),'k:')
132
    ylim([-10 110])
133
    xlim([0.01 0.1])
134
    grid on
135
    if BFno==1
136
        ylabel('masker dB SL')
137
        xlabel('gap')
138
%         text(0.02,80,' TMC','backgroundColor','w')
139
    end
140
    title([num2str(BFs(BFno)) ' Hz'])
141
    set(gca,'XTick',[ 0.1],'xTickLabel', { '0.1'})
142
end
143

  
144
% IFMCs
145
for BFno=1:length(compareBFs)
146
    compareFreq=compareMaskerFreqs'*BFs(BFno);
147
    subplot(2,1,2)
148
    semilogx(compareFreq,compareIFMCs(:,BFno),'k:')
149
    ylim([0 100])
150
    xlim([100 12000])
151
    grid on
152
end
multithreshold 1.46/printReport.m
6 6

  
7 7
global experiment stimulusParameters betweenRuns withinRuns statsModel   audio
8 8
global LevittControl expGUIhandles
9

  
9
global paramChanges
10 10

  
11 11
global inputStimulusParams OMEParams DRNLParams
12 12
global IHC_VResp_VivoParams IHCpreSynapseParams  AN_IHCsynapseParams
......
24 24
    printReportGuide.showTracks=experiment.printTracks;
25 25
    printReportGuide.fileName=[];
26 26
    if experiment.saveData
27
        saveFileName=['savedData/' experiment.name '_' experiment.date '_' experiment.paradigm];
27
        saveFileName=...
28
            ['savedData/' experiment.name '_' ...
29
            experiment.date '_' experiment.paradigm];
28 30
    else
29 31
        % save this data (just in case)
30 32
        saveFileName=['savedData/mostRecentResults'];
......
84 86
msg=printTabTable(resultsTable,  headers);
85 87
addToMsg(msg,0)
86 88
fprintf('\n')
89
disp(paramChanges)
87 90

  
88 91
% sort tracks into the same order
89 92
betweenRuns.levelTracks=betweenRuns.levelTracks(idx1);
......
181 184
end
182 185

  
183 186
fprintf('\nparadigm:\t%s\n ', experiment.paradigm)
187
disp(paramChanges)
184 188

  
185 189
% ------------------------------------------------------- sortTablesForPrinting
186 190
function table= sortTablesForPrinting(idx1,idx2, var1values,var2values, x)
multithreshold 1.46/subjGUI_MT.m
1349 1349
    %  without waiting for button press
1350 1350
    startNewRun(handles)
1351 1351

  
1352
    % show sample Rate on GUI; it must be set in MAPparams
1352
    % show sample Rate on GUI; it must be set in MAPparams ##??
1353 1353
    set(expGUIhandles.textsampleRate,'string',...
1354 1354
        num2str(stimulusParameters.sampleRate))
1355 1355

  
1356
    if experiment.singleShot
1356
    if experiment.singleShot % ##??
1357 1357
        AN_IHCsynapseParams.plotSynapseContents=1;
1358 1358
    else
1359 1359
        AN_IHCsynapseParams.plotSynapseContents=0;
......
1424 1424
function [modelResponse, MacGregorResponse]=MAPmodel
1425 1425

  
1426 1426
global experiment stimulusParameters audio withinRuns
1427
global outerMiddleEarParams DRNLParams AN_IHCsynapseParams
1427
% global outerMiddleEarParams DRNLParams AN_IHCsynapseParams
1428
global ICoutput ANdt dt savedBFlist ANprobRateOutput expGUIhandles
1429
global paramChanges
1428 1430

  
1429 1431
savePath=path;
1430 1432
addpath(['..' filesep 'MAP'], ['..' filesep 'utilities'])
......
1444 1446
% ---------------------------------------------- run Model
1445 1447
MAPparamsName=experiment.name;
1446 1448
showPlotsAndDetails=experiment.MAPplot;
1449

  
1450
% important buried constant ##??
1447 1451
AN_spikesOrProbability='spikes';
1448 1452
AN_spikesOrProbability='probability';
1449 1453

  
1450 1454
% [response, method]=MAPsequenceSeg(audio, method, 1:8);
1451
global ICoutput ANdt dt savedBFlist ANprobRateOutput expGUIhandles
1452
global stimulusParameters experiment
1453 1455

  
1454 1456
if sum(strcmp(experiment.ear,{'MAPmodelMultiCh', 'MAPmodelListen'}))
1455 1457
    % use BFlist specified in MAPparams file
......
1458 1460
    BFlist=stimulusParameters.targetFrequency;
1459 1461
end
1460 1462
paramChanges=get(expGUIhandles.editparamChanges,'string');
1461
eval(paramChanges)
1463
% convert from string to a cell array
1464
eval(paramChanges);
1462 1465

  
1463 1466
MAP1_14(audio, stimulusParameters.sampleRate, BFlist,...
1464 1467
    MAPparamsName, AN_spikesOrProbability, paramChanges);

Also available in: Unified diff