Skip to content

Add posturography, physiological-signal, and mocap-I/O utilities#352

Merged
alexarje merged 4 commits into
masterfrom
sound-motion-analysis-pr2
Jul 16, 2026
Merged

Add posturography, physiological-signal, and mocap-I/O utilities#352
alexarje merged 4 commits into
masterfrom
sound-motion-analysis-pr2

Conversation

@alexarje

Copy link
Copy Markdown
Contributor

Second batch of study-derived methods (independent of #351):

  • _posture.py — a full posturography battery: CoP sway metrics (path length/rate, 95% confidence-ellipse area, ML/AP stats, mean sway frequency), convex-hull area, stabilogram diffusion (Collins–De Luca), DFA, sample entropy, spectral edge frequencies, sway texture (frozen-fraction/burst-rate), PCA sway orientation + anisotropy, axial Rayleigh statistics (with correct angle doubling), and spatial-extent / drift-decomposition metrics.
  • _physio.py — respiration-rate estimation (band-pass + Welch peak per window) and spectral band-fraction diagnostics for QoM signals (how much of a near-still signal is cardiorespiratory).
  • _mocap.py — a robust QTM/TSV reader (consolidating several ad hoc loaders), video-vs-mocap envelope validation, and a band-limited dominant-frequency helper (module-level only; not re-exported to avoid shadowing the existing _analysis.dominant_frequency).

38 new tests with known-answer synthetics (white-noise DFA α≈0.5, random-walk SDA H≈0.5, sine-vs-shuffled sample entropy, synthetic breathing at 15 br/min, in-test QTM fixtures). No new suite failures. Sources: stillstanding project and Westney comparisons (self-port).

🤖 Generated with Claude Code

alexarje and others added 4 commits July 16, 2026 09:14
Ports the still standing study's posturography stack into pure numpy/scipy:
CoP sway metrics, confidence-ellipse and convex-hull area, Collins-De Luca
stabilogram diffusion, DFA, sample entropy, spectral edges, sway texture,
sway orientation, axial Rayleigh, spatial extent, and principal-axis
projection. From-scratch SDA/DFA/SampEn are validated against known-answer
synthetic signals.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0147io2kMk8M6jcNFNt1G96m
Ports the still standing study's physiology features: windowed respiration
rate (band-pass + Welch peak per window) and caller-supplied spectral band
fractions (the cardiorespiratory spectral-composition diagnostic, with bands
supplied by the caller so there is no sensor dependency). Registers the
_posture and _physio exports in the package namespace. Validated against a
0.25 Hz breathing sinusoid (~15 br/min) and a two-tone band split.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0147io2kMk8M6jcNFNt1G96m
Consolidates the several near-duplicate QTM/TSV loaders into one robust
read_qtm_tsv (MARKER_NAMES header, autodetected data start, zeros->NaN,
encoding fallback, returns marker names / [T,M,3] array / fs). Adds
compare_modality_envelopes (per-second resample + Pearson r, decoupled from
QoM computation) and a Welch-based dominant_frequency (not re-exported at
package level to avoid colliding with _analysis.dominant_frequency).
Validated with an in-test QTM TSV fixture and known-lag envelopes.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0147io2kMk8M6jcNFNt1G96m
@alexarje
alexarje merged commit efec9fb into master Jul 16, 2026
1 of 10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant