synchronize event markers with refresh rate

Baris Demiral demiral.007 at googlemail.com
Tue Mar 29 21:29:45 UTC 2011


Hank,

In practice, there is no trigger which can be sent on the exact complete
onset of the stimulus. Only thing is that the trigger can best be written
out when the stimulus is started to be written on the screen. In LCD
monitors this is a bit different but lets come to the main issue.

There are some strategies that you can follow in order to minimize the
trigger jitters between the trials in e-prime. I will list these for you.
But beforehand you need to know i) what the refresh rate of your monitor is
ii) what your digital loading (on the digital card) is on your LCD monitor
(if you are using one).

Try to set the duration of the object (which I will can Y)  preceding the
main object (which I will call X, that you will send trigger to be marked
for the onset) to be the multiples of the refresh rate.

First option: Maybe the best option is to use something like:

*X.OnsetSignalEnabled*

*X.OnsetSignalPort
X.OnsetSignalData*

* *

*where* "X" *is the *actual name of the object *on which the *property is
being set.


Write an inline at the beginning of the experiment/trial and set these. You
can read more about this at http://www.pstnet.com/eprimelegFAQ.cfm.


If you want to control the length of the trigger, you either write the
following lines in the same on-line object:


*X.OffsetSignalEnabled
X.OffsetSignalPort
X.OffsetSignalData*

*
*

Or, use WRitePort and prepare another in-line object, put this inline after
the X object and set X object's PreRelease to [X duration minus length of
the trigger you desire]. In e-prime PreRelease "releases" (or executes) the
inline objects coming after right away. It does not wait. Then, it prepares
the next object to be shown as soon as the offset of X. But, make sure that
Pre-release did not alter the length of the X object, because if you keep
PreRelease very long it can act weird (at very long prereleases compared to
the object's original duration). So this option is great if you have stimuli
with very short durations. Almost exact onset time is caught. But you go
with a long trigger as long as the X object if this does not bother you.


Second option: (Offset correction/consideration needed, but no jitters).
Set Y's PreRelease to a value which will be good enough to cover up for  i)
vertical blank time ii) trigger length. I assume you loaded your
images/sounds at the beginning of the trial. If you did not,  you need to
include iii) loading time of the stimulus. For example: You have an image
shown in X which takes 40-50ms to load (you can find this in e-prime output
when you are designing your experiment and testing some dummy experiment.
Look at the onset latency).


You know your monitor's refresh rate is 100Hz, and you want your trigger to
be 5ms (for some other reasons).  Total time required for the image to be
ready to be displayed is minimum 40+10+5=55ms maximum 65ms. Use Pre-release
in Y and set it to 70ms (or if you want to be safer, set it to 100ms). Then
write the in-line to send the trigger after Y. This will ensure that all
your triggers will be sent exactly 70 or 100ms before time the stimulus is
started to be written to the screen. If you load your images at the
beginning of the trial or you are showing text, you can make the PrRelase
shorter, 20ms.


You also factor in if there are some LCD digital preparation duration
latencies in the digital card of the LCD monitor. For instance for Samsung
100Hz LCD I found this to be 10ms. But it is, at least, presenting the image
as a whole once (I think), not bit by bits consecutively as in CRT.


Third Option: Use Canvas object like things and write your code.  You can
have full control. There were some nice scripts on this list written by some
others. Or use something like WaitForVerticaBlank after you load your images
and make them ready. WaitForVerticalBlank makes the object ready to be
shown, then you can send the trigger, and the object is shown in the next
refresh time. This option will make sure you fix the latency between the
trigger and the stimulus just one refresh rate. Don't make the length of the
trigger longer than the refresh rate.

If you know how earlier the triggers were sent, then you can use this
information to adjust for time windows or other statistics later.

Best
Baris

On Tue, Mar 29, 2011 at 5:37 PM, Hank Jedema <Jedema at pitt.edu> wrote:

> Hi All,
>
> I am trying to run a stop signal response task while recording
> electrophysiological activity on another setup. In order to get
> synchronization of behavior with the timing of my recordings, I have E-
> prime sent out event markers via the parallel port to an input of my
> recording device. It seems that this works well responses, but it
> seems that E-prime sends out the event markers for the display of
> stimuli before the stimulus actually appears on the screen: the
> eventmarker/timestamp is sent when the code issues the request for the
> stimulus to appear, rather than when the stimulus actually appears on
> the screen (i.e at the vertical blank/screen refresh after the
> stimulus.onset delay). Is there a way to get the event marker signal
> to synchronize with the actual appearance of the stimulus or is this
> something that can only be corrected offline by correcting the
> timestamps for stimulus appearance with their onset delay ?
>
> Thanks very much for your help.
>
> Hank
>
> --
> You received this message because you are subscribed to the Google Groups
> "E-Prime" group.
> To post to this group, send email to e-prime at googlegroups.com.
> To unsubscribe from this group, send email to
> e-prime+unsubscribe at googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/e-prime?hl=en.
>
>


-- 
SB Demiral, PhD.
Department of Psychology
7 George Square
The University of Edinburgh
Edinburgh, EH8 9JZ
UK
Phone: +44 (0131) 6503063

-- 
You received this message because you are subscribed to the Google Groups "E-Prime" group.
To post to this group, send email to e-prime at googlegroups.com.
To unsubscribe from this group, send email to e-prime+unsubscribe at googlegroups.com.
For more options, visit this group at http://groups.google.com/group/e-prime?hl=en.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://listserv.linguistlist.org/pipermail/eprime/attachments/20110329/da7ec5e5/attachment.htm>


More information about the Eprime mailing list