Revision 38:c2204b18f4a2 multithreshold 1.46

View differences:

multithreshold 1.46/MTprofile.m
1
function x = MTprofile
2
%created: 17_20hr18_Aug_2011
3

  
4
x.BFs = [250   500  1000  2000  4000  8000];
5

  
6
x.LongTone = [16.4      13.1      8.77      9.38      15.8      21.4];
7
x.ShortTone = [18.8      15.1      11.9      13.3      20.7        25];
8

  
9
x.Gaps = [0.01      0.03      0.05      0.07      0.09];
10
x.TMCFreq = [250   500  1000  2000  4000  8000];
11
x.TMC = [
12
37.8	32.6	28.6	40.8	41.7	38	 
13
41.5	36.3	40.1	44.5	44.6	37.5	 
14
48.7	42.6	43	49.4	49.7	41.2	 
15
55.4	45.6	52.2	52.9	52.3	43.2	 
16
62.7	55.5	62.5	52.3	58	45.9	 
17
];
18
x.TMC = x.TMC';
19

  
20
x.MaskerRatio = [0.5      0.7      0.9        1      1.1      1.3      1.6];
21
x.IFMCFreq = [250   500  1000  2000  4000  8000];
22
x.IFMCs = [
23
44.3	58.4	66.1	73.5	81.9	82.9	 
24
39.6	46.8	49.9	54	66.5	67.6	 
25
36.8	36	35.1	42.8	49.9	38	 
26
37	32.9	33.1	40.8	41.7	37.3	 
27
34.6	30.6	30.6	41.9	42	38.3	 
28
35.3	31.8	42.7	52.4	61	56.7	 
29
40.5	45.3	61	75.5	85.3	90.5	 
30
];
31
x.IFMCs = x.IFMCs';
multithreshold 1.46/multiThreshold.m
46 46

  
47 47
% Edit the above text to modify the response to help multiThreshold
48 48

  
49
% Last Modified by GUIDE v2.5 20-Sep-2011 11:47:22
49
% Last Modified by GUIDE v2.5 25-Oct-2011 07:51:14
50 50

  
51 51
% Begin initialization code - DO NOT EDIT
52 52
gui_Singleton = 1;
......
93 93
% Then wait for user action
94 94
global stimulusParameters experiment betweenRuns
95 95
global targetTypes maskerTypes backgroundTypes
96
global variableNames paradigmNames threshEstNames  cueNames
96
global variableNames paradigmNames threshEstNames  cueNames betweenRunsVariables
97 97

  
98 98
% Specify order of fields in main structures
99 99
% identify as empty values or empty strings only
......
106 106
variableNames={'stimulusDelay','maskerDuration','maskerLevel',...
107 107
    'maskerRelativeFrequency', 'targetFrequency', 'gapDuration',...
108 108
    'targetDuration','targetLevel','rampDuration',...
109
    'cueTestDifference', 'WRVstartValues', 'WRVsteps', 'WRVlimits'};
109
    'cueTestDifference', 'WRVstartValues', 'WRVsteps', 'WRVlimits',...
110
    'OHIOnTones'};
110 111

  
111 112
% Variable variables
112 113
%  (names of variable that can changed between runs)
113 114
betweenRunsVariables={'stimulusDelay','maskerDuration','maskerLevel',...
114 115
    'maskerRelativeFrequency','targetFrequency', 'gapDuration',...
115
    'targetDuration','targetLevel','numOHIOtones'};
116
    'targetDuration','targetLevel','OHIOnTones'};
116 117
% populate the 'between runs variable' menus
117 118
set(handles.popupmenuVaryParameter1,'string',betweenRunsVariables)
118 119
set(handles.popupmenuVaryParameter2,'string',betweenRunsVariables)
......
143 144
% Establish available paradigms by scanning paradigms folder
144 145
paradigmNames= what('paradigms');
145 146
paradigmNames= paradigmNames.m; % select m files only
147
idx=strmatch('paradigm_', paradigmNames); % with 'paradigm_'
148
paradigmNames=paradigmNames(idx);
146 149
for i=1:length(paradigmNames)   % strip off file extension
147 150
    paradigmNames{i}=paradigmNames{i}(10:end-2); 
148 151
end
......
183 186
    '2I2AFC++', '2I2AFC+++'};
184 187
set(handles.popupmenuThreshEst, 'string', threshEstNames);
185 188
experiment.stopCriteria2IFC=[75 3 5];
186
experiment.stopCriteriaSI=[20];
189
experiment.stopCriteriaSI=20;
187 190

  
188 191
% ** editBoxes that are only set by hand
189 192
% music (relative) level, 'tada!' (manual setting only)
......
191 194
set(handles.editMusicLevel,'string','0')
192 195

  
193 196
% Catch Trial Rate
194
set(handles.editCatchTrialRate,'string','0.2   0.1  2 ');
197
set(handles.editCatchTrialRate,'string','0.2   0.1  ');
195 198

  
196 199
% calibration
197 200
stimulusParameters.restoreCalibration=7;
......
205 208
% saveData
206 209
experiment.saveData=1;
207 210
set(handles.editSaveData,'string',num2str(experiment.saveData))
211
set(handles.pushbuttonSave,'visible','off')
208 212

  
209 213
% printTracks
210 214
experiment.printTracks=0;
......
336 340
set(handles.editBackgroundLevel,'string', num2str...
337 341
    (stimulusParameters.backgroundLevel))
338 342

  
343
% values related to assessment method
344
switch experiment.threshEstMethod
345
    case {'MaxLikelihood','oneIntervalUpDown'}
346
        set(handles.editstopCriteriaBox, 'string', ...
347
            num2str(experiment.singleIntervalMaxTrials))
348
    case {'2I2AFC++','2I2AFC+++'}
349
        set(handles.editstopCriteriaBox, 'string', ...
350
            num2str(experiment.stopCriteria2IFC))
351
    otherwise
352
        error([' aResetPopupMenus:  threshEstMethod not recognised -> ' ...
353
            experiment.threshEstMethod])
354
end
355
% assessment method popup may be changed between paradigms
356
%  e.g. SRT must be one interval
357
x=get(handles.popupmenuThreshEst, 'string');
358
set(handles.popupmenuThreshEst, 'value', ...
359
    strmatch(experiment.threshEstMethod, x));
360

  
361

  
339 362
% on RUN the sample rate will be picked from the text box
340 363
% However, MAP overrules the sample rate and sets its own
341 364
aSetSampleRate(stimulusParameters.subjectSampleRate, handles);
......
352 375
% ------------------------------------------------------ aResetPopupMenus
353 376
function aResetPopupMenus(handles)
354 377
global   stimulusParameters betweenRuns variableNames
355
global targetTypes maskerTypes experiment backgroundTypes
378
global targetTypes maskerTypes experiment backgroundTypes betweenRunsVariables
356 379

  
357 380
switch experiment.threshEstMethod
358 381
    case {'MaxLikelihood','oneIntervalUpDown'}
......
375 398

  
376 399
%set variables popupmenus as specified in betweenRuns
377 400
variableParameter1ID=0; variableParameter2ID=0;
378
for i=1:length(variableNames)
379
    if strcmp(variableNames{i},betweenRuns.variableName1)
401
for i=1:length(betweenRunsVariables) %  variableNames
402
    if strcmp(betweenRunsVariables{i},betweenRuns.variableName1)
380 403
        variableParameter1ID=i;
381 404
    end
382
    if strcmp(variableNames{i},betweenRuns.variableName2)
405
    if strcmp(betweenRunsVariables{i},betweenRuns.variableName2)
383 406
        variableParameter2ID=i;
384 407
    end
385 408
end
......
416 439
set(handles.edittargetDuration, 'visible', 'on')
417 440
set(handles.edittargetFrequency, 'visible', 'on')
418 441

  
442
switch experiment.paradigm(1:3)
443
    case 'OHI'
444
        set(handles.editOHIOnTones, 'visible', 'on')
445
        set(handles.textOHIOnTones, 'visible', 'on')
446
    otherwise
447
        set(handles.editOHIOnTones, 'visible', 'off')
448
        set(handles.textOHIOnTones, 'visible', 'off')
449
end
450

  
419 451
switch experiment.ear
420 452
    case {'statsModelLogistic', 'statsModelRareEvent'}
421 453
        set(handles.editStatsModel, 'visible', 'on')
......
688 720
global experiment expGUIhandles stimulusParameters
689 721
tic
690 722
expGUIhandles=handles;
723
set(handles.pushbuttonSave,'visible','off')
724

  
691 725
set(handles.pushbuttonStop, 'backgroundColor', [.941 .941 .941])
692 726
% set(handles.editparamChanges,'visible','off')
693 727

  
......
718 752

  
719 753
% --- Executes on button press in pushbuttonSingleShot.
720 754
function pushbuttonSingleShot_Callback(hObject, eventdata, handles)
721
global experiment
755
global experiment paradigmNames
722 756
experiment.singleShot=1;
723 757

  
758
% startup paradigm, 'training' (could be anywhere on the list)
759
startupParadigm='training';
760
idx= find(strcmp(paradigmNames,startupParadigm));
761
set(handles.popupmenuParadigm,'value', idx)
762
aParadigmSelection(handles);
763

  
724 764
% special test for spontaneous activity
725 765
x=get(handles.editWRVstartValues, 'string');
726 766
y=get(handles.edittargetDuration, 'string');
......
740 780
% ------------------------------------------aReadAndCheckParameterBoxes
741 781
function errorMsg=aReadAndCheckParameterBoxes(handles)
742 782
global experiment  stimulusParameters betweenRuns  statsModel
743
global variableNames  LevittControl paramChanges
783
global variableNames  LevittControl paramChanges betweenRunsVariables
744 784
% When the program sets the parameters all should be well
745 785
% But when the user changes them...
746 786

  
......
801 841
end
802 842

  
803 843
chosenOption=get(handles.popupmenuVaryParameter1,'value');
804
betweenRuns.variableName1=variableNames{chosenOption};
844
betweenRuns.variableName1=betweenRunsVariables{chosenOption};
805 845
eval(['betweenRuns.variableList1 = stimulusParameters.' ...
806 846
    betweenRuns.variableName1 ';']);
807 847

  
......
891 931
        'catch trial base rates must be less than catch trial start rate';
892 932
    return,
893 933
end
934
% force the decay rate for catchTrialRate
935
%  to avoid having to explain it to the user
936
stimulusParameters.catchTrialRates(3)=2;
894 937

  
895 938
% sample rate
896 939
% The sample rate is set in the paradigm file.
......
1040 1083
% identify model parameter changes if any
1041 1084
paramChanges=get(handles.editparamChanges,'string');
1042 1085
if ~strcmp(paramChanges, ';'), paramChanges=[paramChanges ';']; end
1086
try
1043 1087
eval(paramChanges);
1088
catch
1089
    error('Problems with suggested parameter changes')
1090
end
1091

  
1044 1092

  
1045 1093
% -------------------------------------------- aSetSampleRate
1046 1094
function aSetSampleRate(sampleRate, handles)
......
1099 1147
        stimulusParameters.includeCue=0;						 % no cue
1100 1148
        set(handles.popupmenuCueNoCue,'value', 2)
1101 1149

  
1102
        set(handles.editCatchTrialRate,'string','0 0  2 ');%no catch trials
1150
        set(handles.editCatchTrialRate,'string','0 0');%no catch trials
1103 1151
        set(handles.editName,'string', 'Normal')			% force name
1104 1152
        experiment.name=get(handles.editName,'string');	% read name back
1105 1153
        set(handles.editcalibrationdB,'string','0')
......
1110 1158
        set(handles.editSaveData,'string', '0')
1111 1159
        set(handles.editSubjectFont,'string', '10');
1112 1160
        experiment.MacGThreshold=0; % num MacG spikes to exceed threshold
1161
    otherwise
1162
        set(handles.editCatchTrialRate,'string','0.2 0.1');%no catch trials
1163

  
1113 1164
end
1114 1165
aResetPopupMenus(handles)
1115 1166

  
......
1119 1170

  
1120 1171
% ------------------------------------------------------------- cueSetUp
1121 1172
function cueSetUp(handles)
1122
global stimulusParameters
1173
global stimulusParameters experiment
1123 1174

  
1124
chosenOption=get(handles.popupmenuCueNoCue,'value');
1125
if chosenOption==1
1126
    stimulusParameters.includeCue=1;
1127
    set(handles.editcueTestDifference,'visible', 'on')
1128
    set(handles.textcueTestDifference,'visible', 'on')
1129
    stimulusParameters.subjectText=stimulusParameters.instructions{2};
1130
else
1131
    stimulusParameters.includeCue=0;
1132
    set(handles.editcueTestDifference,'visible', 'off')
1133
    set(handles.textcueTestDifference,'visible', 'off')
1134
    stimulusParameters.subjectText= stimulusParameters.instructions{1};
1175
switch experiment.threshEstMethod
1176
    case {'oneIntervalUpDown', 'MaxLikelihood'}
1177
        chosenOption=get(handles.popupmenuCueNoCue,'value');
1178
        if chosenOption==1
1179
            stimulusParameters.includeCue=1;
1180
            set(handles.editcueTestDifference,'visible', 'on')
1181
            set(handles.textcueTestDifference,'visible', 'on')
1182
            stimulusParameters.subjectText=stimulusParameters.instructions{2};
1183
        else
1184
            stimulusParameters.includeCue=0;
1185
            set(handles.editcueTestDifference,'visible', 'off')
1186
            set(handles.textcueTestDifference,'visible', 'off')
1187
            stimulusParameters.subjectText= stimulusParameters.instructions{1};
1188
        end
1135 1189
end
1136 1190

  
1137 1191
% -------------------------------------------- popupmenuThreshEst_Callback
......
1761 1815
end
1762 1816

  
1763 1817

  
1818

  
1819

  
1820
function pushbuttonSave_Callback(hObject, eventdata, handles)
1821
global experiment
1822

  
1823
subjectName=experiment.name;
1824
if ~isdir(['savedData' filesep subjectName ])
1825
    mkdir(['savedData' filesep subjectName ])
1826
end
1827

  
1828
% date and time and replace ':' with '_'
1829
date=datestr(now);idx=findstr(':',date);date(idx)='_';
1830
fileName=[subjectName ' ' date '.mat'];
1831
movefile(['savedData' filesep 'mostRecentResults.mat'], ...
1832
    ['savedData' filesep subjectName filesep fileName])
1833
set(handles.pushbuttonSave,'visible','off')
1834

  
1835

  
1836

  
1837
function editOHIOnTones_Callback(hObject, eventdata, handles)
1838

  
1839

  
1840
function editOHIOnTones_CreateFcn(hObject, eventdata, handles)
1841

  
1842
% Hint: edit controls usually have a white background on Windows.
1843
%       See ISPC and COMPUTER.
1844
if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
1845
    set(hObject,'BackgroundColor','white');
1846
end
1847

  
1848

  
multithreshold 1.46/nextStimulus.m
2 2
% Handles everything concerned with the stimulus presentation
3 3
%  called from startNewRun in subjGUI
4 4

  
5
global experiment stimulusParameters withinRuns  
5
global experiment stimulusParameters withinRuns  betweenRuns
6 6
experiment.status='presentingStimulus';
7 7
errormsg='';
8 8

  
......
234 234
            case {'training','absThreshold', 'absThreshold_8',  ...
235 235
                    'TENtest', 'threshold_duration','discomfort',...
236 236
                    'overShoot','overShootB','overShootMB1', ...
237
                    'overShootMB2', 'OHIO','OHIOabs','OHIOspect'}
237
                    'overShootMB2', 'OHIO','OHIOabs','OHIOspect'...
238
                    'OHIOrand', 'OHIOtemp', 'OHIOspectemp'}
238 239
                cueTargetLevel=targetLevel+cueTestDifference;
239 240
                
240 241
            case {'forwardMasking','forwardMaskingD','trainingIFMC', ...
241
                    'TMC','TMC_16ms', 'TMC - ELP', 'IFMC','IFMC_8ms', 'FMreProbe'}
242
                    'TMC','TMC_16ms', 'TMC - ELP', 'IFMC','IFMC_8ms', ...
243
                    'FMreProbe'}
242 244
                % cue masker is weaker to make target more audible
243 245
                cueMaskerLevel=maskerLevel-cueTestDifference;
244 246
        end
245 247
end
246 248

  
249
% thresholds (in dB SPL) of the single tone with 12 frequencies:
250
%    1   2    3     4    5     6     7     8     9     10     11    12
251
% 494, 663, 870, 1125, 1442, 1838, 2338, 2957, 3725, 4689, 5866, 7334
252

  
253
% 2. ?OHIOtemp? is for measuring thresholds for temporally integrated
254
% combinations of 2, 4, 8, and 12 tones presented simultaneously.
255
% In our experiment, we used 4680Hz frequency.
256

  
257
% 3. ?OHIOspec? is for measuring thresholds for spectrally integrated
258
% combinations of 2(7335 and 5866Hz), 4(7334, 5866, 4680, and 3725Hz),
259
% 8(7334, 5866, 4680, 3725, 2957, 2338, 1838, and
260
% 1442Hz), and
261
% 12(all 12 frequencies) tones presented simultaneously.
262

  
263
% 4. ?OHIOspectemp? is for measuring thresholds for patterned signals
264
% differing in both the spectral and temporal domains.
265
% The frequency conditions are the same as that of ?OHIOspec?.
266

  
267
% 5. ?OHIOrand? is for measuring thresholds for spectrotemporally varying
268
% signals with random frequency presentation.
269

  
270
switch experiment.paradigm(1:3)
271
    case 'OHI'
272
        targetType='OHIO';
273
        OHIOtype=experiment.paradigm;
274
        % 1. ?OHIOabs? paradigm is a baseline procedure for measuring absolute
275

  
276
        nTones=betweenRuns.var1Sequence(betweenRuns.runNumber);
277
        allFreqs=[494, 663, 870, 1125, 1442, 1838, 2338, 2957, 3725, 4689, 5866, 7334];
278
        toneLevelBoost= ...
279
            [1	0	0	1	1	4	8	12	12	14	17	19 ];
280

  
281

  
282
        % for nTones=nTonesList
283
        switch experiment.paradigm
284
            %         case ' OHIOabs'
285
            %             % one tone frequency at a time
286
            %             stim.frequencies=allFreqs(1);
287
            %             stim.amplitudesdB=0;
288

  
289
            case 'OHIOrand'
290
                % chose nTones frequencies at random
291
                x=rand(1,12);
292
                [sorted idx]=sort(x);
293
                cueTargetFrequency=allFreqs(idx(1:nTones));
294
                cueTargetLevel=toneLevelBoost(idx)+...
295
                    targetLevel + cueTestDifference;
296
                targetFrequency=allFreqs(idx(1:nTones));
297
                targetLevel=targetLevel + toneLevelBoost(idx);
298

  
299
            case 'OHIOtemp'
300
                % 4680 Hz repeated nTones times
301
                cueTargetFrequency=4680*ones(1,nTones);
302
                cueTargetLevel=repmat(toneLevelBoost(10),1,nTones)+...
303
                    targetLevel + cueTestDifference;
304
                targetFrequency=4680*ones(1,nTones);
305
                targetLevel= targetLevel+repmat(toneLevelBoost(10),1,nTones);
306

  
307
            case {'OHIOspect',  'OHIOspectemp'}
308
                % nTones frequencies either simulataneously or sequentially
309
                switch nTones
310
                    case 2
311
                        cueTargetFrequency=[7335 5866];
312
                        targetFrequency=[7335 5866];
313
                        idx=[12 11];
314
                        cueTargetLevel=targetLevel + toneLevelBoost(idx)+cueTestDifference;
315
                        targetLevel=targetLevel + toneLevelBoost(idx);
316
                    case 4
317
                        cueTargetFrequency=[7334, 5866, 4680, 3725];
318
                        targetFrequency=[7334, 5866, 4680, 3725];
319
                        idx=[12:-1:9 ];
320
                        cueTargetLevel=targetLevel + toneLevelBoost(idx)+cueTestDifference;
321
                        targetLevel=targetLevel + toneLevelBoost(idx);
322
                    case 8
323
                        cueTargetFrequency=...
324
                            [7334, 5866, 4680, 3725, 2957, 2338, 1838, 1442];
325
                        targetFrequency=...
326
                            [7334, 5866, 4680, 3725, 2957, 2338, 1838, 1442];
327
                        idx=[12:-1:5 ];
328
                        cueTargetLevel=targetLevel + toneLevelBoost(idx)+cueTestDifference;
329
                        targetLevel=targetLevel + toneLevelBoost(idx);
330
                    case 12
331
                        cueTargetFrequency=allFreqs;
332
                        targetFrequency=allFreqs;
333
                        cueTargetLevel=targetLevel + toneLevelBoost(1:12)+cueTestDifference;
334
                        targetLevel=targetLevel + toneLevelBoost(1:12);
335
                end
336
        end
337

  
338
    otherwise
339
        OHIOtype='none';
340
end
341

  
342
switch experiment.paradigm(1:3)
343
    case 'OHI'
344

  
345
        switch experiment.threshEstMethod
346
            case {'2I2AFC++', '2I2AFC+++'}
347
                % the cue stimulus (masker + probe) is the 'no' window
348
                % the target stimulus (masker+probe) is the 'yes' window
349
                % the order of presentation is decided at the last minute.
350
                cueTargetLevel=-100; 
351
        end
352

  
353

  
354
        switch experiment.paradigm
355
            case {'OHIOabs', 'OHIOspect'}
356
                OHIOtoneDuration=.02+stimulusParameters.stimulusDelay;
357
                globalStimParams.overallDuration=OHIOtoneDuration;
358
            otherwise
359
                OHIOtoneDuration=nTones*0.02+stimulusParameters.stimulusDelay;
360
                globalStimParams.overallDuration=OHIOtoneDuration;
361
        end
362
end
363

  
247 364
% ----------------------------- catch trial
248 365
if withinRuns.catchTrial
249 366
    targetLevel=-100;	% no target
......
370 487
            return
371 488
        end
372 489
        
490
    case 'gapDuration'
373 491
        % legacy programming
374
    case 'gapDuration'
375 492
        if gapDuration<0
376 493
            errormsg=['gapDuration (' num2str(gapDuration) ...
377 494
                ') is less than zero  ***'];
......
497 614
globalStimParams.nSignalPoints=...
498 615
    round(globalStimParams.overallDuration*globalStimParams.FS);
499 616

  
617
% special case
618
switch experiment.paradigm(1:3)
619
    case 'OHI'
620
        switch experiment.paradigm
621
            case {'OHIOabs', 'OHIOspect'}
622
                OHIOtoneDuration=.02+stimulusParameters.stimulusDelay;
623
                globalStimParams.overallDuration=OHIOtoneDuration;
624
            otherwise
625
                OHIOtoneDuration=nTones*0.02+stimulusParameters.stimulusDelay;
626
                globalStimParams.overallDuration=OHIOtoneDuration;
627
        end
628
end
629

  
630

  
500 631
%           ----------------------------------------------cue stimulus
501 632
% cue masker
502 633
componentNo=1;
......
527 658
componentNo=2;
528 659
precedingSilence=precedingSilence + maskerDuration+cueGapDuration;
529 660
stimComponents(targetEar,componentNo).type=targetType;
661
stimComponents(targetEar,componentNo).OHIOtype=OHIOtype;
530 662
stimComponents(targetEar,componentNo).toneDuration=targetDuration;
531 663
stimComponents(targetEar,componentNo).frequencies=cueTargetFrequency;
532 664
stimComponents(targetEar,componentNo).amplitudesdB=cueTargetLevel;
......
605 737
componentNo=2;
606 738
targetDelay=precedingSilence+ maskerDuration+ gapDuration;
607 739
stimComponents(targetEar,componentNo).type=targetType;
740
stimComponents(targetEar,componentNo).OHIOtype=OHIOtype;
608 741
stimComponents(targetEar,componentNo).toneDuration=targetDuration;
609 742
stimComponents(targetEar,componentNo).frequencies=targetFrequency;
610 743
stimComponents(targetEar,componentNo).amplitudesdB=targetLevel;
......
661 794
        %     case 'SRT'
662 795
        %         set(handles.editdigitInput,'visible','off')
663 796
    otherwise
664
        stimulusParameters.testTargetBegins=targetDelay;
665
        stimulusParameters.testTargetEnds=targetDelay+targetDuration;
797
        switch experiment.paradigm(1:3)
798
            case 'OHI'
799
                stimulusParameters.testTargetBegins=0;
800
                stimulusParameters.testTargetEnds=OHIOtoneDuration;
801
            otherwise
802
                stimulusParameters.testTargetBegins=targetDelay;
803
                stimulusParameters.testTargetEnds=targetDelay+targetDuration;
804
        end
666 805
end
667 806

  
668 807
% ------------------------------------------------------------- play!
multithreshold 1.46/old files/MAPmodel.m
20 20
AN_spikesOrProbability='spikes';
21 21

  
22 22
% [response, method]=MAPsequenceSeg(audio, method, 1:8);
23
global ICoutput ANdt
23
global ICoutput dtSpikes
24 24
    MAP1_14(audio, 1/method.dt, method.nonlinCF,...
25 25
        MAPparamsName, AN_spikesOrProbability);
26 26
    
......
29 29
    options.showModelOutput=1;
30 30
    options.printFiringRates=1;
31 31
    options.showACF=0;
32
    options.showEfferent=1;
32
    options.showEfferent=0;
33 33
    UTIL_showMAP(options)
34 34
end
35 35

  
......
41 41

  
42 42
% ---------------------------------------------------------- end model run
43 43

  
44
dt=ANdt;
44
dt=dtSpikes;
45 45
time=dt:dt:dt*length(MacGregorResponse);
46 46

  
47 47
% group delay on unit response
multithreshold 1.46/paradigms/paradigm_IFMC.m
1 1
function paradigm_IFMC(handles)
2 2
global stimulusParameters experiment betweenRuns
3 3

  
4
paradigm_training(handles) % default
4
paradigmBase(handles) % default
5 5

  
6 6
stimulusParameters.WRVname='maskerLevel';
7 7
stimulusParameters.WRVstartValues=10;
multithreshold 1.46/paradigms/paradigm_TENtest.m
1 1
function paradigm_TENtest(handles)
2 2
global stimulusParameters experiment betweenRuns
3 3

  
4
paradigm_training(handles) % default
4
paradigmBase(handles) % default
5 5

  
6 6
stimulusParameters.WRVname='targetLevel';
7 7
stimulusParameters.WRVstartValues=40;
......
29 29
%   single interval up/down no cue
30 30
stimulusParameters.instructions{1}=[{'YES if you hear the added click'}, { }, { 'NO if not (or you are uncertain'}];
31 31
%   single interval up/down with cue
32
stimulusParameters.instructions{2}=[{'count how many distinct clicks you hear'},{'ignore the tones'},{' '},...
32
stimulusParameters.instructions{2}=[{'count how many distinct clicks you hear'},{'ignore the noise'},{' '},...
33 33
    {'The clicks must be **clearly distinct** to count'}];
34 34

  
multithreshold 1.46/paradigms/paradigm_TMC.m
1 1
function paradigm_TMC(handles)
2 2
global stimulusParameters experiment betweenRuns
3 3

  
4
paradigm_training(handles) % default
4
paradigmBase(handles) % default
5 5

  
6 6
stimulusParameters.WRVname='maskerLevel';
7 7
stimulusParameters.WRVstartValues=50;
multithreshold 1.46/paradigms/paradigm_absThreshold.m
1 1
function paradigm_absThreshold(handles)
2 2
global stimulusParameters experiment betweenRuns
3 3

  
4
paradigm_training(handles) % default
4
paradigmBase(handles) % default
5 5

  
6 6
betweenRuns.variableName1='targetFrequency';
7 7
betweenRuns.variableList1=[250 500 1000 2000 4000 8000 ];
multithreshold 1.46/paradigms/paradigm_absThreshold_16.m
1 1
function paradigm_absThreshold16(handles)
2 2
global stimulusParameters experiment betweenRuns
3 3

  
4
paradigm_training(handles) % default
4
paradigmBase(handles) % default
5 5

  
6 6
betweenRuns.variableName1='targetFrequency';
7 7
betweenRuns.variableList1=1000;
multithreshold 1.46/paradigms/paradigm_discomfort.m
1 1
function paradigm_discomfort(handles)
2 2
global stimulusParameters experiment betweenRuns
3 3

  
4
paradigm_training(handles) % default
4
paradigmBase(handles) % default
5 5

  
6 6
stimulusParameters.WRVname='targetLevel';
7 7
stimulusParameters.WRVstartValues=75 ;
multithreshold 1.46/paradigms/paradigm_forwardMasking.m
1 1
function paradigm_forwardMasking(handles)
2 2
global stimulusParameters experiment betweenRuns
3 3

  
4
paradigm_training(handles) % default
4
paradigmBase(handles) % default
5 5

  
6 6
stimulusParameters.WRVname='targetLevel';
7 7
stimulusParameters.WRVstartValues=50;
multithreshold 1.46/paradigms/paradigm_overShoot.m
1 1
function paradigm_overShoot(handles)
2 2
global stimulusParameters  betweenRuns experiment
3 3

  
4
paradigm_training(handles) % default
4
paradigmBase(handles) % default
5 5

  
6 6
stimulusParameters.WRVname='targetLevel';
7 7
stimulusParameters.WRVstartValues=50;
multithreshold 1.46/paradigms/paradigm_profile.m
1 1
function paradigm_profile(handles)
2 2
global stimulusParameters experiment betweenRuns
3 3

  
4
paradigm_training(handles) % default
4
paradigmBase(handles) % default
5 5

  
6 6
betweenRuns.variableName1='targetFrequency';
7 7
betweenRuns.variableList1=[250 500 1000 2000 4000 8000 ];
multithreshold 1.46/paradigms/paradigm_psychometric.m
1 1
function paradigm_psychometric(handles)
2 2
global stimulusParameters experiment betweenRuns
3 3

  
4
paradigm_training(handles) % default
4
paradigmBase(handles) % default
5 5

  
6 6
experiment.printTracks=1;
7 7
experiment.maxTrials=30;
multithreshold 1.46/paradigms/paradigm_threshold_duration.m
1 1
function paradigm_threshold_duration(handles)
2 2
global stimulusParameters experiment betweenRuns
3 3

  
4
paradigm_training(handles) % default
4
paradigmBase(handles) % default
5 5

  
6 6
stimulusParameters.WRVname='targetLevel';
7 7
stimulusParameters.WRVstartValues=40;
multithreshold 1.46/paradigms/paradigm_training.m
1 1
function paradigm_training(handles)
2 2
global stimulusParameters experiment betweenRuns
3 3

  
4
stimulusParameters.subjectSampleRate=44100; % compatible with file input
5
stimulusParameters.subjectSampleRate=64000; % compatible with file input
4
paradigmBase(handles) % default
5

  
6
% rest may be unnecessary
7

  
6 8
% stimulusParameters.subjectSampleRate=128000; % compatible with file input
7 9

  
8 10
%  assessment method
multithreshold 1.46/paradigms/paradigm_trainingIFMC.m
1
function paradigm_trainingIFMC(handles)
1
function paradigmBaseIFMC(handles)
2 2
global stimulusParameters experiment betweenRuns
3 3

  
4
paradigm_training(handles) % default
4
paradigmBase(handles) % default
5 5

  
6 6
stimulusParameters.WRVname='maskerLevel';
7 7
stimulusParameters.WRVstartValues=-10;
......
16 16
betweenRuns.variableList1=[ 0.5       .9 .7   1.3 ];
17 17
betweenRuns.variableName2='targetFrequency';
18 18
% keep old list of target frequencies
19
betweenRuns.variableList2=str2num(get(handles.edittargetFrequency,'string'));
19
betweenRuns.variableList2=[ 2000 ];
20 20

  
21 21
experiment.maskerInUse=1;
22 22
stimulusParameters.maskerType='tone';
multithreshold 1.46/plotProfile.m
4 4

  
5 5
%% plot profile
6 6
if nargin<1
7
    fgName = myFile;
7
    fgName = 'profile_JSAN_R';
8 8
    bgName = '';
9 9
end
10 10

  
......
68 68
    freq=foreground.MaskerRatio'*foreground.IFMCFreq(BFno);
69 69
    subplot(2,1,2)
70 70
    semilogx(freq,foreground.IFMCs(BFno,:),'r','lineWidth',3), hold on
71
    ylim([0 100])
71
    ylim([-20 100])
72 72
    xlim([100 12000])
73 73
%     grid on
74 74
end
75 75
xlabel('frequency (Hz)')
76 76
ylabel('masker dB / probe dB')
77 77
set(gca,'XTick',foreground.IFMCFreq)
78
set(gca,'Ytick', [-20 0 50 100])
78 79

  
79 80
if ~isempty(bgName)
80 81
    for BFno=1:length(background.IFMCFreq)
multithreshold 1.46/printReport.m
19 19
printReportGuide.showPsychometric=0;
20 20
printReportGuide.HorizontalTracks=1;
21 21

  
22

  
22 23
if nargin==0
23 24
    % print new report
24 25
    printReportGuide.showTracks=experiment.printTracks;
......
180 181
    disp('Psychometric function')
181 182
    fprintf(' level  \tfreq\tprob\n')
182 183
    fprintf('%6.0f\t%6.2f\t%6.0f\n',[levelsBinVector; binFrequencies; psy])
183
    fprintf('\n')
184
    fprintf('k \t %6.2f\n',logistic.bestK)
185
    fprintf('g  \t%7.5f\n',rareEvent.bestGain)
184

  
185
    switch experiment.threshEstMethod
186
        % only one value required for level change
187
        case {'MaxLikelihood',  'oneIntervalUpDown'};
188
%             fprintf('\n')
189
%             fprintf('k \t %6.2f\n',logistic.bestK)
190
%             fprintf('g  \t%7.5f\n',rareEvent.bestGain)
191
    end
186 192
    fprintf('\n')
187 193

  
188 194
end
multithreshold 1.46/subjGUI_MT.m
986 986
        otherwise
987 987
            title([stimulusParameters.WRVname ' = ' ...
988 988
                num2str(withinRuns.variableValue, '%5.1f') ...
989
                ';    TH= ' num2str(estThresh, '%5.1f')])
989
                ';    TH= ' num2str(estThresh, '%5.1f') ' dB'])
990 990
    end
991 991
end
992 992
xlim([0 experiment.maxTrials+withinRuns.beginningOfPhase2]);
993 993
ylim(stimulusParameters.WRVlimits)
994
ylabel ('dB SPL')
994 995
grid on
995 996

  
996 997
% Panel 4: Summary of threshold estimates (not used here)
......
1275 1276
end
1276 1277
xlimRM([ min(betweenRuns.variableList1) max(betweenRuns.variableList1) ])
1277 1278
ylim(stimulusParameters.WRVlimits)
1278
ylabel('thresholds')
1279
ylabel('thresholds (dB)')
1279 1280
xlabel(betweenRuns.variableName1)
1280 1281
set(gca,'ytick', [0 20 40 60 80 100])
1281 1282
try
......
1305 1306
    % update experimenter GUI
1306 1307
    addToMsg('Experiment completed.',1)
1307 1308

  
1309
    set(expGUIhandles.pushbuttonSave,'visible','on')
1308 1310
    printReport
1309 1311
    experiment.status='endOfExperiment';
1310 1312
    return
......
1433 1435

  
1434 1436
global experiment stimulusParameters audio withinRuns
1435 1437
% global outerMiddleEarParams DRNLParams AN_IHCsynapseParams
1436
global ICoutput ANdt dt savedBFlist ANprobRateOutput expGUIhandles
1438
global ICoutput dtSpikes dt savedBFlist ANprobRateOutput expGUIhandles
1437 1439
global paramChanges
1438 1440

  
1439 1441
savePath=path;
......
1479 1481
    options.showModelOutput=1;
1480 1482
    options.printFiringRates=1;
1481 1483
    options.showACF=0;
1482
    options.showEfferent=1;
1484
    options.showEfferent=0;
1483 1485
    options.surfProbability=0;
1484 1486
    showMapOptions.surfSpikes=0;
1485 1487
    UTIL_showMAP(options)
......
1493 1495

  
1494 1496
if strcmp(AN_spikesOrProbability,'spikes')
1495 1497
    MacGregorResponse= sum(ICoutput,1);                 % use IC
1496
    dt=ANdt;
1498
    dt=dtSpikes;
1497 1499
    time=dt:dt:dt*length(MacGregorResponse);
1498 1500
else
1499 1501
    % for one channel, ANprobResponse=ANprobRateOutput
......
1508 1510
windowOnsetDelay= 0.004;
1509 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 1515
switch experiment.threshEstMethod
1513 1516
    case {'2I2AFC++', '2I2AFC+++'}
1514 1517
        idx= time>stimulusParameters.testTargetBegins+windowOnsetDelay ...
......
1550 1553
            num2str([withinRuns.variableValue nSpikesTrueWindow ...
1551 1554
            nSpikesFalseWindow  nSpikesDuringTarget], '%4.0f') ] )
1552 1555
    otherwise
1553
        % single interval
1556
        
1557
        % single interval up/down
1554 1558
        idx=find(time>stimulusParameters.testTargetBegins +windowOnsetDelay...
1555 1559
            & time<stimulusParameters.testTargetEnds+windowOffsetDelay);
1556 1560
        if strcmp(AN_spikesOrProbability,'spikes')
......
1747 1751
end
1748 1752

  
1749 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 1757
    serobj.Baudrate = 9600;           		% Set the baud rate at the specific value
1752 1758
    set(serobj, 'Parity', 'none') ;     	% Set parity as none
1753 1759
    set(serobj, 'Databits', 8) ;          	% set the number of data bits

Also available in: Unified diff