Page 1 of 1

System Latency using AmpServer and E-Prime

Posted: 29 Mar 2020, 09:45
by emanuellorenz
Hi there,

I currently have the following system running:

Amplifier: EGI NA300
Source Module: AmpServerPro ADC
Signal Processing Module: FieldTrip Buffer
Signal Processing: MATLAB
Stimulus Generation: E-Prime 2

So basically everything is communicating via TCP/IP except, the stimulus triggers are sent via UDP to the Operator module of BCI2000. My question now is, is there any smart way to measure the latency of the system? So how to align the trigger with the EEG signal.

Therefore I need to know the latency of the stimulus presentation and the UDP connection, right? The TCP/IP should have time-stamps, right?

Hope some can help me.

All the best,


Re: System Latency using AmpServer and E-Prime

Posted: 30 Mar 2020, 08:38
by mellinger
Hi Emanuel,

there is some information about BCI2000 system timing here: ... nce:Timing

BCI2000 tries to obtain information about system timing as far as it can. Its software perspective is limited, however. To measure the latency between E-prime's trigger as it exists in the E-prime software, and the corresponding event as recorded in BCI2000, you would have to connect a signal generator to E-prime, and to an amplifier input channel, and then measure the time difference between the signal edge as it shows up in the EEG channel, and the point in time where the event from E-prime is recorded.

Alternatively, if E-prime is running on the same machine as BCI2000, you may directly compare the value of E-prime's time stamps to BCI2000's SourceTime timestamp, taking care to use only the last 16bits of an E-prime time stamp after converting it to milliseconds.


Re: System Latency using AmpServer and E-Prime

Posted: 30 Mar 2020, 11:07
by emanuellorenz
Thanks Jürgen.

I will try the first option as E-Prime has to run on a separate system in our case. I will talk with EGI about the requirements of the amplifiers signal input and the circuit I will use to record the trigger. Hope I won't forget to post it here. ;)

All the best,