neuromore / Max Neurofeedback dataflow example
There is no neurofeedback software for OpenBCI other than Brainbay and BioEra. Both are quite old Windows apps and I have been a staunch Mac user for 10 years now so in the absence of a proper app some coding and visual programming will be necessary. It's to be expected with an open hardware project anyway. My board hasn't arrived yet but that didn't stop me from getting started with software programming, starting with a single channel alpha protocol and binaural feedback.


I am using Neuromore studio to process the EEG data and provide OSC streams of numbers. The two I need for this protocol are Alpha gain, and Alpha dominant frequency.

With these two streams of data I can generate the feedback I need, tracking both the frequency and magnitude of my alpha activity. Max/MSP is used to turn this information into an audio signal.

My base binaural frequency is 264 Hz which is entered in a box near the top on the right hand side. The incoming alpha frequency (osc-route /output/1) gets divided by two, and either added or subtracted from 264 depending on the side. This is so that the pitch is changing equally on each side and the one channel drifting up and down is less distracting. The result of these two signals when played left and right is that the frequency of the binaural beat they create is being dynamically altered by the domains frequency signal from Neuromore.
At first the frequency data was coming from Neuromore as integers and the changes in frequency were very obvious as steps. I smoothed the signal and multiplied it by 200 before sending it to Max. When it got there it's divided again by 200. The result is a very big resolution of 6 decimal places for the dominant frequency, and so the frequencies drift rather than step making it feel much more natural.
The magnitude data (osc-route /output/2) controls the volume of the binaural signal, and there is a 'handicap' makeup gain slider which adds to the magnitude of the alpha signal and would get lowered as training progresses and alpha magnitude increases.
Whilst this is a very simple protocol it's also going to be extremely effective at training alpha as it gives direct information on the frequency we are trying to train and the current magnitude of that frequency. The brain then uses this magnitude data as a reward and the binaural beat guides the brain toward the state we want
The neurofeedback software chain involves capture, DSP, threshold control, feedback and data logging - all but the latter are present in this example. (the data logging can be as simple as noting the value of the handicap amount at the beginning and end of a session). If you understand how a protocol needs to be wired, it's just as easy to make it in Max as it would be to make it in BioExplorer but with much greater flexibility for nesting designs and a fantastic tool for creating touchable control interfaces.
I know very little about neurofeedback protocols, but a lot about building audiovisual software and would be very keen to work with anyone who can help me to understand more about techniques and training conventions.
Comments
What is the UDP packet rate coming out of neuromore in this situation? Sometimes VPL element blocks run at the same sample rate as the EEG amp, in this case 250 samples/sec. Do the FFT or smoothing blocks reduce that to a more reasonable rate? 500 packets per second might be a lot.
A consideration in feedback applications is the latency between the signal processing and the actual feedback changes presented to the client. Do you have any idea what that latency is, in this case? It would involve processing and digital filter / FFT delays in neuromore, Max, and network delay components. Ideally many neurofeedback applications aim for latencies less than 300 milliseconds. Since FFT induces longer delays than digital filters, many applications opt for designs based on filters for the mainline data flow. Although FFTs and spectrograms might be utilized for monitoring purposes.
I assume you've seen the BrainBay neurofeedback tutorial at,
https://sites.google.com/site/biofeedbackpages/brainbay-openbci
Most alpha reward protocols just reward on amplitude in the 8-12 hz band. Individuals vary in their alpha peak frequency, but it's generally at 10hz. Another common component is to inhibit or alert the client if he is producing too much beta, say 15-20 (beta2) and 20-30 (beta3). If the user 'tries' too hard or becomes hypervigilant, it can 'look' like increased alpha, when in fact the beta increase will have a negative impact.
Neurofeedback and protocols are a huge area, some references here,
http://openbci.com/forum/index.php?p=/discussion/402/free-neurofeedback-applications
The Intel NUCs are great, let us know how that goes.
William
BioEra. Both are quite old Windows apps and I have been a staunch Mac
user for 10 years now...
I wanted comment on the 'old' label on BioEra. You're correct on BrainBay, it has not seen much development in recent years, although the source is completely open; which can be an advantage for extensions.
BioEra on the other hand is maintained by Jarek Foltynski, and is contantly updated. Almost new releases and revisions / additions each week. Rapid response to questions and queries. I'm using it right now for an OpenBCI design, works great. BioEra is also the basis of a number of up to date commercial packages such as LENS (Len Ochs), Cygnet (Othmer protocols), etc. One of our OpenBCI users and neurofeedback practitioners George Martin, uses it as well. BioEra can also run under Parallels or VirtualBox, when used with the included license dongle.
William
http://www.autodidacts.io/binaural-beat-openbci-eeg-experiment/
One other aspect that LENS, HPN, Flexyx, etc. emphasize: (These are all protocols based on measuring EEG dominant frequency, and then reflecting it back via light, sound, microcurrents, etc.)
Is that there is a slight chance that driving the EEG through external frequencies at the EEG dominant frequency, could potentially induce or amplify seizures. More so in the case of individuals with this tendency.
So to be safe, they always add an adjustable offset to the measured dominant frequency before reflecting it back in some ways. (LED goggles were used for the early Flexyx. Later LENS switched to a nano tesla PEMF scheme. HPN is using is using nano current pulses delivered to the scalp at the sensor locations; with some simliarities to tACS.)
The reflected dominant frequency is not attempting to "guide the brain toward the state we want" (as you considered in your 1st post.) Rather the dominant frequency plus offset is attempting to inform the central nervous system (CNS) what kind of frequency band it is hanging out in, and give it the chance to breakup or go away from those habitual patterns. We basically trust the intelligence of the CNS to see this mirror reflection and make adjustments that will increase the resilience and adaptability of the system as whole. Releasing old patterns. We're not trying to force or drive the EEG to a particular desired frequency.
This of course differs from alpha amplitude training, where we reward for the whole band. Although protocols do exist where it is attempted to raise the alpha peak frequency if it is in the low range.