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, andbetaneed 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:
cumsumis a method for reaction time detection andcorrectis 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()
xis a triggering angle (the one which reaches 0.5 radians first)yis 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)
| File | Size | Uploaded | |
|---|---|---|---|
| tiltx-0.0.1.tar.gz | 8.3 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| 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
|