emgteach: an open-source teaching platform for surface electromyography
Abstract
emgteach is an open-source Python package that provides a unified PySide6 desktop application for real-time acquisition, offline analysis and maximum voluntary contraction (MVC) normalisation of surface electromyography (sEMG) signals. It is designed for hands-on biopotential acquisition in undergraduate physiology teaching laboratories, and is meant to be set up by instructors with different levels of technical background and used directly by students during a practical session. The application is hardware-agnostic through a common AcquisitionDevice interface and ships with two interchangeable low-cost backends: BITalino (revolution) over Bluetooth, and an Arduino RedBoard Plus + MyoWare 2.0 over USB serial (open firmware included). A single setting switches between them. Main features: Three-tab GUI (Acquisition, Analysis, MVC normalisation) wrapping a reusable, Qt-free analytic core. Bilingual interface (English / Spanish) with automatic start-up language detection and an in-app language switch. Two-channel acquisition (e.g. agonist/antagonist) with a stacked two-channel live view. Automatic contraction-onset detection (baseline + k·SD threshold) stored as EDF+ annotations. Muscle-load analysis (Jonsson APDF): static (P10), median (P50) and peak (P90) %MVC levels, both offline and as a live monitor with warning/danger zones. One-click PDF session and MVC/muscle-load reports. Reliable EDF+ output using a buffered-write pattern that avoids a silent file-corruption artefact during continuous streaming. Reproducible synthetic signals for class assignments and hardware-free continuous integration. Assisted selection of significant fragments, with an editable fragment editor (detection parameters and envelope-filter cut-offs) applied to the analysis. CSV export of results and a live signal-quality check during recording. An ECG signal profile alongside EMG, selectable through a profile registry. Classroom mode: a read-only live dashboard served over the local network so students follow the session on their phone/tablet browser (no install), with a per-session access code so the follower link only works while the broadcast is running. Kinematics via the BITalino accelerometer (v2.0.0): a movement-versus-EMG analysis panel, a guided force-velocity acquisition wizard (an MVC maximum followed by cued quick lifts, each auto-marked with its load), and a force-velocity study that turns one recording into the load-velocity, Hill force-velocity, power and recruitment curves. Since v3.0.0 the accelerometer's input is a stated convention (muscle on A1, accelerometer on A2) rather than a selectable channel. Configuration by practical (v3.0.0): three practicals — one muscle, agonist/antagonist and muscle kinematics — fix the channel count, the accelerometer and what each tab offers, replacing the settings that were previously chosen one at a time. The session as a single file with its phases marked inside it (v3.0.0): warm-up, calibration repetitions, preparation and recording, so the maximum voluntary contraction every percentage is measured against travels with the signal, and a derived (tuned) recording carries the decisions taken on screen. Teaching layer (v3.0.0): a guided tour over the interface, contextual help on every box, one analysis row per contraction with its electromechanical delay, and an agonist/antagonist co-activation index (Falconer-Winter) computed per marked phase in %MVC. Handling at the laboratory bench (v3.1.0): the fragment editor as a three-step procedure that counts the marked contractions against the protocol and lets each be kept, dropped, split or dragged, with the detection sensitivity set per practical and recorded in the report and the CSV; a single running instance with a start-up splash; pictures of the electrode placement and the calibration in the guided tour; and a printable sheet for each station of the agonist/antagonist practical. Patch 3.1.1: the co-activation of a named window is read on the uncut recording, with each muscle's resting level taken from the whole recording phase, so choosing fragments no longer measures the antagonist against a rest taken from a signal with no rest in it. Patch 3.1.2: the calibration asks for a brief, explosive maximal jerk of each muscle's own movement (wrist flexion with the fist clenched for the forearm flexor, wrist extension with the hand open for the extensor) instead of a sustained push against something fixed, and releases carry the source only. emgteach runs on Windows, macOS and Linux with Python 3.10–3.12, is covered by a suite of 1078 automated tests, and is released under the GPL-3.0-or-later license. Source code, documentation and issue tracker: https://github.com/aagisto-maker/emgteach Started in 2025 as the author's own Python programs over open-source libraries and the boards' interfaces; brought together into a single application and developed since with the assistance of an AI coding tool (Claude Code, Anthropic) under the author's specification, review and hardware validation. See the README section "How this software was developed".