Recorded File different from the GUI screen

edited August 2016 in OpenBCI_GUI
Hi everyone.

I have just performed my first experiment and the result is not what I expected.

First of all, let me describe my equiment: The board is the OpenBCI 32bit Board and there is the option to use it together with the Daisy Module, but I did not use, hence, the teste was made with 8 channels . I also used the gold cup electrodes and the paste.

When the test was running I was whatching the EEG signals on the OpenBCI_GUI and they were OK. After that I opened the recorded file to see the data and the values were different, all the values were in a crescent order and when I opened the file with OpenBCI_GUI the EEG signals were not the same that I saw when I was performing the teste. The channels 1 and 3 were repeated, the same thing happened with channels 2 and 4.

Does someone know what is wrong? How can I solve this problem?

Thank you in advance.

 

Comments

  • wjcroftwjcroft Mount Shasta, CA
    The values in the CSV file will also contain the DC offset component, which is slowly changing; see,


    >  the values were different, all the values were in a crescent order

    I don't understand the term 'crescent'.

    > The channels 1 and 3 were repeated, the same thing happened with channels 2 and 4.

    Are you using the row of pins closest to the board for channels 1 through 4? Reference on SRB2 (typically one ear), Bias on the other ear? 

    William

  • Thank you for your answer @wjcroft.

    I will try to remove the DC offset from my data.

    >  the values were different, all the values were in a crescent order
    Here I tried to say that the values had a range from -14000 to 35000, always increasing.

    > The channels 1 and 3 were repeated, the same thing happened with channels 2 and 4.
    No, I used all the 8 channels, but the channels 5, 6, 7, 8 had no value, it was showing ¨Railing¨

    I would like to ask something that is simple that I have seen in other topics but its not clear for me:

    Which are the sample rate? 250Hz or 256Hz? In the header of the data file is written 250Hz, but the first column starts with 0 and ends with 255, making 256Hz.

    Another question is: If I use the Daisy Module to use 16 channels together, will the sample rate be the half of the sample rate with 8 channels?

    Thank you again.

    Laercio

  • wjcroftwjcroft Mount Shasta, CA
    edited April 2016
    The normal way to remove the offset is to run the channel data stream through a high pass filter, say at .5 hz.

    For channels that are unused or RAILING, just turn them off with the GUI.

    Sample rate is 250 hz for 8 channel, 125 hz for 16 channel. Number in the first column is a sample counter which runs from 0 to 255, then wraps around. It is not related to the sample rate.

  • @wjcroft

    Thank for you answer

    One last doubt, at least hope so, rs.

    When I use the OpenBCI_GUI to read my raw file the filters are turned on? If they are, why the signal that I see when I use "Playback (from file)" is not the same as the "Live (from OpenBCI)". For example, When I am recording the signals (Live), channels 1 and 2 are almost the same, but when I read the file that was saved (Playback) channels 1 and 3 look like. Is that correct?
  • wjcroftwjcroft Mount Shasta, CA
    The filters you have selected are applied to the raw signal (or file). Are you sure you have selected the same filters during recording and playback?

    A good test to do is to short all your leads together (channels and SRB2 plus Bias). This can be done with a glob of paste or clips, etc. Result should be a signal close to 0 uV.

    Use the search box at right to lookup: neuromore, BrainBay and OpenViBE. These are all VPL, visual programming languages that allow you to do signal processing without programming.
  • Maybe I have been done this in the wrong way.

    I used pins "Bias" and "SRB" as reference and plugged them on my ears, one pin in each ear using paste.

    The pins from N1P to N8P I plugged on the scalp through gold cup electrodes and paste.

    All of them were the bottom pins.

    The filters were the same when I was recording and when I was reading the raw file. So there is something wrong, all the filters used are the same ones. 
  • @wjcroft

    I have just performed the test that you asked me. The problem is the same.

    When I was recording all the values were zero (almost it, there was no variation in the signal)

    When I played the raw file what I saw was totally different, the channels 2, 4, 6 and 8 appears with a huge variation while the channels 1, 3, 5, and 7 are almost zero.

    Do you have any idea why this is happening?
  • wjcroftwjcroft Mount Shasta, CA
    edited May 2016
    Did you install the OpenBCI_GUI from source or from the precompiled binary? Can you try the other option if one of them seems to have this issue? You might also try another laptop or OS. I'm going to mention @Conor here, who maintains the GUI source.

    So with this recording you made with all the channels and SRB2, Bias connected together. Does your file look like all the "close to 0 uV" values are recorded correctly? Or do you see the even channels as having large variation? It sounds like the GUI is getting the correct data stream from the dongle and displaying correctly when running live.

    But the creation of the recording file is distorting the even channels saved onto the file, so when you play that back, you see the even channels messed up. Does that sound like what you are seeing?

    You could also try a test with 'neuromore'. Use the search box at right for a tutorial.

    Please try the first suggestion to see if the Processing binary or source might be corrupt.

    Thanks,

  • @wjcroft, I didn´t understand your question about source and precompiled binary.

    I have 3 different OS installed in 3 different machines and I will tell what is happening

    Linunx LTS 14.04 and processing 2.2.1 downloaded from https://processing.org/download/?processing
    When I am recording a file appears in on way but when I try to playback the signal is in another way

    Win10 and processing downloaded from http://openbci.com/index.php/downloads as recommended in the OpenBCI website
    When I am recording a file appears in on way but when I try to playback the signal is in another way

    Win7 and processing downloaded from http://openbci.com/index.php/downloads as recommended in the OpenBCI website 
    In this case it works, the signal that I see when I am performing the test is the same signal that I see when I am reading the file in the playback

    So, I used the same version of processing in 2 OS (win7 and win 10) but it worked just in the win7. Using Linux and an old version of processing (2.2.1) it didn't work

    I tried to install other versions in my Win7 computer, like processing 2.2.1 and 3.0.2, but it did not work. I followed the instructions in the website but I received the following messages:

    Processing 2.2.1: Cannot find anything called "surface". 
    In this case I had to delete the folder Minin because the software was accusing double libraries

    Processing 3.0.2: The package "ddf"does not exist. You might be missing a library.
    In this case I installed the folder Minin

    My idea is to have processing 2.2.1 or 3.0.2 installed to change some details in the code and record the data and the other one already installed in my machine to open the files. Is it possible? If this is not possible, can I change the code of processing downloaded from  http://openbci.com/index.php/downloads
  • wjcroftwjcroft Mount Shasta, CA
    Laercio, hi.

    re: your remark on pre-compiled vs build from source and libraries.

    The zip files on the download page, are "ready to run" without needing the steps to build from source as shown on,

    https://github.com/OpenBCI/OpenBCI_Processing

    It's possible that if you use the steps shown on the github page above, the result may be correct vs. what you are finding with the zips. That is what I would suggest trying next on your Windows 10 and Linux. The instructions on the Github page say to use the latest stable Processing, which is 3.0.2, not 2.2.1.

    I'm going to mention @Conor and Joel @biomurph here, as it appears that the zip files are having issues on Windows 10 and your particular Linux. (But the zip runs ok on Windows 7.) By rebuilding directly from the Github instructions, let us know how that works for you.

    William

  • @wjcroft

    I tried to install the version 3.0.2 but it did not work. The same problems that I had before keep appearing.

    So I installed the version 2.2.1 with all folder that I have when I downloaded it in Oct, 2015 and its fine. So far my problem is solved.

    I did not understand what is happening in the map on the right side of the OpenBCI_GUI, My signal is stronger in channels 1 and 2 but the color red and blue do not make sense. What is the right way to analyze this map?

    Thank you again.

    Laercio
  • wjcroftwjcroft Mount Shasta, CA
    Laercio, hi.

    That's great you found a workaround. I guess you are right, Processing 2.2.1 is required to agree with the external library setup. So you say that it is now working on your Windows 10 and Linux machines?

    The head map contour algorithm is here,

    https://github.com/OpenBCI/OpenBCI_Processing/blob/master/OpenBCI_GUI/HeadPlot.pde

    This is Chip @chipaudette 's code. I believe dark red is indicating RAILED or out of range. And the working electrodes are "averaged" into a kind of "heat map" using a color scale ranging in shades from blue to white to red. So depending on the overall range of your channel amplitudes, you could see any shade in that range.

    Chip might comment here. I think it would be helpful to have a sentence on how the colors are interpreted on the docs site.

    William

  • @wjcroft

    First of all thank you for all your answers.

    Now I have Processing 2.2.1 installed in Win10 and Linux as you said.

    I have been asking a lot a question in the same topic that I opened, but the subject changed, is it OK?

    Now I have a different doubt. I changed a little bit the code just to save the TimeStamp of the data and I saw something different. I have a line with 18:40:19.365 and my next line has 18:40:19.802, hence, I have 437ms without data. what is happening?

    And another question, my first line of data (I am not considering the header) the Timestamp is 18:40:17.405 and after one second my Timestamp is 18:40:18.405, but I have 353 line between them, if my frequency is 250Hz, Shoudn't I have 250 lines between them?
  • wjcroftwjcroft Mount Shasta, CA
    re: sample buffering delays, have you applied the FTDI "Latency Timer" adjustments?


  • @wjcroft

    Once again, thank you a lot. Its working just fine, maybe 1ms of delay but the world is not perfect, hahaha

    The only doubt that I have now is related to HeadPlot.pde file that I tried to read but I did not understand what happens with the map in the OpenBCI_GUI
  • wjcroftwjcroft Mount Shasta, CA
    The map can be considered more for visual "eye candy" and a rough idea of what is going on with the amplitudes, it's not not really the same sort of quantitative tool such as you might find in QEEG head maps.


  • @wjcroft

    I have one doubt that is related to this old topic.

    I have permorfed an experiment with Daisy Module and I saved the timestamp for each line of data. I saw that the difference bewwen the lines is 4ms, the same difference when I do not use Daisy Module, hence, in this case my frequency is 250Hz. I was expecting 8ms of difference

    But when talked few months ago, you told me that the frequency would be 125Hz, half of the frequency using just 8 channels. What is the real frequency using Daisy Module?

    Another question, I was looking at the website and its written that the frequency is 250Hz, but because of the 16 channels the file saves the data per module, which means, it saves the first 8 channels and after some time 8 more channels. Am I right to have this thought?

    Thank you,

    Laercio
  • wjcroftwjcroft Mount Shasta, CA
    Laercio, hi.

    With the Daisy installed, the radio packets are still coming in 250 times per second, but the channels in each packet alternate. Explained on this page (scroll down to "16 Channel Data" section.)


    William

  • Thank you!

    I have just seen that some lines are repeated, 2 lines in a row have the same values for the 8 first channels for examples. So I think that we have something like this: Its necessary to get to 8 first values of one line and the 8 last values of he next line to have the original signal, because of that the frequency is the half of the frequency without Daisy Module
  • wjcroftwjcroft Mount Shasta, CA
    The original signal is not actually available over the radio link, as described on the docs link above. An averaging process is involved. The original signal IS available if recording to SD card.

    Winslow Strong, in his firmware mods to utilize a hard wired USB connection instead of the radios, is able to achieve higher bits/second over the wire. And so he was able to raise the 16 channel sample rate back to 250, AND remove the averaging code.



    I believe the V2.0 firmware also supports some of this functionality. For example for the next 2.1 release AJ is shooting for support for a wifi addon breakout board.

  • Hello, 
    I am working on a project which takes the textfile recording of OpenBCI 32bit board as an input. 
    However, the numbers written on the text file contains some DC values increasing with time. Moreover, by framing, I cannot still obtain the ac signal levels (which can be shown in the GUI). 

    What should I do, in order to obtain data with same appearence and values with GUI time axis plot? (in matlab from the textfile formed by GUI )

    Thanks,

    Mark
  • wjcroftwjcroft Mount Shasta, CA
    Mark @B2D, hi.

    See the first few posts in this thread. The raw data contains a DC offset.

    William


  • I know that but how can I remove that offset? 0.5 Hz High pass filter or mean value calculations did not work. 
    I also tried getting means of small offsets seperately but still I cannot see values and waveform same with GUI in MATLAB. 
    Please help me about that issue, clearly. 
    Thanks in advance
  • wjcroftwjcroft Mount Shasta, CA
    The high pass filter will work if you are doing it correctly. To verify this, explore some of the VPLs, such as BrainBay, neuromore, OpenViBE, etc.


  • @wjcroft Hi,

    I had an similar problem with Mark. I am importing the raw EEG data file (created by GUI) to a Matlab code for processing by real time. However, I can not process the raw data since there is a DC offset which is not constant (increase or decrease by time) and I could not removed it. So I have three questions:

    -Is it possible to create the text file by GUI without writing the raw datas but writing the DC offset eliminated ones (namely, the micro rms values seen in GUI flowing nearby the graph)
    I want to process those values so is there a part in GUI code for extracting those values or so ?
    -I also can not work the high pass filter work with the raw eeg data stream in my Matlab. Is there a solution that eliminates the raw eeg data on Matlab from the dc offsets or so on. Or if it is HPF how can I implement it since the HPF's did not return me any desired outputs. Because, I did not want to deal with any other tools since my project is works with only text files.
    -Or is there a conversion style that converts RAW data to rms ones as formula and like?

    I am open for any detailed advices and detailed comments / codes etc. for all my questions. I hope I can explained my big problem. I will be very very glad for any detailed advice. 

    Thanks


  • Hi @f10-forever and @B2D.

    I had the same problems as you have now and I solved this using the following code in python:

     #2 x (fc/wc), fc = freq de corte desejada e wc = freq do sinal#
        bp_stop_Hz = np.array([59.0, 61.0]) #filtro rejeita faixa que será usado posteriormente
        ###Canal 1###
        #número ¨2¨ é referente a ordem do filtro, 0.008 é referente a frequencia de corte que é 0.5Hz
        b, a = scipy.signal.butter(2, 0.008, btype='highpass')
        output_signal = scipy.signal.filtfilt(b, a, chan1)
        #número ¨2¨ é referente a ordem do filtro, 0.8 é referente a frequencia de corte que é 50Hz
        b, a = scipy.signal.butter(2, 0.8, btype='lowpass')
        output_signal2 = scipy.signal.filtfilt(b, a, output_signal)
        # create the 60 Hz filter

    Some of the comments are in Portuguese, if you need any help can help. In this case I used the OpenBCI board + Daisy Module.
    My friend used the EEGLAB toolbox for Matlab and she told me that it worked for her.

    Best Regards,

    Laercio
  • @laerciosilvajunior

    Hi, I tried your code with the same methods in Matlab and it worked correctly at last :) Thank you very very much for your detailed help. 

    Have a nice day..

    Sincerely

    Mert
Sign In or Register to comment.