MATLAB Simulation for ECG and PPG Signal Generation
This post introduces a MATLAB-based simulation tool designed to generate synthetic Electrocardiogram (ECG) and Photoplethysmogram (PPG) signals. The primary objective is to create labeled datasets with controlled noise characteristics, which are essential for training and robustly validating signal classification algorithms.
Source Code
The complete source code and modified versions are available below:
- Original Algorithm: PPG Generation Algorithm
- Modified Version: Modified PPG Generation Algorithm
Note: The modified version addresses an issue in the original code where PPG signals could not be generated with zero noise. It is recommended to use the modified version for clean signal generation.
Simulation Results: Signal Type 1 (50 RR Intervals)
The following metrics illustrate the time-domain and frequency-domain characteristics of the generated signals under various noise conditions.
Parameters
- Signal Duration: 50 RR intervals
- Signal Type: Type 1 (Standard Verification Signal)
1. Noise-Free Baseline
The reference signal without any added noise.
2. Noise Scenario 1
Signal Analysis
Time and frequency domain representation of the signal corrupted by Noise 1.
Component Breakdown
- Clean Signal Component:
- Noise Component:
- Signal-to-Noise Ratio (SNR) Analysis:
3. Noise Scenario 2
Signal Analysis
Component Breakdown
- Clean Signal Component:
- Noise Component:
- SNR Analysis:
4. Noise Scenario 3
Signal Analysis
Component Breakdown
- Clean Signal Component:
- Noise Component:
- SNR Analysis:
5. Noise Scenario 4
Signal Analysis
Component Breakdown
- Clean Signal Component:
- Noise Component:
- SNR Analysis:
Comparative Analysis: Signal Types with 10 RR Intervals
To evaluate short-duration performance, we generated five distinct signal types with a duration of 10 RR intervals.
Type 1
Type 2
Type 3
Type 4
Type 5