Coherence Neurofeedback Protocol

Forum for software developers to discuss BCI2000 software development
Post Reply
maiavalentina
Posts: 2
Joined: 25 May 2025, 14:48

Coherence Neurofeedback Protocol

Post by maiavalentina » 25 May 2025, 16:56

Hi everyone!
My name is Maia. I'm a student from Spain.

My team and I are currently working on a EGG alpha neurofeedback protocol designed to reduce connectivity between the prefrontal cortex and somatosensory areas. We first built a custom coherence filter, but then decided against it.
Now, we are getting familiar with the coherence filter that's found in the BCI2000 wiki, but still, we're a bit lost and wonder if that was the most adequate choice. We also would appreciate if anyone could give us any specific advice on coherence neurofeedback, or maybe some recommendations for the parameters' settings... it would be really appreciated!

Thanks in advance,
Maia.

mellinger
Posts: 1341
Joined: 12 Feb 2003, 11:06

Re: Coherence Neurofeedback Protocol

Post by mellinger » 26 May 2025, 08:15

Hello Maia,

my name is Jürgen, and I wrote the BCI2000 coherence filter.
This filter uses correlation between time series of Fourier coefficients as a measure of coherence.
That measure cannot work between different frequencies but only for a single frequency at a time.

So, the first step for your experiment will probably be to choose a frequency for which coherence between alpha and sensorimotor rhythm is high.
I suggest you do that in an offline analysis of data taken at rest, using the formula given at the CoherenceFilter's reference page on the wiki.

Then, you can set up either the TransmissionFilter or the SpatialFilter to reduce the number of channels to two, and the CoherenceFilter to operate at the frequency determined in the first step. As is has only two inputs then, its output will contain only a single value, which is the coherence between the two channels.

Let me know if you need further assistance.

maiavalentina
Posts: 2
Joined: 25 May 2025, 14:48

Re: Coherence Neurofeedback Protocol

Post by maiavalentina » 10 Jun 2025, 04:28

Dear Jürgen,
Thank you very much for your response; it was extremely helpful.
We are currently working on determining the optimal parameter settings using SignalGenerator. Would it be possible for you to provide a .prm file that demonstrates coherence between two channels? The specific channels are not important, as our main objective is simply to become familiar with the process.
Your assistance would be greatly appreciated.
Kind regards,
Maia.

mellinger
Posts: 1341
Joined: 12 Feb 2003, 11:06

Re: Coherence Neurofeedback Protocol

Post by mellinger » 10 Jun 2025, 11:28

Here is a parameter fragment that produces two coherent sources in five channels.
Note that you will need to update BCI2000 from SVN, and recompile, before using it.

The two sources only differ in the relative strength of the first harmonic, and the phase offset of each component.
Apart from noise, you should find 100% coherence between all output channels.

Code: Select all

Source:Signal%20Properties int SourceCh= auto // number of digitized and stored channels (allow_override)
Source:Signal%20Properties int SampleBlockSize= 8 // number of samples transmitted at a time (allow_override)
Source:Signal%20Properties int SampleBlockDuration= auto // duration of a sample block (set SampleBlockSize to auto)
Source:Signal%20Properties int SamplingRate= 256 // sampling rate (allow_override)
Source:Signal%20Properties list ChannelNames= 1 auto // list of channel names (allow_override)
Source:Signal%20Properties list SourceChOffset= 1 auto // Offset for channels in A/D units (allow_override)
Source:Signal%20Properties list SourceChGain= 1 auto // gain for each channel (A/D units per physical unit) (allow_override)
Source:SignalGeneratorADC int ModulateAmplitude= 0 0 0 1 // Modulate the amplitude with the mouse (0=no, 1=yes) (boolean)
Source:SignalGeneratorADC int SineChannelX= 0 0 0 % // Channel number of sinewave controlled by mouse x position
Source:SignalGeneratorADC int SineChannelY= 0 0 0 % // Channel number of sinewave controlled by mouse y position (0 for all)
Source:SignalGeneratorADC int SineChannelZ= 0 0 0 % // Channel number of sinewave controlled by mouse key state
Source:SignalGeneratorADC list NaNChannels= 1 auto // Channel numbers set to NaN if space is pressed (empty if not used)
Source:SignalGeneratorADC float SineFrequency= 0 10Hz % % // Frequency of sine wave
Source:SignalGeneratorADC int SineAmplitude= 0 100muV % % // Amplitude of sine wave
Source:SignalGeneratorADC int NoiseAmplitude= 30muV 30muV % % // Amplitude of white noise (common to all channels)
Source:SignalGeneratorADC int DisableRandomNoise= 0 0 0 1 // disable random noise generation (boolean)
Source:SignalGeneratorADC int DCOffset= 60muV 0muV % % // DC offset (common to all channels)
Source:SignalGeneratorADC string AmplitudeMultiplier= 1 1 % % // Expression to multiply amplitude by
Source:SignalGeneratorADC string OffsetMultiplier= StimulusType StimulusType % % // Expression to multiply offset by
Source:SignalGeneratorADC int SignalType= 0 0 0 2 // numeric type of output signal:  0: int16, 1: float32, 2: int32 (enumeration)
Source:SignalGeneratorADC matrix SourceProperties= 4 { Frequency Amplitude Time%20Offset } 12Hz 10muV 0 24Hz 6muV 0.1s 12Hz 5muV 0.05s 24Hz 5muV 0.2s // Source properties
Source:SignalGeneratorADC matrix MixingMatrix= 4 5 1 -1 .4 .3 -.2 1 -1 .4 .3 -.2 0 1 -.1 1 -.4 0 1 -.1 1 -.4 // Source-to-sensor projection, rows are sources, columns are sensors
Source:SignalGeneratorADC float VariateTiming= 0 0 0 0.9 // Introduce random variation into block duration

Post Reply

Who is online

Users browsing this forum: No registered users and 0 guests