Page 1 of 1

RoundTrip Data

Posted: 17 Jan 2020, 17:16
by ebjorklund

Is there a way to extract RoundTrip data from existing data? Or is this only possible through running BCI2000 with SignalGenerator and FilePlayback?

Thank you.

Re: RoundTrip Data

Posted: 20 Jan 2020, 10:09
by mellinger

details of timing information are explained here: ... nce:Timing

Timing information is based on a number of time stamps that are contained in data files in form of BCI2000 states.
Most importantly, the SourceTime time stamp is set when acquiring a block of data, and the StimulusTime time stamp is set when data have been processed by BCI2000, and screen content has been updated. There is little difference between the StimulusTime stamp, and the time when BCI2000 begins waiting for the next data block. Thus, the difference between SourceTime stamp and StimulusTime stamp is close to the Roundtrip time that you desire. The time stamp for roundtrip time is taken when BCI2000 begins waiting for the next block, but is not saved in the data file.

You could slightly modify the DataIOFilter in the source module in order to save this time stamp. Let me know if you need assistance for how to do this.

Note that any timing information you obtain from running the FilePlayback module refers to the playback session, not the original recording session. Therefore, using FilePlayback is not a way to read out information about original roundtrip data.


Re: RoundTrip Data

Posted: 20 Jan 2020, 13:51
by ebjorklund
Hi Jürgen,

I would greatly appreciate assistance on how to set that up. Sounds relatively straightforward but I have limited experience in C++ help would be welcome so that I don't spin my wheels unnecessarily.

Thank you,

Re: RoundTrip Data

Posted: 21 Jan 2020, 10:37
by mellinger
Hi Erik,

you need to perform the following changes to src/shared/modules/signalsource/DataIOFilter.cpp.
Line numbers are for the original file, they will change as you perform the changes.
Line 236: Insert a line

Code: Select all

"Roundtrip 16 0 0 0",
Line 721: Insert a line

Code: Select all

State("Roundtrip") = functionEntry;
In the recorded file, roundtrip time should then be the difference between the Roundtrip state, and the previous block's SourceTime stamp.

Let me know if it works for you.