How to send markers/triggers from ZEP (EEG)
If you have suggestions on how to improve this document, or find mistakes, please send them to firstname.lastname@example.org
Using markers during electroencephalography (EEG) helps to identify specific events in your data. When analyzing data the markers become crucial for synchronizing epochs or identify responses. It is of paramount importance that these markers are very precise; any jitter reduces the quality of your data. The accuracy of markers is of less importance. Markers are generally added by triggering output-lines of a parallel port that outputs from the stimulus-presentation equipment to the EEG-recording equipment.
When using Zep (2.x) for stimulus presentation during EEG it is relatively simple to add markers to your recording. Adding markers/triggers can be done by using the custom-built Zep-marker module. This Zep module is maintained on a repository on GitHub. It requires the use of Zep 2.x and the presence of a parallel port. This how-to assumes you already have a Zep-scripted experiment that needs only the addition of markers as a finishing touch but is otherwise ready-to-go.
This module’s performance in precision and accuracy of markers has been tested against that of Presentation©. The tests suggested that Zep performs equally well or even better.
Firstly, import the module in the top-level Zep script (.zp file) by adding the line
Secondly, after setting up the presentation of a stimulus within your experiment script add the following function call:
setup_marker_at( marker, tref );
marker being the integer you want to send and
tref being the (expected) time the event you want to mark will start:
The best way to mark a participant response is to add a fixed delay (10~20 milliseconds) between the response of the participant and the setup onset of the marker. For example, when receiving a response at time X (e.g. an event_time in Zep) use
setup_marker_at( 1, event_time + 20ms )to mark the response. Using
send_marker( 1 );would be more accurate but less precise. This is because of a small but variable latency between the time of response registration and the time that Zep actually handles response event. In EEG precision is everything.
Use the following function call for sending out a marker as quickly as possible:
This call will setup a marker to be sent as quickly as possible. Because of internal logistics there is a minimum setup time required before sending the marker. This setup is determined by the sum of
SCHEDULER_PRE_EMPT_ERROR_TOLERANCE variables from the settings. Using the default settings in
zep_markers_settings.zm this minimum is 7.5 milliseconds.