Frames vs timing - will my frame rate be automatically detected?

OS (e.g. Win10):
PsychoPy version (e.g. 1.84.x):
Standard Standalone? (y/n) If not then what?:
What are you trying to achieve?:

Hi all,
I’m creating a visual masking experiment in which I need to have images appear between masks for fractions of a second.

What did you try to make it work?:

I have it working by asking for specific timing to 3 decimal places according to some math I did to determine what 1Hz would be on a 120Hz refresh rate monitor.

What specifically went wrong when you tried that?:

Nothing went wrong as far as I can tell, but I saw a pop up stating that setting the timing by frames might be more accuarte, I was mainly curious as to how Psychopy determine what the frame rate is, and if this will change when I use a 60Hz monitor instead. I sometimes need to do this when writing the experiment on my laptop. I will also be extending my screen to be able to run the experiment on my 60Hz monitor laptop, but displaying the image on a 120Hz external monitor. I have the external extended setting output as 120 Hz. I suppose my question is if the Frame Rate option for timing is contingent upon the monitor I am using, or the settings I have selected for the output?
Thanks for your time!

Both. PsychoPy will attempt to measure the frame rate on the main display before the experiment begins and store the result in your data file. It can’t actually set the frame rate itself – you have to take care of that in the OS.

PsychoPy assumes you know what the duration of a frame is. If you specify that a stimulus should appear for one frame, then that will last approximately 16.7 ms when the experiment is run on your 60 Hz display and 8.3 ms on your 120 Hz display. PsychoPy will just count how many frames have elapsed, and not care about their duration, so frame-based stimulus timings can change markedly across different refresh rates.

Thanks very much for that explanation Michael, much appreciated! <3
Peter

Hi all, just a follow-up question on this matter: I see on top of each log file something about the “actual frame rate measure”, which is always a little bit different from participant to participant. We have a monitor with 240 Hz as the refresh rate and the actual refresh rate ranges from, e.g., 200 to 250 Hz. My question is whether the timing will be based on this “actual refresh rate” or on the theoretical refresh rate. If the former, then isn’t frame-based timing a bad idea, given how much it varies? Thank you very much in advance for your help with this!

Hello Priscila

Yes, if the frame rate is variable, then using the frame rate is not a good idea. As Michael wrote, PsychoPy and other software simply count the number of frames, but do not care about the actual duration of a frame. If you want to use frame rate, you need to find out why it varies on your computer from participant to participant. Nowadays, the operating system and video card drivers can adjust the frame rate depending on what is in the video buffer. You may want to turn this feature off.

Note also the contradiction. PsychoPy reports a frame rate of 250 Hz, but your monitor cannot run faster than 240 Hz.

If you want an accurate measure of the frame rate, you need to measure it. One way to determine the frame rate is to measure it using a photodiode attached to the monitor and an oscilloscope.

Best wishes Jens