Both records were held out of training for the network and switch shown below (record-disjoint fold A).
Invoke the network only if the switch's predicted mixing weight α̂ ≥ τ. 0.65 is the paper's peak operating point (38% invocation).
System Architecture & Mathematical Formulations
Comprehensive mathematical specifications for each processing stage in the single-channel pipeline.
Baseline Wander Removal
In accordance with IEC 60601-2-25 telemetry guidelines, baseline respiration drift (< 0.7 Hz) is suppressed prior to adaptive stages via a 4th-order Butterworth high-pass filter ($f_c = 0.5\text{ Hz}$):
Forward-backward filtering guarantees zero phase distortion, inducing an ST-segment deviation of only $42.1\ \mu\text{V}$ (safe within the $100\ \mu\text{V}$ ischemia boundary).
60 Hz Quadrature Notch (PLI)
To remove powerline interference without an auxiliary sensor, orthogonal quadrature sinusoids are synthesized internally:
A 2-tap adaptive LMS filter updates weights to subtract the narrow-band interference, achieving $>16\text{ dB}$ attenuation without attenuating high-frequency QRS components.
C-DSAF Adaptive Architecture
Combines a fast-tracking short filter ($L_1 = 6$) and a high-precision slow filter ($L_2 = 16$) blended through a dynamic sigmoid logit $a(n)$:
Decoupled filter updates guarantee mean-square convergence, allowing immediate adaptation (<25 ms) during abrupt motion artifacts.
| Policy | Network invocation rate | Mean ΔSNR (wide grid) |
|---|---|---|
| Never invoke (Stage 1 alone) | 0% | +3.75 dB |
| Always invoke (SE4 network on every segment) | 100% | +1.69 dB |
| Switch (this demo, τ=0.65) | 38% | +4.95 dB |
| Oracle switch (upper bound, true weight) | ≈45% | +5.71 dB |
These four rows are the paper's numbers, not something this page computes -- they come from proof scripts in the repository (proofs/ecg-v2-switch.py) over a much larger evaluation than any single record, and include a fix to Stage 1's line canceller (it now auto-detects 50 vs.\ 60 Hz mains instead of assuming 60 Hz -- see the "Unseen 50 Hz Mains" noise option above). Restricted to the composite noise, -10/-5/0 dB range the network was actually designed for, always-invoking it reaches +11.55 dB -- the switch reproduces this automatically without being told which regime it's in.
The metrics ribbon above is different: it is computed live, in your browser, on whichever single record/noise/SNR combination and threshold you have selected -- it will not match the pooled numbers in this table, which average over many more conditions. This demo's switch and network were also fit only on fold A's 3 held-out records (not the leave-one-record-out protocol the paper uses), so treat this page as an illustration of the mechanism, not a restatement of the paper's results.
| Policy | MAC/sample | Reduction |
|---|---|---|
| Always-on, larger network (15,169 params) | 3,923 | — |
| Always-on, this demo's SE4 network (2,313 params) | 698 | — |
| Switched, 38% invocation (this demo) | 299 | −57% / −92% |
Arithmetic on analytic MAC counts, not a hardware measurement; does not include the switch's own six-feature Welch-spectrum computation (also run client-side above, but not benchmarked in the paper).