Add posturography, physiological-signal, and mocap-I/O utilities#352
Merged
Conversation
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
…tes) Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_0147io2kMk8M6jcNFNt1G96m
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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