Time Series Plot Default filters

Hello, thank you for accepting me in the forum this is my first post here.
We are building an Oculus Quest app that receives data from the Cyton board and then use that data to predict hand position with an AI model. We are receiving the data correctly and converting it to microvolts correctly apparently. But if we plot the raw data we get we don't get anything like the Time series plot in the OpenBCI GUI so I would like to know which is the post-processing done to the data by default in the OpenBCI GUI time series plot.

I read in the OpenBCI documentation GUI widget guide that the data is plotted as uVrms but I'm not sure how many data points does it take to do that, and I guess there are more steps done to the data so if anyone could help me with that I would be really grateful.

I tried checking the OpenBCI GUI source code using Processing but in the Time Series Plot class, I only found data about drawing the plot and updating it, not exactly what is done to the data before plotting it, if someone could point me to where in the code that is done I could look by myself too.

Sorry for the long post and thank you in advance.

Comments

  • wjcroftwjcroft Mount Shasta, CA

    Hi Jilermo,

    re: your Quest app

    Can you clarify how your app is receiving the data stream? With Brainflow library or something else?

    Normally the EEG data samples are unfiltered, raw. This is true for recordings as well. On the other hand the GUI is pre-filtering the stream for best visual display. You can see the filter parameters here:

    https://docs.openbci.com/Software/OpenBCISoftware/GUIWidgets/#filters

    The Cyton data stream is DC-coupled, meaning that samples will contain a DC-offset when raw. Normally this is removed with the bandpass or high pass filter. Brainflow library has filter functions you can call. These are the same calls used by the GUI for screen display. Typically all you need is say a bandpass from .5 Hz to say 45 Hz. And a notch at your mains frequency.

    https://openbci.com/forum/index.php?p=/discussion/201/large-millivolt-data-values-fbeeg-full-band-eeg

    William

  • JilermoJilermo Mexico
    edited May 13

    Hello William,

    Sorry for the late response, got lost in other parts of development.

    Currently, we have implemented a pure serial interface with the Oculus Quest so we get the values directly from the headset in the Cyton data format explained here:

    https://docs.openbci.com/Cyton/CytonDataFormat/

    So we are doing the conversion from 24-bit signed data to uV ourselves, in fact, I found out quite difficult to do it as the example that the page shows doesn't work in C# and it seems that brainflow doesn't expose those functions.

    Another thing is that our data of course doesn't look like the data shown in the OpenBCI GUI that's why I was asking what filters you use as default for the time-series.

    I will try with the bandpass filter from .5 to 45 Hz.

    Do you mind explaining what you mean with a notch at your mains frequency?

    Thank you for your help.

    Jilermo

    P.D. Oh another thing, do you know anything about the uVrms that the time series says it uses?

  • wjcroftwjcroft Mount Shasta, CA

    re: notch

    This is a term used for a bandstop filter, usually applied at your mains frequency 60 or 50 Hz. Bandstop's work similarly to bandpass, and usually specify a range. So applying a bandstop from say 59 to 61 would take out the 60 Hz interference.

    re: uVrms

    This is an 'average' value of microvolts, Root Mean Square

    re: manual decoding via serial stream or library access via Brainflow

    We usually highly recommend the library as it has many functions including filtering.

    https://brainflow.org/
    https://brainflow.readthedocs.io/en/stable/Examples.html

  • JilermoJilermo Mexico

    Hi again William
    Thanks for the answers, will check the notch filter, didn't know that that was a term for a bandstop filter. I will check to implement it too.

    As for the uVrms do you know if the time series plot displays the values as uVrms or does it only shows that value in the text??

    About using brainflow it is actually not supported for Android as stated in the brainflow documentation:
    https://brainflow.readthedocs.io/en/stable/GameEngines.html#unity
    And I find it weird, I understand that maybe you can't use the functions for connecting and getting data from the boards as that would probably require Java-specific code but even the DataFilter part for signal processing doesn't work.
    I tested it building for Android and it builds correctly but when I try to use any function from brainflow I get a GENERAL_ERROR= 17 exception and I find it weird, there shouldn't be any problem running that on Android (the data filters for example the bandstop or bandpass) I don't know if it does a platform check and if it finds out it is not window Linux or Mac it automatically shows that error.
    That's the main reason why I'm not using brainflow although I would love to. I can't find a lot of implementations of filters for example and brainflow already has all of that integrated.

    Again, thanks for the answer.

    Jilermo

  • wjcroftwjcroft Mount Shasta, CA

    @Jilermo said:
    ...
    As for the uVrms do you know if the time series plot displays the values as uVrms or does it only shows that value in the text??

    No, the graph line is in uV. The text annotation in uVrms is just to give an idea of the 'average' trend of the amplitude.

    About using brainflow it is actually not supported for Android as stated in the brainflow documentation:
    https://brainflow.readthedocs.io/en/stable/GameEngines.html#unity

    That limitation may only be for the Unity access. My understanding was that Android Brainflow library access was a desired goal, but that NDK (low level native functions) was causing issues. Best place to inquire is on the Brainflow Slack. Sign up with the link on the page, then use the 'askhelp' channel on the Slack.

    https://brainflow.org/

    And I find it weird, I understand that maybe you can't use the functions for connecting and getting data from the boards as that would probably require Java-specific code but even the DataFilter part for signal processing doesn't work.
    I tested it building for Android and it builds correctly but when I try to use any function from brainflow I get a GENERAL_ERROR= 17 exception and I find it weird, there shouldn't be any problem running that on Android (the data filters for example the bandstop or bandpass) I don't know if it does a platform check and if it finds out it is not window Linux or Mac it automatically shows that error.

    Show your errors on the Slack channel. There has been some Brainflow Android activity in the past:

    https://www.google.com/search?q=brainflow+android

    That's the main reason why I'm not using brainflow although I would love to. I can't find a lot of implementations of filters for example and brainflow already has all of that integrated.

    Again, thanks for the answer.

    Jilermo

Sign In or Register to comment.