Skip to content
New issue

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

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to modify the sample rate of Myo? #5

Open
RaphaelDuan opened this issue May 10, 2021 · 2 comments
Open

How to modify the sample rate of Myo? #5

RaphaelDuan opened this issue May 10, 2021 · 2 comments

Comments

@RaphaelDuan
Copy link

Dear author,

I'm doing some research based on Myo Armband now. Pewter is powerful and well designed, but I was very confused about how to modify the default sample rate of the EMG signal. I tested it and I think the default sample rate was 200Hz, right?

Could you tell me where to modify the default sample rate? I can not find it. Thx so much.

@mayorhao
Copy link

Hi, @RaphaelDuan, Has you figured out how to set the sample rate? also, since the Thamlic is dead, could you share the Myo connect for the windows installer? Thanks a lot

@david-olivier-cs
Copy link

Hi @mayorhao
I worked on a project using the myo a few years back. However, it's been years since I worked with this code.

Here is information that might be useful.

Digging through the myo.js (https://github.com/thalmiclabs/myo.js) file, which pewter uses to communicate with the myo, you can see that it uses a web socket to send commands to the armband.

Ex:
Myo.socket.send(JSON.stringify(["command", {
"command": "unlock",
"myo": this.id,
"type": "hold"
}]));

Now, the myo.js file doesn't seem to be modifying the armband's output frequency. However, when looking at another project "myo-raw" (https://github.com/Alvipe/myo-raw), which communicates with the myo via Bluetooth and is implemented in Python, there is a line where the armband's output frequency is set :

https://github.com/Alvipe/myo-raw/blob/680775071d0dd4defb88b35f91d9122c0645eedb/myo_raw.py#L279

self.write_attr(0x19, pack('BBBBHBBBBB', 2, 9, 2, 1, C, emg_smooth, C // emg_hz, imu_hz, 0, 0))

Communicating with the myo via Bluetooth seems to allow finer configuration.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants