[Eeglablist] How to create a buffer in MATLAB for real time EEG data acquisition?

Arnaud Delorme arno at ucsd.edu
Wed Sep 12 11:22:37 PDT 2018


Dear Norman,

See also the code from this small project. 

It streams EEG data using LSL, buffers it, resample it, remove artifacts using ASR, apply spatial filter on electrodes (such as ICA), compute power in specific frequency bands, and provide visual feedback using the Matlab psycho toolbox.

https://github.com/arnodelorme/neurofeedbacklab
Look for function nfblab_process.m

Arno

> On Sep 12, 2018, at 10:48 AM, Alejandro Ojeda <alejo.ojeda83 at gmail.com> wrote:
> 
> Hi Norman,
> 
> Perhaps the easiest way to accomplish what you want (with maximum control of your codebase) is to use a Matlab timer and read from the RDA client frequently, then you can pass the chunk of samples to a function implementing your pipeline. 
> 
> Another option is to use BCILAB.
> 
> If Simulink is an option, you could have a look at SimBSI (Simulink for Brain Signal Interfaces). The package is still in beta version so some things may change down the road, but it is fully functional and actively used at the moment. SimBSI leverages many existing functions in Simulink for signal processing and machine learning with flexible data acquisition interfaces (LSL, TCP/IP, UDP, among others) with online-capable brain imaging functions. If you need to write your own processing block, check Matlab's doc's pages and you can find also many tutorials on Youtube.
> 
> Whatever you do, beware that the processing time needs to be less than the acquisition time for a chunk of data, otherwise, samples will accumulate and the pipeline won't be real-time.
> 
> I hope this helps, best,
> Alejandro
> 
> On Wed, Sep 12, 2018 at 9:49 AM Norman Sinnigen <norman.sinnigen at student.uni-tuebingen.de> wrote:
> Is there a function or software package, suitable for Matlab, (except Fieldtrip) enabling to create a buffer for real-time EEG data and perform calculations?
> 
> The processing pipeline is the following: EEG data is recorded using BrainVision Recorder and sent via TCP/IP (RDA client) to Matlab. The incoming EEG data’s point size is 63x10. Performing calculation on the incoming EEG data takes time, which is why I am looking for a way of creating a buffer enabling to perform calculation on a specific window of incoming EEG data packages, while further incoming EEG data packages are stored in a buffer, waiting to be further used for calculation.
> 
>  
> 
> Fieldtrip offers this service, but converting data from EEG to Fieldtrip and back requires too much time. I found MatRiver, but couldn’t find a way to download it, since download is not offered and the given email doesn’t work.
> 
>  
> 
> 
> _______________________________________________
> Eeglablist page: http://sccn.ucsd.edu/eeglab/eeglabmail.html
> To unsubscribe, send an empty email to eeglablist-unsubscribe at sccn.ucsd.edu
> For digest mode, send an email with the subject "set digest mime" to eeglablist-request at sccn.ucsd.edu
> 
> 
> -- 
> Alejandro Ojeda 
> Neural Engineering Lead at NEATLabs
> 
> Ph.D. candidate in the Electrical & Computer Engineering Department, University of California San Diego, USA
> ResearchGate GitHub
> _______________________________________________
> Eeglablist page: http://sccn.ucsd.edu/eeglab/eeglabmail.html
> To unsubscribe, send an empty email to eeglablist-unsubscribe at sccn.ucsd.edu
> For digest mode, send an email with the subject "set digest mime" to eeglablist-request at sccn.ucsd.edu




More information about the eeglablist mailing list