Inhaltsverzeichnis

Age of sample: BrainVision EEG recording with LSL

Copyright: Ole Traupe (2017).

Motivation

LSL syncs multi-source multi-modal (multi-channel) time series data on our lab network (https://github.com/sccn/labstreaminglayer). However, it cannot account for anything it does not know. Most importantly, LSL does not know how old those samples are, i.e. how long it took from the occurrence of e.g. a scalp potential to time-stamping its digitized sample. We have to measure this „age of sample“ ourselves in order to compensate for it in the data to enable markers make useful statements about experimental timing.

EEG hardware

Here we look at the age of the EEG samples recorded with our BrainVision equipment, i.e. our active ActiCap electrodes (incl. control boxes), our wireless MOVE EEG transmission system (senders and receivers; optional) and our BrainAmps DC (incl. USB adapters).

Test setup and procedure

The test involves sending electrical impulses (n=3600, 50 ms average recurrence) from a low-latency interface (the parallel port, controlled via MATLAB) of a PC directly to our ActiCap EEG electrodes. Impulse amplitude is limited to ~150 mV via a voltage divider (ratio: 1:20). „At the same time“ this PC sends „LSL makers“ (string formatted irregularly sampled time series data) over the network, the „ground truth“ in this setup. Another PC runs the BrainVision Recorder (gathering data from the USB adapters), the BrainVision LSL app („converting“ these data samples into an LSL stream), and LSL's LabRecorder recording the „EEG data“ (electrical impulses) and the markers sent from the first PC. The age of sample then is given by the time stamp difference of the markers and the corresponding impulse flanks in the BrainVision data.

The low latency of the parallel interface was confirmed earlier by sending and receiving electrical impulses from one parallel port to a second parallel port on the same PC and by measuring the time from „immediately“ before to „immediately“ after this transmission (controlled via MATLAB).

Low latency and accuracy of the LSL markers were confirmed earlier by sending them over the network in parallel to the transmission of electrical impulses from one PC to another via a parallel port connection (also controlled via MATLAB).

Notions like „at the same time“, „low latency“, and „immediately“ refer to time spans far below of what is of interest here (i.e. „How many milliseconds…?).

PC and network specifications

The sending PC was equipped with an Intel Core i5 3570 Quad-Core processor (@ 3.4 GHz) and 16 GB of RAM. The recording PC was equipped with an Intel Xeon E5 2620 Hexa-Core processor (@ 2.0 GHz) and 64 GB of RAM. Both machines used only a small fraction of their resources during the test. Both were equipped with a 1 Gbit/s ethernet interface and were running in 1 Gbit/s mode (verified).

Software versions

Experience shows that „device latency“ depends on a lot of factors. Virtually all parts of the signal processing cascade contribute to it, be it hard- or software. The age of sample can be seen as an integrated property of all the „functional“ parts (ignoring electrical conduction, i.e.) of the contributing lab equipment as it is at the time of the measurement.

The sending PC employed MATLAB R2012b and the low-level interface controlling driver „io64“ (inpoutx64.dll) ver. 1.20.

The recording PC ran the BrainVision Recorder ver. 1.20.0601, the BrainAmpSeries and the BrainVisionRDA LSL apps ver. 1.10, and LSL's LabRecorder ver. 1.12b (Windows executable).

Varied parameters

As we don't use one and the same setup all the time, this test varied those parameters which should have the strongest practical implications. Those are:

  1. Signal transmission from the ActiCap Control Boxes to the BrainAmps: WIFI (MOVE) vs. tethered (standard ribbon cables)
  2. LSL sample collection: from the BrainVision Recorder's RDA interface (BrainVisionRDA) vs. „directly“ via querying the USB adapters (BrainAmpSeries)
  3. Sampling rate: 5000 vs. 1000 vs. 250 Hz
  4. Channel count: 128 vs. 32 channels

Test results

The following measurements were taken (each series of time stamp differences is shown in 3 different scales: 100 ms range, 10 ms range, and auto-scale):

a) tethered_direct_5000_32: 50.6 ms

b) tethered_direct_5000_128: 49.8 ms

c) tethered_rda_5000_32: 59.0 ms

d) tethered_rda_5000_128: 60.5 ms

e) tethered_rda_1000_32: 59.5 ms

f) tethered_rda_1000_128: 59.8 ms

g) tethered_rda_256_32: 66.9 ms

h) tethered_rda_256_128: 67.6 ms

i) wifi_rda_5000_32: 63.5 ms

j) wifi_rda_5000_128: 65.1 ms

k) wifi_rda_1000_32: 64.0 ms

l) wifi_rda_1000_128: 66.5 ms

Conclusions

Several findings seem noteworthy and are presented here in the order of impact.

Following these conclusions, the „worst case“ scenario would be the RDA access (60 ms) of 160 EEG channels (+ 1-2 ms) sampled with 256 Hz (+ 8 ms) and transmitted via the MOVE system (+5 ms) with an age of sample of up to 75 ms, whereas our „standard setup“ of RDA access of 160 channels sampled with 1000 Hz transmitted via MOVE defaults to a value of < 67 ms.

Problems

Several problems were encountered during data acquisition and are addressed briefly.

Warnings

The following warnings must be issued with regard to the presented results and conclusions.