Real Time BCI frameworks using Python, Wyrm, Matlab, BCILAB, etc.
Hi there,
I am performing real time auditory stimulation in phase to an EEG using the OpenBCI. Right now I have the necesary script written in matlab within a loop.
What I need is the latest EEG Value and Timestamp set to a variable at the beginning of each loop. My script relies on a simple threshold, so I simply need to see when the EEG is of a certain value.
The EEG needs to be bandpass filtered between .25 and 4 Hz in real time.
Prior to this, I've been using OpenVibe to filter the data, which I would then open in python to give feedback in real time to the eeg. However when trying this with Matlab, I realize this approach may not be fast enough, as the data jumps in half second intervals. I would think my code is at fault, but these jumps are perfectly in time to the openvibe graph lag, so I think its just a limitation of the software (unless someone can suggest otherwise).
I figured it'd be best for me to directly access the data in matlab, and it seems I'll be using BCIlab and lab streaming layer. Before I begin, I just wanted to see if anyone had performed a similar feat. I know real time filtering can be a tricky issue, so I'm hoping BCIlab might have the ability similar to programs like openvibe. Thanks for any help!
Alec
I am performing real time auditory stimulation in phase to an EEG using the OpenBCI. Right now I have the necesary script written in matlab within a loop.
What I need is the latest EEG Value and Timestamp set to a variable at the beginning of each loop. My script relies on a simple threshold, so I simply need to see when the EEG is of a certain value.
The EEG needs to be bandpass filtered between .25 and 4 Hz in real time.
Prior to this, I've been using OpenVibe to filter the data, which I would then open in python to give feedback in real time to the eeg. However when trying this with Matlab, I realize this approach may not be fast enough, as the data jumps in half second intervals. I would think my code is at fault, but these jumps are perfectly in time to the openvibe graph lag, so I think its just a limitation of the software (unless someone can suggest otherwise).
I figured it'd be best for me to directly access the data in matlab, and it seems I'll be using BCIlab and lab streaming layer. Before I begin, I just wanted to see if anyone had performed a similar feat. I know real time filtering can be a tricky issue, so I'm hoping BCIlab might have the ability similar to programs like openvibe. Thanks for any help!
Alec
Comments
http://openbci.com/forum/index.php?p=/discussion/199/latencytimer-inbuffersize-for-os-x-new-info-plist
http://openbci.com/forum/index.php?p=/discussion/200/latency-timer-windows-control-panel-setting
Also if you remember, I am the one completing the slow wave sleep project. I've been met with great success, I am currently working on a new stimulation that doesn't require any parameters, allowing anyone to recieve it without a test period. I also recieved seed funding from my school to develop the technology into a wearable sleep mask that may be used to improve slow wave sleep in deficient populations (i.e. elderly).
I am currently working in a neuroscience lab, and we're trying to transfer my code to a starstim so that my mentor's lab in Italy may test it on subjects and gather data on aspects of cognition the following morning.
You've been a great help William, and I owe an enormous amount to OpenBCI for making this possible.
Here's a couple of related posts on the docs site,
http://docs.openbci.com/tutorials/09-Mac_FTDI_Driver_Fix
http://docs.openbci.com/tutorials/10-OpenBCI_on_Windows
I think you'll have better luck sticking with the OpenViBE and Python. The BCILAB when I looked at it seemed very featureful, but perhaps not as "user friendly" in terms of interface and setup. Plus Matlab is likely to have more latency compared to a compiled executable such as OpenViBE.
https://www.google.com/search?q=python+eeg
Wyrm, Python BCI with Mushu acquisition and Pyff interface feedback: