Data collection with LSL
I am trying to collect data from OPENBCI 21 channel cap. I have put the GEL in six channels only (FPZ, GND, REF, FP1, FP2, FP3, FP4, FP8, FP7) as I had some issues in data collection therefore just to verify if everything is OK.
My MATLAB code to collect data using LSL is given below:
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...');
x = 1;
eegstarttime = clock;
tic
while toc<60
% get data from the inlet
while toc>0 && toc<60
[chdata(x,:),tsdata(x,1)] = inlet.pull_sample();
x = x + 1;
end
end
My data set is also attached ...Can anyone please guide if this data is OK while no filter is applied and only 6 channel are wet.
Comments
i am unbale to upload .mat file here can anyone please guide what to do
Saima, hi.
Have you seen the Getting Help section on this page:
https://labstreaminglayer.readthedocs.io/info/getting_started.html#support
They recommend joining the LSL Slack and asking there. That is where the LSL experts are. Even if you have an LSL question specific to OpenBCI, that Slack should be able to point you in the right direction. (Such as first creating a test / dummy data stream in another app, then seeing if you can receive that test stream in your Matlab.)
William
hello wjcroft
I couldn't get any reply from there ...Can i share plot of collected data so u may guide me if Data quality seems to be OK ....!Kindly guide ...Its just a 2 second data and five second in which channel 1,2, 9,10,11,and 12 were wet. If you can provide some valuable comments after seening data.
You appear to have a huge amount of noise in your EEG plots. Normal EEG is generally below 80 microvolts. Are you pre-filtering your raw data before plotting. Typical filters would be a bandpass say from .5 Hz to 45 Hz. Then a notch at your mains frequency, is it 50 Hz there in Pakistan?
You signed up for the Slack, and no one is commenting there? Sometimes they have multiple Slack 'channels', there may be a specific one for 'help' etc.
Data quality is NOT OK. Quality is terrible.
Yes i activated filter button in OPENBCI GUI before starting data stream....also settled the notch filter at 60 and band pass at 0.5 to 45. Do i need to make vert Sclae at Auto rather than 200uV...
Thank you so much in advance
How does your data look in OpenBCI GUI? If it looks ok there, but you show multiple hundreds of microvolts noise in your plots, then that means the LSL stream you are receiving is RAW (unfiltered) and needs to have your own filtering applied.
https://www.google.com/search?q=mains+frequency+in+pakistan
That implies your mains frequency is FIFTY hertz, not sixty.
so do you recommend me to fix notch filter at 50 ???
I had applied ...can i share with you the images of data after applying filter
I have done several recordings with filter OFF and ON but in vein.
Ah, forgot that the LSL Networking Widget does not show the proper label for the 'filtering' buttons. In any event it sounds as if the filtering feature is not working, is that your experience? If this is the case, the easiest approach is to filter on your Matlab side. We can file an 'issue' on the Github to have the GUI buttons repaired. But that would take much longer than just doing the filtering with Matlab DSP functions.
Hello wjcroft ......
Thank you so mych for being so kind......I will try this and will discuss with you
Regards
Mentioning Richard @retiutut. Saima believes that the Networking LSL Widget, may not be filtering her data stream. Even though she has tried using the toggle switches at the bottom.
The screenshot above is not from the latest GUI. The Filter buttons in the Networking Widget only apply to TimeSeries data type. Every other data type ignores this, as it's not applicable.
The EMG data sent out is fed filtered data and then normalized between 0-1 for each channel.
First, I recommend updating to GUI 5.1.0 https://www.openbci.com/downloads. This also removes the arbitrary "# Chan" textfield.
@retiutut thank you so much for your guidance....... if i update the new version of GUI....then there is no option of time series in LSL streams and documents "https://docs.openbci.com/Software/CompatibleThirdPartySoftware/Matlab/" defines on this page guides user to set timeseries on type of Data......![]
what should i do....
Scroll down while the list is open. It's there.
Thank you so much ...@ retiutut ......
