Using Lempel–Ziv Complexity to Assess ECG Signal Quality

Yatao Zhang, Shoushui Wei, Costanzo Di Maria, Chengyu LiuJournal of Medical and Biological Engineering 2016

Abstract

The poor quality of wireless electrocardiography (ECG) recordings can lead to misdiagnosis and waste of medical resources. This study presents an interpretation of Lempel-Ziv (LZ) complexity in terms of ECG quality assessment, and verifies its performance on real ECG signals. Firstly, LZ complexities for typical signals, namely high-frequency (HF) noise, low-frequency (LF) noise, power-line (PL) noise, impulse (IM) noise, clean artificial ECG signals, and ECG signals with various types of noise added were analyzed. Then, the effects of noise, signal length, and signal-to-noise ratio (SNR) on the LZ complexity of ECG signals were analyzed. The simulation results show that LZ complexity for HF noise was obviously different from those for PL and LF noise. The LZ value can be used to determine the presence of HF noise. ECG plus HF noise had the highest LZ values. Other types of noise had low LZ values. Signal lengths of over 40 s had only a small effect on LZ values. The LZ values for ECG plus all types of noise increased monotonically with decreasing SNR except for LF and PL noise. For the test of real ECG signals plus three types of noise, namely muscle artefacts (MAs), baseline wander (BW), and electrode motion (EM) artefacts, LZ complexity varied obviously with increasing MA but not for BW and EM noise. This study demonstrates that LZ complexity is sensitive to noise level (especially for HF noise) and can thus be a valuable reference index for the assessment of ECG signal quality.

Introduction

As cardiac monitoring shifts toward wearable and wireless technologies, the challenge of maintaining signal quality has intensified. Unlike clinical environments, mobile recordings are frequently contaminated by muscle tremors (high-frequency noise), power line interference, and baseline wander from movement. These artifacts lead to misdiagnosis and "alarm fatigue" in automated systems. This study investigates whether Lempel–Ziv (LZ) complexity—a non-linear measure of pattern diversity—can serve as a robust metric for automatically identifying unacceptable ECG recordings.

Methods

The Lempel–Ziv complexity algorithm provides a mathematical "quality score" by quantifying the number of unique patterns in a digital sequence. The process involves:

  1. Coarse-Graining: The continuous ECG signal is converted into a binary string (0s and 1s) based on whether data points fall above or below the signal's mean value.
  2. Pattern Counting: The algorithm scans the binary string to count unique subsequences. Highly repetitive signals (clean ECGs) yield low LZ values, while chaotic signals (noise) yield high values.
  3. Normalization: Raw counts are normalized to a scale between 0 and 1 to ensure the metric is independent of signal length.

Researchers tested this metric using synthetic signals (generated via ECGSYN) and clinical data from the MIT-BIH Arrhythmia Database, combined with real-world noise from the Noise Stress Test Database (NSTDB).

Key Insights and Results

Sensitivity to Noise Types

LZ complexity is exceptionally sensitive to High-Frequency (HF) noise, such as muscle artifacts. Because HF noise is essentially random, it generates a high volume of unique binary patterns, causing the LZ score to spike. In contrast, the algorithm is relatively insensitive to low-frequency noise like baseline wander, as slow drifts do not significantly alter the binary pattern distribution after coarse-graining.

LZ complexity values for various noise types and clean ECG signals across 50 signal repeats.

Impact of Signal-to-Noise Ratio (SNR)

For most noise types, LZ complexity increases monotonically as the signal quality degrades (lower SNR). The study identified a "tipping point" at approximately 4.6 dB for mixed noise, where critical ECG features like P and T waves become unidentifiable. At this threshold, the LZ complexity effectively flags the signal as "unacceptable."

The relationship between SNR and LZ complexity, showing the monotonic increase in complexity as SNR decreases for HF and mixed noise.

Stability and Classification Performance

The researchers determined that a signal length of at least 40 seconds is necessary to achieve a stable LZ value. When used as a classifier to separate acceptable from unacceptable signals, the algorithm achieved an Area Under the Curve (AUC) of 0.979 in mixed-noise scenarios, indicating near-perfect performance.

Conclusion

LZ complexity is a powerful tool for detecting high-frequency noise in ECG signals, offering a clear mathematical threshold for quality control. While it requires pre-processing to handle baseline wander and further study to distinguish between noise and complex arrhythmias (like ventricular fibrillation), it serves as a valuable reference index for the automated assessment of ECG signal quality in wireless monitoring systems.

Summary updated

Abstract

The poor quality of wireless electrocardiography (ECG) recordings can lead to misdiagnosis and waste of medical resources. This study presents an interpretation of Lempel-Ziv (LZ) complexity in terms of ECG quality assessment, and verifies its performance on real ECG signals. Firstly, LZ complexities for typical signals, namely high-frequency (HF) noise, low-frequency (LF) noise, power-line (PL) noise, impulse (IM) noise, clean artificial ECG signals, and ECG signals with various types of noise added (ECG plus HF, LF, PL, and IM noise, respectively) were analyzed. Then, the effects of noise, signal length, and signal-to-noise ratio (SNR) on the LZ complexity of ECG signals were analyzed. The simulation results show that LZ complexity for HF noise was obviously different from those for PL and LF noise. The LZ value can be used to determine the presence of HF noise. ECG plus HF noise had the highest LZ values. Other types of noise had low LZ values. Signal lengths of over 40 s had only a small effect on LZ values. The LZ values for ECG plus all types of noise increased monotonically with decreasing SNR except for LF and PL noise. For the test of real ECG signals plus three types of noise, namely muscle artefacts (MAs), baseline wander (BW), and electrode motion (EM) artefacts, LZ complexity varied obviously with increasing MA but not for BW and EM noise. This study demonstrates that LZ complexity is sensitive to noise level (especially for HF noise) and can thus be a valuable reference index for the assessment of ECG signal quality.
BibTeX
@article{zhang2016using,
  author = {Yatao Zhang and Shoushui Wei and Costanzo Di Maria and Chengyu Liu},
  title = {{Using Lempel–Ziv Complexity to Assess ECG Signal Quality}},
  journal = {Journal of Medical and Biological Engineering},
  year = {2016},
  doi = {10.1007/s40846-016-0165-5},
}
Figure