MRM MRM MRM MRM
SYSTEM BOOTING
Back to projects
Research

ECG Signal Processing & Abnormality Detection

A biomedical DSP pipeline turning raw clinical ECG recordings into heart-rate estimates and rule-based abnormality classification.

Difficulty — advanced Complexity — 7/10 Category — Research

Overview

A structured Digital Signal Processing pipeline in MATLAB, built on real recordings from the PTB Diagnostic ECG Database rather than synthetic waveforms. Each stage — filtering, peak detection, feature extraction, classification, segmentation — feeds the next, producing an end-to-end system rather than a simple visualization script.

Architecture

Sequential DSP pipeline: import & normalize → 5-point moving-average filtering → adaptive R-peak detection → BPM estimation → statistical feature extraction → rule-based classification → beat segmentation for morphology comparison.

Key Features

  • Adaptive threshold R-peak detection (mean + 0.5×σ) that adjusts to each recording's amplitude, rather than a fixed global threshold.
  • Heart-rate estimation in BPM derived directly from detected R-peak spacing.
  • Four-feature statistical fingerprint (mean, standard deviation, RMS, peak-to-peak) per recording.
  • Beat-by-beat segmentation (±30 samples around each R-peak) enabling direct normal-vs-abnormal morphology comparison.

Development Process

  • Normalized and cleaned raw recordings before any peak detection was attempted.
  • Tuned the adaptive threshold formula against multiple recordings to avoid both false positives and missed beats.
  • Derived the classification threshold from the full dataset's statistical distribution rather than a single recording.
  • Validated predicted labels against the PTB database's ground-truth normal/abnormal labels.

Challenges & Solutions

Challenge

A fixed peak-detection threshold performed inconsistently across recordings with different baseline amplitudes.

Solution

Replaced it with an adaptive threshold computed from each signal's own mean and standard deviation.

Results & Impact

The pipeline reliably detects heartbeats and estimates heart rate across recordings of varying signal quality, and the rule-based classifier's predictions were validated directly against the PTB Diagnostic Database's expert labels.

Future Improvements

  • Replace the rule-based classifier with a trained model for higher sensitivity.
  • Add arrhythmia-specific feature detection.
  • Test against a broader, more diverse patient dataset.