kurokida / jspsych-psychophysics

A jsPsych plugin for psychophysics
https://kurokida.github.io/jspsych-psychophysics/
MIT License
51 stars 13 forks source link

Precise timing and different screen refresh rates #37

Closed trygveso closed 1 year ago

trygveso commented 2 years ago

Thanks for providing a phenomenal plugin!

I'm using the psychophysics plugin in research and have a few questions about the plugin and paper:

  1. I assume that the monitors you have tested on are 60Hz, in which case a frame should be 16.67ms (as stated in your paper). I would therefore expect display time measurements to come in multiples of 16.67. Is this correct?

  2. From Table 4 in your paper the 20ms condition gives a -13ms deviation from the intended 20ms display time. From the Histograms on OSF for the ProBook Chrome with plugin, we see that the average display time is about 7ms. This could mean that for about half of the trials no frames were displayed. But the histogram shows that almost all measurements were between 5 and 10ms. How can the stimulus be displayed for less than a frame? and what does it mean?

  3. Similarly, it seems that measured display times are not in steps of 16.67ms also for longer intended display times. Why is this?

  4. Monitors with higher refresh rates (e.g. 120Hz and 144Hz) are becoming more common. This makes it tricky to base the stimulus presentation on frames. What is the recommended way to deal with this? (the browser-check plugin for jsPsych does not give accurate refresh rates). I could imagine making a calibration trial that measures the avg_frame_time and calculates the screen refresh rate, and then use show_end_frame instead of show_end_time. Do you have something like this already?

  5. I need precise display times for 50ms (3 frames on 60Hz). Would you advice to set the show_end_time to e.g. 53ms to avoid getting only 2 frames in 60Hz and 4 frames in 144Hz?

  6. Getting the avg_frame_time is very useful. However, would it also be possible to retrieve the exact number of frames that each stimulus object has been displayed for? Then we would have a way to control what our participants have actually seen.

Thanks, T

kurokida commented 2 years ago

Thank you for your good questions. I am impressed by your deep insights. I'm not sure if I can completely answer your questions, but I'll try.

Answer about Q0: You're theoretically right. But, we should note that the actual value measured by a photo sensor is not necessarily the multiple of 16.7. This might be related to Q1.

Answer about Q1 and Q2: In fact, in the experiment of the paper, I specify the presentation time in terms of not frames but milliseconds. At that time my plugin did not support specifying time in frames. When the presentation time was specified as 20ms, the program probably intended to present the stimulus for 2 frames. I think the program actually presented the stimulus for 2 frames or only 1 frame. One frame means the other frame was dropped.

There are two possible reasons why the actual measured time of presentation was not a multiple of 16.7ms. Firstly, I used the BlackBox toolkit to measure the actual presentation time, and I adjusted the threshold of the photo sensor. The higher the sensitivity of the sensor, the longer the presentation time. The lower the sensitivity of the sensor, the shorter the presentation time. The sensitivity might not be high enough in my experiment. Secondly, the computer (video card, or display) performance was too poor, and could not accurately present the stimulus for 1 or 2 frames. I can't discriminate between the two reasons.

Q3 and Q4 Unfortunately, I haven't checked how the stimulus would be presented using a display with such a high refresh rate. If you can record the avg_frame_time when running your program on a high-refresh-rate display, please share the results. I have two ideas about your concerns. Firstly, the presentation time is specified in terms of frames, then only results with the avg_frame_time of about 17ms are used. Secondly, before starting the experiment, ask participants to check the refresh rate and change it to 60Hz. Both of them are not smart, though.

Q5 Sorry, but it is impossible.

By the way, have you checked my recent accuracy check? It might be helpful. You don't need to use Pixi mode.