This repository contains a MATLAB script designed to detect R-peaks in ECG (Electrocardiogram) signals using advanced signal processing techniques. The approach involves preprocessing, feature extraction, and logic for accurate R-peak detection in raw ECG data.
- Bandpass Filtering: Removes baseline wander and high-frequency noise while preserving essential features.
- Normalization and Differentiation: Enhances the QRS complex for better peak detection.
- Shannon Energy Envelope: Highlights significant energy changes in the ECG signal.
- Moving Average Filters: Smoothens the signal for peak enhancement.
- Combines squaring, filtering, and a refined search method.
- Identifies peaks in a neighborhood of candidate points for accurate localization.
The detection process is divided into four major steps:
- Load the ECG signal from a
.matfile. - Apply a Chebyshev Type I Bandpass Filter to eliminate noise.
- Perform differentiation and normalization to emphasize QRS complexes.
- Compute the Shannon Energy Envelope to amplify regions with high energy.
- Smooth the signal using a moving average filter.
- Differentiate and square the smoothed signal to highlight peaks.
- Use an additional moving average filter to refine candidate peaks.
- Detect peaks from the smoothed signal.
- Refine R-peak positions by searching within a ±25-sample window.
- Overlay detected R-peaks on the original ECG signal.