Global frame counter and accurate timing programming

2 visualizzazioni (ultimi 30 giorni)
Dear members
I am currently programming for a very timing-snsitive experiment. I was wondering whether there is a way to setup a global frame counter, which starts upon the program initiated, keeps counting till the program terminated, so that I could check and specify different actions(e.g., present images or text) accourding to the specific frames reached. In other words I am looking for a tic toc timer or internal cpu clock alternative(e.g., using the function GetSecs).
The reason behind trying to sdopt this rather cumbersome method is due to the fact that according to the Accurate timimg demo it seemed better to count the number of frames rather than specify the duration of each event. At the same time, a potential concern for using this frame counting strategy is I am not sure whether dropping frames (perhaps due to hardware limitations) would messed up the sequences entirely. For example, using a 240Hz display dropping 1 frame would advance the entire sequence forward by 1/240 second, as more frames were dropped the effect would accmulate resulting further timing deviations? I am pretty new with this type of programming, perhaps this is a misunderstanding?
Any comments or suggestions would be great! Thanks in advance!
p.s. I am using psychtoolbox for better timing accuracy
  8 Commenti
Walter Roberson
Walter Roberson il 17 Feb 2021
There is very slim hope of doing any of this with regular MATLAB; you would either need psychtoolbox facilities or build your own that are similar to psychtoolbox. Psychtoolbox already works are to ensure that screen flips are in synch with monitor refreshes.
Yu Takahashi
Yu Takahashi il 18 Feb 2021
@Walter Roberson Thanks! I think I might try to contact someone from the dev team.

Accedi per commentare.

Risposte (0)

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by