Accessing to some cods and having trouble with some functionalities


#1

Hi
first question: horseshoes return 1,2,3 or 4. which one is noisier. rationally 1 must be noisy and 4 noise-less but doesnt seem so.
second question:
what are the exact requirements to use concentration and mellow datatypes.
it always return 0 . . . (even after long time waiting) and im working with android, however randomly it worked 2 times during last two days test and debug

public void receiveMuseDataPacket(MuseDataPacket p) {
switch (p.getPacketType()) {
case EEG:
updateEeg(p.getValues());
break;
case HORSESHOE:
updateHorseshoe(p.getValues());
break;
case CONCENTRATION:
updateConcentration(p.getValues());
break;
case MELLOW:
updateMellow(p.getValues());
break;
default:
break;
}
}

private void updateConcentration(final ArrayList<Double> data) {
Activity activity = activityRef.get();
if (activity != null) {
activity.runOnUiThread(new Runnable() {
@Override
public void run() {
TextView acc_x = (TextView) findViewById(R.id.conce);

int n = Integer.parseInt(100 * Math.round(data.get(0))

  • “”); // convert to percentage

acc_x.setText(“Concentration: %” + n);

}
});
}
}

Warmest regards
Amir


#2

Hi Amir,

With regards to HORSESHOE indicator:
According to the Developers DOCs, the value for HORSESHOE are 1 = GOOD, 2 = OK, 3 = BAD (in fact I had never got a 3, for BAD I allways see 4).
You can see more detailled info here: https://sites.google.com/a/interaxon.ca/muse-developer-site/museio/osc-paths/osc-paths---v3-6-0#TOC-Headband-Status

Now, about your code and Mellow and Concentration values: I’m stilll waiting for LibMuse for Windows as I’m not skilled enough to develop for Android.
But I can see that you are using LibMuse’s example code, and believe I can comment on some points I have read in other posts:

1 - Have you remembered to register a DataListener for each value you want ? (it’s necessary to register each one) - take a look at the method [B]onClick(View v)[/B] in the example code:
muse.registerDataListener(dataListener,MuseDataPacketType.CONCENTRATION);
muse.registerDataListener(dataListener,MuseDataPacketType.MELLOW);

2 - I can see that you are using the [B]acc_x[/B] user interface field to show the concentration value, but your code is making reference to an element in the layout with ID = “[B]conce[/B]”.
Have you included this TextView element in you layout (since the original demo does not have one defined for the [B]layout[/B] in [B]activity_main.xml[/B]).

As a side note I think I should mention that, personally, I don’t trust too much in those mellow and concentration indicators - as mentioned in the DOCs, they are “experimental”, and I have not see any consistence in their values.

Hope this helps a little, and it would be nice to see comments also from Tom or others, as things are going too slow by here :slight_smile:

Eduardo


#3

I really appreciate your response and wish you a great day

Actually i have added concentration and mellow into my datalistener.
Iv got textviews, [B]acc_x[/B], and [B]conce [/B]are just local names and random IDs.
Also my code is working properly, but i have a massive delay on receiving concentration and mellow values in my functions. maybe every 4 or 5 seconds I receive a value.
so ive got 2 probabilities:
1- I used to use 4 as a high quality horseshoe value, so I all time had tried my app with extremely noisy signals. Ill try it today with values that you mentioned.
2- the thread that Im using is not the right thread and causes delay on receiving.
I guess as you said I must start developing my own concentration and mellow functionalities via a neural network. if you are interested as well following article gives a good clue for measuring attention:
http://waset.org/publications/999910…e-eeg-channels
however in this article categorization of signals are different with muse’s one. As article has mentioned:
[B]Power ratio between beta and theta bands has been used as a parameter for determining the concentrated state[/B]
but based on muse’s categorization it can be measured by:
[B]Power ratio between alpha and gamma can determine the concentrated state.[/B]

I would really appreciate if you can introduce me a shorter way.
concentration and mellow are working perfectly and accurately on muse lab, you can find how a user lose its concentration easily and accurately.

I will reply you the result as soon as I found the solution.

warmest regards
Amir


#4

SOLVED
Hi again Mr Eduardo

wish you a great day

As i said my first probability was right and counting 4 as a high quality signal had caused it.
also i had problem on
int n = Integer.parseInt(100 * Math.round(data.get(0))
i changed it with
int n = Integer.parseInt(Math.round(100 * data.get(0))
I tried to do some informal experiments in order to test the concentration with some friends. i can guarantee that these functions are working properly, when the subject keeps his mind on a state like reading a management text, you can see how concentration goes up and you can see how the concentration would be broken and start going up when subject changed reading management into a news about volcano.
so you can see is subject stays on one state or they change the state of mind.
!!!
I dont know what is the algorithm that muse uses in order to create concentration and mellow. probably it must be neural networks, therefore in order to train a neural network function takes 30 seconds to be trained, so it is really important to keep the subject’s mind away from mellow. the best thing that i can suggest is to follow same structure as muse app uses. ask subject to think about different categories every 10 seconds. 3 different subjects like books, movies, natural disaster (let subject be a bit frustrated as well) or vehicles for instance can train a neural network perfectly.

warmest regards
Amir