In the provided script, we use MNE-Python to load the XDF file and compare time stamps of the hardware triggers, LSL markers, and the Photo Sensor signal. Please download the analysis script and the XDF files (see box below) that were created with the previously explained setup. There is one file for LiveAmp (“TimingTest_LA.xdf”) and one for actiCHamp/actiCHamp Plus (“TimingTest_aC.xdf”), the main difference being the different signal delays, which you will notice after running the analysis.
Before you can run the script, you need to make sure to install the following packages, for example with a command such as pip install mnelab pyxdf PySide2 rich. Make sure you install at least MNELAB version 0.6.6.
Executing the script (for example in Spyder) will result in a table with some statistics and a figure (Figure 4), demonstrating the nature of the delays for a LiveAmp (left) and an actiCHamp/actiCHamp Plus (right) example. We analyze the delays between photo signal and hardware triggers, between photo signal and LSL markers, and between hardware triggers and LSL markers. The delay between photo signal and hardware trigger is almost the same for both amplifiers, which is to be expected because it is independent from the acquisition device. The delay of ~18 ms indicates that the square flashes only after a full screen update cycle at 60 Hz. The delay between hardware triggers and LSL markers is the main difference between the two recordings. It shows that the LSL stream from LiveAmp has a higher latency (~13 ms) than the one from actiCHamp/actiCHamp Plus (~3 ms). This difference also results in the longer delay between time stamps of the photo signal versus LSL markers, on average more than 30 ms for LiveAmp. These additional 30 ms should be considered when LSL markers are used as starting points for epochs containing events related to the actual flashing of the screen. In chronological order, the LSL markers appear first, followed by the hardware triggers, and then the screen updates come last.
Figure 4: Delays over 300 trials between the three events: onset of the photo signal, hardware triggers, and LSL markers. LiveAmp on the left and actiCHamp (Plus) on the right.
Please feel free to adjust the script to your needs and test with other files you recorded yourself.