Skip to main content

TiltX

Feature extraction from mobile phone motion sensor data

This repository implements a method which extracts some of the key features from mobile phone motion sensor data.

At t=0 a visual stimulus appears on the screen. As the response, a participant (person holding the phone) is required to tilt the phone in a specific direction (left, right, up, or down). Once the roll or picth angle reaches 0.5 radians (t=T>0), the movement is completed. T is the event time registered by the app. The rotaion along the third axis (yaw) does not affect the outcome of the task, hence it is neglected.

The features extracted by TiltX are: reaction time, L1 norms, maximal deviation, number of turning points, and sample entropy.

Usage

These steps introduce how to use TiltX.

Input data

The DataGenerator is a utility class that generates sample datasets.

from tiltx.data_generator import DataGenerator
t, alpha, beta = DataGenerator.example(1)

Note: t, alpha, and beta need to be equal length arrays.

Extract features

The FeatureExtractor extracts key features from the data.

from tiltx.feature_extractor import FeatureExtractor
features = FeatureExtractor(t,alpha,beta,RT_method='cumsum',correct='up')

Note: cumsum is a method for reaction time detection and correct is the direction in which the phone should be tilted in order to successfully complete the task.

print('Reaction time: %.3f'%(features.RT))
print('L1-norm of the triggering axis: %.3f'%(features.L1_x))
print('L1-norm of the remaining (non-triggering) axis: %.3f'%(features.L1_y))

Reaction time: 0.669
L1-norm of the triggering axis: 0.492
L1-norm of the remaining (non-triggering) axis: 0.006

Visualize

By calling plot() function in FeatureExtractor, we plot the roll and pitch angles from the moment the stimulus appears till the moment when the app registers the move as completed.

features.plot()

  • x is a triggering angle (the one which reaches 0.5 radians first)
  • y is the remaining (non-triggering) angle
  • the shaded regions are proportional to L1 norms
  • the black dotted line marks the begining of the reaction

Documentation

For a tutorial and a brief note on signal features, check out the notebooks folder.

Metadata

Release files for tiltx 0.0.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for tiltx 0.0.1
File Size Uploaded
tiltx-0.0.1.tar.gz 8.3 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for tiltx 0.0.1
File Interpreter ABI Platform
tiltx-0.0.1-py3-none-any.whl Python 3 none any Details

Total release size: 18.5 kB

Release files / tiltx-0.0.1.tar.gz

Download URL tiltx-0.0.1.tar.gz
Size 8.3 kB
Tags Source
SHA-256 checksum
How to use checksums
8b9555560f1c76b2528b45b3c9df9ba3802ac4dbc43bb3993cfe1824d1b04f19
BLAKE2b-256 checksum
How to use checksums
015bbe2eaaf89eb315760624976b29e5c9f1c99e23aaf939713962845460aba9
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/2.0.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/39.0.1 requests-toolbelt/0.9.1 tqdm/4.36.1 CPython/3.6.5

Release files / tiltx-0.0.1-py3-none-any.whl

Download URL tiltx-0.0.1-py3-none-any.whl
Size 10.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
5de6fee71444bd229fd4aca5b20c7f76cbbb2acd41bb28d9458e2ad09dbdc7b8
BLAKE2b-256 checksum
How to use checksums
398aca36487f44e61193a3120d2993380d3935629c82e32732d3ad5f7531baa2
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/2.0.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/39.0.1 requests-toolbelt/0.9.1 tqdm/4.36.1 CPython/3.6.5

Release history Release notifications | RSS feed

This release

0.0.1 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page