Each electrode node in the woven strap reads a raw signal d[n] = clean ECG + motion artifact. The artifact is partly predictable: it correlates with a reference motion signal x[n] (the fabric's own stretch/accelerometer channel), the same way a runner's gait couples into a chest-strap sensor.
An adaptive noise canceller (LMS — least-mean-squares) learns K weights that predict the artifact from K past samples of the reference and subtracts the prediction:
y[n] = Σ w_i · x[n-i] i = 0..K-1 (artifact estimate)
e[n] = d[n] - y[n] (filtered output)
w_i += 2·μ·e[n]·x[n-i] (weight update)
Because e[n] is what remains after removing the predictable part, driving it toward the true clean ECG is exactly what minimizes mean-square error — the filter converges without ever being told what "clean" looks like. The 3D twin of this sim fixes K=2 taps; this 2D scope generalizes the same update rule to any tap count so you can see how filter order trades off convergence speed against how much of the artifact's memory it can model.
- Heart rate — sets the true R-peak spacing woven into the simulated signal.
- Motion artifact — how strongly gait/stretch noise couples into the raw reading; the reference channel scales with it too.
- Sensor noise — uncorrelated electrode noise floor that no LMS filter can remove (it isn't predictable from the reference).
- Adaptation rate μ — how fast the weights chase the artifact; too high overshoots and rings, too low barely converges within a session.
- Filter taps — how many delayed reference samples the filter uses; more taps can track a longer-memory artifact but converges more slowly and is noisier per weight.
- Filter ON/OFF — toggle the subtraction off to see the raw electrode reading alone, weights frozen.
Real-world relevance: this is the same architecture behind motion-artifact cancellation in chest-strap ECG textiles and adaptive-noise-cancelling headphones — a correlated reference channel plus an LMS filter recovering signal buried in structured noise.