Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

dukeduck1984/biosig

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

BIOLOGICAL AND TRANSDUCER SIGNAL PROCESSING

This Python package provides functions to process and plot biological (EMG) and transducer (force) signals.

This package will be extended over time to include functions to process other types of signals, and improve ease of package installation.

Version 1.1 DOI

Citation and license

If this code is used to analyse data or generate figures for publication, please cite the code as:

Diong J (2017) Biological and transducer signal processing in Python. DOI: 10.5281/zenodo.438155.

This code is released under the GNU General Public License.

Installation

Clone or download this package and navigate to the root directory of the package, then run:

pip install -e . 

where the -e flag is short for --editable and . refers to the current directory. Ie. this line will install the current directory in editable mode.

Alternatively (although this practice is not preferred for these reasons), clone or download this package and point Python to the root directory. For example:

import sys

sys.path.append("/home/joanna/Dropbox/Sketchbook/python/")
import biosig

Note, filepaths are specified differently in:

  • Linux or Mac: "/home/joanna/Dropbox/Sketchbook/python/"
  • Windows: "C:\\Users\\joanna\\Dropbox\\Sketchbook\\python\\"

Description

File structure:

  • biosig
    • emg
      • process
    • force
      • process
    • plot
    • readin
    • spectral

Dependencies

  • matplotlib
  • numpy
  • os
  • scipy
  • shutil
  • sys
  • warnings

Short example of usage

Supply a dictionary of names and data values. Read in the raw data, where data are stored in columns in a text file. Remove DC offset, band pass filter the EMG data, and calculate the root-mean-square (RMS) EMG.

import sys

sys.path.append("/home/joanna/Dropbox/Sketchbook/python/")
import biosig

channels = {'force':0, 'emg':1, 'distance':2}
data = biosig.readin.read_data('data.txt', channel=channels)
emg = data['emg']
emg = biosig.emg.process.remove_mean(emg)
emg_filt = biosig.emg.process.filter_bandpass(emg, fq=2000, highpass=30, lowpass=500)
rms_emg = biosig.emg.process.calc_rms(emg, fq=2000, window=50, plot=True) 

Acknowledgements

With thanks to Martin Héroux for contributions to the RMS EMG functions.

References

Merletti R and Parker P (2004) Electromyography : physiology, engineering, and noninvasive applications. John Wiley & Sons & Wiley InterScience (Online Service); Piscataway, NJ : IEEE Press, Hoboken, NJ.

About

Biological and transducer signal processing

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages