-
Notifications
You must be signed in to change notification settings - Fork 14
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 data range #5
Comments
In my code, the raw EMG signals are also represented by 8 bit signed integers. The data unpacking is done as follows:
The As for the filtered EMG signals, that is, the measure of the amplitude of the EMG, code return 8 values ranging from 0 to 65536, since those data are unpacked as unsigned shorts:
The IMU returns 10 signed short values (4 quaternions, 3 acceleration values and 3 gyro values) , so each of them range from −32,767 to +32,767, but they are scaled depending on the kind of data:
I hope you find this information useful. |
Thank you for such detailed information! It is very helpful for my current
research.
On Mon, 26 Nov 2018 at 16:25, Álvaro Villoslada ***@***.***> wrote:
In my code, the raw EMG signals are also represented by 8 bit signed
integers. The data unpacking is done as follows:
emg1 = struct.unpack('<8b', data[:8])
emg2 = struct.unpack('<8b', data[8:])
The '<8b' parameter in the unpack command means "unpack passed data as 8
little endian signed chars". You can find more information about unpack
commands in the module documentation
<https://docs.python.org/2/library/struct.html>.
As for the filtered EMG signals, that is, the measure of the amplitude of
the EMG, code return 8 values ranging from 0 to 65536, since those data are
unpacked as unsigned shorts:
emg_filt = struct.unpack('<8H', data[:16])
The IMU returns 10 signed short values (4 quaternions, 3 acceleration
values and 3 gyro values) , so each of them range from −32,767 to +32,767,
but they are scaled depending on the kind of data:
values = struct.unpack('<10h', data)
quat = [x/16384.0 for x in values[:4]]
acc = [x/2048.0 for x in values[4:7]]
gyro = [x/16.0 for x in values[7:10]]
I hope you find this information useful.
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#5 (comment)>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/Aa-NR-JlwulG7DmYqAy6ezjOCSYXy19eks5uzBYWgaJpZM4Yy-lk>
.
--
Best regards,
Ruoshi Wen
|
@ruoshiwen, I forgot to mention that, if you want to use the raw EMG data, the one that takes values from -127 to 127, you have to modify line 43 in main.py and write:
I should comment that example code and write some documentation on how to use this module. I originally programmed it for myself, but now that you and some other people are using it, I should make it easier to understand and use. |
I am just trying to familiarize myself with my code now. :)
Thanks for mentioning this! Could save me a lot of time. By the way, your
code is really good for my current project!
On Wed, 28 Nov 2018 at 10:10, Álvaro Villoslada ***@***.***> wrote:
@ruoshiwen <https://github.com/ruoshiwen>, I forgot to mention that, if
you want to use the raw EMG thata, the one that takes values from -127 to
127, you have to modify line 43
<https://github.com/Alvipe/Open-Myo/blob/28d04c134580392d6aa314e1ccf047ced31cbee2/main.py#L43>
in main.py and write:
myo_device.services.set_mode(myo.EmgMode.RAW, myo.ImuMode.DATA, myo.ClassifierMode.ON)
I should comment that example code and write some documentation on how to
use this module. I originally programmed it for myself, but now that you
and some other people are using it, I should make it easier to understand
and use.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#5 (comment)>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/Aa-NR7O_Yz_rbttf8tA-SBZt_cu4ZZ7-ks5uzmEHgaJpZM4Yy-lk>
.
--
Best regards,
Ruoshi Wen
|
In official SDK, the emg is represented by 8 bits integer (-128~127). When I tested using your code, it seems the amplitude is more than the above range.
Could you please tell me the unit/range of the EMG data (also IMU sensors)?
I could not appreciate more.
The text was updated successfully, but these errors were encountered: