0

我正在 MATLAB (R2014b) 中使用 Psychtoolbox 进行反应时间实验。我正在使用 SyncTests,这让我可以估计在我运行实验时有多少翻转命令错过了请求的响应期限。多少次错过的翻转太高(即引起关注)?我通常每 1900 次翻转获得 140 次左右,所以略高于 7%。可以吗?

这是我收到的消息(自然,每次实验运行后实际数字略有不同):“信息:PTB 的 Screen('Flip', 10) 命令似乎错过了请求的刺激演示截止日期,总共有 130 次在本次会议期间总共进行了 1900 次翻转。”

这是我用来翻转的代码(然后测量 RT,这是我的代码中最关键的部分):

WaitSecs(.2); [this is the intertrial interval, more or less]
Screen('DrawTexture', mainwin, Target);
Screen('Flip', mainwin);
timeStart = GetSecs;keyIsDown=0; correct=0; rt=0;
while 1 & (GetSecs - timeStart) < 3 
      [keyIsDown, secs, keyCode] = KbCheck;
      FlushEvents('keyDown');
          if keyIsDown
                nKeys = sum(keyCode);
                if nKeys==1
                        if keyCode(Left)||keyCode(Right)||keyCode(Down)||keyCode(Up)
                            rt = 1000.*(GetSecs-timeStart);
                            keypressed=find(keyCode);
                            Screen('Flip', mainwin);
                            [etc., I just close all loops/if statements and move on
                            to the next trial]

一些背景知识:我在 Windows 10 上运行我的范例,并且还有一个我无法解决的“DPI 感知”问题(我收到警告说 MATLAB 在我的计算机上不支持 DPI)。我不确定这可能会产生什么问题——但范式似乎正在做我希望它做的事情,而且它看起来很棒(即图像显示得很好),所以我从不担心那么多。我应该有吗?这会影响反应时间测量的准确性吗?

4

1 回答 1

0

下面的建议有点不完整,因为我没有剩下的实验,但我想你会明白的。您应该可以通过提前安排屏幕翻转来获得更高的精度。在此示例中,先前和当前刺激之间的时间被计算为帧,然后将当前刺激安排为比您希望呈现的少一帧的 1/2。然后,Psychtoolbox 将在下一个可能的帧上呈现它,也就是你希望它呈现的时候(因为你不能在帧之间呈现视觉刺激)。

mainwin = Screen('OpenWindow');

% fetch the interflip interval of the screen
ifi = Screen('GetFlipInterval', mainwin);

% inter-trial interval
ITI = .2;

% start of block, flip a screen at an arbitrary time to get a reference
% point for the first trial
Screen('FillRect', mainwin, 0);
[~, lastVisualOnset] = Screen('Flip', mainwin);

% ID the number of frames until the next stimulus should be presented
% trial-by-trial timing jitter could also be added here if desired
nextStimFrameDelta = round( ISI / ifi);

Screen('DrawTexture', mainwin, Target);

% schedule the Flip in advance by .5 frames less than needed,
% so that the next available frame will be the one wanted
% this visual onset time stamp will then be the reference point for the
% next trial
[~, lastVisualOnset] = Screen('Flip', mainwin,  lastVisualOnset + ((nextStimFrameDelta - 0.5) * ifi));

keyIsDown=0; correct=0; rt=0;
while (GetSecs - lastVisualOnset) < 3
    [keyIsDown, secs, keyCode] = KbCheck;
    FlushEvents('keyDown');
    if keyIsDown
        nKeys = sum(keyCode);
        if nKeys==1
            if keyCode(Left)||keyCode(Right)||keyCode(Down)||keyCode(Up)
                rt = 1000.*(GetSecs-lastVisualOnset);
                keypressed=find(keyCode);
                Screen('Flip', mainwin);
            end
        end
    end
end
于 2017-11-23T04:10:46.317 回答