Timing in an EEG task: timing by frames or milliseconds?

108 views
Skip to first unread message

josé ab

unread,
Jul 19, 2016, 10:06:38 AM7/19/16
to psychopy-users
Dear Psychopy users,

I've used Builder (version 1.78.01) to create an EEG task on visual sentence processing, and I have a question about timing. I've read Pyschopy's recommendations with respect to timing, and it is my understanding that, at least for visual presentation (reading), it is better to use "timing by frames" to avoid desynchronization issues. However, I'm not sure I need to do this for my experiment and I wanted to check with you guys.

My question is the following. My experiment involves 120 trials. Each trial involves an untimed context, an untimed question and the target sentence presented in Rapid Serial Visual Presentation. The sentence structure was created via a succession of routines: fixation (500ms) + word1 (450ms) + pause1 (300ms) + word2 (450ms) + pause2 (300ms)... until the end of the final word of the sentence. As of now, the participants then have all the time they need to provide a response.  

For each sentence, I have a code component that sends a trigger to the EEG recording software on words 6 and 7. I don't need the triggers to be synchronized across trials. I just need them to be sent exactly at the onset of words 6 and 7. Should I still use timing by frames? Even if there is some desynchronization between the EEG recording computer and the Psychopy experiment, I was thinking that the triggers will always be sent at the onset of words 6 and 7, and the time it takes for those triggers to actually be sent to the recording computer should be stable, right? In other words, in case of desynchronization after 100 sentences, it won't be the case that the triggers are sent 1 whole second after the onset of words 6 and 7. Is this correct? 

Any advice will be massively appreciated.
Best wishes and many thanks,

josé

Richard Höchenberger

unread,
Jul 19, 2016, 12:05:08 PM7/19/16
to psychopy-users
Dear josé,

On Tue, Jul 19, 2016 at 4:06 PM, josé ab <alema...@gmail.com> wrote:
> Dear Psychopy users,
>
> I've used Builder (version 1.78.01) to create an EEG task on visual sentence
> processing, and I have a question about timing. I've read Pyschopy's
> recommendations with respect to timing, and it is my understanding that, at
> least for visual presentation (reading), it is better to use "timing by
> frames" to avoid desynchronization issues.
[...]
> My question is the following. My experiment involves 120 trials. Each trial
> involves an untimed context, an untimed question and the target sentence
> presented in Rapid Serial Visual Presentation. The sentence structure was
> created via a succession of routines: fixation (500ms) + word1 (450ms) +
> pause1 (300ms) + word2 (450ms) + pause2 (300ms)... until the end of the
> final word of the sentence. As of now, the participants then have all the
> time they need to provide a response.

why would you use different routines for every stimulus/pause of your
experiment? Couldn't that go into a single routine, with the onset
times of the different components specified accordingly?

> For each sentence, I have a code component that sends a trigger to the EEG
> recording software on words 6 and 7. I don't need the triggers to be
> synchronized across trials. I just need them to be sent exactly at the onset
> of words 6 and 7. Should I still use timing by frames?

Generally, whenever presenting visual stimuli through a computer
display, you should synchronize to the vertical refresh of the
monitor, and "time the stimulation by frames". This will give you the
highest precision and accuracy possible, as long as you don't happen
to drop frames.

> Even if there is some
> desynchronization between the EEG recording computer and the Psychopy
> experiment, I was thinking that the triggers will always be sent at the
> onset of words 6 and 7, and the time it takes for those triggers to actually
> be sent to the recording computer should be stable, right? In other words,
> in case of desynchronization after 100 sentences, it won't be the case that
> the triggers are sent 1 whole second after the onset of words 6 and 7. Is
> this correct?

I don't know the exact paradigm you're using, but commonly one
presents stimuli (and sends the respective triggers) at time points
relative to trial onset, or fixation onset, or something like that, on
every single trial. So the entire timing within a single trial only
depends on that very trial; the "global" time does not matter. Timing
errors or jitter does not accumulate across trials that way.

Does that help you? :)

All the best,

Richard

josé ab

unread,
Jul 20, 2016, 4:56:11 AM7/20/16
to psychopy-users
Dear Richard,

Thanks a lot for your kind response! I answer below

 
why would you use different routines for every stimulus/pause of your
experiment? Couldn't that go into a single routine, with the onset
times of the different components specified accordingly?


I guess it could, but this is how I've done it in the past (in different softwares though), and it's always worked fine. I am almost completely new to Psychopy. Initially, I tried to create just two routines (word + pause) and create a loop that would feed the different words of the sentence into it, but I wasn't successful.

Generally, whenever presenting visual stimuli through a computer
display, you should synchronize to the vertical refresh of the
monitor, and "time the stimulation by frames". This will give you the
highest precision and accuracy possible, as long as you don't happen
to drop frames.

To be honest, I could do the timing by frames, since I have no reason to think that we might be dropping frames. Our lab monitors have very good graphic cards, no antivirus, they're not connected to the internet, etc. I simply thought that it might just be simpler (or more straight forward to me, since I am not computer savvy and am not familiar with frames...) to use "timing by milliseconds" because I only care about the 300ms before and the 1500ms after the triggers. If the timing of a trial only depends on the trial, then I should be okay (I think...). 
 
I don't know the exact paradigm you're using, but commonly one
presents stimuli (and sends the respective triggers) at time points
relative to trial onset, or fixation onset, or something like that, on
every single trial. So the entire timing within a single trial only
depends on that very trial; the "global" time does not matter. Timing
errors or jitter does not accumulate across trials that way.

   I do the same, except that each word is presented in one routine, and I send my triggers relative to the onset of two of those routines (words 6 and 7). I guess that means that I shouldn't worry about desynchronization/jitter/timing errrors? 

Does that help you? :)
All the best,
    Richard

ABSOLUTELY! I'm super grateful that you took the time to respond and provide help!
Best wishes,
José

Richard Höchenberger

unread,
Jul 20, 2016, 6:20:55 AM7/20/16
to psychopy-users
Hello José,

On Wed, Jul 20, 2016 at 10:56 AM, josé ab <alema...@gmail.com> wrote:
>> why would you use different routines for every stimulus/pause of your
>> experiment? Couldn't that go into a single routine, with the onset
>> times of the different components specified accordingly?
>>
> I guess it could, but this is how I've done it in the past (in different
> softwares though), and it's always worked fine. I am almost completely new
> to Psychopy. Initially, I tried to create just two routines (word + pause)
> and create a loop that would feed the different words of the sentence into
> it, but I wasn't successful.

is the timing/duration of all stimuli and pauses constant throughout
the experiment? I.e., you stated initially, "fixation (500ms) + word1
(450ms) + pause1 (300ms) + word2 (450ms) + pause2 (300ms) ..."; does
that mean that ALL words have a duration of 450 ms, and ALL pauses
have a duration of 300 ms? How do you specify the sentences to be
used? Is there an outer loop that pulls in a complete sentence per
trial, and you use code to split the sentence into words, which are
then presented in different routines?

>> Generally, whenever presenting visual stimuli through a computer
>> display, you should synchronize to the vertical refresh of the
>> monitor, and "time the stimulation by frames". This will give you the
>> highest precision and accuracy possible, as long as you don't happen
>> to drop frames.
>
>
> To be honest, I could do the timing by frames, since I have no reason to
> think that we might be dropping frames. Our lab monitors have very good
> graphic cards, no antivirus, they're not connected to the internet, etc. I
> simply thought that it might just be simpler (or more straight forward to
> me, since I am not computer savvy and am not familiar with frames...) to use
> "timing by milliseconds" because I only care about the 300ms before and the
> 1500ms after the triggers. If the timing of a trial only depends on the
> trial, then I should be okay (I think...).

Do definitely use timing by frames, then. :)

>> I don't know the exact paradigm you're using, but commonly one
>> presents stimuli (and sends the respective triggers) at time points
>> relative to trial onset, or fixation onset, or something like that, on
>> every single trial. So the entire timing within a single trial only
>> depends on that very trial; the "global" time does not matter. Timing
>> errors or jitter does not accumulate across trials that way.
>
>
> I do the same, except that each word is presented in one routine, and I
> send my triggers relative to the onset of two of those routines (words 6 and
> 7). I guess that means that I shouldn't worry about
> desynchronization/jitter/timing errrors?

The timing should be absolutely reliable if you don't have hardware
issues or are dropping frames :)

Cheers,

Richard
Reply all
Reply to author
Forward
0 new messages