1. Overview & Biophysical Kinematics
Smartphones and portable smart devices house solid-state Micro-Electro-Mechanical Systems (MEMS) capable of high-rate inertial tracking. The two foundational sensor architectures are the piezoresistive/capacitive triaxial accelerometer and the vibrating-structure Coriolis gyroscope.
In human biomechanics, physical therapy, and sport kinematics, these built-in sensors provide a high-frequency, non-invasive telemetry apparatus for continuous postural tracking, gait impairment diagnostics, and dynamic tremor classification. DeviceSense renders a mathematical simulation and hardware-interfaced sandbox bridging mobile sensor events ($DeviceMotionEvent$ and $DeviceOrientationEvent$) directly to triaxial spatial attitude, kinematic jerks, and acoustic audio feedback loops.
2. Spatial Coordinate Transformations & Euler Angle Derivation
The World Geodetic Coordinate Frame $N = \{X_n, Y_n, Z_n\}$ follows an East-North-Up (ENU) convention, whereas the Device Coordinate Frame $B = \{X_b, Y_b, Z_b\}$ is pinned to the physical screen chassis:
- $X_b$ (Lateral Axis): Directed rightward through the screen edge. Rotation about $X_b$ corresponds to Pitch ($\beta$).
- $Y_b$ (Longitudinal Axis): Directed upward through the top speaker edge. Rotation about $Y_b$ corresponds to Roll ($\gamma$).
- $Z_b$ (Normal Axis): Directed orthogonally out of the display face toward the user. Rotation about $Z_b$ corresponds to Yaw / Heading ($\alpha$).
The Direction Cosine Matrix (DCM) transforming vectors from the device frame into the inertial world frame is formulated via intrinsic $Z-X'-Y''$ Tait-Bryan rotations:
$$R_{b}^{n}(\alpha, \beta, \gamma) = R_z(\alpha) R_x(\beta) R_y(\gamma)$$
Expanding these elementary rotation matrices:
$$R_z(\alpha) = \begin{bmatrix} \cos\alpha & -\sin\alpha & 0 \\ \sin\alpha & \cos\alpha & 0 \\ 0 & 0 & 1 \end{bmatrix}, \quad R_x(\beta) = \begin{bmatrix} 1 & 0 & 0 \\ 0 & \cos\beta & -\sin\beta \\ 0 & \sin\beta & \cos\beta \end{bmatrix}, \quad R_y(\gamma) = \begin{bmatrix} \cos\gamma & 0 & \sin\gamma \\ 0 & 1 & 0 \\ -\sin\gamma & 0 & \cos\gamma \end{bmatrix}$$
At $\beta = \pm 90^\circ$, the system approaches a mathematical singularity known as gimbal lock, where Yaw ($\alpha$) and Roll ($\gamma$) describe rotation about the same physical vertical axis. In high-performance bio-kinematics, unit quaternions $\mathbf{q} = [q_0, q_1, q_2, q_3]^T \in \mathbb{H}$ are frequently deployed to eliminate this trigonometric discontinuity:
$$\dot{\mathbf{q}} = \frac{1}{2} \mathbf{q} \otimes \boldsymbol{\omega}_b$$
where $\boldsymbol{\omega}_b = [0, \omega_x, \omega_y, \omega_z]^T$ denotes instantaneous angular velocity measured in rad/s.
3. Gravitational Vector Isolation & Sensor Fusion
An accelerometer in static equilibrium measures the normal contact force counteracting gravitational acceleration, manifesting as $1g \approx 9.80665 \text{ m/s}^2$ directed along the local zenith. Dynamic biomechanical locomotion superimposes true translational acceleration $\vec{a}_{\text{dyn}}$ onto the static gravitational vector $\vec{g}$:
$$\vec{a}_{\text{total}} = \vec{a}_{\text{dyn}} + \vec{g}$$
To separate high-frequency movement from static gravity, DeviceSense supports a dual-layer complementary filter. The estimated pitch $\hat{\beta}$ and roll $\hat{\gamma}$ fuse high-bandwidth gyroscopic integration with long-term low-frequency accelerometer tilt angles:
$$\theta_{\text{acc}} = \arctan\left(\frac{A_y}{\sqrt{A_x^2 + A_z^2}}\right), \quad \phi_{\text{acc}} = \arctan\left(\frac{-A_x}{A_z}\right)$$
$$\hat{\theta}_{k} = \lambda \cdot (\hat{\theta}_{k-1} + \omega_y \Delta t) + (1 - \lambda) \cdot \theta_{\text{acc}}$$
where the fusion parameter $\lambda = \frac{\tau}{\tau + \Delta t} \approx 0.96$ is governed by the time constant $\tau$, effectively discarding drift while rejecting impulsive linear accelerations.
4. Bio-Kinetic Gait Analysis & Tremor Classification
When secured near the lumbar center of mass ($L3-L5$ vertebrae) during human locomotion, the phone captures cyclic accelerometric waveforms corresponding to the fundamental gait cycle:
- Heel Strike (Initial Contact): Yields a prominent positive deceleration spike along the vertical $Z_b$ and anterior-posterior $Y_b$ axes.
- Midstance: Accelerations settle toward $1g$ equilibrium as the limb supports the full gravitational load.
- Toe-Off: Characterized by an anterior propulsion jerk followed by limb swing.
The instantaneous kinematic jerk vector $\vec{j}(t)$, describing rate of force change, is evaluated via the discrete backward difference:
$$\vec{j}(t) = \frac{d\vec{a}}{dt} \approx \frac{\vec{a}(t) - \vec{a}(t - \Delta t)}{\Delta t}$$
Parkinsonian resting tremor typically oscillates in the $4-6\text{ Hz}$ frequency band, whereas essential tremor occurs within $8-12\text{ Hz}$. By monitoring real-time root-mean-square acceleration and sample variances, clinicians evaluate postural sway ellipses and identify early motor degradation.
5. How to Use & Experimental Sandbox Procedures
- Hardware Acquisition: On mobile devices (Safari on iOS or Chrome on Android), click Request Physical Sensors to initiate the secure permission handshake. Hold the phone flat to inspect the $9.8\text{ m/s}^2$ vertical baseline.
- Interactive 3D Canvas Attitude: On desktop, click and drag directly over the 3D phone model on the canvas to rotate its physical attitude in real time. Notice how the visualizer cursor shifts dynamically between crosshair and grabbing states.
- Kinematic Sliders: Manually modulate triaxial acceleration ($A_x, A_y, A_z$) and orientation angles ($\alpha, \beta, \gamma$) to inspect the dual-channel live oscilloscopes and verify coordinate cross-talk.
- Auditory Sonification: Toggle SOUND to activate real-time audio mapping. The synthesized frequency tracks net motion magnitude $\|\vec{A}\|$, while lateral tilt modulates spatial filter attenuation.
- Interactive Demo Tour: Click DEMO to launch the multi-chapter educational walkthrough. Use the audio scrubber to navigate through gravitational baselines, gait dynamics, and sensor fusion principles.
- Data Export: Expand the Telemetry Signal Log and click Export CSV to save timestamped kinematic datasets for offline analysis in MATLAB, Python, or R.
6. Kinetic Resource & Sensor Directory
Open Access License: This interactive educational module is released under
CC BY-NC 4.0 (Attribution-NonCommercial)
for non-commercial research, academic study, and clinical education.
Commercial & Enterprise Licensing: For white-labeling, proprietary LMS/course embedding, hardware dashboard telemetry integration, or custom feature engineering, secure a commercial license at
BioniCloud.com or contact
Dr. Yuri Beno.