add a new bandpass filter on GUI to receive 1-100 hz EEG?

edited April 2018 in Software
Dear all 
 I need do some special research,so I want to get 1-100Hz eeg data, but OPENBCI GUI has 1-50Hz,  5-50Hz, notching option only, how do I add a new bandpass filter 1-100Hz? Someone tried it? I need help.

Comments

  • wjcroftwjcroft Mount Shasta, CA
    The raw data CSV file, does not have any filtering applied. You can (and must) do your own. There are many DSP filtering packages available in various languages.
  • wjcroftwjcroft Mount Shasta, CA
    Also, the default sample rates will not give you 100 hz EEG. Cyton samples at 250 hz, Ganglion at 200 hz, default rates. Unless you sample faster, you will be limited to around 50 hz EEG. At 250 hz sample rate, with 5 samples per waveform, 250 / 5 = 50 hz.
  • Thank for your help. But I don't know how you get the '5 samples per waveform' at 250Hz sample rates. I think of the 250Hz sample mean is 250 time/sec, if I want to get the 100Hz, it will still be 250Hz and it will be the 2.5 times the eeg rate. why is '5 samples per waveform'?

    Other I have wifi shield, can I get the 100Hz eeg data? Thank you.
  • wjcroftwjcroft Mount Shasta, CA
    edited April 2018
    Profeell, do a search on Nyquist Limit.

    The bare minimum sample rate for a signal is twice the frequency. And that is a very poor sampling. 4, 5 or more samples is more reasonable.

    EEG beyond 50 hz is generally thought to be contaminated with substantial EMG noise from scalp muscles.

    Some research and lab EEG uses sample rates of 500 or 1000 hz, just so the samples are more accurate. Not to record the EEG signal components present at 100 hz. Your Wifi Shield can do 500 or 1000 hz sample rate.

    With direct cortical EEG (electrode on cortical surfaces, requiring surgery), The higher frequency EEG components are not distorted and can go up into various higher ranges such as 100-500.






    Regards,

    William

  • Thank for your help, but I still want to get 1-120Hz eeg data, mybe it has EMG noise, nothing, I want to try. Do you have good solution? 
  • wjcroftwjcroft Mount Shasta, CA
    Did you read the links I provided above?? EEG from scalp above 50 hz is (1) extremely low signal voltage, likely below 2 microvolts. (2) therefore extremely poor signal to noise ratio. (3) contaminated by EMG.

    One of the papers above DID manage to extract high gamma, however they used 27 channels, source localization, etc. In other words extremely complex and advanced signal processing to pick the signal out of the noise. Also if you read the paper, this high gamma is primarily associated with motor activity.


    You can use your Cyton plus Wifi Shield to get 500 or 1000 sample per seconds from 8 channels. BUT this will NOT get you the 120 hz EEG you are looking for. It will only get you higher resolution EEG from approximately 1 to 50 hz.

    Regards,

    William

  • If I don't use openbci GUI software, can I use other software get the high gamma signal, I know the signal voltage is lower, but I  want to try. 
  • wjcroftwjcroft Mount Shasta, CA
    In short, NO. The only reason that the "High Gamma Mapping using EEG" paper succeeded, is that they (1) had a large enough number of channels for source localization. (2) highly sophisticated signal processing software. 
  • Thank you so much, I know, let me try to use wifi shiled to get the signal. 
  • wjcroftwjcroft Mount Shasta, CA
    The other option for higher sample rates (without needing the wifi shield), is to simply record the EEG data to the SDcard. 
  •  Why use the SDcard can get higher sample rates? I just read the tutorials,  ' the Accelerometer is sampling at 50Hz, while the ADS1299 is sampling at 250Hz' , how to change the sample rates, when I use the SDcard to record the eegdata?
  • wjcroftwjcroft Mount Shasta, CA
    edited April 2018
    I believe this is just done using the GUI. Look around in the menus.

    The actual SDK sample rate change commands are here,

  • Sorry, I still have a problem, how to use openbci cyton SDK, for example, I want to change the sample rates, how do I send the command, in 'processing'  or other software? Thank you.

    Regards,

    Jack
  • Sorry, I still have a problem, how to use openbci cyton SDK, for example, I want to change the sample rates, how do I send the command, in 'arduino'  , do I need update all firmware, or use a simple way to change?  Thank you.
  • wjcroftwjcroft Mount Shasta, CA
    Jack, hi.

    If you want to record to SDcard, just open a terminal window to your COM port. You can use the Arduino IDE or other terminal emulators. Set the correct baud rate, 115200. When you power up the Cyton, you should see some output in the terminal window. SDK commands are just simple text. For example '?' will print out some info and registers. Lookup the command string to change the sample rate, then start the SDcard collection.

    The sample rate commands are in V3 firmware. Your ? command should tell you what firmware you have.

    William

  • Thank your reply, I still have three questions, one is I use SD card
    to collect data, through the ARDUINO set the sampling frequency is 8000 hz,
    when I start to collect data, I found the OPENBCI GUI still have the data
    stream, the bluetooth cannot transmit high sampling rate data, isn't it, why it
    also has the data stream activity?





    The second problem is that if not in the
    PROCESSING run OPENBCI GUI, can the SD card data conversion, I had a test, OPENBCI
    GUI run on WINDOWS, the SD card data can also conversion, but I don't know why
    the original 16 M of data in SD card into 1.2 M, the data lost a lot of, why?

    Third question: if the SD card can be used 8000 hz, 16000
    hz sampling frequency, the  WIFI SHILED can only transmit data at 2000 hz,
    they together can`t be real-time display of data on OPENGUI, why they can be
    used at the same time, they do not match.

  • wjcroftwjcroft Mount Shasta, CA
    (1) are you getting the 8000 hz samples ok on your SD card? Correct, the RFduinos cannot stream that fast. Yet may still stream at 250 hz.

    (2) I'm having trouble understanding your English. Can you try reading the SD card with another utility?

    (3) Do you NEED real time display of your data if you are recording to SD card at 8000 hz? I thought that high sample rate was your priority, NOT real time stream viewing. Do the samples on your SD card make sense as 8000 hz data? In other words, if you generate alpha waves at 10 hz in the EEG, does that correspond with what you see in the 8000 hz samples?

    There are other ways to display time series data, than the GUI. Such as the EDFBrowser utility, etc.
  • Sorry to much, my english is too bad, the second question is: how many ways can convert these hexadecimal files in the SD card to ‘normal’ data files?

    Thank you!
  • wjcroftwjcroft Mount Shasta, CA
    The hex format of the SD card data is explained here,


    These hex values can be converted to microvolts using (1) either the GUI, or (2) converting yourself using,



  • Thank you so much. Let me try it.
  • edited May 2018

    I have a questions about the SD card to
    write. I want to use the 8000 hz sampling frequency to write the SD card,  do I need to close the other channels and leave only a channel
    to get the EEG data? Or how
    many channel date can I get to use 8000HZ sampling frequency and no lost data?  in this case, how do I
    set the serial port baud rate? how do I need to set the SD card block
    parameters? such as:    'F': BLOCK_COUNT = BLOCK_30MIN = 34Mb 'G': BLOCK_COUNT = BLOCK_1HR = 67Mb

    Thank you!

  • wjcroftwjcroft Mount Shasta, CA
    re: changing serial port baud rate: NO, you will only get the faster sample rate to the SD card, not the serial port.

    As you suggest, changing the block size may be necessary at higher rates. You'll just have to try it out and see what works. Why don't you try some more modest rates first such as 1000, 2000? Change the blocksize using the SDK commands, before you start your SD card recording.

  • Thank you so much, let me try.
  • Sorry, I tried many times, but I can't read know the EEG-data, I still use 8000HZ sample rate to get the eeg-date, please forgive my stubbor, I need convert the eeg-data to WAV format data next step in MATLAB, the WAV format file need sample rate at least 8000Hz. For keeping the sigle is real, I want to get the 8000hz sample rate eeg-data. I used the Openbci-GUI to covert the SD card HEX file to normal file, but I can't read know the TXT file, how to know it is 8000Hz sample rate data, how to know its stop time?  

    when I covert the SD card HEX file, do I need run the Openbci-GUI in Processing for this work? 
    next is the TXT file :

    %OBCI Data Log - 2018-05-06_13-51-02
    %STOP AT
    116509.0
    0,36545.613,45425.76,-23450.824,-14993.796,-2523.1765,-13662.213,53715.82,-187500.02,0.068,1.0040001,0.074
    1,33273.273,43799.76,-23892.494,-15809.366,-2424.5159,-15893.408,52122.21,-187500.02
    2,38524.75,44045.72,-22981.615,-14863.932,-2248.2053,-12306.356,52173.617,-187500.02
    3,42465.945,45705.426,-22423.873,-13931.261,-2318.2559,-9623.5205,53777.6,-187500.02
    4,37733.52,45678.785,-23261.795,-14758.364,-2505.8315,-12862.579,53932.23,-187500.02
    5,33172.223,44014.45,-23930.805,-15805.655,-2466.0007,-15980.356,52350.152,-187500.02
    6,37330.99,43829.29,-23178.133,-15112.886,-2274.4016,-13128.587,51987.207,-187500.02
    7,42398.53,45463.805,-22418.084,-13982.96,-2290.9866,-9661.541,53507.637,-187500.02,0.074,1.0040001,0.074
    8,38905.824,45853.754,-23074.822,-14531.449,-2487.4585,-12058.408,54064.35,-187500.02
    9,33357.383,44274.914,-23925.418,-15734.9795,-2490.029,-15851.454,52610.84,-187500.02
    10,36162.035,43676.848,-23379.098,-15340.628,-2292.0596,-13924.645,51861.098,-187500.02
    11,42061.758,45169.945,-22464.04,-14090.874,-2268.1655,-9902.984,53222.14,-187500.02
    12,40014.83,45959.633,-22890.354,-14324.942,-2463.922,-11304.26,54145.938,-187500.02
  • wjcroftwjcroft Mount Shasta, CA
    Earlier I suggested you place an electrode at Oz or Pz and create some 10 hz alpha with your eyes closed. This should show up in your data and be visible so you can verify your sample rate. You can also run the same test with the live GUI at 250 hz, and just see that you are generating alpha on both the time series graph and the FFT.

    Your EEG data needs to be filtered before use. Typically with a bandpass from say .5 hz to 40 hz. That will take out the mains noise at 60 hz. If instead you want to go higher, say .5 hz to 100 hz or higher, you still need a notch filter at your mains freq. The .5 hz low end of the pass band takes off the DC offset.

  • edited May 2018
    Thank you so much. I meet a question again, please help to look, I want to run openbci  from processing IDE, I am according to the tutorials to set the processing IDE, and setup the openbcihub, but when I run the openbci from the processing IDE, the Processing IDE give me the prompt message: 

    OpenBCI_GUI::Setup: Is RX mulitcast: false
    OpenBCI_GUI::Setup: Has RX joined multicast: false
    Instantiating hub object...
    click
    May 07, 2018 6:59:09 PM controlP5.ControlBroadcaster printMethodError
    SEVERE: An error occured while forwarding a Controller event, please check your code at controlEvent
    java.lang.reflect.InvocationTargetException
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    .........
    at com.jogamp.opengl.util.FPSAnimator$MainTask.run(FPSAnimator.java:178)
    at java.util.TimerThread.mainLoop(Timer.java:555)
    at java.util.TimerThread.run(Timer.java:505)
    Caused by: java.lang.NullPointerException
    at OpenBCI_GUI.controlEvent(OpenBCI_GUI.java:2802)
    ... 33 more


    Can you help to look ,why?
  • when I tried run again, the Processing IDE give me the prompt message:
    Welcome to the Processing-based OpenBCI GUI!
    Last update: 9/5/2016
    For more information about how to work with this code base, please visit: http://docs.openbci.com/OpenBCI Software/
    Graphics & GUI Library: ControlP5 2.2.6 infos, comments, questions at http://www.sojamo.de/libraries/controlP5
    attempting to load images for presentation...
    org.eclipse.jdi.TimeoutException: Timeout occurred while waiting for packet 125.
    at org.eclipse.jdi.internal.connect.PacketReceiveManager.getReply(PacketReceiveManager.java:187)
    at org.eclipse.jdi.internal.connect.PacketReceiveManager.getReply(PacketReceiveManager.java:198)
    at org.eclipse.jdi.internal.MirrorImpl.requestVM(MirrorImpl.java:192)
    at org.eclipse.jdi.internal.MirrorImpl.requestVM(MirrorImpl.java:227)
    at org.eclipse.jdi.internal.ObjectReferenceImpl.invokeMethod(ObjectReferenceImpl.java:437)
    at processing.mode.java.runner.Runner.findException(Runner.java:866)
    at processing.mode.java.runner.Runner.reportException(Runner.java:789)
    at processing.mode.java.runner.Runner.exceptionEvent(Runner.java:709)
    at processing.mode.java.runner.Runner$2.run(Runner.java:599)

Sign In or Register to comment.