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

EMG raw data #17

Open
blackjacksme opened this issue Mar 29, 2016 · 6 comments
Open

EMG raw data #17

blackjacksme opened this issue Mar 29, 2016 · 6 comments

Comments

@blackjacksme
Copy link

Hi,
Thank you for your work , this code really helped a lot

I have a question though, how do i access the raw, unfiltered, EMG data from your myo_raw.py code?
because i noticed in your proc_emg function :

def proc_emg(emg, moving, times=[]):
        if HAVE_PYGAME:
            ## update pygame display
            plot(scr, [e / 2000. for e in emg])
        else:
            print(emg)
        ## print framerate of received data
        times.append(time.time())
        if len(times) > 20:
            #print((len(times) - 1) / (times[-1] - times[0]))
            times.pop(0)`

you can print out the emg, but the EMG data in that variable is already filtered, as in there is no EMG data with negative value. I need help to access the real raw EMG data because i need the frequency spectrum of the signal. How can i do this?

Another thing is about the sample rate. After i change the m.run(1) into m.run(), the sample rate increased into 50 Hz, but the myo device itself can send the EMG data up to 200 Hz. How can i further increase the sample rate?

Best Regards,
Rizki F.Z.

@larasamirammal
Copy link

@blackjacksme
Did you solve the problem ? If so how do you reach the Raw EMG data ? and how did you solve the sampling rate problem ?
there is a line where they set emg_hz to 50 did you try to change it?

@Alvipe
Copy link

Alvipe commented Apr 21, 2017

I don't know if you are still interested, as this issue is from a year ago, but I've managed to get the real raw EMG signals, not the filtered ones that this code provides. You can check the code in my fork: https://github.com/Alvipe/myo-raw

@hananabilabd
Copy link

@Alvipe which .py to run to get the Raw EMG dATA ?

@Alvipe
Copy link

Alvipe commented May 18, 2018

@hananabilabd, the main code is the myo_raw.py. This code graphs raw data from the 8 channels of the Myo. The variable where raw EMG data is stored is called emg. Hope this helps you.

@hananabilabd
Copy link

@Alvipe Thanks
Yes ,I handled it from emg ,, But I had a problem , that emg data frame is very slow , I receive 512 frame of emg every 10 sec which is very slow
while in windows running the capture data provided by MYO_SDK gives me 3000 frame in 10 seconds

@PerlinWarp
Copy link

@Alvipe Thank you for your PR!

It's worth noting that the Myo actually has 3 modes, @Alvipe's PR adds the ability to get raw and filtered data using the Myo.
Actually raw data is unrectified and scaled between -128 and 127 and can be requested by sending 0x03.
I've been working with the Myo for a year and have added some extra functions, including multithreading and Windows support here.

I've also made a Jupyter notebook showing the difference between these modes and you might preprocess the data here.
This was for a project on using the Myo to play Breakout, the repo is here.
Playing breakout with sEMG

Myo Modes
(0x01, raw=False)
By default myo-raw sends 50Hz data that has been rectified and filtered, using a hidden 0x01 mode.
(0x02, raw=True, filtering=True)
Alvipe added the ability to also get filtered non-rectified sEMG (thanks Alvipe).
(0x03, raw=True, filtering=False)
Then I futher added the ability to get true raw non-filtered data at 200Hz.
This data is unrectified but scales from -128 and 127.

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

5 participants