ERPLAB Studio: Shift Event Codes - ucdavis/erplab GitHub Wiki

The Shift Event Codes panel is used to shift event codes to account for a fixed delay between the event code and the corresponding stimulus.

In almost all LCD monitors, there is a substantial delay (typically 10-30 ms) between the time the video signal is generated by the computer and the appearance of the stimulus on the screen. This leads to a delay between the event code and the actual stimulus onset. There is no way for the computer to know about this delay. It must be measured using a photosensor (contact the manufacturer of your EEG system for instructions). There may also be delays for other kinds of stimuli.

This panel allows you to shift the stimulus event codes to align them with the actual time of the stimulus (assuming you know the length of the delay). You list the event codes to be shifted in the Event codes box. Typically, this would be the event codes for the stimuli, not the event codes for the responses. If you have different delay lengths for different stimuli, you can run the routine multiple times, once for each delay length.

Shift Event Codes

You enter the amount of the needed shift (in milliseconds) in the Timeshift box. A positive value will cause the event code to be shifted rightward/later in time (which is the typical case, in which the original event code was X ms prior ./Studio_Manual/Images-Panelsto the actual stimulus and needs to be shifted in time by +X ms). A negative value will cause the event code to be shifted leftward/earlier in time (which could be used if the stimulus occurred prior to the event code for some reason).

The routine will need to round if you specify a Timeshift value that is not exactly equal to the time between samples. We recommend rounding to the first sample before the Timeshift amount (Round to earlier time sample). For example, if you have a sample every 4 ms (i.e., a 250 Hz sampling rate), and you specify a +15 ms time shift, there will be sample points at +12 and +16 ms. If you specify Round to earlier time sample, the event code will be shifted to the point at +12 ms. Although it may seem counterintuitive, this will tend to shift the event code closer to the actual time of the event than rounding to the nearest time sample (which would be at +16 ms in this example). This is because the discrete sampling every 4 ms will lead to a rightward (positive) error in the time at which the event code was initially recorded.

⚠️ **GitHub.com Fallback** ⚠️