Adding secondary input into BCI2000 signal

Forum for software developers to discuss BCI2000 software development
Locked
boulay
Posts: 382
Joined: 25 Dec 2011, 21:14

Adding secondary input into BCI2000 signal

Post by boulay » 23 Feb 2014, 15:55

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

Thanks,
-Chad

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

Re: Adding secondary input into BCI2000 signal

Post by mellinger » 28 Sep 2020, 07:35

Sorry for the late response. This sounds like a use case for an Input Logger component:
https://www.bci2000.org/mediawiki/index ... put_Logger

Locked

Who is online

Users browsing this forum: No registered users and 5 guests