Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Already on GitHub? Sign in to your account

Channels masks ? / errors in doc ? #28

robertbiloute opened this Issue Aug 8, 2012 · 6 comments


None yet
4 participants


I don't understand the definition of channels mask seen in emokit.c. For each channels there are a list of bit position, but this list does not match the bits showed in the documentation:https://github.com/qdot/emokit/blob/master/doc/emotiv_protocol.asciidoc.

Anyway, it seems to work like this, but so it would mean raw data for a given channel may be scattered all around a frame ? then how did you do to find these masks??

Also I suppose these lines are wrong in the doc:

  • 121:133 TP7 DATA should be '121:134' (and the following positions accordingly to this shift)
  • TP8 DATA has only 8 bits ??

well maybe this part of the doc is not up to date, or does it? Im a little lost here..
If someone can confirm there are some problems here (or confirm I didnot understand a thing!) I may try to correct these in the coming days

heavyk commented Oct 22, 2012

yeah, the docs are clearly wrong... for example, the docs reference AF8, but that sensor does not exist in the code

it appears to be magic.

I just tried reading the values with normal bitshifting techniques, and I do not get wave-like patterns at all... there is one thing correct in the docs, and that is the battery is part of the counter... I also managed to, what appears, get the signal strength on bits 112:119 ... ie. when connected to the normal epoc app, I get similar signal strength... (using a normal bit shifting, not that crazy magic).

the reality is, I'm quite lost on the signal strength deal... I'm just gonna go with it for now and hook it up to a visualizer. seems something is working, cause I am getting wave-like numbers :)


qdot commented Nov 1, 2012

The sensor not existing in the code doesn't mean the doc is wrong. The doc was not derived from the code, it was derived from information I was sent by someone who reworked the packet layout. :)

We are actually missing 2 sensors in the code (notice there's 16 sensors on the headset, 14 in the code).

In the end, I'd like to get a better corelation between the doc and the code. It does look pretty magic at the moment, but I swear it does actually make a very odd sort of sense.

heavyk commented Nov 1, 2012

yeah, I know :)

I spent a good amount of time trying to figure that magic out with nearly no success.

  1. I have no idea how to get the data for the remaining two sensors. the magic is a bit over my head
  2. as for mapping the signal quality to the correct sensors, I figured I would do that as soon as my first working prototype is done. this would also give me a hint as to which two sensors were missing. I was going to overlay the connection data over a head model. like in the app.

as for the first version of the prototype. come back later today, as I'm putting the final touches on the visualizer now. just added the fft for the spectrum data. webgl/three.js rocks!


ghost commented Dec 22, 2012

I think the two sensors that are missing from the code are only there to make sure the headset is in place, which then turns on the quality reading for all the other sensors. Take one out and the quality will not be reported. They are the two interchangeable sensors on each side. I'm pretty sure I've exhausted all possible bit mask combinations to get a value out of them. I spent the better part of a day trying to figure this out.

TP7 and TP8 are the question marks on either side, respectively.

Here is a crude mapping diagram:


I've documented some of the patterns for the bit masks on my fork's wiki. Might help someone figure it out.


ghost commented Dec 22, 2012

Confirming that Emotiv's software doesn't show readout for a TP7 or TP8 either. This issue can be closed the docs need to revert back to AF3 and AF4 also. Per the Emotiv documentation located here: http://emotiv.com/eeg/download_specs.php

Lx37 commented Sep 12, 2013


I also didn't understood the difference between the channel data bits Indexes given in the doc
and the bits indexes used in the code (emotiv.py -> sensorBits)

For example, for F3 sensor, the doc indicates 8:21 bits but the code takes [10, 11, 12, 13, 14, 15, 0, 1, 2, 3, 4, 5, 6, 7] bits.

Is the doc wrong or did I miss something ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment