Questions about OpenBCI Raw Data Recordings using Daisy+Cyton
Hello,
I am using the Daisy/Cyton and v5.2.1 of the OpenBCI GUI. I am at a bit of a loss for how I could convert the Raw OpenBCI text files generated from data sessions into useable data. I've seen in other forum posts that a DC offset is included in the values listed under each channel and needs to be removed, but even when I do that the values do not seem to reflect the expected range of about 0-25 uVrms (as indicated in time series graphs). I've tried to remove the DC offset in MATLAB and EEGLAB whereupon the values are still very large as seen in the images below.
Also the samples are listed in intervals of 2 strangely, and seem to occur at 128 sps rather than the 125 sps commented in the text file header (I counted each row between an interval from 0.0 to 254.0). It seems that this does not match with the Cyton/Daisy sampling method outlined in the documentation (which also mentions a scale factor being used, I've tried to implement this in the image below) where odd numbered samples are from the Cyton and even number samples are from the Daisy: https://docs.openbci.com/Cyton/CytonDataFormat/
I would also like to mention that putting the files in playback mode does give me the expected signals, so somehow the values do reflect uVrms I'm just not sure how. Also I've been reliably observing the FFT spike at 10 Hz when I close my eyes so it appears the electrodes work fine. I've attached one of my txt files below, it was a 1 minute recording of me moving/not moving my right hand in 5 second intervals (I'm trying to observe event-related desynchronization for motor imagery).
Would anyone have any insight into this? Perhaps I should look into Brainflow or BDF+ data recording? Is there something I'm missing/not doing right?
Thank you.
EEGLAB time series with "remove DC offset" option toggled on:
Matlab bandpass from 0.5-60 Hz at 125 sampling rate:
Matlab bandpass from 0.5-60 Hz at 128 sampling rate with scale factor included:
Comments
Update:
I still don't know how to convert the RAW data values, but I've found an alternative. Instead of using the txt files, I use the networking widget/LSL with the TimeSeriesFilt option selected to stream the data directly to a MATLAB variable. Setting up MATLAB, I downloaded the liblsl-Matlab library from here: https://github.com/labstreaminglayer/liblsl-Matlab/releases
then modified the script from the documentation (https://docs.openbci.com/Software/CompatibleThirdPartySoftware/Matlab/) to accumulate each sample in a matrix variable (also under the library directory liblsl-Matlab>>examples>>ReceiveData.m ). I've attached this code below in a txt file. The TimeSeriesFilt data is straightforwardly representative of the signal as uV amplitude is recorded (see image below, timeseries plot matlab vs openbci gui). Also the TimeSeriesRaw option records the same information as what is generated in the txt files, within a tolerance of +/- .004 (based on comparison between my data in the txt files vs matlab variables).
I'll be moving forward with this method, but I'd also like to verify my process for motor imagery ERD. I've attached the MATLAB code for plotting ERD where I calculate time in seconds, notch filter the signal at 60 Hz (american), obtain mu and/or beta frequencies via bandpass, calculate instantaneous power of the signal by squaring all samples, then plot power of a single channel vs. time in seconds. I've attached the plot image below. I don't necessarily see the decrease in power that supposedly happens during an interval when a limb moves (the procedure for this recording was to start/stop moving the right hand in a repetitive flicking motion in 5 second intervals, so ideally I would see lower power in intervals 5-10s, 15-20s, 25-30s etc). Any recommendations or insight into this?


Hi Zachary,
I'm unclear how you are processing the raw CSV recording files. All you need to do to remove the DC offset is have a filter of any type, cut off frequencies below about .5 Hz. The CSV units are microvolts. As you can see without filtering the values are in the millivolt range because of the slowly moving offset. It is also advisable to use a notch filter at your local mains frequency.
So for example combining a bandpass say from .5 Hz to 45 Hz, with a 60 Hz notch (US) or 50 Hz notch (elsewhere) should get you in the proper range.
The GUI display graphs have been pre-filtered to get into range. You can adjust these filter values, however the recording file is always raw with NO filtering. You should not need to go through LSL / Matlab to obtain good quality recorded data.
I can't comment on your motor imagery setup. But in general, MI is much less user friendly than other BCI paradigms such as SSVEP or cVEP. These latter systems allow many more choices for the operator than just simple left/right.
https://openbci.com/forum/index.php?p=/discussion/3894/mindaffect-eeg-cvep-bci-robot-control-tutorial-by-pyotr-vozniak
William
A bandpass from .5 Hz to 60 Hz (you mention in one of your comments), is not sufficient to knock out the mains amplitude, which is huge. Bandpass filters have skirts with 'rolloff', and do not act sharply at the edges of the bandpass. This is why a separate notch is always advised in addition to your primary bandpass.
You mention 'scale factor' a couple times. The recording values are always in microvolts, so you do not need to apply any of your own scale factors. Similarly for the streams.