How to design trigger codes to obtain accurate markers
by Shivakumar Viswanathan, Ph.D.
Scientific Consultant (Brain Products)
Event-related analyses of EEG data are a powerful approach to study dynamic neurocognitive processes related to key events (e.g., the onset of certain stimuli, the execution of certain actions). Conducting these analyses requires accurate markers of what events occurred and when across the experiment. This marker record is crucial as experiments can have hundreds of events of several types with randomized orders between participants.
Hardware triggers are a valuable method to create markers for events as they occur during EEG data acquisition. However, setting up a trigger pipeline can be technically demanding as it involves configuring the hardware/software interactions between multiple devices. A crucial step is the design of trigger codes, namely, the information that needs to be sent between devices when an event occurs during the experiment. In this Support Tip, we will walk you through a structured strategy to design effective trigger codes.
- First, we define some useful terms and concepts to describe the relationship between events, markers, and triggers.
- Next, we define the one-to-one mapping criteria to evaluate success when using trigger signals, and how to achieve it by creating a one-to-one trigger plan.
- Finally, we provide three examples to demonstrate how to complete a one-to-one trigger plan using the trigger2marker tool.
Background: Events, markers and triggers
What is an event?
In the context of an experiment, an event typically refers to a discrete happening related to the participant. An event can be described by what happened and when. Common examples include (Figure 1A):
- the presentation of a sensory stimulus to the participant (what) after a particular baseline duration (when)
- the participant executes an action (e.g., presses a button) (what) at a specific time following a sensory stimulus (when)
- the start of an interval where participants follow a specific instruction (e.g., to maintain a resting state with eyes open) (what) after a preparation period (when)
Experimental events can be under experimenter control (e.g., stimulus presentation) or participant control (e.g., movement initiation). In the latter case, detecting events can involve various interaction devices and peripheral sensors (e.g., response buttons, motion trackers, eye trackers, accelerometers, photo sensors, microphones, force sensors, etc.).
In EEG practice, the record of all relevant events over the experiment is implemented with markers.
What is a marker?
A marker is a representation of an event that is integrated with the EEG timeline. A typical graphical depiction of event markers on the EEG timeline is show in Figure 1B.
Figure 1: (A) Schematic of typical events of interest over the experiment timeline. (B) Graphical depiction of markers on the EEG timeline. The label ‘S 2’ describes an event (i.e., what) and its position on the EEG timeline indicates when the event occurred. Markers are recorded with multiple features in a marker file (see text).
In EEG data files with the BrainVision Core Data Format, markers are stored in a dedicated marker file (extension .vmrk). In this file, each marker has several features to describe the represented event (bottom of Figure 1B), namely:
- Marker number: The marker’s serial order in the recording relative to other markers.
- Type, Description: Labels to describe the represented event, i.e., what happened (we will discuss these two features in more detail in the following sections).
- Position (in data points): The timing of an event (when) on the EEG timeline relative to the start of the recording. The resolution of the data points is defined by the sampling rate of the EEG data.
- Size (in data points): The duration of the event, which is equal to 1 for a point event.
- Channel number: A value of 0 indicates an event related to all channels.
By systematically creating a marker for every relevant experimental event, we obtain a record of all events on the EEG timeline.
Hardware-based trigger signals provide one of the best methods to create time-accurate markers for events as they occur during EEG data acquisition.
What is a trigger signal?
Why trigger signals?
EEG recordings typically involve multiple devices. In one common configuration (among many) (Figure 2), experimental events are controlled and detected by one group of interconnected devices (blue cluster, Figure 2), while the participant’s EEG is recorded in parallel with a different group of devices (green cluster, Figure 2). Trigger signals serve as a bridge (red line in Figure 2) to communicate event information to the EEG recording system. The received event information is then used to create event markers integrated with the EEG timeline.
Figure 2: Schematic of common recording configuration with multiple devices (left) and their communication structure (right). Blue cluster: devices to control and detect experimental events, green cluster: devices involved in EEG recording, red line: connection path of trigger signal.
Why trigger codes?
Triggering is based on digital communication protocols that are implemented in the hardware of the interacting devices (read more in our guide: Communicating with the trigger port). This hardware implementation enables rapid inter-device communication but constrains the size and format of the communicated messages. First, the messages have to be in binary format (i.e., ones and zeros). Second, the number of binary digits (i.e., bits) per message is limited, for example, eight bits.
Due to these constraints, it is useful to consider trigger-based communication as the transmission of binary coded messages from the sender (blue cluster, Figure 2) to the receiver (green cluster, Figure 2). Figure 3 is a simplified animation of this communication when there is a single sender, namely:
- Sender: When an event occurs (e.g., display of an orange square), the sender selects a binary trigger code specific to this event-type. This binary code is immediately sent as a message using a trigger signal.
- Message transmission: The trigger signal is sent only when a relevant event occurs, i.e., it is “triggered” by the event. This signal is rapidly transmitted via cables (or wirelessly) and intermediate devices (such as the TriggerBox) to a connected receiver.
- Receiver: The received binary coded message is decoded to create a marker with information about the triggering event (i.e., ‘E 11‘ for a displayed orange square).
With this protocol, markers can be created for events as they occur during the experiment. Trigger-based communication is successful if the decoded marker information corresponds to the information that the sender encoded into the message.
Note: The trigger code does not include information about the triggering event’s timing (i.e., when it occurred). Trigger signals are rapidly transmitted due to their hardware-based implementation. Consequently, the latency between a trigger signal’s sending time and its received time is reliably low and typically negligible for the timescales of an EEG recording. Therefore, the received time of the trigger signal (red clock icon in lower panel, Figure 3) is used to represent an event’s timing in the created marker. For more information, see our Support Tip on timing verification.
Figure 3: Animated schematic of communication with trigger signals for a hypothetical experiment with a single sender (trigger code are defined by 4 bits). The lower panel is a static depiction of the sequence of steps between an event and the created marker (the relative timings are not to scale).
IMPORTANT: The assignments of a trigger code (read from right to left => top to bottm) to each relevant event-type (shown as the Sender table in Figure 3) has to be prepared before the experiment. When the experiment is running, this prepared “table” is used by the experimental software to select and send the appropriate trigger code when an event occurs (shown simplistically in Figure 3). The specific implementation of these run-time steps depends on the software being used (e.g., PsychoPy, Psychtoolbox, E-Prime®, Presentation®).
How are trigger codes decoded?
In the BrainVision Recorder software, the Digital Port Settings define the decoding rules that decide how a received trigger code in binary format (e.g., 00001001) is converted into a marker description in alphanumeric format (e.g., ‘E 9‘).
In general, trigger codes are decoded by performing a binary-to-decimal conversion. Specifically, the trigger code is treated as the binary representation of a number. This binary coded number is converted into its decimal form (i.e., by performing a binary-to-decimal conversion). The resulting decimal number is used in the marker description. However, the Digital Port Settings have additional parameters to modify how this binary-to-decimal conversion is performed and hence influence the resulting markers.
Figure 4: Digital Port Settings for actiCHamp family of amplifiers. Readers are referred to our trigger guide for full details of the various parameters. For our discussion, we assume that all bits are High active.
Figure 4 shows the parameters of the Digital Port Settings for the actiCHamp family of amplifiers with an 8-bit trigger input. Readers are referred to our trigger guide for full details of the various parameters. Our focus is restricted to the table with columns labelled Bit, Enabled, and Type due to their influence on the decoded marker description:
- Bit (Column 1) specifies the bit position (from 0 to 7) as related to the input pins of the hardware connector.
- Enabled (Column 2, green box) specifies whether the bit at a particular position is enabled (i.e., whether inputs to this bit should be included during decoding). A checked box ☑ indicates that the bit position on that row is enabled while an unchecked box ☐ indicates a disabled bit. This setting can be modified by the user, and its practical effects for trigger code design are discussed in the example section below.
- Type (Column 3, blue box) specifies which bits are to be decoded together and can be modified by the user. All bits with the same bit-type are decoded together to produce a type-specific marker. For example, if the user sets bits 0 to 3 to have the same bit-type Event then the resulting marker description would have the form Exxx, where E is the first letter of the type Event, and xxx are three positions reserved for the decoded decimal number (spaces are used to indicating leading zeros). This setting is valuable when trigger codes are received from multiple senders, rather than a single sender (see Note below). The practical effects of bit-types for trigger code design are discussed in the example section below.
NOTE: bit-types help distinguish senders, not event-types.
In the default configuration of the Digital Port Setting (see Figure 4), bits 0 to 3 have the type Stimulus and bits 4 to 7 have the type Response. The bit-types help to distinguish trigger codes from different senders, for example, when there is a different sender for stimulus-related trigger codes, and for response-related trigger codes. However, bit-types do not refer to event-types (i.e., whether an event was a stimulus or a response) especially when there is a single sender device for all trigger codes (as in Figure 2, 3). This confusion can be avoided by using a neutral term for the bit-type, such as Event.
With this background, we are now ready to address how to ensure successful trigger-based communication.
The need for a trigger plan
Trigger-based communication is successful when the decoded marker information corresponds to the information that the sender encoded into the message. When an experiment has many event-types, each event-type has to be encoded as a different trigger code, and these trigger codes have to be decodable in the intended manner.
Successful communication: One-to-one mapping
Ideally, there should be a one-to-one mapping between the relevant event-types and the recorded marker descriptions. This mapping is defined by the three basic criteria listed in Table 1 (left column).
Table 1: One-to-one mapping and its violations. The left column lists the criteria to achieve a one-to-mapping between event-types and recorded marker descriptions. The right column lists examples of how each criterion could be violated in actual recordings.
Criteria for one-to-one mapping | Possible violations in actual recordings | |
---|---|---|
1 | Every relevant event-type is associated with a corresponding marker. | – Missing markers: There are event-types that are not associated with any marker (e.g., display of a green triangle stimulus planned as S 1 but does not result in a marker). |
2 | Every event of a particular type (e.g., display of a green triangle stimulus) is associated with the same planned marker description (e.g., S 1). | – Incorrect markers: Events of a particular event-type have markers with the same but incorrect description (e.g., green triangle stimulus planned as S 1 but recorded as S 4). – One-to-many mapping: Events of a particular event-type are associated with multiple markers with different descriptions (e.g., every presentation of green triangle stimulus is recorded as S 1 and R 3). |
3 | Every marker with a particular description (e.g., S 1) is associated with the same planned event-type (e.g., display of a green triangle stimulus). | – Markers without events: There are markers that cannot be associated with a relevant event-type (e.g., marker S 3 is recorded without being specified). – Many-to-one mapping: Events of multiple event-types are associated with the same marker description (e.g., green triangle stimulus is recorded as S 1; red square stimulus is also recorded as S 1). |
In actual recordings, a one-to-one mapping can be violated in a variety of ways as illustrated by the examples in the right column of Table 1. Some of these violations can be corrected after-the-fact by editing the recorded marker descriptions (see our guides on editing markers in BrainVision Analyzer: link1, link2). However, making ad hoc corrections can sometimes be impossible, for instance, without an independent event record (e.g., experiment log-files) to serve as the “ground-truth” for marker correction.
In general, violations of a one-to-one map can hinder and even prevent the application of event-related analysis to the acquired EEG data. To avoid these difficulties, the one-to-one map provides a useful concept to guide the design and testing of the trigger pipeline before data acquisition. To help achieve such a one-to-mapping, we recommend the preparation of a one-to-one trigger plan.
Recommendation: Prepare a one-to-one trigger plan
Several of the criteria violations in Table 1 are deviations from the planned relationship between event-types and specific marker descriptions. Therefore, it is crucial to ensure that this planned relationship is in fact achievable. This can be achieved by preparing a one-to-one trigger plan.
For a single sender configuration, a simple template of a trigger plan is shown in Table 2. This table distinguishes the roles of the sender and the receiver on each row as follows:
- Sender-side: The first cell specifies a relevant event-type in the study. The second cell specifies the trigger code that should be sent for that event-type. This code can be described in decimal format (for human readability, and also used by some experimental software) and binary format (the actual trigger code that is to be sent).
- Receiver-side: The third cell specifies the planned marker description that should be obtained when the trigger code (specified in cell 2) is decoded. When using the BrainVision Recorder software, the rules for the trigger-to-marker decoding is specified by the Digital Port Settings (discussed above).
Table 2: Example template for a trigger plan. The entries in the table under Event type and Planned marker description are only shown for illustration purposes.
Sender | Receiver [Digital Port Settings] |
|
---|---|---|
Event type | Send trigger code [decimal (binary)] |
Planned marker description |
Display of green triangle | ? | E 1 |
Display of red square | ? | E 2 |
…. | .. | …. |
… | … | … |
Pressing of ‘M’ button | ? | … |
You can prepare a one-to-one trigger plan for your study by completing the above template table with information specific to your study, as follows:
- In column Event Type, list all event-types that require a trigger-based marker in your experiment.
- Fill in columns 2 and 3 with validated pairs of trigger codes and markers that support a one-to-one mapping between event-types and markers. How can this be done? We will show you in the next section.
When a one-to-one trigger plan has been completed:
- The validated trigger codes can be used in the control software to generate trigger signals during the experiment.
- When troubleshooting the trigger pipeline, the validated trigger codes can be ruled out as a source of errors.
We next demonstrate how to find validated trigger codes and markers.
How to find validated trigger codes for a one-to-one trigger plan
In this section, we provide three examples (of increasing complexity) of how to find one-to-one mappings between trigger codes and markers for different configurations of the Digital Port Settings.
Example 1: All bits are enabled and have the same type
Our first example is for the Digital Port Settings configuration shown in Table 3. In this 8-bit configuration, all bits are enabled (Column 2) and have been modified to have the same bit-type (Column 3), namely, Event.
Table 3: Example configuration of Digital Port Setting. All 8 bits are enabled and have the same type “Event”.
Bit | Enabled | Type |
---|---|---|
0 | ☑ | Event |
1 | ☑ | Event |
2 | ☑ | Event |
3 | ☑ | Event |
4 | ☑ | Event |
5 | ☑ | Event |
6 | ☑ | Event |
7 | ☑ | Event |
The binary-to-decimal decoding with this configuration is shown in Table 4 for an example trigger code 0011 0000 (decimal: 48). The resulting marker is E 48, where 48 is the outcome of binary-to-decimal conversion (shown in Table 4) and E is the first letter of the bit-type Event. The numeric value of the marker (i.e., 48) matches that of the received trigger code (i.e., 48).
Table 4: Binary-to-decimal conversion (all bits enabled, all same type). The trigger value (shown in red, column 1) at each bit position k (column 3) is multiplied by 2k (column 4, 5). The multiplication outcomes (Column 6) are summed across all positions to obtain the decimal representation of the binary code.
Receiver input | Binary to decimal conversion | ||||
---|---|---|---|---|---|
Received trigger code |
Bit number (hardware) |
Bit mask (position for decoding) |
Power of 2 | Multiplication | Outcome |
0 | 0 | 0 | 20 | 0 x 20 | = 0 |
0 | 1 | 1 | 21 | 0 x 21 | = 0 |
0 | 2 | 2 | 22 | 0 x 22 | = 0 |
0 | 3 | 3 | 23 | 0 x 23 | = 0 |
1 | 4 | 4 | 24 | 1 x 24 | = 16 |
1 | 5 | 5 | 25 | 1 x 25 | = 32 |
0 | 6 | 6 | 26 | 0 x 26 | = 0 |
0 | 7 | 7 | 27 | 0 x 27 | = 0 |
SUM = 48 |
Consequences for one-to-one mapping
Figure 5 shows all possible trigger codes (i.e., from 1 to 27) and the corresponding decoded markers for the above configuration of the Digital Port Setting. This figure was created using the trigger2marker tool, which simulates the decoding behavior of the Digital Port Settings for a defined configuration.
Applying the three criteria for a one-to-one mapping, we see that:
✓ Every trigger code is associated with a corresponding marker.
Why? Every non-zero trigger code (left matrix) is associated with a non-zero marker (right matrix).
✓ Every trigger code (left matrix) is associated with a unique marker (right matrix).
Why? For all 255 trigger codes, the numeric value xxx (e.g., 89) is decoded to produce a marker Exxx (i.e., E 89).
✓ Every marker (right matrix) is associated with a unique trigger code (left matrix).
Why? There are 255 unique markers, and each marker Exxx is uniquely associated with a trigger code xxx.
Thus, there is a one-to-one mapping between the full set of trigger codes and decoded markers.
Figure 5: Trigger code to marker mapping (all bits enabled, same type). This figure was generated using the trigger2marker tool. The matrix on the left lists all 255 trigger codes (in decimal format for readability). For a trigger code at row i, column j (left matrix), the corresponding decoded marker is shown at the same position in the matrix on the right (without the prefix “E”). Red circles (and text boxes) highlight selected trigger codes and their markers. This information is obtained interactively when using the trigger2marker tool, by clicking within the cell of interest. The red arrows between these trigger/marker pairs is for illustration only. The color variation between cells are for visualization.
For your trigger plan
When all trigger signals are sent by a single sender, the configuration shown in Table 3 (all bits enabled with the same type) provides high flexibility to select trigger codes for your trigger plan.
- If your study has N event-types (where N is ≤ 255), then use the full listing in Figure 5 to select N unique non-zero trigger codes (with the associated markers).
- Assign each selected trigger code and its marker to one event-type in the trigger plan table.
- The completed trigger plan supports a one-to-one map between event-types and markers.
We recommend using this configuration for the Digital Port Setting, especially when all trigger signals are sent by a single device (as in Figure 2).
Example 2: All bits have the same type but some bits are disabled
Certain special scenarios might require one or more bits of the Digital Port Setting to be disabled. This modification has substantial consequences for a one-to-one mapping. To illustrate these consequences, an example configuration is shown in Table 5, which is identical to Table 3 above but with one bit disabled. For illustration purposes, we have disabled bit number 3.
Table 5: Example configuration of Digital Port Setting. All bits have the same type and bit 3 is disabled.
Bit | Enabled | Type |
---|---|---|
0 | ☑ | Event |
1 | ☑ | Event |
2 | ☑ | Event |
3 | ☐ | Event |
4 | ☑ | Event |
5 | ☑ | Event |
6 | ☑ | Event |
7 | ☑ | Event |
With this configuration, decoding the example trigger code 0011 0000 (decimal: 48) results in the marker E 24 (as shown in Table 6). This is different from the marker E 48 obtained when all bits were enabled (Table 3).
Table 6: Binary-to-decimal conversion (bit 3 disabled, all same type). The display conventions are as in Table 4. The disabled bit leads to a reassignment of bit positions for decoding (column 3, highlighted in purple). NaN = not a number.
Receiver input | Binary to decimal conversion | ||||
---|---|---|---|---|---|
Received trigger code |
Bit number (hardware) |
Bit mask (position for decoding) |
Power of 2 | Multiplication | Outcome |
0 | 0 | 0 | 20 | 0 x 20 | = 0 |
0 | 1 | 1 | 21 | 0 x 21 | = 0 |
0 | 2 | 2 | 22 | 0 x 22 | = 0 |
0 | 3 | NaN | – | – | – |
1 | 4 | 3 | 23 | 1 x 23 | = 8 |
1 | 5 | 4 | 24 | 1 x 24 | = 16 |
0 | 6 | 5 | 25 | 0 x 25 | = 0 |
0 | 7 | 6 | 26 | 0 x 26 | = 0 |
SUM = 24 |
Disabling a bit does NOT mean that the disabled bit is set to zero during decoding. Instead, the positions of the enabled bits are reassigned to ignore the disabled bit, as shown schematically in Figure 6.
Figure 6: Effect of disabling bits. For decoding, bit positions are reassigned to only include enabled bits (grey numbers) as shown for two example configurations (left: bit 3 disabled, right: bit 2 disabled). Disabling specific bits affects receiver-side decoding but not the sender. Therefore, the sender can send different trigger codes that would still be decoded to the same value. Left: 9 and 11 are decoded as 5, Right: 9 and 13 are decoded as 5 (# = disabled bit).
Consequences for one-to-one mapping
Figure 7 shows all the possible trigger codes (i.e., from 1 to 27) and the corresponding decoded markers for the above configuration. For this full set of trigger codes, two criteria for a one-to-one mapping are violated:
x Every trigger code is NOT associated with a marker (there are missing markers)
Why? Due to the disabled bit, certain trigger codes will not produce a corresponding marker. As shown in Figure 7, trigger code 0000 1000 (decimal: 8) has a 1 at the ignored bit position 3 and zeros at all other positions. Therefore, ignoring bit 3 during decoding would result in a trigger code with only zeros, which would not be decoded into a marker. Importantly, this missing marker is due to the logic of decoding rather than a hardware issue.
✓ Every trigger code (left matrix) is associated with a unique marker (right matrix), although only when we exclude the special case of the trigger code 8 described above.
x Every marker (right matrix) is NOT associated with a unique trigger code (left matrix) (there is a many-to-one mapping)
Why? Different trigger codes can produce the same marker (see Figure 6). For example, the trigger codes 0110 0001 (decimal: 97) and 0110 1001 (decimal: 105) have an identical pattern of 1s and 0s (blue font) except at the disabled bit position 3. Therefore, both trigger codes are decoded to produce the same marker E 49 (see Figure 7). In fact, there are only 127 unique marker values since every marker value is obtained with two different trigger codes. This can be seen in Figure 7, where the upper and lower halves of the marker matrix are identical.
However, there IS a valid one-to-one mapping for the restricted set of 127 trigger codes/markers highlighted by the solid black frames. This restricted set of trigger codes will vary depending on how many and which bits are disabled.
Figure 7: Trigger code to marker mapping (one bit disabled, all same type). The figure was generated using the trigger2marker tool. Trigger code 8 is decoded as 0 and is not associated with a marker. The set of trigger codes/markers shown with boxes with solid black frames have a one-to-one mapping. The dotted frames indicate duplicate trigger-code/marker mappings (many-to-one).
For your trigger plan
Typical usage scenarios do not require bits to be disabled. When it is unavoidable, the trigger plan can be completed by a careful selection of trigger codes, as follows:
- Identify the set of valid trigger codes for your specific Digital Port Settings by using the trigger2marker tool. If the number of event-types (N) is less than the available number of trigger codes, then
- Select N unique trigger codes from the values highlighted by solid black frames.
- Assign each selected trigger code and its marker to one event-type in the trigger plan table.
- The completed trigger plan supports a one-to-one map between event-types and markers.
- However, if there are more event-types than available trigger codes, consider alternative strategies to ensure a one-to-one mapping. For example,
- Can the disabling of bits in the Digital Port Setting be avoided or reduced?
- Can markers for certain event-types be created during analysis rather than with trigger signals during data acquisition?
Example 3: All bits are enabled but with different types
Trigger signals can be received from multiple independent devices. In these scenarios, it can be useful to assign different types to individual bits depending on their device origin. An example configuration is shown in Table 7, where 4 bits are assigned to the type Stimulus and 4 bits are assigned to the type Response.
Table 7: Example Digital Port Settings configuration. All 8 bits are enabled but have different types (either Stimulus or Response).
Bit | Enabled | Type |
---|---|---|
0 | ☑ | Stimulus |
1 | ☑ | Stimulus |
2 | ☑ | Stimulus |
3 | ☑ | Stimulus |
4 | ☑ | Response |
5 | ☑ | Response |
6 | ☑ | Response |
7 | ☑ | Response |
With this configuration, decoding the example trigger code 00110000 (decimal: 48) results in the marker R 3 (see Table 8). As shown in Table 8, bit positions are reassigned separately for each type
Table 8: Binary-to-decimal conversion (all bits enabled with different types). For each type, the bit positions are reassigned to ignore bits of other types (column 3 for Stimulus, column 4 for Response). The binary-to-decimal conversion is otherwise like the previous examples. Due to this type-based separation, one trigger code can result in more than one marker.
Receiver input | Binary to decimal conversion | ||||
---|---|---|---|---|---|
Received trigger code |
Bit number (hardware) |
Bit mask (Stimulus) |
Bit mask (Response) |
Multiplication (Stimulus) |
Multiplication (Response) |
0 | 0 | 0 | NaN | 0 x 20 | – |
0 | 1 | 1 | NaN | 0 x 21 | – |
0 | 2 | 2 | NaN | 0 x 22 | – |
0 | 3 | 3 | NaN | 0 x 23 | – |
1 | 4 | NaN | 0 | – | 1 x 20 |
1 | 5 | NaN | 1 | – | 1 x 21 |
0 | 6 | NaN | 2 | – | 0 x 22 |
0 | 7 | NaN | 3 | – | 0 x 23 |
SUM = 0 |
SUM = 3 |
Consequences for one-to-one mapping
Figure 8 shows all the possible trigger codes (i.e., from 1 to 27) and the corresponding decoded markers for the above configuration. For this full set of trigger codes, two criteria for a one-to-one mapping are violated:
✓ Every trigger code is associated with a marker.
Why? Since all bits are enabled, every non-zero trigger code will result in at least one marker.
x Every trigger code (left matrix) is NOT associated with a unique marker (right matrix)(i.e., there is a one-to-many mapping).
Why? For example, for trigger code 0011 1001 (decimal: 57), the bits assigned to the Stimulus type (orange) and the Response type (blue) are not all zeros. Therefore, both groups of bits are decoded to produce valid markers, namely, S 9 and R 3. Only a narrow range of trigger codes produce a single marker (either Sxxx or Rxxx) as highlighted by the solid black frames.
x Every marker (right matrix) is NOT associated with a unique trigger code (left matrix) (i.e., there is a many-to-one mapping).
Why? For example, the trigger codes 0011 0000 (decimal: 48) and 0011 1001 (decimal: 57) are identical for the bits positions of Response type (blue). Therefore, both trigger codes would produce the same marker R 3. Due to these symmetries, every marker value (e.g., R 3) is associated with 15 distinct trigger codes. As shown in Figure 8, each row of the Stimulus marker matrix has identical values, and each column of the Response marker matrix has identical values.
However, there IS a one-to-one mapping for the restricted set of 30 trigger codes/marker highlighted by solid black frames in Figure 8. This set of suitable trigger codes can differ depending on the number of types, the number of bits assigned to each type and their specific positions.
Figure 8: Trigger code to marker mapping (all bits enabled but with different types). The figure was generated using the trigger2marker tool. The display conventions are the same as in Figure 5. The set of trigger codes/markers shown with solid black frames have a one-to-one mapping.
For your trigger plan
Remember that bit-types do not refer to event-types (see Note box above). Using multiple bit-types is not required when all trigger signals are sent by a single sender. When there are multiple senders, the trigger plan can be completed by a careful selection of trigger codes. To complete your trigger plan:
- Identify the set of valid trigger codes for your specific Digital Port Settings by using the trigger2marker tool. If the number of event-types (N) is less than the available number of trigger codes, then
- Select N unique trigger codes from the available trigger codes.
- Assign each selected trigger code and its marker to one event-type in the trigger plan table.
- The completed trigger plan supports a one-to-one map between event-types and markers.
- If there are more event-types than available trigger codes, consider alternative strategies to ensure a one-to-one mapping. For example,
- Is the use of different bit types necessary?
- Can the number of bits assigned to each type be changed?
- Can markers for certain event-types be created during analysis rather than with trigger signals during data acquisition?
Conclusion
Designing a one-to-one trigger plan is a simple yet systematic “paper and pencil” strategy that can be performed before data acquisition. It can provide you with usable trigger codes as well as help you make strategic decisions about the trigger pipeline and how to configure the Digital Port Settings for your data acquisition. Be sure to check out our Support & Resources and Solutions pages for further information and ideas on designing effective trigger pipelines.