All Projects → sho-87 → sensormotion

sho-87 / sensormotion

Licence: MIT license
Package for analyzing human motion data (e.g. PA, gait)

Programming Languages

python
139335 projects - #7 most used programming language

Projects that are alternatives of or similar to sensormotion

dana
DANA: Dimension-Adaptive Neural Architecture (UbiComp'21)( ACM IMWUT)
Stars: ✭ 28 (-61.64%)
Mutual labels:  accelerometer, sensor-data
Excuser
An Android app which trigger a fake call on the device, just by shaking android wear on your wrist.
Stars: ✭ 25 (-65.75%)
Mutual labels:  accelerometer
wiimote-webhid
A Wiimote implementation using WebHID - AKA: Wiimote for the Web
Stars: ✭ 31 (-57.53%)
Mutual labels:  accelerometer
MotionCollector
iOS app for collecting data from internal motion sensors (gyroscope, magnetometer, accelerometer) of iPhone and Apple Watch.
Stars: ✭ 55 (-24.66%)
Mutual labels:  accelerometer
BetterJoyForDolphin
Allows the Nintendo Switch Pro Controller and Joycons to be used with the Dolphin Emulator
Stars: ✭ 44 (-39.73%)
Mutual labels:  accelerometer
mpu6050
MPU6050 Arduino Library
Stars: ✭ 141 (+93.15%)
Mutual labels:  accelerometer
Balance-Bot
A two-wheel self-balancing robot based on the ATmega2560 micro-controller.
Stars: ✭ 33 (-54.79%)
Mutual labels:  accelerometer
gaitutils
Extract and visualize gait data
Stars: ✭ 28 (-61.64%)
Mutual labels:  gait-analysis
ios logger
Application for camera and sensor data logging (iOS)
Stars: ✭ 60 (-17.81%)
Mutual labels:  accelerometer
LaunchPadFlightController
TM4C123G based Flight Controller
Stars: ✭ 62 (-15.07%)
Mutual labels:  accelerometer
SparkFun ADXL345 Arduino Library
Arduino Library for the ADXL345
Stars: ✭ 34 (-53.42%)
Mutual labels:  accelerometer
pymetawear
Community developed SDK around the Python bindings for the C++ SDK
Stars: ✭ 42 (-42.47%)
Mutual labels:  accelerometer
CodeDroneDIY
The most simple, but working, quadricopter flight controller from scratch, using Arduino Uno/Nano.
Stars: ✭ 68 (-6.85%)
Mutual labels:  accelerometer
GY-85
Arduino implementation for GY-85 (ADXL345 accelerometer, ITG3200 gyroscope and HMC5883L magnetometer)
Stars: ✭ 63 (-13.7%)
Mutual labels:  accelerometer
OpenMaterial
3D model exchange format with physical material properties for virtual development, test and validation of automated driving.
Stars: ✭ 23 (-68.49%)
Mutual labels:  sensor-data
embedded pedometer
Accelerometer-based pedometer algorithm for embedded applications
Stars: ✭ 71 (-2.74%)
Mutual labels:  accelerometer
imusensor
Python library for communication between raspberry pi and MPU9250 imu
Stars: ✭ 47 (-35.62%)
Mutual labels:  accelerometer
InterfaceInteraction
Interact your app's interface elements with different effects!
Stars: ✭ 57 (-21.92%)
Mutual labels:  accelerometer
adxl345
ADXL345 full function driver for general MCU and Linux.
Stars: ✭ 170 (+132.88%)
Mutual labels:  accelerometer
AndrOBD-Plugin
AndrOBD plugin development project
Stars: ✭ 38 (-47.95%)
Mutual labels:  accelerometer

Installation | Requirements | Usage | Contribution | Getting Help

Sensor Motion

PyPI - Python Version PyPI GitHub issues https://readthedocs.org/projects/sensormotion/badge/?version=latest https://badges.gitter.im/gitterHQ/gitter.png

Python package for analyzing sensor-collected human motion data (e.g. physical activity levels, gait dynamics).

Dedicated accelerometer devices, such as those made by Actigraph, usually bundle software for the analysis of the sensor data. In my work I often collect sensor data from smartphones and have not been able to find any comparable analysis software.

This Python package allows the user to extract human motion data, such as gait/walking dynamics, directly from accelerometer signals. Additionally, the package allows for the calculation of physical activity (PA) or moderate-to-vigorous physical activity (MVPA) counts, similar to activity count data offered by companies like Actigraph.

Installation

You can install this package using pip:

pip install sensormotion

Requirements

This package has the following dependencies, most of which are just Python packages:

  • Python 3.x
    • The easiest way to install Python is using the Anaconda distribution, as it also includes the other dependencies listed below
    • Python 2.x has not been tested, so backwards compatibility is not guaranteed
  • numpy
    • Included with Anaconda. Otherwise, install using pip (pip install numpy)
  • scipy
    • Included with Anaconda. Otherwise, install using pip (pip install scipy)
  • matplotlib
    • Included with Anaconda. Otherwise, install using pip (pip install matplotlib)

Usage

Here is brief example of extracting step-based metrics from raw vertical acceleration data:

Import the package:

import sensormotion as sm

If you have a vertical acceleration signal x, and its corresponding time signal t, we can begin by filtering the signal using a low-pass filter:

b, a = sm.signal.build_filter(frequency=10,
                              sample_rate=100,
                              filter_type='low',
                              filter_order=4)

x_filtered = sm.signal.filter_signal(b, a, signal=x)

images/filter.png

Next, we can detect the peaks (or valleys) in the filtered signal, which gives us the time and value of each detection. Optionally, we can include a plot of the signal and detected peaks/valleys:

peak_times, peak_values = sm.peak.find_peaks(time=t, signal=x_filtered,
                                             peak_type='valley',
                                             min_val=0.6, min_dist=30,
                                             plot=True)

images/peak_detection.png

From the detected peaks, we can then calculate step metrics like cadence and step time:

cadence = sm.gait.cadence(time=t, peak_times=peak_times, time_units='ms')
step_mean, step_sd, step_cov = sm.gait.step_time(peak_times=peak_times)

Physical activity counts and intensities can also be calculated from the acceleration data:

x_counts = sm.pa.convert_counts(x, time, integrate='simpson')
y_counts = sm.pa.convert_counts(y, time, integrate='simpson')
z_counts = sm.pa.convert_counts(z, time, integrate='simpson')
vm = sm.signal.vector_magnitude(x_counts, y_counts, z_counts)
categories, time_spent = sm.pa.cut_points(vm, set_name='butte_preschoolers', n_axis=3)

images/pa_counts.png

For a more in-depth tutorial, and more workflow examples, please take a look at the tutorial.

I would also recommend looking over the documentation to see other functionalities of the package.

Contribution

I work on this package in my spare time, on an "as needed" basis for my research projects. However, pull requests for bug fixes and new features are always welcome!

Please see the develop branch for the development version of the package, and check out the issues page for bug reports and feature requests.

Getting Help

You can find the full documentation for the package here

Python's built-in help function will show documentation for any module or function: help(sm.gait.step_time)

You're encouraged to post questions, bug reports, or feature requests as an issue

Alternatively, ask questions on Gitter

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].