Sending filtered data to Lab Streaming Layer

Hi,

I'm trying to stream data from OpenBCI into Unity using Lab Streaming Layer. I do that by typing "python user.py -p=COM4 --add streamer_lsl" in OpenBCI_Python. This way however, the data streams into Unity unfiltered. Are there options to apply notch and bandpass filters for LSL, as in the OpenBCI GUI?

Best,
Marius

Comments

  • For the case of Unity, I have written some filters in C# that should more or less match those of the OpenBCI GUI. You find them here: https://github.com/mariusrubo/Unity-IIR-Online-Filtering. It would, however, still be interesting to know if it is possible to stream filtered data from OpenBCI to LSL.

    Best,
    Marius
  • Does anyone have an idea by now how to send filtered data through LSL?
  • wjcroftwjcroft Mount Shasta, CA
    Have you tried sending your LSL stream to OpenViBE, then filtering and processing with OpenViBE, or just filter and send an output LSL stream to another program.
  • I was hoping that OpenBCI_Python could directly do the filtering.The command "python user.py -p COM4 -a streamer_lsl --no-filtering" works and seems to suggest that there's a filtering option.
  • wjcroftwjcroft Mount Shasta, CA
    You can see the source code here. The no-filtering option is just controlling the notch,


  • I see, thanks! Then I think the filters I wrote in C# and linked above are more versatile ;-)
  • wjcroftwjcroft Mount Shasta, CA
    There is a great open source filter package, written in C, called FIDLIB. It allows you to construct / change the filters at runtime. This filter package is the one used in the BioEra biofeedback system.


    Found this Github copy of it, but the original source is on the fidlib link above.


    James Hight apparently added the Gnu autotools build system, which IMHO often overcomplicates things. See original tar files at uazu.net.

    ---

    There are also multiple Python signal processing libraries.


    William


  • Hi everyone - I'm actually trying to do this and I'm wondering...there are on and off buttons in the networking widget. Do these not work (in terms of sending filtered data) over LSL in the current version of the OpenBCI GUI (v3.2.0)? I'm trying to do a comparison with the default text file and the data sent to ReceiveData.m from the lab-streaming-layer-master folder off of Github.
  • Hi!

    I have exactly the same question. Is there any way how I can send through LSL/save the filtered data (as displayed in the GUI)?

    Thank you!
  • Never mind, I read in the wrong file. The solution described by faheemersh should work.
  • Hi @cerealkiller! I've tried doing this multiple times and checking the text files/comparing with MATLAB when I was working on my senior design project. It does seem that filtering occurs when sending through LSL. It would be great if other  users could test this out and verify.

    To be certain, it might be better to use something like OpenViBE for filtering and saving the data. You can see how to do this here. You'll have to convert the OpenViBE data to .mat or whatever program's file type you're using to receive the LSL stream. If you're using MATLAB, this might be helpful. Ideally, you might create two Generic stream writer boxes in the OpenViBE scenario for the raw and filtered data, that way you could get two files of a single recording session and compare the too. All the timings would be lined up and that would tell you for sure whether or not the data is being filtered.
Sign In or Register to comment.