ChrisVeigl / BrainBay

Open Source Biofeedback Software
http://brainbay.lo-res.org
Other
163 stars 52 forks source link

OpenBCI with 16 channels (Cyton+Daisy) #27

Closed nickilanger closed 4 years ago

nickilanger commented 4 years ago

Dear Chris,

First of all, thank you for creating BrainBay! It's fantastic.

I would like to describe my issue:

I've purchased recently the OpenBCI Cyton (version v3-32) and the Daisy Module to record with 16 channels. I've tested my set up in the OpenBCI software and it works. However, I would like to use BrainBay to be more flexible and modular.

Unfortunately, I can't get the signal for 16 channels, when I choose the EEG amplifier from BrainBay: OpenBCI (16 channel EEG). Also no signal from the accelerator. It seems that the connection is not established (no red light on the USB Dongle).

However, if I chose the EEG amplifier: OpenBCI (8 channel EEG) and can establish the connection (red light on the Dongle) and get a Signal from 8 electrodes. So, it seems that there's an issue with the setting in the EEG amplifier: OpenBCI (16 channel EEG).

I've used both time the same port (COM4) and the same Baudrate.

Do you have any idea, if there's a bug or I'm doing anything wrong.

Thank you very much for your help and all the effort to create BrainBay!

Best,

Nicolas

ChrisVeigl commented 4 years ago

hi nicolas! thanks for reporting the issue! i do not have the 16-chn version here - so it will be difficult to find the reason... do you see any log output or error messages (in particular if you start brainbay from a console window with parameter -d : brainbay.exe -d) ?

wjcroft commented 4 years ago

Chris and Nicholas, hi.

Here is the issue with the OpenBCI BrainBay driver, 16 channel mode. At the time that code was written (by me), neither the hardware NOR the specifications for the Daisy output stream had yet to be released. So I had assumed that the 16 channel stream would just be an obvious extension of the 8 channel packet format, but holding 16 channels. I was obviously wrong.

The 16 channel format is considerably more complex, and described here.

https://docs.openbci.com/docs/02Cyton/CytonDataFormat#16-channel-data-with-daisy-mdule

The radio packets ALTERNATE and further need to be averaged in a certain way. I believe the sentence in that link that discusses UP SAMPLING to 250 Hz is actually wrong. The data stream for 16 channels only runs at 125 Hz, but does have the unusual averaging mentioned.

I don't have the time at the moment to mod the driver, Nicholas or Chris feel free to jump in.

Frankly it's unconventional to use 16 channels in band based neurofeedback applications. Unless you are trying to do QEEG (typically 19 channels) or source localization. Neither of which is BrainBay's specialty. Those types of applications require much additional complexity and signal processing.

There might be a Daisy parser in one of the other Cyton data parsing libraries. For example here is a Python version, showing the averaging,

https://github.com/OpenBCI/pyOpenBCI/blob/master/pyOpenBCI/cyton.py

Apologies, and carry on... :-)

William

ChrisVeigl commented 4 years ago

thanks William for the detailled answer! I agree that brainbay is not the best choice for processing 16 chn EEG recordings. I won't be able to write a driver for the 16 chn version in the near future ... (although i'd find it great if someone finds time and motivation to do it)

should we remove the 16-chn version from the menu?

wjcroft commented 4 years ago

Chris, yes, there might be some way of disabling the choice of the 16 channel option, WITHOUT disabling all the underlying code that allows two entry points to the driver and user interface sections. That 16 channel code could be utilized when and if the Daisy is properly decoded from the alternating radio packets.

I would not do an entirely new release of BrainBay just for that removal. But could be appropriate to bundle with your next release.


ACTUALLY, here's another avenue to possibly even better Daisy support: I know you were considering previously offering the ability to input LabStreamingLayer streams. If that was available, the OpenBCI GUI could stream out 16 channels as an LSL stream. A further advantage of LSL in that case, is that a Wifi Shield could be utilized that could sample 16 channels at the full 250 or even 500 Hz.

As I mentioned above, running the Daisy with the Cyton dongle results in an alternating-packet averaged data stream at the effective 125 Hz sample rate. Kind of on the low side for sample rates that one typically finds.

nickilanger commented 4 years ago

Hi Chris, Hi William,

Thanks a lot for your answers and suggestion. I agree with William. The LSL stream would be probably to ideal solution as it would also solve the issue with the impedance measurement (as it would be done in the OpenBCI GUI). For now, i will use the 8 channel solution, which works fine for most of my purposes.

Best,

Nicolas

ChrisVeigl commented 4 years ago

yes - the LSL integration is planned. it would be great - the question is when there will be time to implement it ...