Python example

About BCI and box tutorial/demo scenarios bundled with OpenViBE.
Post Reply
hydrocity
Posts: 3
Joined: Wed Feb 27, 2013 7:12 pm

Python example

Post by hydrocity »

Hi everyone!

I am working on a project that I think may have to utilize python. This is my situation.

I have an emotive EEG and have successfully tested it with open vibe. My target was to filter out the theta wave on all or selected sensors and store my data in a CSV.

So i have RAW theta wave power data pulling at 4 times a second. My next goal is to write a python script that takes that data (4 chunks a second) and performs an action based on every chunk.

I have read the python examples over and over again but I still am not comprehending it. Could anyone give me a smaller scale example. I realize there are things that I must include in the script that are native to open vibe. It would also be great if I was able to round the data to only have 2 numbers. But I see it like this.

Signal data = input on python box. Call it X (how Do I define that input in the script?)
if X = .1
then (perform action)
elseif X = .2
then (perform action)
and so on and so forth down to maybe 6. so the range would be .1 to 6

I think a dictionary would work well for this but I haven't gotten to that point yet. It needs to be looped so it will check against the input data at every input interval ( 4 times a second)

I am also going to have to modify the performed action based on what X is and it will be cumulative. so I will have to use a few dynamic variables all changing their value based on the input from the signal.

I can work on the harder stuff, but a simple example of what the input would look like in a python box would really help get me started.

Thank you and any help would be great.

hydrocity
Posts: 3
Joined: Wed Feb 27, 2013 7:12 pm

Re: Python example

Post by hydrocity »

Hi again,

I was thinking and even a simple.

Print function would be enough to get me started.

Signal box isolated to 4-7 hearts Index 5

Python script
print each buffer (4 every second)

Post Reply