Page 1 of 1

Adding secondary input into BCI2000 signal

Posted: 23 Feb 2014, 15:55
by boulay
Does anyone know of any sample code for taking another input source, like a data glove, a cursor (mouse), or an infrared positional tracker, and storing its data in the SIGNALS in a BCI2000 dat file?

I recognize there'd be some synchronization problems, but the alternative of 1 value per block (i.e., in states) won't suffice. I guess I could also record those other sources independently and include in each source some synchronization signals, but that's actually difficult to do for the particular hardware I'm looking into. Also, I need to update part of the feedback based on the positional tracker or touch screen, so it makes sense to have that information in BCI2000.

If you don't know of any sample code, please take a look at the following and let me know if you see any pitfalls I'm missing:

During initialization & Preflight
-Set the signal output properties to include the added channels (e.g., x, y, z, joint_angle_1, etc)
-Initialize any buffers these other 'sources' will use
During process
-Get the last N samples from the device|buffer, where N is the number of samples that corresponds to a brain signal block period
-Sometimes the device might not have N samples available, I don't think I can wait until it does... or can I?
-Up- or down-sample (filtering as needed) to match the brain signal sampling rate
-Add them to the signal


Re: Adding secondary input into BCI2000 signal

Posted: 28 Sep 2020, 07:35
by mellinger
Sorry for the late response. This sounds like a use case for an Input Logger component: ... put_Logger