Skip to content
/ EMGProc Public

Electromyography Processing application at Neuro, Nano and Quantum Computing (slo. Nevro, Nano in Kvantno Računalništvo)

License

Notifications You must be signed in to change notification settings

jonpas/EMGProc

Repository files navigation

FERI-EMGProc

Electromyography Processing application at Neuro, Nano and Quantum Computing (slo. Nevro, Nano in Kvantno Računalništvo).

Includes PCA analysis script and helper applications for processing conversions and model fitment.

Usage

Following are most useful usage patterns and do not describe all patterns of the application. Run with -h to show all available arguments.

Core

  • $ emgproc.py to read raw data at 200 Hz from Myo device.
  • $ emgproc.py -r rec.csv to playback a CSV recording at 200 Hz.
  • All arguments support recorded and raw data.
  • $ emgproc.py --rms to smooth the data in real-time.
  • $ emgproc.py --s to put Myo into deep sleep (shut down).

Visualizer Controls

  • R to record to a CSV file (using selected processing).
  • P to pause data reading.
  • Q to quit the application.

Processing

PCA, ICA and SVM fitting and processing is available in real-time (with visualizer) as well as separate command line mode for conversions and fitting. Example training data is located in training/ folder.

All training was performed with the Myo armband positioned on the most dominant arm, just below the elbow, with the Myo logo on the inner side of the arm.

Process data in real-time:

  • $ emgproc.py --pca *_raw.csv fit at start using given training data.
  • $ emgproc.py --ica model.ica given training model.

Fit and save model to a file:

  • $ emgfit.py --pca *_raw.csv creates <timestamp>_model.pca
  • $ emgfit.py --ica model.ica creates <timestamp>_model.ica

Convert recording to processed recording:

  • $ emgconvert.py example_raw.csv --pca *_raw.csv creates example_pca.csv

Game

Small proof of concept game based on wultes/snapy. It features Myo gesture recognition (extension and flexion) to control snake movement.

  • Place Myo armband on your most dominant arm, just below the elbow, with the Myo logo on the inner side of the arm.
  • Run with $ python emggame.py (using 2 PCA components 2comp training models).

Best gesture recognition is achieved by performing extension and flexion quickly and slowly returning to the idle position to prevent triggering the opposite gesture on the way back.

emggame

Setup

Targetted at Python 3.8.

  • $ python -m venv venv (virtual environment)
  • $ source venv/bin/activate
  • $ pip install -r requirements.txt ($ pip freeze > requirements.txt to update dependencies)
    • Installs all required packages.

Dependencies:

About

Electromyography Processing application at Neuro, Nano and Quantum Computing (slo. Nevro, Nano in Kvantno Računalništvo)

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages