GithubHelp home page GithubHelp logo

lif3line / myo-matlab-interface-emg-gyro-accel Goto Github PK

View Code? Open in Web Editor NEW
7.0 2.0 1.0 30.7 MB

MATLAB interface for pseudo real time data capture on the Myo Armband

C++ 46.02% C 3.19% MATLAB 50.80%

myo-matlab-interface-emg-gyro-accel's Introduction

Myo-MATLAB Interface


Intro

Simple interface demonstration for taking Myo Electromyography (EMG) data in near real time and piping to MATLAB; script shows the data on a graph as it comes in along with the Mean Absolute Value Feature.

Text files for EMG, accelerometer, gyroscope and orientation data are also generated including timestamps for syncing .

  • Distributed under a modified MIT Licence

    • For academic works please reference with the following key information: "A, Hartwell (2016) Myo-MATLAB Interface"
  • Requires Windows (OS based high res timestamps).

  • Build using Myo SDK 0.9 and Myo Connect 1.01


Usage

  1. Get Myo Connect and ensure running correctly
  2. Run realTimeFeatureExtractOptimised.m

Notes on Visual Studio Project

Uses a C++ executable built using Visual Studio 2015 Community Version which is included for reference. This will be run in a command prompt by the MATLAB script.

If recompiling the project you'll have to do some additional set up rather than just opening the project; see Myo SDK Website for further details of the SDK and how to use it as this will depend on operating system/compiler etc.


Potential Limitations

Like any true hack (MATLAB and real time aren't things that generally go together) there are potential issues :

  • Currently only works on windows due to taking millisecond precision time stamps from Windows.h

  • The use of a text file (emg.txt) as a bridge. The C++ code keeps it open in append mode for 15 samples at a time (CLOSE_COUNT_MAX in the C++ source); the file is then closed and reopened. Opening and closing on each write is possible but intermittently and inconsistently causes problems in the I/O as it likely hits some race hazard which will vary depending on your system/load/etc. Other potential issues include file size I/O problems and locking by other programs. File size is easily mitigated by clearing the text file between runs (as in the script) since the Myo battery will go before this becomes an issue.

  • Longest continuous gathering period tested thus far: ~2.5 hours

  • Modifying CLOSE_COUNT_MAX will allow MATLAB to read in bigger/smaller batches of data at a time but thorough testing on each system will need to be done to ensure stability with any use of the variable.

Have Fun ^^

myo-matlab-interface-emg-gyro-accel's People

Contributors

lif3line avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Forkers

csuzhhj

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.