![]() ![]() ![]() The MNE-Python script for analyzing the data In chronological order, the LSL markers appear first, followed by the hardware triggers, and then the screen updates come last. 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. 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. It shows that the LSL stream from LiveAmp has a higher latency (~13 ms) than the one from actiCHamp/actiCHamp Plus (~3 ms). The delay between hardware triggers and LSL markers is the main difference between the two recordings. The delay of ~18 ms indicates that the square flashes only after a full screen update cycle at 60 Hz. 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. We analyze the delays between photo signal and hardware triggers, between photo signal and LSL markers, and between hardware triggers and LSL markers. ![]() Make sure you install at least MNELAB version 0.6.6.Įxecuting 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. 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.īefore 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. Please download the analysis script and the XDF files (see box below) that were created with the previously explained setup. 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. It is also recommended to select “EEG Channel” for the “LSL Trigger Output Style”. You can add EEG channels, but there is no need for them. It does, however, make a difference regarding the software you want to use for analyzing the data, as you will create an XDF file with LabRecorder and BrainVision data format with BrainVision Recorder.Įither way, make sure to specify one AUX channel for the Photo Sensor. It does not matter, as all the relevant information is only stored in the EEG stream. With this setup, you can record the data any way you want: You can use BrainVision Recorder, or you can use the amplifier-specific LSL connector (see an example for LiveAmp in Figure 2) and LabRecorder. You can also use a StimTrak that generates triggers out of the Photo Sensor signal and connect it to the TriggerBox, but we will assume that the analog signal from the Photo Sensor will be used to generate triggers in the analysis part later. Now, connect a Photo Sensor to an AUX input and put the sensor on the screen where the flashes appear (per default in the upper left corner). The TriggerBox connects directly with actiCHamp (Plus) and BrainAmp (via the BrainAmp USB 2 Adapter, BUA), or via the Sensor & Trigger Extension for LiveAmp. You can easily do this by connecting a TriggerBox to the computer that is running PsychoPy and connecting the TriggerBox output to your Brain Products amplifier. The main purpose of the script is to measure the delay between the time of the hardware trigger and the actual event, which is the flashing of the screen. This means, the triggers and markers are supposed to be sent immediately when the screen refreshes. Another important detail is that the trigger function, send_triggers, is called on flip with win.callOnFlip(send_triggers, ). Each time it goes black, the hardware trigger is reset to ‘0’ which is also sent as an LSL marker. Each time the square goes white, a ‘1’ is sent as a hardware trigger and as an LSL marker. In the for loop, the square toggles between black and white every 30 frames. In our example, we set this value to 30 frames, which means half a second for a display with a refresh rate of 60 Hz. After a waiting time of 10 s, we start a loop that lasts for the specified trial number. Then, we define the parameters for the square that flashes on the screen and open the LSL stream with all the required information. The PsychoPy script for running the experimentĪfter running the necessary imports for drawing and connecting to the TriggerBox, we define a function that sends hardware triggers to the serial ports and LSL markers at the same time. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |