Equipment Latencies

Introduction

This webpage has information regarding the latencies associated with various lab equipment in SCCN.

Each piece of equipment involved in MoBI experiments takes some amount of time to deliver or receive its data. Furthermore, given the high CPU and memory load necessary for real time MoBI experiments, often times equipment is driven by more than one computer. Thanks to labstreaminglayer (LSL -- by Christian Köthe), we have a convenient and reliable way to coordinate the timing of events and data streams; but, in order to line everything up, it is necessary to understand how long it takes for information to go in or out of every piece of equipment that the lab uses.

Measured latencies are also gathered in a spreadsheet below. Whenever possible, these latencies are accounted for in software so that experimenters will not have to worry about them when running their analyses. Sometimes, however, devices don't behave as reliably as one would like and special care must be taken. Futrhermore, the latencies measured here are only for the equipment used in SCCN. The below procedures are given to indicate how similar measurements might be taken with other equipment that other labs may use in conjunction with labstreaminglayer. The pages below outline the procedure and results of tests made on equipment and example for testing and analysis are provided.

Procedure for adjusting latencies

The xdf loading function (eeg_load_xdf.m) is sensitive to a marker in the xdf header that can be adjusted to compensate for latency or lead time. This is how synchrony is acheived. Unfortunately, many devices behave differently depending on what mode they are in. Every effort is made to include these latencies in the data gathering process. However, it is wise to check what, if any, lag times are subtracted from LSL timestamps by the loading procedure.

This can be done with the XDFBrowser application (part of the suite of LSL apps). Check for lines in the stream headers like:

<desc>
  <synchronization>        
<offset_mean>0.00772</offset_mean>
</synchronization> </desc>
In this case when this stream is loaded into EEGlab or MobiLab, 7.72ms will be subtracted from every timestamp. This block of code can be edited and saved into the xdf file directly (again, using XDFBrowser). Be careful. XDFBrowser is a crude program and if the syntax is not correct, the meaning of the xml markup will be lost.

This work was begun by Matthew Grivich and continued by David Medine.

Procedures and Results

Spreadsheet

An up to date spreadsheet accumulating the results of these experiments can be found here. Click here to download it in xlsx format.