Don’t use the post link feature, it doesn’t work properly. Please post again your facebook page, I would like to see that.

Thanks for sharing your algorithm. If it works, there is no problem with it. If you know, however, the specific channels in which theta and beta modulation is the strongest, you might benefit of not averaging all channels together and focusing solely on where the information is. To put this in perspective, if only one channel was carrying information and you were to average it with 2 more, you might still be able to pick up the desired signal. If you were to average it with a 100 more, then you can be sure to lose your signal to background noise.

The process I’m currently using, but it’s only for the sake of simplicity:

Each sample consists in the single Fourier transform term corresponding to 10Hz, computed over a 0.5 seconds time window (110 data points). I take out any samples for which I detect and eye blink. I only consider the power in channels 0 and 3, since these two carry the strongest 10Hz modulation.

Calibration phase:

Record 20 samples, while the participant is awake and mentally active. Compute the mean and standard deviation of the sampled values.

Test phase:

(sample - mean)/standard_deviation

This is a quick and simple normalization procedure that defines a standard normal distribution reference frame. If the participant is relaxing samples should be above 0 and shouldn’t exceed a value of 3. I then feed this transformed signal to a leaky-integrator, which takes care of filtering the signal.

I get very reliable results for relaxation with eyes closed vs. awake state and the good things is that the system trains in approximately 10 to 15 seconds.

Here’s the system running, you’ll see both the training phase and test phase.