openyou / emokit

Open source driver for accessing raw data from the Emotiv EPOC EEG headset
http://www.openyou.org
Other
521 stars 235 forks source link

Can emokit record at a higher sample rate? #204

Closed windweller closed 7 years ago

windweller commented 7 years ago

We are using this library to extract raw eeg data, and things have been going very well! However, we can't help to notice that the data we get are roughly 38 data points (samples) per second. Based on the website, the sample rate is much higher: 128 or 256 samples per second (https://www.emotiv.com/epoc/, under tech specification).

I'm wondering if this is a problem with the transmission, or the headset, or the library?

(if we run the example_export.py, we can see the sample rate Rx at 32-33)

ghost commented 7 years ago

If you run the example.py is the sample rate also low?

Which OS and Python version are you running it on?

windweller commented 7 years ago

yes, it is run with example.py, the OS is Win 7 professional SP1, and Python version is 2.7.12. The version of headset is EPOC+.

ppasler commented 7 years ago

I quite achieve 128 data points per second with Win7 and python 2.7. @windweller have you tried a faster machine? Just for the record: The sample rate (128 or 256) for the EPOC+ has to be configured with the Xavier Control Panel.

Edit: With the latest revision, I only get 51Hz with the example.py

Morgan243 commented 7 years ago

For those debugging this - I get roughly 128 HZ, and it seems slightly more consistent if I disable the writer. I'm on Linux with a 4 core Intel i5-3320M and an SSD.

windweller commented 7 years ago

We did some testing, and used a fork of this repo that does give us 128Hz recording, however, once we added the code to have the program write csv output to a file, the rate dropped to 40Hz.

So we are hypothesizing that this could be a file IO blocking issue!

ghost commented 7 years ago

@windweller Yeah it makes sense looking back through it I thought I had fully implemented multithreading but failed to do so on the writer module.

I will get it fixed.

ghost commented 7 years ago

Alright if you could pull down this repo: https://github.com/CerebralPower/emokit

Let me know what you think, made some changes.

ghost commented 7 years ago

Make sure you are not using Python3, it is not stable as Python2 when exporting.

I'm gonna work on that but no idea when I'll get around to it.

windweller commented 7 years ago

YES! The repo worked :) Thank you!

ghost commented 7 years ago

No problem, I'll get it merged in here in a bit. Have to wait for headset to charge up again.

ppasler commented 7 years ago

I can confirm, that the latest master writes values with 128Hz (console and file both on). Thanks @bschumacher