How to collect reaction times in a RSVP detection task
6 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
Hi All,
I'm using Psychtoolbox to run an RSVP detection task, but I have a problem in collecting reaction times (RT) while the RSVP sequence is running. What the code do at the moment is to present 16 stimuli in sequence, with one target presented in random position among distractors. Stimulus duration is 133 ms with an inter stimulus interval (blank screen) of 367 ms:
vStimuli = [2 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1]; %stimuli vector, 2=target stimulus
vStimuli_shuffled = randperm(numel(vStimuli))
for i = 1:nStimuli % number of stimuli
if Stimuli_shuffled(1,i) == 1 %DISTRACTOR
Screen('FillRect', window, [255 255 255], stimulus_position);
Screen('Flip', window);
WaitSecs(durStim);
elseif Stimuli_shuffled(1,i) == 2 % TARGET
Screen('FillRect', window, [0 0 0], square_position);
Screen('Flip', window);
WaitSecs(durStim);
end
Screen(window, 'FillRect', [128, 128, 128]); % Blank screen (ISI)
Screen('Flip', window);
WaitSecs(durISI);
end
The code I use to record RT is:
for i = 1:nStimuli % number of stimuli
if Stimuli_shuffled(1,i) == 2 %TARGET
Screen('FillRect', window, [0 0 0], stimulus_position);
[starttime]= Screen('Flip',window);
endtime=KbQueueWait(); % Wait a Keypress
StimTime=GetSecs;
while (StimTime-starttime)<=StimTime
[KeyIsDown, endtime, KeyCode]=KbCheck;
if KeyIsDown
RT= round(1000*(endtime-starttime)); %Compute reaction time in second
PressBt=KbName(KeyCode);
break;
end
end
The problem is that this code wait for a key press to present the next stimulus, while I want a fixed timing in the RSVP presentation, and to record any keypress from the onset of the target stimulus to the next stimulus (500 ms). Moreover, I don't want that the keypress determines a short stimulus or ISI duration.
Any suggestion?
0 commentaires
Réponses (0)
Voir également
Catégories
En savoir plus sur Timing and presenting 2D and 3D stimuli dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!