Skip to content

hrelab/emg-processer

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

18 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

emg-processer

This repository contains the code to process a set of emg data from Delsys.

Export "y_data", NOT "yt_data". We do not need the time series data as we can easily recreate it


Running the Code

First, you must start/create the python environment. The simplest way to do this is with a virtual environment, the steps are:

  1. cd to the emg-processer directory
  2. create the venv: python -m venv venv
  3. start the venv:
    1. Mac - source venv/bin/activate
    2. Linux - source venv/Scripts/activate
    3. Windows Powershell - .\venv\Scripts\Activate.ps1
    4. Windows Bash - venv\Scripts\activate.bat
  4. install the requirments: pip install -r requirements.txt

To run the code, there are a few arguments to know. I will list them here, but you can also read details about them with the python main.py --help command

  1. Required Arguments (Must be in this order)
    1. filepath: Name of file (including ".csv"), and path leading to it
    2. emgNum: Number of EMG's used (1 quattro = 4 emgs)
    3. emgFreq: Frequency that the emg data was taken at
  2. Optional Arguments (Can be in any order)
    • --imuNum: If IMU's were used, how many?
    • --imuFreq: If IMU's were used, what is the sampling frequency?
      • If --imuNum is used, this must be specified as well
    • --proc: Used if we want to process the data. When doing this, put the rms window size (in ms) we want to use
      • If this command is not used, the raw data will be visualized
      • Using this command, the data will become rectified and smoothed with the specified rms window
      • This command only processes EMG data, never the IMU data
    • --save: This command is used if you want to save the processed data. This can be ran with or without the --proc, but the saved files will be the same as the orginals

Examples

  1. Data found at data/y-data.csv, using 2 quattros saved at 2222.2222 Hz

    • Vizualize raw data: python main.py data/y-data.csv 8 2222.2222
    • Visualize processed data (50 ms): python main.py data/y-data.csv 8 2222.2222 --proc 50
    • Visualize and save processed data: python main.py data/y-data.csv 8 2222.2222 --proc 20 --save proc_data/procData1.csv
  2. Data found at IMU.csv, using 1 quattro and using IMU data, emgFs is 2000.0 Hz, and imuFs is 148.148 Hz

    • Vizualize raw data: python main.py IMU.csv 4 2000 --imuNum 1 --imuFreq 148.148
    • Visualize processed data (50 ms): python main.py IMU.csv 4 2000 --imuNum 1 --imuFreq 148.148 --proc 50
    • Visualize and save processed data (100 ms): python main.py IMU.csv 4 2000 --imuNum 1 --imuFreq 148.148 --proc 100 --save proc_data/IMU_proc.csv

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors