Poor data quality, plotted in EEGLAB / Matlab

SaimaSaima Pakistan
edited February 2023 in Cyton

Can any one please guide me why my data is being plotted like this as i haven't encounter that kind of EEG data plot yet. I have made all my channels "Not Railed" and impedance of channel was fine too .I am so worried please help .I am plotting this data in matlab R2020a and in EEGLAB too.!

Comments

  • retiututretiutut Louisiana, USA

    For issues such as this, it's very important to share the code that you have written in Matlab.

  • SaimaSaima Pakistan

    I simply opened OpenBCI saved file in ".txt" format in EEGLAB and plot its channel data ony....no processing no filter just EEGLAB channel plot command

  • SaimaSaima Pakistan
    edited February 2023

    Step # 01: I just use this code to open .txt file in matlab and function [data] = open_files()

      % Prompt user for filename
       [fname, fdir] = uigetfile( ...
       { '*.txt*', 'Text Files (*.txt*)'; ...
         '*.xlsx', 'Excel Files (*.xlsx)'; ...
         '*.csv*', 'Text Files (*.csv)'}, ...
         'Pick a file');
      % Create fully-formed filename as a string
       filename = fullfile(fdir, fname);
      % Check that file exists
       assert(exist(filename, 'file') == 2, '%s does not exist.', filename);
      % Read in the data, skipping the 5 first rows
       data = csvread(filename,5,1);
    end
    

    Step # 02: I saved this file in .mat format with the command given below:
    save('raw.mat','ans')
    Step# 03: I opened this mat file in EEG lab and click on Channel plot....
    Plz help me.i am a PHD scholar and bougth this OpenBCI device with lot of difficulty

  • wjcroftwjcroft Mount Shasta, CA

    Have you tried some of Irene's tutorials?

    https://irenevigueguix.wordpress.com/category/research-tools/eeglab/

    If the time series data plots look ok with OpenBCI_GUI, but distorted with Matlab or EEGLAB, then your import and filtering in those apps must be sub-optimal. Remember that the recording file is RAW data values, and must be pre-filtered to look like what is showing with the GUI. Typical bandpass would be from say .5 Hz to 45 Hz. And also helps to have a mains frequency notch at your local mains, 50 or 60 Hz.

    William

  • SaimaSaima Pakistan

    The code i shared above to open OPENBCI .TXT file in matlab has been taken from "https://irenevigueguix.wordpress.com/2016/04/22/loading-openbci-datasets-in-eeglab/" tutorial. but i will look for any filtering technique has been shared in this tutorial. Thank you so much for your time....

  • wjcroftwjcroft Mount Shasta, CA

    When Irene wrote those tutorials, the CSV format was somewhat different than currently. Examine the CSV file and make any code changes necessary.

  • SaimaSaima Pakistan

    I followed Irene tutorial to open OpenBCI .txt file in MATLAB and separated its AUX and channel data as Irene did ...and it worked wonderfully .Now i will read more tutorial as i have few stimulus videos and i will collect data using LSL ......
    Thank you...Stay blessed

  • SaimaSaima Pakistan
    edited February 2023

    I have plotted the OPENBCI .TXT file in EEGLAB properly, but as in my experiment i will have to collect data using LSL in matlab as i need to show the visual stimuli simultaneously. I have used the code mentioned below to collect data but its plot is in a straight line or squares in data attached in file. Do i need to inlet two streams for AUX and EEG separately as i have seen in few codes of github

    %% instantiate the library
    disp('Loading the library...');
    lib = lsl_loadlib();
    % resolve a stream...
    disp('Resolving an EEG stream...');
    result = {};
    while isempty(result)
    result = lsl_resolve_byprop(lib,'type','EEG'); end
    % create a new inlet
    disp('Opening an inlet...');
    inlet = lsl_inlet(result{1});
    disp('Now receiving data...');
    
  • SaimaSaima Pakistan
    edited February 2023

    Sir can you please guide do i need to keep only one stream opened on OpenBCI gui...I did all three streams in Time Series and EEG data as shown in the picture attached

Sign In or Register to comment.