<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Education | Soroush Dianaty, M.D.</title><link>https://soroushdianaty.com/tags/education/</link><atom:link href="https://soroushdianaty.com/tags/education/index.xml" rel="self" type="application/rss+xml"/><description>Education</description><generator>HugoBlox Kit (https://hugoblox.com)</generator><language>en-us</language><lastBuildDate>Wed, 23 Sep 2026 00:00:00 +0000</lastBuildDate><image><url>https://soroushdianaty.com/media/icon_hu_a589f346fc4c3e9d.png</url><title>Education</title><link>https://soroushdianaty.com/tags/education/</link></image><item><title>GaitScope: A Browser Lab for Movement-Sensor Signal Processing</title><link>https://soroushdianaty.com/projects/gaitscope/</link><pubDate>Wed, 23 Sep 2026 00:00:00 +0000</pubDate><guid>https://soroushdianaty.com/projects/gaitscope/</guid><description>&lt;p&gt;GaitScope is an interactive lab, in the browser, for learning how movement-sensor signals are processed. You record or load a walk from a phone&amp;rsquo;s accelerometer, then filter it, look at its spectrum, and put several step detectors on the same plot to see where and why they disagree. There is nothing to install, and files never leave the browser.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;
&lt;/strong&gt;&lt;/p&gt;
&lt;hr&gt;
&lt;h2 id="at-a-glance"&gt;At a glance&lt;/h2&gt;
&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;&lt;/th&gt;
&lt;th&gt;&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Status&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Early development. Started 2026-09-23; version 0.1.0, no tagged release yet. Features still change from week to week.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Role&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Maintainer: directs and reviews all work; code, tests and documentation largely written with Claude Code (Anthropic&amp;rsquo;s AI coding assistant) — see
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Origin&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;A class project in BME 598/494 &lt;em&gt;Wearable Devices for Sport, Health, and Wellness&lt;/em&gt; (ASU, Dr. Aurel Coza), Fall 2026&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Domain&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Wearable sensing, digital signal processing, education&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;License&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;MIT for now; a move to AGPL-3.0 is planned, pending the course instructor&amp;rsquo;s permission for the port of the course detector (
)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Repository&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Live app&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;hr&gt;
&lt;h2 id="why-it-exists"&gt;Why it exists&lt;/h2&gt;
&lt;p&gt;The course provides a MATLAB step-detection script, &lt;code&gt;LabStepDet_2025.m&lt;/code&gt;, and a sample recording. Students may skip MATLAB and use an AI tool to run the code instead. GaitScope started there, with a Python port of the script and a browser dashboard to run it on other recordings.&lt;/p&gt;
&lt;p&gt;Working through the script made a broader point visible. A step count depends on choices that are easy to miss: the sampling rate the code assumes, the threshold, which axis of the phone you analyse, where the phone sits on the body, and how ties and stray peaks are handled. GaitScope puts those choices on the screen, so a student can change one and see what happens to the steps.&lt;/p&gt;
&lt;hr&gt;
&lt;h2 id="what-it-does"&gt;What it does&lt;/h2&gt;
&lt;p&gt;&lt;strong&gt;Bring a walk.&lt;/strong&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Upload a MATLAB &lt;code&gt;.mat&lt;/code&gt; file (v5 to v7.3), a Physics Toolbox Sensor Suite CSV export, a phyphox export zip, or any CSV with numbers in columns.&lt;/li&gt;
&lt;li&gt;Or record a walk on a phone with the browser&amp;rsquo;s motion sensors, with no app to install. The page asks how many steps you counted and where the phone was, and compares your count with the detectors.&lt;/li&gt;
&lt;li&gt;Reopen a previous analysis from a GaitScope JSON export.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;strong&gt;Check the file.&lt;/strong&gt; Every file is checked against a documented
before analysis. The rule is to be strict where bad input would give wrong numbers with no visible sign, and lenient where a person looking at the plot can judge. Each problem comes with a concrete fix, such as the MATLAB line to re-save a file in a readable format.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Prepare the signal.&lt;/strong&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Pick x, y, z or the magnitude; when the recording includes gravity, also the vertical and horizontal acceleration.&lt;/li&gt;
&lt;li&gt;Resample to a chosen rate (linear or monotone cubic, with optional anti-aliasing).&lt;/li&gt;
&lt;li&gt;Filter: Butterworth, Bessel, Chebyshev I and II, elliptic, moving average, median, Savitzky–Golay, wavelet denoising and notch.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;strong&gt;Detect steps.&lt;/strong&gt; Detectors and envelopes work like indicators on a chart: any number on the plot at once, each with its own settings, colour and source signal (filtered or recorded), and its own metrics column.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Coza:&lt;/strong&gt; the course&amp;rsquo;s detector, ported exactly as written.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Coza (modified):&lt;/strong&gt; a variant of the same detector. It counts tied peaks once, drops start and stop artefacts, uses a window in seconds and real timestamps, and reports cadence.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Threshold peaks, Peak-to-valley and Zero-crossing:&lt;/strong&gt; three textbook detectors, each credited to its source.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Envelopes and bands:&lt;/strong&gt; sliding window, peak-trough, dynamic threshold, mean ± k·SD, Hilbert envelope and percentile band. They are a view only and never change the steps.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;strong&gt;Read the results.&lt;/strong&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Metrics&lt;/strong&gt; per detector: steps, step duration, cadence, step-time variability, gait asymmetry, walking span and harmonic ratio. All detectors&amp;rsquo; metrics come from the same function, working only from step times, so the columns compare directly.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Frequency domain:&lt;/strong&gt; a whole-recording view (Welch&amp;rsquo;s spectrum, Lomb–Scargle, autocorrelation) and an over-time view (spectrogram, Morlet wavelet scalogram, wavelet bands, Hilbert–Huang spectrum). Walking shows as a peak, which gives a cadence without detecting any steps. That is an independent cross-check on the detectors.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Step intervals&lt;/strong&gt;, a &lt;strong&gt;steps table&lt;/strong&gt;, and &lt;strong&gt;notes&lt;/strong&gt; pinned to the plot or the spectrum (&amp;ldquo;turned around&amp;rdquo;, &amp;ldquo;counted twice&amp;rdquo;).&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;strong&gt;Export&lt;/strong&gt; in the format each tool expects: CSV, a zip of CSVs, a MATLAB &lt;code&gt;.mat&lt;/code&gt; struct, NumPy &lt;code&gt;.npz&lt;/code&gt; (no pickle), or JSON, which reopens the whole analysis in GaitScope. Sample numbers are 1-based, as in MATLAB.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Python port.&lt;/strong&gt; &lt;code&gt;python/lab_step_det.py&lt;/code&gt; is a 1:1 translation of the course script. It reads the same file types and writes the same export layout.&lt;/p&gt;
&lt;hr&gt;
&lt;h2 id="how-the-methods-are-checked"&gt;How the methods are checked&lt;/h2&gt;
&lt;p&gt;The repository separates three kinds of evidence and states the limit of each.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;1. The course detector matches the original script.&lt;/strong&gt; On the course&amp;rsquo;s sample walk, the dashboard, the Python port and GNU Octave running &lt;code&gt;LabStepDet_2025.m&lt;/code&gt; give identical steps and metrics on all three axes.
&lt;em&gt;Limit:&lt;/em&gt; the course files are not in the repository, so this check runs only on a machine that has them, not in continuous integration. CI checks the same code on a synthetic walk.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;2. Each method agrees with an established library.&lt;/strong&gt; Test fixtures are generated by the reference implementation, and the tests compare against them on every pull request:&lt;/p&gt;
&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Method&lt;/th&gt;
&lt;th&gt;Reference&lt;/th&gt;
&lt;th&gt;Tolerance&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;IIR filters (Butterworth, Bessel, Chebyshev I/II, elliptic)&lt;/td&gt;
&lt;td&gt;scipy&lt;/td&gt;
&lt;td&gt;1e-9&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Moving average, median, Savitzky–Golay, wavelet denoising, notch&lt;/td&gt;
&lt;td&gt;scipy, PyWavelets&lt;/td&gt;
&lt;td&gt;1e-9&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Resampling&lt;/td&gt;
&lt;td&gt;the Python port (numpy, scipy)&lt;/td&gt;
&lt;td&gt;linear bit for bit; cubic and anti-aliased 1e-12&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;FFT, Welch, spectrogram&lt;/td&gt;
&lt;td&gt;numpy, scipy&lt;/td&gt;
&lt;td&gt;1e-12 (relative)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Lomb–Scargle, autocorrelation&lt;/td&gt;
&lt;td&gt;scipy, numpy&lt;/td&gt;
&lt;td&gt;1e-12, 1e-13&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Morlet wavelet transform, Daubechies-4 bands&lt;/td&gt;
&lt;td&gt;PyWavelets&lt;/td&gt;
&lt;td&gt;1e-10 (relative), 1e-12&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Empirical mode decomposition&lt;/td&gt;
&lt;td&gt;PyEMD&lt;/td&gt;
&lt;td&gt;1e-9&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;p&gt;Every export format is read back with an independent reader (scipy, numpy, Python&amp;rsquo;s &lt;code&gt;zipfile&lt;/code&gt; and &lt;code&gt;csv&lt;/code&gt;, and Octave when installed).
&lt;em&gt;Limit:&lt;/em&gt; agreement is shown on test inputs. It is evidence that the code computes the intended method, not proof for every input.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;3. A few real walks with hand-counted steps.&lt;/strong&gt; On 2026-10-07 the maintainer recorded four walks with the dashboard and counted the steps: three on a Pixel 9a (10, 28 and 60 steps) and one on an iPad (24 steps). Inside the walk, Coza (modified), Threshold peaks, Peak-to-valley and Zero-crossing were within 2 of the count on the total acceleration and within 1 on the vertical. The unmodified Coza found 45 of 60 at the phone&amp;rsquo;s rate of about 60 Hz, because its window is counted in samples and assumes 100 Hz; resampled to 100 Hz, it found all 60.
&lt;em&gt;Limit:&lt;/em&gt; one person, two devices, a normal pace, two phone positions. That is too little to rank the detectors or to call any of them accurate.&lt;/p&gt;
&lt;hr&gt;
&lt;h2 id="signal-pipeline"&gt;Signal pipeline&lt;/h2&gt;
&lt;div class="mermaid"&gt;
flowchart TD
A["Load or record&lt;br/&gt;.mat, Physics Toolbox CSV, phyphox zip,&lt;br/&gt;any CSV, phone recording, JSON export"] --&gt; B["Input-schema checks&lt;br/&gt;error / warn / info, each with a fix"]
B --&gt; C["Signal to analyse&lt;br/&gt;x, y, z, magnitude, vertical, horizontal"]
C --&gt; D["Resample (optional)&lt;br/&gt;linear or pchip, anti-aliasing"]
D --&gt; E["Filter (optional)"]
E --&gt; F["Step detectors&lt;br/&gt;Coza, Coza (modified), Threshold peaks,&lt;br/&gt;Peak-to-valley, Zero-crossing"]
D -. "recorded signal" .-&gt; F
E --&gt; G["Envelopes and bands&lt;br/&gt;view only"]
F --&gt; H["Metrics&lt;br/&gt;one function for every detector"]
E --&gt; I["Frequency domain&lt;br/&gt;spectral cadence, steps from the rhythm"]
I -. "cross-check" .-&gt; H
H --&gt; J["Export&lt;br/&gt;CSV, zip, .mat, .npz, JSON"]
G --&gt; J
&lt;/div&gt;
&lt;p&gt;The browser app is a static page with no build step: plain JavaScript, with Plotly for the charts. The computational core (&lt;code&gt;src/core.js&lt;/code&gt;) has no DOM access, so the same code runs under Node in the tests.&lt;/p&gt;
&lt;hr&gt;
&lt;h2 id="status-and-roadmap"&gt;Status and roadmap&lt;/h2&gt;
&lt;p&gt;Development started on 2026-09-23. The app is live and usable, but there is no tagged release yet and behaviour still changes. The plan lives in the
. The main open threads:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Licence and purpose:&lt;/strong&gt; move to AGPL-3.0 and settle the educational aim, after the instructor&amp;rsquo;s permission (
,
).&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;More counted walks:&lt;/strong&gt; a back pocket, slow and fast walks, other people, and an iPhone, which has not been tested yet (
,
).&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;A citable release:&lt;/strong&gt; tag v0.1.0 and archive it on Zenodo for a DOI (
). Until then, cite the software through its &lt;code&gt;CITATION.cff&lt;/code&gt;, with the version used.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;An optional tutor:&lt;/strong&gt; research into what a language-model tutor running in the browser would cost, and whether small models are good enough (
,
).&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Plugins&lt;/strong&gt; for user-supplied detectors, envelopes and filters (
).&lt;/li&gt;
&lt;/ul&gt;
&lt;hr&gt;
&lt;h2 id="what-it-is-and-what-it-isnt"&gt;What it is, and what it isn&amp;rsquo;t&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;It is a teaching and exploration tool.&lt;/strong&gt; It is for students and instructors who want to see what a filter, a spectrum or a step detector does to a real signal, and why two detectors disagree.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;It is not a validated gait-measurement instrument.&lt;/strong&gt; Step counts, cadence and the other metrics have been compared with hand-counted steps on a few walks by one person, nothing more. They have not been validated across people, devices or walking conditions, or against a reference system such as an instrumented walkway.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;It is not for clinical use.&lt;/strong&gt; Do not use it to diagnose, monitor or make decisions about anyone&amp;rsquo;s health.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Other known limits:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Phone recording needs https and the screen on. Browsers stop sending motion data when the screen locks, so a recording ends there (
).&lt;/li&gt;
&lt;li&gt;Whether each peak is a step or a stride depends on the axis and where the phone is carried; how the page should decide is still under investigation (
).&lt;/li&gt;
&lt;li&gt;The Python port covers only the course detector; the other detectors and the harmonic ratio are not ported yet (
).&lt;/li&gt;
&lt;li&gt;The page loads its charting libraries from a CDN, so it needs an internet connection.&lt;/li&gt;
&lt;/ul&gt;
&lt;hr&gt;
&lt;h2 id="use-in-teaching"&gt;Use in teaching&lt;/h2&gt;
&lt;p&gt;GaitScope is built for the questions a signal-processing or wearables lab tends to raise: what does this filter remove, why does the spectrum show a peak at half the step rate, why does the same detector find different steps at 60 Hz and 100 Hz. Each method shows its settings and credits its authors, with a DOI where one exists, on the page and in exports.&lt;/p&gt;
&lt;p&gt;Its use in a course has not been settled. How the educational side will work is still to be decided (
), and questions to the course instructor, including whether a Python version is acceptable for submissions, are open (
). Students taking BME 598/494 are asked to check the course&amp;rsquo;s rules before contributing, since a contribution may count as shared work on an assignment.&lt;/p&gt;
&lt;hr&gt;
&lt;h2 id="credits"&gt;Credits&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Coza&lt;/strong&gt; and the course&amp;rsquo;s sample walk come from BME 598/494 &lt;em&gt;Wearable Devices for Sport, Health, and Wellness&lt;/em&gt; (ASU, Dr. Aurel Coza). The course files are not in the repository; the detector is ported and credited to Dr. Coza.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Coza (modified):&lt;/strong&gt; Soroush Dianaty.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Every other method&lt;/strong&gt; credits its authors on the page and in exports; the full list is under Credits in
.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Who did what&lt;/strong&gt;, including the use of AI, is recorded in
.&lt;/li&gt;
&lt;/ul&gt;
&lt;hr&gt;
&lt;h2 id="related-work-on-this-site"&gt;Related work on this site&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;
: the research pillar on wearable sensor data. GaitScope is a teaching tool rather than part of that research, but it works with the same kind of signal.&lt;/li&gt;
&lt;/ul&gt;</description></item></channel></rss>