System Latency using AmpServer and E-Prime

Forum for software developers to discuss BCI2000 software development
Post Reply
emanuellorenz
Posts: 10
Joined: 21 Aug 2019, 07:47

System Latency using AmpServer and E-Prime

Post by emanuellorenz » 29 Mar 2020, 09:45

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,

Emanuel

mellinger
Posts: 1208
Joined: 12 Feb 2003, 11:06

Re: System Latency using AmpServer and E-Prime

Post by mellinger » 30 Mar 2020, 08:38

Hi Emanuel,

there is some information about BCI2000 system timing here:
https://www.bci2000.org/mediawiki/index ... 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.

HTH,
Jürgen

emanuellorenz
Posts: 10
Joined: 21 Aug 2019, 07:47

Re: System Latency using AmpServer and E-Prime

Post by emanuellorenz » 30 Mar 2020, 11:07

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,

Emanuel

Post Reply

Who is online

Users browsing this forum: No registered users and 5 guests