most probably mishap in streaming eeg signals with openbci python

I am currently streaming with a cyton and 16 channel setup where : 
- Bias is connected with the Y connector (on both bottom bias pins of cyton+ganglion board) to AFz
- Both SRB2 are connected respectively on auricular A1 and A2
- the 16 remaining channels are connected on remaining bottom pins of the boards

While connecting with OpenBCI_GUI, the signal seems fine and no channel is railed

Then, I am using openbci_python with a LSL plugin to stream data from the board without filtering.

board = open_bci_v3.OpenBCIBoard(port=ports[0],  daisy=True,  filter_data=False, scaled_output=True, log=False) 
...
activatePlugin("streamRawLSL",devices+datatypes,plug_list,callback_list,board)
...
etc...

The strange thing is that most of the channels in the received signal seem to be drifting. I am new to the field so there must be something I have not checked yet. Any idea?
see below some of the streamed channels:
image
image

Comments

  • @compmonks this is actually a normal trait of the EEG signal, the DC drift! It's pretty cool :) totally normal to see.
  • ha ok thanks. Reassuring :)
    Which kind of filter is generally used in python to normalize this?
  • At a minimum you should use a high pass filter of 0.5Hz or greater
  • Thanks. But how would that work when the drift varies over channels and time?
    Is there a standard way to adapt the filter over time and channels with scipy signal for example?

  • wjcroftwjcroft Mount Shasta, CA
    The high pass filter will remove it. Because the DC offset (drift), is at a very low frequency, below .5 or even .1 hz.

    The Networking widget / LSL has a checkbox to turn on filtering before the LSL data is sent out.
  • I am currently having an issue with the Networking Widget of the GUI : https://github.com/OpenBCI/OpenBCI_GUI/issues/320. So I cannot check it that way
    But so far I have tried directly a bandpass filter in python with a recorded file with no success. I try to put the filter as low as .1 Hz to not alter too much the data

    So with recorded signals as shown above I use
    #
    from scipy import signal
    def makeBandPassFilterOnData(self,the_data,sampling_freq=125,the_order=8,arr_freq=[.1,20.],timeaxis=0,btype='band'):
    freq = [] 
     fn = sampling_freq/2 # calculate the nyquist frequency 
     for f in arr_freq: 
     freq.append(f/fn) # create low and high freq passes 
    b,a = signal.butter(the_order,freq,btype = btype)
    data = signal.lfilter(b, a,the_data, axis=timeaxis) 
    return data
    #

  • edited April 2018
    I heard you can use UDP to stream into matlab instead of LSL in the meantime.

    Your high pass filter should be at least greater than 1Hz, not 0.5Hz sorry
Sign In or Register to comment.