openbsl
Biopac Student Lab recordings, without Biopac Student Lab
Physiology labs record ECG, pulse and heart sounds with Biopac’s BSL software, then send you home with files that only BSL opens, on a license that lives in the lab. The analysis the report asks for is simple: select from one R wave to the next and read off Delta T, BPM and peak-to-peak amplitude. The data can still only be read on campus.
openbsl reads the files with the open-source bioread parser, exports them to CSV, and builds a static page that reproduces the part of BSL a lab report needs. You drag across the trace, read the same measurement boxes BSL shows, label the selection, and the lesson’s data report tables fill themselves in. It handles Lessons 5 (ECG), 6 (ECG II: Einthoven’s law and the mean electrical axis), 7 (ECG & pulse), 16 (blood pressure) and 17 (heart sounds).
For Lessons 6 and 16 it also does the analysis itself. openbsl axis measures the QRS waves on Leads I and III and draws the vectorgrams the report asks you to plot with a protractor. openbsl bp finds the Korotkoff sounds on the stethoscope channel and reports the cuff pressure where the microphone heard systolic and diastolic, next to where the person listening pressed the marker.
The demo below runs on synthetic recordings (drag to select, scroll to zoom, Enter to save). Open it full-size.
how it works
- Reading. bioread parses the AcqKnowledge container into channels and event markers. BSL writes each recording segment (Supine, Seated, After exercise) as an “append” marker, and the keypresses a recorder makes during a lesson as “default” markers. Those become the conditions the report is organised by.
- Measuring. The viewer is one canvas with min/max decimation per pixel column, so two minutes at 1 kHz pans smoothly. BSL’s heart-rate channel only changes once per beat, so it is shipped as change points (about 200 numbers instead of 120,000). Everything runs from
file://with no server and no network requests. - Reporting. Each lesson is one config object: its conditions, the components to label, a hint for where each selection goes, and a function from annotations to the report tables. Adding a lesson doesn’t touch the viewer.
- Automating only what’s reliable. P- and T-wave boundaries are too noisy to automate, but QRS amplitudes are large and sharp, and Korotkoff sounds have a giveaway: each one arrives at nearly the same delay after an R wave. The stethoscope under the cuff hears rustle as loud as the sounds, so the detector looks for runs of heartbeat-locked sounds rather than loud ones. When the sounds aren’t clearly there, it leaves the table empty instead of guessing.
- Trust. Beat detection is tested against synthetic ECG with known beat times, the axis against synthetic leads built from known heart vectors, the sound detector against synthetic cuff recordings with known pressures (within 3.5 mmHg in 57 of 60 trials, no false detections on noise-only data), and the report math against hand-computed tables. The public demo is synthetic because real recordings are someone’s health data.
The longer write-up, including why automatic wave delineation lost to a human with a mouse, is in the blog post. Code is on GitHub.
← back home