Blog · Algorithm

Lossless or near-lossless: what an ECG can afford to lose

Discarding information from a cardiac signal is not a compression decision. It is a clinical one.

Every conversation about ECG compression arrives sooner or later at the same question: does it have to be lossless?

The honest answer is that it depends on who will read the signal and why. And that is precisely why the decision should not be made by the algorithm vendor alone.

What each term means

Lossless: the reconstructed signal is identical, sample for sample, to the original. There is no possible argument about what was lost, because nothing was. The cost is a more modest compression ratio.

Near-lossless: the error on every reconstructed sample is guaranteed to stay within a defined maximum. This is not "roughly similar": it is a hard, verifiable bound you can document.

Lossy: information is discarded according to a perceptual or statistical quality criterion. That is what audio and video use. On a diagnostic signal it is far harder to justify, because the notion of "close enough" does not match the clinician's.

Why morphology matters more than mean error

The usual compression metrics — mean squared error, signal-to-noise ratio — average across the whole signal. And an ECG is, for most of its duration, baseline.

An algorithm can post an excellent mean error and still have deformed exactly the segment that matters. If a method slightly smooths the QRS complex or shifts the ST segment by a few tenths of a millivolt, the mean error barely moves — but the interpretation can change.

That is why, in this domain, the relevant metric is not the average: it is the maximum error bound, evaluated specifically over the diagnostically relevant regions.

How we approach it

Our position is that the choice between lossless and near-lossless is a parameter of the customer's product, not a fixed property of the core. The team that understands the device's clinical use — and that will answer for it before a regulator — is the team that should set that bound.

What is our responsibility is that the bound be verifiable: that a reference model exists against which the customer can confirm, on their own recordings, that the error never exceeds what was declared. A number on a datasheet does not do that. An auditable reference implementation does.

The question worth asking first

Before comparing compression ratios across vendors, it is worth answering this:

  • Who reads the reconstructed signal: a detection algorithm, a technician, a cardiologist?
  • Is the signal for screening, or is it diagnostic evidence?
  • What would you need to be able to demonstrate to an auditor about what happened to it?

If the answer to the third is "that it was not altered", the conversation about aggressive compression ratios ends fairly quickly — and it should.

Where we land

BioRLE-1 is lossless. We do not offer a lossy mode or a configurable error bound, because in the domain we work in the answer to that third question is almost always the same. We would rather take a more modest compression ratio and have no regulatory conversation at all.