How it is built
Architecture overview
A patient-monitoring system measures a patient's vital signs continuously, decides whether they are acceptable, and tells the right person when they are not. A bedside monitor (or a small wearable telemetry pack) acquires waveforms: ECG for heart rhythm, photoplethysmography (PPG) for pulse and oxygen saturation, intermittent cuff blood pressure, respiration, temperature, sometimes invasive pressures. It filters them, derives numbers (heart rate, SpO2, blood pressure) and runs alarm logic locally. A central station collects many bedsides over the hospital network, shows them side by side, stores trends and forwards data and alarms to the electronic health record and to nurses' devices. Philips IntelliVue, GE CARESCAPE and Masimo, from the graph's examples, are commercial implementations; this page covers the shared mechanics.
The idea that makes it work is layering by criticality. The bedside monitor must keep measuring and alarming even if the network, the central station or the display fails, so the sensing, signal processing and alarm decision live in a small deterministic embedded system that depends on nothing else. The network layers above it add convenience: remote display, trends, annotation, escalation. A failure there must degrade the service, never silence the bedside.
The hard problems are not arithmetic. They are signal quality (motion, electrode noise, poor perfusion corrupt every measurement), alarm quality (too many false or non-actionable alarms desensitise staff, a problem called alarm fatigue) and evidence (the device is regulated, so its software lifecycle and risk analysis are part of the design).
Parts:
- Acquisition and filtering — sample sensors, remove noise and drift — IIR and FIR filters,
biquad-filters(no page yet), Fast Fourier transform, SIMD programming, Preemptive priority scheduling - Parameter extraction — heart rate, SpO2, pressure from waveforms —
ecg-beat-classification(no page yet),ppg-heart-rate-estimation(no page yet),peak-detection(no page yet),oscillometric-blood-pressure(no page yet),wavelet-transform(no page yet), Kalman filter - Alarm engine — limits, delays, priorities, escalation — Alarm management, Hierarchical state machine,
debouncing-throttling(no page yet), Escalation policies, Hierarchical timing wheel, Recurrence rule expansion,calendar-date-arithmetic(no page yet) - Safety and fault handling — independent checks, memory and code discipline —
safety-monitor-architecture(no page yet), Watchdog timer,redundancy-voting(no page yet), Memory protection unit,end-to-end-protection-e2e(no page yet), Safety-critical coding standards, Dataflow analysis - Time — one clock for samples, alarms and records — Clock synchronization, PID controller, Phase-locked loop (digital), Robust statistics
- Power — wearable and transport units —
battery-state-estimation(no page yet),equivalent-circuit-battery-model(no page yet), Extended Kalman filter,low-power-duty-cycling(no page yet),levenberg-marquardt(no page yet),spline-interpolation(no page yet) - Network and integration — bus inside the monitor, link to the hospital —
publish-subscribe-event-bus(no page yet),hl7v2-message-parsing(no page yet), Bitstream serialization, Slab allocator - Storage and trends — waveform and trend history, search — Time-series chunk storage, Gorilla XOR compression, Delta encoding, Time partitioning, Inverted index, Top-k selection, Unicode text tokenization for search, Text normalization
sensors: ECG leads | SpO2 probe | NIBP cuff | resp | temp
│ ADC, fixed sample rates (hardware timer)
▼
acquisition task (high priority) ─► filters ─► per-parameter algorithms (HR, SpO2, BP, RR)
│ │ numbers + signal-quality flags
▼ ▼
waveform ring buffers alarm engine: limits, delays, priority, latch
│ │ local alarm sound/light
▼ ▼
local display network task: waveforms + numbers + alarms (timestamped, sequenced)
│
───────────────────┴─────────────────── hospital network
central station ─► trend store ─► EHR (HL7 v2 / SDC) ─► nurse devices
(display, review, alarm relay, escalation)
safety monitor + watchdog watch acquisition and alarm tasks; independent audible alarm path
How the parts fit together
Acquisition: fixed rates and a protected task
ECG and PPG are sampled by hardware timers at fixed rates (a few hundred samples per second for ECG and lower for PPG are typical, order of); software only reads the buffer. The acquisition task has the highest priority under Preemptive priority scheduling so that display and network work can never starve it, and its worst-case execution time is measured against its period. Filtering uses IIR and FIR filters: a high-pass to remove baseline drift (breathing, electrode movement), a notch or low-pass for mains interference at 50 or 60 Hz, and band-pass sections built from biquad-filters (no page yet) in cascade. An IIR section has low cost and nonlinear phase; a linear-phase FIR keeps the waveform shape that clinicians read for ST-segment changes, at higher cost, which is why the monitoring mode and the diagnostic mode of an ECG often use different filter bandwidths. The Fast Fourier transform is used for spectral checks (mains noise detection, respiration rate from a slow component), and SIMD programming accelerates multi-channel filter banks on processors that have vector units.
Parameter extraction: the algorithms that give the numbers
Heart rate and rhythm. ecg-beat-classification (no page yet) detects the QRS complex. The classic approach (Pan and Tompkins, IEEE Transactions on Biomedical Engineering, 1985) band-passes the signal, differentiates, squares and integrates over a moving window, then applies adaptive thresholds that follow the signal level, with searchback if a beat is missed. After detection, beats are classified (normal, premature, paced) by template matching on the beat's shape and its timing. peak-detection (no page yet) is the shared primitive: robust peaks in a noisy signal with a dynamic threshold and a refractory period. Public annotated recordings such as the MIT-BIH Arrhythmia Database on PhysioNet are the usual test set.
Oxygen saturation and pulse. ppg-heart-rate-estimation (no page yet) extracts pulse from the optical waveform. SpO2 is estimated from the ratio of pulsatile (AC) to baseline (DC) absorption at red and infrared wavelengths, mapped to saturation through a calibration curve found empirically for each sensor design. Motion corrupts PPG more than ECG; filtering and a Kalman filter that fuses the pulse with the ECG rate help, and the algorithm must report a quality flag so the alarm engine can tell "low saturation" from "no valid signal".
Blood pressure. oscillometric-blood-pressure (no page yet) inflates a cuff, lowers pressure in steps, and records the small pressure oscillations at each step. The envelope of oscillation amplitude peaks near mean arterial pressure; systolic and diastolic values are derived from characteristic ratios of that peak or from other empirical rules that differ between manufacturers and must be validated against reference measurements. The measurement is intermittent and slow (tens of seconds), so the alarm engine treats it as a periodic value, not a stream.
Compression and denoising. wavelet-transform (no page yet) serves two purposes: denoising and compact storage of waveforms. The alternative in the graph is a short-time spectrogram; wavelets localise sharp events such as the QRS better.
Alarm engine: what the nurse actually hears
Alarm management turns limits into a small number of actionable alarms. Principles, which match the structure of the IEC 60601-1-8 standard for alarm systems in medical equipment: alarms have priorities (high, medium, low) that determine sound and light patterns; physiological alarms (heart rate out of range) are distinguished from technical alarms (lead off, cuff leak); a condition must persist for a delay before it alarms; alarms can be acknowledged, silenced for a bounded time, or latched until seen. Implementation uses a Hierarchical state machine per alarm condition (inactive, delayed, active, acknowledged, silenced, cleared), with parent states for global modes such as "alarms paused" or "standby".
debouncing-throttling (no page yet) is the practical tool against alarm fatigue: ignore a limit crossing shorter than the delay, require the condition to clear for a hold time before re-arming, and suppress repeat sounds. Signal quality gates the logic: when the ECG leads are off, the heart-rate alarm is replaced by a "leads off" technical alarm and not by asystole.
Beyond the bedside, Escalation policies route unanswered alarms: first to the assigned nurse's device, then after a timeout to a colleague or charge nurse. Timeouts across thousands of active alarms use a Hierarchical timing wheel. Staff schedules and assignment rules use Recurrence rule expansion over calendar-date-arithmetic (no page yet), because shifts, holidays and daylight-saving changes decide who is on call.
Safety and fault handling
The monitor must not fail silently. A safety-monitor-architecture (no page yet) puts an independent checker beside the alarm path: for example a second processor or a hardware circuit that sounds a fallback alarm if the main software stops updating. A Watchdog timer is serviced only when the acquisition and alarm tasks have each completed their cycle, not just by a timer interrupt. redundancy-voting (no page yet) applies where two sensor channels measure the same quantity, such as two ECG derivations; a Memory protection unit isolates the display and network tasks from the alarm state. Messages that carry alarm state across links use end-to-end-protection-e2e (no page yet): a counter and CRC so a lost or repeated alarm message is detected. Code follows Safety-critical coding standards, checked by static tools based on Dataflow analysis. The medical software lifecycle standard IEC 62304 and the risk standard ISO 14971 are cited by number (no free public text); they require traceability from risk to requirement to test, and that is part of the design, not paperwork afterwards.
Time
Alarms, annotations and waveform segments from different devices are merged by timestamp, so the clocks must agree. Clock synchronization provides the offset estimate; a bedside clock disciplined with a PID controller or a Phase-locked loop (digital) never jumps, and Robust statistics discards outlier delay samples. Waveform streams also keep a sample counter, so the receiver can place samples in time even when packets arrive late.
Power for wearables and transport
Telemetry packs run on batteries, so battery-state-estimation (no page yet) tells nurses how long the pack has left. It uses an equivalent-circuit-battery-model (no page yet) (a resistor-capacitor network fitted with levenberg-marquardt (no page yet)), a voltage-to-charge curve held in spline-interpolation (no page yet) and an Extended Kalman filter that corrects the charge estimate from voltage. low-power-duty-cycling (no page yet) puts the processor and radio to sleep between bursts. A battery-low warning needs margin because low temperature and aging reduce capacity.
Network and integration
Inside the monitor, a publish-subscribe-event-bus (no page yet) decouples acquisition, algorithms, display and network: producers publish numbers and waveform chunks, consumers subscribe. Waveform packets use Bitstream serialization to keep the telemetry link small, and a Slab allocator provides fixed-size message buffers so no allocation can fail or fragment during operation. Toward the hospital systems, hl7v2-message-parsing (no page yet) covers the long-standing text format used to send observations to the record: segments separated by carriage returns, fields by pipes, framed on a TCP stream by a start and end byte pair (MLLP), each message acknowledged. A newer approach for medical-device interoperability is IEEE 11073 SDC (service-oriented device connectivity), which gives devices a standard service interface; open-source implementations exist (see below).
Storage and trends
Central stations keep trends (a number per parameter per minute, or per beat) for days and waveform snippets around events. Time-series chunk storage fits: immutable compressed blocks per series, with Time partitioning to bound queries and retention. Numeric trend data compresses well with Delta encoding and Gorilla XOR compression. Clinical notes and alarm text attached to a patient's record are searched with an Inverted index over text normalised by Unicode text tokenization for search and Text normalization; Top-k selection powers "worst patients by alarm count" views.
Data and control flow
One heartbeat to one alarm:
- A timer starts an ADC conversion; the sample is written to a buffer and the acquisition task runs on the interrupt's signal.
- The sample passes the filters; the QRS detector updates thresholds and, on a detected beat, records the R-R interval.
- Heart rate is computed over a moving window (a robust median of recent intervals, not the last one); a signal-quality flag is attached.
- The alarm engine compares the value to the limits. A crossing starts a delay timer; if the value returns inside the limits, nothing is announced.
- After the delay the alarm becomes active: the bedside plays its pattern, the alarm state is sent with a sequence number and timestamp to the central station.
- If nobody acknowledges within the escalation timeout, the escalation policy sends it to the next recipient.
One blood-pressure measurement:
- The monitor inflates the cuff above the expected systolic value.
- It deflates in steps; at each step it records the oscillation amplitude after rejecting steps with motion artefacts.
- The envelope is analysed, values are computed and range-checked, the cuff is released (a hardware over-pressure limit protects the patient independently of the software).
- The result is stored as a timed numeric and forwarded; the alarm engine evaluates it against its limits.
One telemetry reconnect:
- The wireless link drops; the pack keeps measuring and alarming locally and buffers waveform chunks.
- The central station shows a "no signal" technical alarm after a timeout.
- On reconnect, the pack sends the buffered chunks with their original timestamps and sequence numbers; the receiver fills the gap and removes duplicates.
Scaling
In the order you hit them:
- Signal quality, not CPU. Artefacts dominate false alarms. Levers: better electrodes and skin prep, multi-channel fusion, quality flags that gate alarms.
- Alarm volume per nurse. Levers: delays, priorities, smart defaults per patient type, escalation tuned to staffing, suppression of non-actionable technical alarms.
- Real-time budget on the bedside. More channels and algorithms per processor. Levers: vector instructions, fixed rates, moving non-critical work to a lower-priority task or a second core.
- Central station load. Hundreds of waveforms per station. Levers: send downsampled waveforms for overview, full resolution only on selection, compress with delta and XOR codecs.
- Wireless capacity and battery. Levers: duty cycling, compress, send numbers continuously and waveforms on request.
- Retention. Waveform history is large. Levers: store full waveforms only around events, keep trends for longer, chunked time-series storage with partition-level deletion.
- Software assurance. Each change must be re-verified. Levers: regression suites on recorded waveform databases, modular alarm logic with explicit state machines, static analysis in CI.
Failure modes
| Failure | Symptom | Cause | Fix |
|---|---|---|---|
| Alarm fatigue | staff ignore or silence alarms | many short, non-actionable alarms | delay timers, signal-quality gating, patient-specific limits, review alarm statistics |
| False asystole | alarm on a healthy patient | lead off or flat artefact treated as no beats | technical alarm for lead-off, require multi-lead agreement |
| Missed arrhythmia | no alarm on a real event | adaptive threshold too high after a large artefact, or beat detector misses wide beats | threshold recovery logic, searchback, test on annotated databases |
| Wrong SpO2 under motion | readings drop or jump | motion corrupts the PPG ratio | motion-tolerant filtering, quality flag, hold last good value with an age indicator |
| Silent monitor | screen frozen, no alarm | acquisition or alarm task hung | watchdog tied to task progress, independent fallback alarm |
| Time skew | alarm from one device appears out of order in the record | unsynchronised clocks | Clock synchronization and timestamps from the source, not the receiver |
| Lost or repeated alarm message | central station shows an old or missing alarm | link retries with no sequence checks | counter and CRC end to end, state refresh at intervals |
| Dropped battery without warning | pack dies | state-of-charge estimate wrong at cold temperature or after aging | temperature-aware model, margin on the warning threshold, filter SoC with voltage correction |
| Record mismatch | observation filed against the wrong patient or the wrong time | identity or timestamp error in HL7 mapping | verify patient association at admit, validate messages on receipt, acknowledge only after storage |
| Noisy trend gaps | holes in trends after reconnect | buffered data discarded on restart | persist buffers, replay by sequence number |
Real implementations
| name | what it is | repo | licence | notes |
|---|---|---|---|---|
| OpenICE (MD PnP) | open-source integrated clinical environment for connecting medical devices | mdpnp/mdpnp | BSD-2-Clause (per LICENSE) | research and prototyping platform; supported devices listed in the repo |
| sdc11073 | Python implementation of IEEE 11073 SDC (service-oriented device connectivity) | Draegerwerk/sdc11073 | MIT | maintained by Dräger |
| WFDB for Python | read, write and process physiological signal and annotation files | MIT-LCP/wfdb-python | MIT | used with PhysioNet datasets |
| NeuroKit2 | Python toolbox for ECG, PPG, respiration and other biosignal processing | neuropsychology/NeuroKit | MIT | research and prototyping, not a certified monitor |
Philips IntelliVue, GE CARESCAPE and Masimo are proprietary medical devices; they are named only for orientation. None of the open-source projects above is a cleared medical device on its own.
The alternative: a consumer or research wearable that streams raw data to a phone and computes the metrics there. It is cheap and useful for wellness and studies; it is not a substitute for a regulated monitor where an alarm must reach staff within a defined time, work offline, and come with a risk file and a software lifecycle.
Sources
- PhysioNet, MIT-BIH Arrhythmia Database. dataset
- OpenICE: repo; sdc11073: repo; WFDB: repo; NeuroKit2: repo
- J. Pan and W. J. Tompkins, A Real-Time QRS Detection Algorithm, IEEE Transactions on Biomedical Engineering BME-32(3), 230-236, 1985. paper
- IEC 60601-1-8 (alarm systems), IEC 62304 (medical software lifecycle), ISO 14971 (risk management) and IEEE 11073: standards, cited by number (no free public text)