Добавил:
kiopkiopkiop18@yandex.ru t.me/Prokururor I Вовсе не секретарь, но почту проверяю Опубликованный материал нарушает ваши авторские права? Сообщите нам.
Вуз: Предмет: Файл:
Ординатура / Хирургия / Библиотека им академика М.И. Перельмана / Книга_6027_Библиотеки_им_академика_М_И_Перельмана.pdf
Скачиваний:
0
Добавлен:
31.08.2026
Размер:
29 Мб
Скачать
13 Software for Recording EEG and Peripheral Physiology 159

13.2.2 Special Applications

Some applications require specic recording parameters. For example, the high­amplitude artifacts seen in EEG-fMRI and EEG-TMS require a large measurement range. Very small signals such as an auditory brain stem response require a very high sampling rate in comparison to regular EEG. Covering all special applications is beyond the scope of this chapter. The important message is to be aware of any specic conditions and what can be done to accommodate these conditions and maximise your data quality. Manufacturer guidelines and literature in your eld of study are a good place to start.

13.2.3 Real-Time Processing

Some applications require real-time processing. For example, in closed-loop brain stimulation EEG signal features are used to trigger a stimulation device such as transcranial magnetic stimulation (TMS). In Brain Computer Interface (BCI) appli­cations, immediate feedback is provided to the participant based on an EEG feature. Some sleep recording software can perform real-time sleep scoring and requires access to the real-time data. This typically requires a connection between the recording software and another client (e.g. remote data access). Input from an institutions IT department might be necessary, e.g. if permissions are restricted. Therefore, it is best practice to set up and test the real-time processing pipeline during the pilot testing phase.

13.3 During a Measurement Session

Its tempting to just press record and assume that everything is running as expected. However, it is essential to perform some initial checks before starting the recording and to monitor the signal during recording. Its important to pay attention to detail and to be consistent across measurements.
Impedance Check In Chap. Physiology, the role of impedance at the electrode scalp interface was covered. Researchers should establish a target impedance range for a study, this will depend on the electrode type and the application. Impedance at all recording electrodes should be checked prior to starting a measurement. The options available will depend on the software but you should be aware of the scale that you are using and whether you can switch between scales. Some systems might offer an LED impedance indication system on the electrodes, in which case its crucial to know what levels are set for the light colours. Chapter Acqu
isition, provides some tips and tricks for achieving your target impedance with
different amplier and electrode congurations.
12, Hardware for Recording EEG and Peripheral
16, Practical Aspects of EEG Data
160 T. Warbrick and D. Kadlec
Monitoring the Data The display should be set up to optimally view the signal. Use a scale that is meaningful and will allow you to assess signa l quality or to spot any problems. For high-density recordings, e.g. 256 channels, its not practical to view all channels at once, but rather to view fewer channels in subsets. For signals with different amplitudes or temporal properties, the scaling should be adjusted to view each signal optimally. For example, the galvanic skin response (GSR) is much slower than EEG and requires a different temporal scale for optimal viewing. If display lters are available, it is important to know whether this is enabled and how
/disable this feature. Furthermore, it might be useful to view data in a different
to en montage, for example re-referenced. This functionality isnt available in all software, but if available it should be congured before the recording is started.
Triggers and Markers Triggers should be veried before the recording, especially
shared labs where settings might change between recordings. In addition to trial
in markers, it might be possible to add on-the-y annotations to the data to indicate noteworthy events, e.g. excessive movement or interruptions.
Save the Data! Make sure that the data are being recorded. For example, some progra
ms require you to save a data le at the end of recording, others start saving to disk automatically once you start. Note that your software might have a monitoring mode that allows you to view the data but it is not yet recording, its important to switch from monitoring to saving. This sounds obvious, but its not an uncommon error.

13.4 Troubleshooting

Its important to be prepared for potential problems when recording EEG data. While specic problems will differ across software programmes, there are some typical issues that can be addressed with standard troubleshooting strategies. Below we list a few common problems and where to start troubleshooting them.
License Issues It can be restrictions. Researchers should know where to nd the license information: license number, expiry date, how to activate it, and how to renew it. This information will also be needed if you need to contact the software support service. It is good practice to check the software expiry date during pilot testing to ensure that it wont expire during the study.
Communication
failure to establish communication between the hardware and software. System or software manuals from the manufacturer are a good place to start for troubleshooting advice. Communication problems will most likely be solved during pilot testing; nonetheless, its good to know where to start troubleshooting if problems occur during measurements.
Between the Hardware and Software A common problem is the
frustrating if your software wont open due to licensing
13 Software for Recording EEG and Peripheral Physiology 161
Unexpected Interruptions Avoid using the same computer for recording the data and for other aspects of the study, such as your stimulation paradigm. This will prevent data overow problems (Windows), screen freezes, and other interruptions. Its also important to make sure that the recording computer wont go into sleep mode.
Maintenance Software should be kept up to date. Regularly check for updates and patche
s from the manufacturer. When updating the software, consider whether an update will have an impact on ongoing studies. Its good practice to record all data in a study with the same version of the recording software.
Support Remember that most commercial software comes with a support service.
contacting a support team it is helpful to provide the version number of the
When software, your license information, and a thorough description of the problem, including error messages (screenshots are helpful). If you are using OSS there is often a forum, sometimes moderated by the developers, that can be a useful place to start.

13.5 Conclusion

This chapter has introduced the key features of EEG recording software and the parameters you need to consider when setting up your recording environment. It is important to understand how software choices in uence the data, and we recom­mend that you spend some time setting up your recording software. It is also helpful to pilot test your choices before beginning data acquisition for your study. We have also outlined good practice for monitoring data quality durin g a measurement and provided troubleshooting tips for common software-related probl ems. We recom­mend familiarising yourself with these during the pilot testing phase of your study.

References

Gorgolewski, K. J., Auer, T., Calhoun, V. D., Craddock, R. C., Das, S., Duff, E. P., Flandin, G.,
Ghosh, S. S., Glatard, T., Halchenko, Y. O., Handwerker, D. A., Hanke, M., Keator, D., Li, X., Michael, Z., Maumet, C., Nichols, B. N., Nichols, T. E., Pellman, J., Poline, J. B., Rokem, A., Schaefer, G., Sochat, V., Triplett, W., Turner, J. A., Varoquaux, G., & Poldrack, R. A. (2016). The brain imaging data structure, a format for organizing and describing outputs of neuroim­aging experiments. Scientic Data, 3, 160044.
Pernet, C.
R., Appelhoff, S., Gorgolewski, K. J., Flandin, G., Phillips, C., Delorme, A., & Oostenveld, R. (2019). EEG-BIDS, an extension to the brain imaging data structure for electroencephalography. Scientic Data, 6, 103.
162 T. Warbrick and D. Kadlec
Poldrack, R. A., Gorgolewski, K. J., & Varoquaux, G. (2019). Computational and informatic
advances Science, 2, 119–138.
Weiergräber, M., Papazoglou, A.,
and related pitfalls in EEG analysis. Journal of Neuroscience Methods, 268, 53– 55.
Westner, B. U. (2024). Cycling on the freeway: The perilous state of open source neuroscience
software. 2403.19394. Available: https://arxiv.org/abs/2403.19394.
for reproducible data analysis in neuroimaging. Annual Review of Biomedical Data
Broich, K., & Müller, R. (2016). Sampling rate, signal bandwidth
Chapter 14
Triggers
Alex Kreilinger and Paulo Rodrigo Bazán
Abstract In this chapter, we will cover the importance of triggers and how they can
be used different common ways to generate and record triggers, along with suggestions for alternative approaches if triggers are not an option. Finally, we will demonstrate strategies that are considered good practice.
Keywords Synchronization · Triggers · Events · Markers

14.1 Introduction

Triggers are one way to synchronize external events with EEG recordings. They are necessary to allow the analysis of time-locked signals. To maximize the quality of the results it is vital that the triggers are recorded with the EEG data as precisely as possible.
understand the difference between events, markers, and triggers (Fig. 14.1):
to add contextual information to data recordings. We will also demonstrate
First, some clarication of the terminology used around triggering is needed to
. Event: describes something that is happening which is relevant in the context of
the record
ing. For example, an event could be a behavior from the participant, such as a motor response (e.g., a button press). Or the appearance of a stimulus in an experimental paradigm, e.g., visual, acoustic, or tactile.
. Marker: describes such an event in
the software. It is the information about what and when and is provided either directly in the recording, or in an additional supporting le. For example, a marker le may contain a matrix of types and corresponding time stamps. This information is particularly important for EEG data analysis.
A. Kreilinger (*) · P. R. Bazán Brain Products GmbH, Gilching, Germany e-mail:
alex.kreilinger@brainproducts.com; paulo-rodrigo.bazan@brainproducts.com
© The Author(s), under exclusive license to Springer Nature Switzerland AG 2026 T. Warbrick
https://doi.org/10.1007/978-3-032-20450-9_14
(ed.), The EEG Handbook,
163
164 A. Kreilinger and P. R. Bazán
Fig. 14.1 Events, markers, and triggers in a visual paradigm. In this case, a visual cue appearing on the screen is the event. The stimulus presentation computer sends a trigger to the EEG amplier at the same time. The trigger gets recorded together with the EEG data. The triggers are represented as markers in the recorded le
. Trigger: is the hardware embodiment of an event, represented by an electric or
optical signal. Usually, these triggers are sampled and recorded directly with the EEG to provide optimal timing precision.

14.2 Importance of Triggers

EEG has a very high temporal resolution (Chap. 2, What is EEG). Therefore, to properly analyze EEG signals in relation to a task or stimulus, the time of the task or stimulus needs to be recorded with high precision. In this context, having triggers is a reliable form of relating and synchronizing events to EEG data. Triggers are also helpful for multimodal data acquisition, as they can be used to synchronize the data acquired from different devices. For example, the EEG system can mirror or forward the triggers it receives from a stimulation source to another device, such as a functional near-infrared spectroscopy (fNIRS) system. This also works the other way around: for example, an eye-tracking system can send triggers to the EEG amplier. This will then generate common markers in the multimodal recording which can be used to merge the data or analyze it together. Another option is to replicate triggers with a y-cable or a one-to-many trigger replicator.
The required p
desired analysis. For example, if the analysis focuses on brain activity sustained over several seconds, it is likely that a smaller precision is good enough. In contrast, for event-related potential (ERP) analysis, where an average of trials will be generated in a time-locked window of a few hundred milliseconds, even variations of a few
recision for triggers will depend on the research questions and
14 Triggers 165
milliseconds can signicantly affect the results. In these cases, millisecond precision is required, and high precision triggers are especially important.
The precision is affected by latency and jitter:
. Latency: is related to the delays between the actual onset of the event and the
trigger being recommended to check these delays, as latency can be adjusted during the analysis, if it is known and constant. However, for near real-time applications, latency needs to be very short, such as in transcranial magnetic stimulation (TMS)-EEG, brain-computer interface (BCI), or neurofeedback.
. Jitter: is the variation in the delays from trial to trial. These delays are more
problematic precision level that we want to assure in our experiment.
received or the marker being generated in the EEG recording. It is
because they are variable. Therefore, we need to reduce them to the
Figure 14.2 demonstrates the effects of
ERP.
jitter and latency on the waveform of an

14.3 Advantages of Triggers

While aligning the timing between EEG signals and events may seem straightfor­ward, it is not guaranteed in every setup. There are many factors that can disrupt this alignment, but by encoding the event wi th a hardware trigger, the exact time of the event is recorded precisely when it really happens. This is because the hardware input directly synchronizes the trigger signal with the EEG signal. This means that potential delays caused by separate processing pipelines of markers and EEG data can be avoided. For example, different stimulus presentation software tools could otherwise have a negative effect on precision. There are also differences in how fast data can be read from the amplier to the PC, tablet, or smartphone. Therefore, the main advantage of the triggers is the high precision due to the simultaneous sampling together with EEG signals. Additionally, in some cases triggers can be generated directly from the stimulus or participant response, reducing the need for additional programming when compared to software solutions.
As an examp
aim of an experiment is to record the brains response to a visual stimulus, or to a variety of visual stimuli. These stimuli can be created in a software environment and consist of pictures that appear and disappear at specic moments. Now, to analyze the ERP associated with these visual stimuli, it is important that the synchronization between event and signal is precise. We can guarantee this if every individual visual stimulus is accompanied by a corresponding trigger input that gets sampled simul­taneously with the EEG. Ideally, the visual stimulus can be used itself for creating the trigger input. This can be done by recording the visual stimulus via a photo sensor and sending a trigger as soon as a certain threshold is exceeded. This way, the true appearance of the stimulus can be veried directly in the recording. Otherwise, one can never be sure that a stimulus happens when it is supposed to. For example, a
le, a common scenario is the presentation of a visual stimulus. The
166 A. Kreilinger and P. R. Bazán
Fig. 14.2 Effects of jitter and latency on an ERP condence interval. A stable latency changes the time of the ERPs' appearance in relation to the event (in this case at t ¼ 0 ms). Increasingly high jitter directly affects the waveform. The higher the jitter, the more of the original waveform is getting lost. The four examples demonstrate the effects of latency and jitter, simulated with normally distributed delays based on mean latency jitter: the original and simulated ERPs overlap perfectly. (b) Here, the mean latency is zero, but the jitter has a high standard deviation of 50 ms. The waveform of the ERP is noticeably different. (c) Constant, jitter-free latency: the ERP is preserved but shifted on the time axis. The amplitude can also be affected if baseline correction is used. (d) High latency and high jitter signicantly distort the original waveform and timing information of the ERP
jitter in milliseconds. (a) No latency and no
visual stimulus might be delayed because of an additional screen refresh cycle that was not accounted for, or an acoustic stimulus might require some additional time to load the sound into a buffer. Not accounting for these possibilities can easily lead to jitter and latency issues in the order of tens of milliseconds, which will have an impact on the ERP analysis. At the end of this chapter, we will provide more details on how to set up an experiment to verify the timing accordi
ngly.
If possible, connecting triggers to the EEG recording hardware is a great way to
make sure that important external events are synchronized with the other recorded signals without any potential interference.
14 Triggers 167

14.4 Disadvantages of Triggers

Adding triggers to the setup typically requires additional accessories and cables that can be cumbersome to connect, can make the setup more complicated, and require more preparation time. In certain cases, it may be benecial to have a very fast and uncomplicated design to keep the recording time to a minimum. It could be that the recording itself is already extensive or that the participants need to be kept motivated to not lose their concentration. There are also recording setups that do not foresee the inclusion of triggers, either by not allowing the physical connection or by not needing triggers in the rst place. For example, there are cases in which all the relevant context is provided directly within the acquisition software itself, e.g., in sleep EEG.

14.5 Alternatives to Triggers

As already mentioned, triggers may not always be the preferred method, and there may even be circumstances where triggers are not necessary. A generalization is difcult as this depends on the respective environment of the selected EEG amplier, the research question, and planned analysis. It might be the case that markers can be created and stored directly within the acquisition software. The amplier might also be connected to a platform which creates context by means of a marker or an auxiliary signal and saves it directly with the data (e.g., OpenViBE (Renard et al.,
2010)). In these cases, it is highly recommended to perform thorough testing during
the pilot phase to make sure signals and markers are properly synchronized (Chap. 10, Pilot Testing).
A common alternative to triggers is to use Lab Streaming Layer (LSL) (Kothe
et al., 2025). LSL is a protocol that manages the synchronization of multiple signal sources sampling rate, but also with irregular streams where data points only appear occa­sionally, or at irregular intervals. Instead of triggers, one can create such an irregular marker stream that is available in the network. Any LSL client can then connect to the data and marker streams, allowing signals to be processed and/or saved together with contextual information. A study using TMS-EEG to compare hardware triggers and software markers via LSL is presented in Miziara et al. (
the time that passes between the samplin g of a data point and its availability in the stream. Whereas an LSL marker can be sent to the network almost immediately, the sample from the EEG amplier is subje ct to delays due to several factors: commu­nication on the driver level, transmission time via Bluetooth some internal buffering. Many factors can add up to create a latency that is no longer negligible, especially when dealing with time-critical ERPs.
in a shared local network. It works with regular streams that have a specic
2025).
One drawback of
combining such LSL marker stre ams and LSL da ta streams is
®
or WiFi, or potentially
168 A. Kreilinger and P. R. Bazán

14.6 Good Practice for Using Triggers

Once the decision to use triggers has been made, it is good practice to adhere to a few principles that will ensure that no information is lost, and that the information is presented in a clear and precise manner.
. All triggers must be encoded in a way that they do not overlap with other triggers
or result experiment, triggers can be created by a computer that is running a stimulus presentation software, such as Presentation Berkeley, CA, www.neurobs.com), E-Prime burgh, PA, https://support.pstnet.com/), PsychoPy (Peirce, et al., 2019), MATLAB MathWorks Inc. https://www.mathworks.com), or similar. These software tools interact with a device that can translate the software commands to triggers. This can be done via USB, serial, or parallel port, with the USB port connected to a trigger device becoming more and more the standard. Regardless of how, the user must ensure the device sends signals in a form at that ts to the requirements of the EEG amplier. For example, consider the possible ways that the trigger could be sent via the interface. The corresponding command might require a string, an integer, or it might even be necessary to encode the message as a binary or hex code number: the following dummy code snippets all encode the number 42 but might be interpreted differently: send(42), send(42), send(00101010), or send(0x2A’). Therefore, users are advised to inform themselves about how the triggers are sent and received. Users should also nd out if trigger codes need to be actively reset, or if the software tool already sends pulses with a pre-dened length, after which this happens automatically. If such a reset does not happen, sending another trigger value might have no effect because the linesvalues have not changed. Worse, it could even be the case that sending different codes after each other without a reset in between leads to completely wrong numbers at the receiver, formed by the combination of codes. This will impact ERP analysis. If it is necessary to send additional information in parallel, a viable option is to separate the available bits into groups (Table input consi more likely division is using two groups of 4 bits, or one 7-bit group with the option of a 1-bit trigger input that can be used as an on/off input.
. The pulse width
hand, it should not be too long because otherwise it can block sending subsequent triggers. On the other hand, it should not be too short because very short pulses can easily be missed if the onset and offset occur within a single sampling interval. The minimum pulse width, therefore, should always be at least 2 sam­pling intervals long to be on the safe side. If the length of the pulse width cannot be adjusted, losing triggers can be mitigated by either increasing the sampling rate of the amplier, or by using a hardware solution that extends the pulse durat ion to an adequate length.
in misinterpretations at the receivers end. For example, in a typical EEG
®
(Neurobehavioral Systems, Inc.,
®
(Psychology Software Tools, Pitts-
®
(The MathWorks Inc. MATLAB, Natick, Massachusetts: The
14.1). If the EEG amplier trigger
sts of 8 bits, the input can be divided into eight groups at maximum. A
of a sent trigger code needs to be carefully considered. On one