Issues with OpenBCI EEG preprocessing pipeline or EEG recording process

XilTrgXilTrg France
edited July 2022 in Software

Hi,
I am currently working on visually evoked potentials visualization and am puzzled about the EEG signals and PSDs we get using different recording methods.
For instance, with the same subject, stimulus flickering at 5 Hz and preprocessing pipeline (Notch 50 Hz & 2-40 Hz band-pass filter), when using directly the OpenBCI GUI application we got pretty clear signals and peaks at 5, 10, 15 and 15 Hz (see image 1).
Image 1 (OpenBCI)

On the other hand, when using PyLsL (image 2) or BrainFlow (image 3) to use indirectly OpenBCI, we can still observe some kind of peaks at 5, 10, 15 and 20 Hz but in the form of plateaus, flattened and less pronounced (as if the data were smoothed or very noisy). Plus, their amplitudes are almost four times smaller.
Image 2 (PyLsl)

Image 3 (BrainFlow)

Could the difference between the peaks obtained via OpenBCI and the others be due to incorrect data preprocessing on our part (even though the same pipeline was used for the different methods)?
Or would there be additional preprocessing steps built-in by OpenBCI? - If so, would it be possible to get the details of this pipeline?
Otherwise, would you have any idea how to explain these differences?

Thank you for your help and advice.

Comments

  • wjcroftwjcroft Mount Shasta, CA

    Mentioning Richard @retiutut and Andrey @Andrey1994.

  • retiututretiutut Louisiana, USA
    edited July 2022

    Please provide more information about how the data was collected in the second and third screenshots, beyond what pieces of software were used. The OpenBCI GUI uses the BrainFlow backend (Java binding). I would say that the data is not being collected in a similar way, based on the photos. Please share scripts or links to Github repos containing precise method of data collection. LSL is a networking protocol, while BrainFlow interacts directly with OpenBCI hardware.

  • wjcroftwjcroft Mount Shasta, CA

    XilTrg, in addition to Richard's comment, it would be helpful to show the differences between the DSP filtering function calls you are using. For example, are you saying the filtering DSP in figure 1 (I assume applied to the CSV recording?), is identical to what you applied to the figures 2 and 3?

  • XilTrgXilTrg France

    Thank you for your feedbacks.
    Here is a link to the scripts we used to collect the EEG data and the three data sets: https://we.tl/t-qL22nB70V8.

    wjcroft, I am not sure I understand your question correctly. We applied the exact same basic preprocessing pipeline - including the filtering step, to the 3 collected data sets. The DSP filtering in figure 1 was indeed applied to the CSV recording.
    We used two functions provided by MNE-Python to filter the data and the calls were as follows:
    notch_filtered_eeg = raw.copy().notch_filter(freqs=50, picks=eeg_channels)
    notch_bp_filtered_eeg = notch_filtered_eeg.copy().filter(l_freq=2, h_freq=40)
    (The data were then epoched and figures 1, 2 and 3 were obtained from epochs.plot_psd(fmin=2, fmax=36) )

  • wjcroftwjcroft Mount Shasta, CA

    Richard @retiutut, any ideas? I'm somewhat stumped looking at the files in the zip he provided.

    I do note that in the zip file, the serial_streamer.py program is reading DIRECTLY from the Cyton serial port. And the values saved to the CSV file look like typical channel values to me. (I assume channels 1 and 2 are at O1 O2 in all these examples.) By which I mean typical Cyton channel amplitudes contain a 'DC offset' of typically a few tens of millivolts. (10,000+ microvolts.) That is the case for the Cyton data file.

    However I note in the other two files, created by the LSL and Brainflow python programs, the channel 1 and 2 data streams DO NOT contain a substantial DC offset. Which might imply they are being truncated somewhere. Also to note that these two programs use a Python library routine, Pandas, to output the CSV file. Possibly there is some weirdness in this output function.

    https://pandas.pydata.org/docs/user_guide/io.html#io-store-in-csv

    I'm at a loss to explain your truncated result raw data or FFTs.

    William

Sign In or Register to comment.