Software Open Access

Model for Simulating ECG and PPG Signals with Arrhythmia Episodes

Andrius Sološenko Andrius Petrėnas Birutė Paliakaitė Vaidotas Marozas Leif Sörnmo

Published: May 2, 2022. Version: 1.3.1


When using this resource, please cite: (show more options)
Sološenko, A., Petrėnas, A., Paliakaitė, B., Marozas, V., & Sörnmo, L. (2022). Model for Simulating ECG and PPG Signals with Arrhythmia Episodes (version 1.3.1). PhysioNet. https://doi.org/10.13026/s32e-sv15.

Please include the standard citation for PhysioNet: (show more options)
Goldberger, A., Amaral, L., Glass, L., Hausdorff, J., Ivanov, P. C., Mark, R., ... & Stanley, H. E. (2000). PhysioBank, PhysioToolkit, and PhysioNet: Components of a new research resource for complex physiologic signals. Circulation [Online]. 101 (23), pp. e215–e220.

Abstract

The simulation of electrocardiographic (ECG) and photoplethysmographic (PPG) signals with cardiac arrhythmias is important when developing and testing arrhythmia detectors. This software is capable of simulating sinus rhythm, episodes of atrial fibrillation and atrial premature beats in ECGs and PPGs as well as extreme bradycardia and ventricular tachycardia in PPGs. Different types of noise and artifacts can be added to simulated signals to improve realism and mimic the signals acquired in free-living conditions. Two versions are provided: a binary version for Windows 10 and Matlab source code.


Background

Cardiac arrhythmias are a major health problem often associated with serious outcome or sudden death [1,2]; hence, reliable detection of initial arrhythmia episodes is crucial to provide timely treatment. Conventional arrhythmia monitoring relies on long-term ECG acquisition in free-living conditions. However, high expectations are placed on wearables with integrated optical sensors capable of acquiring PPG, which should enable unobtrusive arrhythmia monitoring [3]. Irrespective of the underlying modality, i.e. ECG or PPG, the development, testing and validation of arrhythmia detectors should rely on annotated databases. The development of robust arrhythmia detectors, intended for use in free-living conditions, is particularly challenging since annotation of long-term signals, often contaminated with noise and artifacts, is time-consuming and costly. Moreover, PPG annotations must rely on a simultaneously acquired ECG due to the absence of guidelines for PPG-based arrhythmia interpretation.

The provided software facilitates the development and testing of arrhythmia detectors by enabling simulation of databases of ECG and PPG signals annotated by design. The simulator operates in three distinct modes: 1) simulation of ECGs with episodes of atrial fibrillation; 2) simulation of PPGs with episodes of atrial fibrillation; 3) simulation of PPGs with episodes of extreme bradycardia or ventricular tachycardia. Simulation of ECGs with atrial fibrillation is valuable when developing ECG-based algorithms for the detection of brief (less than 30 seconds) arrhythmia episodes since they are scarce in currently available annotated ECG databases. Simulation of PPGs with episodes of atrial fibrillation, extreme bradycardia or ventricular tachycardia fills the void of absent PPG databases with annotated arrhythmias. Another important aspect of simulators is the ability to control properties of generated signals, e.g., the number of arrhythmic beats, the amount and amplitude of noise and artifacts. Such flexibility allows a comprehensive investigation of arrhythmia detectors under different circumstances.


Software Description

Two versions of the software are provided. The zipped_binary folder contains the full ECG and PPG simulator, including a graphical user interface (GUI). The ECG_PPG_model folder contains source Matlab files for the simulator (note that two compiled Matlab pcode files are included, which are required for the generation of clean PPG).

Using the graphical interface

The simulator is launched by the SIM_ARR.exe application file. The software comes with a GUI which can handle various simulator parameters described in the following sections (see also Figure 1 in files below).

Section “Rhythm selection”

One of three types of arrhythmias can be selected: atrial fibrillation, extreme bradycardia, or ventricular tachycardia.

Section “Signal selection”

Only RR series can be generated by selecting “RR intervals only”. Otherwise, RR intervals and corresponding ECG and PPG signals are generated by selecting “All signals”.

Field “Number of datasets” determines the number of unique signal sets generated, e.g., if the number is set to 2, the program will generate 2 unique sets of RR intervals, ECG and PPG signals.

Section “Rhythm parameters”

The following parameters can be set:

  • The length of generated signals is determined by selecting the number of RR intervals (“Number of RR intervals”).
  • “Median length of arrhythmia episode” determines median duration of arrhythmia episodes in RR intervals.
  • The total time when arrhythmia is present is determined by providing “Arrhythmia burden” from 0 (no arrhythmia) to 1 (arrhythmia only).
  • The amount of atrial premature beats is selected by providing “Rate of atrial premature beats” from 0 (no premature beats) to 0.5 (half of all beats are premature).

Section “ECG noise”

One of three types of noise frequently encountered in free-living ECG recordings, i.e., muscle noise, electrode movement artifacts and baseline wander, as well as a mixture of them or no noise at all can be selected. Under the field “Noise RMS” the amplitude of noise is selected.

Section “PPG artifacts”

One of four types of artifacts frequently encountered in free-living PPG recordings, i.e., device displacement, forearm motion, hand motion and poor contact, as well as a mixture of them or no artifacts at all can be selected. Under the field “Mean interval duration” the mean duration of artifacts and artifact-free intervals can be selected.

Section “ECG leads”

Any combination of ECG leads is allowed. Bipolar limb (I, II, III), augmented unipolar limb (aVR, aVL, aVF), unipolar chest (V1, V2, V3, V4, V5) and orthogonal (X, Y, Z) ECG leads can be generated. Sampling frequency of 250, 500 or 1000 Hz can be selected for ECG generation.

Section “PPG pulses”

Any combination of PPG pulse types defined by Dawber et al. [4] can be selected for PPG simulation. Sampling frequency of 75, 100, 250, 500 or 1000 Hz is available.

Signal generation is initialized by pressing the button “Generate signals”. The progress of signal generation is displayed in the “Progress” bar at the bottom of the window.

Location of generated signals can be changed by pressing the button “Set path”. Current location is displayed under the button.

Relevant information including original publications, acknowledgements and copyrights can be reached by pressing the button “About”.

Using the source files

The execution of the source files is demonstrated by running MAIN_PROGRAM.m file. The code allows for modification of parameters concerning rhythm, ECG noise, PPG artifacts and selection of PPG pulse type (see corresponding sections in “Using the graphical interface”). It is possible to select either real, or synthetic RR interval series as well as ventricular and atrial activity tracings when generating ECGs. When generating PPGs, any available RR interval series (generated by ECG simulator or extracted from real ECG tracings) can be used as an input. Note that PPG simulator is tested for generating sinus rhythm, atrial fibrillation, premature beats, bradycardia and tachycardia episodes.

Important notes:

  • Noise and artifacts for ECGs and PPGs are generated separately, and thus unrelated.
  • Episodes of extreme bradycardia and ventricular tachycardia are only available for simulation of PPG signals.
  • RR series with sinus rhythm are taken from the MIT–BIH Normal Sinus Rhythm Database [5], with atrial fibrillation – from the Long-Term AF Database [5, 6], with extreme bradycardia and ventricular tachycardia – from the PhysioNet CinC Challenge 2015 Database training set [5]. Currently, the software does not support usage of custom RR series.
  • For ECG simulation, QRST complexes and P-waves are taken from the PTB Diagnostic ECG Database [5, 7], f-waves – from patients clinically diagnosed with atrial fibrillation [8], noise – from the MIT–BIH Noise Stress Test Database [5, 9].

Technical Implementation

A detail description of model implementation is provided in four publications. A part of model for simulating multi-lead ECGs during sinus rhythm, episodes of atrial fibrillation and atrial premature beats is described in several associated papers [10-13]:

  • Petrėnas, A., Marozas, V., Sološenko, A., Kubilius, R., Skibarkienė, J., Oster, J., & Sörnmo, L. (2017). Electrocardiogram modeling during paroxysmal atrial fibrillation: Application to the detection of brief episodes. Physiological Measurement, 38(11), 2058–2080. http://doi.org/10.1088/1361-6579/aa9153

A part of model for simulating PPGs during sinus rhythm, episodes of atrial fibrillation and atrial premature beats is described in:

The extension of the later part allowing simulation of extreme bradycardia and ventricular tachycardia in PPGs is described in:

  • Paliakaitė, B., Petrėnas, A., Sološenko, A., & Marozas, V. (2020). Photoplethysmogram modeling of extreme bradycardia and ventricular tachycardia. In Mediterranean Conference on Medical and Biological Engineering and Computing – MEDICON 2019, IFMBE Proceedings, 76, 1–10. http://doi.org/10.1007/978-3-030-31635-8_141

The simulation of realistic artifacts in PPGs is described in:

  • Paliakaitė, B., Petrėnas, A., Sološenko, A., & Marozas, V. (2020). Modeling of artifacts in the wrist photoplethysmogram: Application to the detection of life-threatening arrhythmias. Biomedical Signal Processing and Control, 66, 102421. https://doi.org/10.1016/j.bspc.2021.102421

Please include the citation of the appropriate publication when using the corresponding feature of the software.


Installation and Requirements

The binary version of the simulator (found in the zipped_binary folder) can be used directly in Windows 10. Please note that the folder contains segments of real signals from PhysioNet [5] used to simulate ECGs and thus 2.3GB of storage space is required for download. The software is intended to be run in Windows environment (tested in Windows 10).

The source file version of the simulator can be opened and run in Matlab (version 2020b and later). Running MAIN_PROGRAM.m will generate example ECG and PPG files. This script is intended to be modified to allow parameters to be updated as necessary.


Usage Notes

The provided software enables generation of datasets containing realistic simulated ECG and PPG signals with arrhythmia episodes. Such datasets will facilitate the development and testing of ECG and PPG signal processing algorithms and arrhythmia detectors.

The output generated by the software is a .mat file named according to such convention arrhythmia abbreviation_date_time_timestamp.mat, e.g., the file AF_20200902_171641_356591.mat contains signals with atrial fibrillation episodes and was generated on the 2nd of September, 2020 at 17:16:41 with a unique timestamp being 356591, (AF stands for atrial fibrillation, BR for extreme bradycardia, and TA for ventricular tachycardia). The file contains three structures.

Structure “labels” (Figure 2 in files below)

Measurement units for RR intervals, median length of arrhythmia episode, RMS of ECG noise, sampling frequencies of ECG and PPG signals, mean duration of PPG artifacts and artifact-free intervals are given. The structure also contains names of generated ECG leads and PPG pulse types, as well as selected types of ECG noise and PPG artifacts.

Structure “parameters” (Figure 3 in files below)

All numeric parameters set before signal generation are given: length of RR interval series, rate of atrial premature beats, median length of arrhythmia episode, arrhythmia burden (AF stands for atrial fibrillation, BR – for extreme bradycardia, TA – for ventricular tachycardia), RMS of ECG noise, sampling frequencies of ECG and PPG signals, mean duration of PPG artifacts and artifact-free intervals.

Structure “signals” (Figure 4 in files below)

The structure contains generated RR interval series, multi-lead ECG, as well as its ventricular activity (VA), atrial activity (AA) and noise components, R peak indices, target output for rhythm changes between sinus rhythm (0) and arrhythmia (1, AF stands for atrial fibrillation, BR – extreme bradycardia, TA – ventricular tachycardia), target output for atrial premature beats, boundaries and length of arrhythmia episodes, generated PPG, as well as its pulsatile and artifact components, PPG pulse indices, target output for PPG artifacts (0 – artifact-free, 1 – device displacement, 2 – forearm motion, 3 – hand motion, 4 – poor contact).


Release Notes

Version 1.3.0: Initial public release after several internal iterations.

Version 1.3.1: Updated source code in MAIN_PROGRAM.m file to facilitate usage of the model.


Ethics

The authors declare no ethics concerns.


Acknowledgements

This work was supported by the Research Council of Lithuania (agreement No. MIP088/15), the European Regional Development Fund under grant agreement with the Research Council of Lithuania (project No. 01.2.2-LMT-K-718-01-0030) and the Swedish Research Council (grant No. 621-2012-3509).


Conflicts of Interest

The authors have no conflicts of interest to declare.

 

 


References

  1. John, R. M., Tedrow, U. B., Koplan, B. A., Albert, C. M., Epstein, L. M., Sweeney, M. O., Miller, A. L., Michaud, G. F. & Stevenson, W. G. (2012). Ventricular arrhythmias and sudden cardiac death. The Lancet, 380(9852), 1520–1529. http://doi.org/10.1016/S0140-6736(12)61413-5
  2. Staerk, L., Sherer, J. A., Ko, D., Benjamin, E. J., & Helm, R. H. (2017). Atrial fibrillation: epidemiology, pathophysiology, and clinical outcomes. Circulation Research, 120(9), 1501–1517. http://doi.org/10.1161/CIRCRESAHA.117.309732
  3. Cheung, C. C., Krahn, A. D., & Andrade, J. G. (2018). The Emerging Role of Wearable Technologies in Detection of Arrhythmia. Canadian Journal of Cardiology, 34(8), 1083–1087. http://doi.org/10.1016/j.cjca.2018.05.003
  4. Dawber, T. R., Thomas, H. E., & Mcnamara, P. M. (1973). Characteristics of the dicrotic notch of the arterial pulse wave in coronary heart disease. Angiology, 24(4), 244–255. http://doi.org/10.1177/000331977302400407
  5. Goldberger, A. L., Amaral, L. A., Glass, L., Hausdorff, J. M., Ivanov, P. Ch., Mark, R. G., Mietus, J. E., Moody, G. B., Peng, Ch. & Stanley, H. E. (2000). PhysioBank, PhysioToolkit, and PhysioNet: Components of a new research resource for complex physiologic signals. Circulation, 101(23), e215–e220. http://doi.org/10.1161/01.CIR.101.23.e215
  6. Petrutiu, S., Sahakian, A. V., & Swiryn, S. (2007). Abrupt changes in fibrillatory wave characteristics at the termination of paroxysmal atrial fibrillation in humans. Europace, 9(7), 466–470. http://doi.org/10.1093/europace/eum096
  7. Bousseljot, R., Kreiseler, D., & Schnabel, A. (1995). Nutzung der EKG-Signaldatenbank CARDIODAT der PTB über das Internet. Biomedizinische Technik, 40(s1), 317–318. http://doi.org/10.1515/bmte.1995.40.s1.317
  8. Stridh, M., Sörnmo, L., Meurling, C. J., & Olsson, S. B. (2004). Sequential characterization of atrial tachyarrhythmias based on ECG time-frequency analysis. IEEE Transactions on Biomedical Engineering, 51(1), 100–114. http://doi.org/10.1109/tbme.2003.820331
  9. Moody, G. B., Muldrow, W. K., & Mark, R. G. (1984). A noise stress test for arrhythmia detectors. In Computers in Cardiology, 11, 381–384.
  10. Petrėnas, A., Marozas, V., Sološenko, A., Kubilius, R., Skibarkienė, J., Oster, J., & Sörnmo, L. (2017). Electrocardiogram modeling during paroxysmal atrial fibrillation: Application to the detection of brief episodes. Physiological Measurement, 38(11), 2058–2080. http://doi.org/10.1088/1361-6579/aa9153
  11. Sološenko, A., Petrėnas, A., Marozas, V., & Sörnmo, L. (2017). Modeling of the photoplethysmogram during atrial fibrillation. Computers in Biology and Medicine, 81, 130–138. http://doi.org/10.1016/j.compbiomed.2016.12.016
  12. Paliakaitė, B., Petrėnas, A., Sološenko, A., & Marozas, V. (2020). Photoplethysmogram modeling of extreme bradycardia and ventricular tachycardia. In Mediterranean Conference on Medical and Biological Engineering and Computing – MEDICON 2019, IFMBE Proceedings, 76, 1–10. http://doi.org/10.1007/978-3-030-31635-8_141
  13. Paliakaitė, B., Petrėnas, A., Sološenko, A., & Marozas, V. (2020). Modeling of artifacts in the wrist photoplethysmogram: Application to the detection of life-threatening arrhythmias. Biomedical Signal Processing and Control, 66, 102421. https://doi.org/10.1016/j.bspc.2021.102421

Share
Access

Access Policy:
Anyone can access the files, as long as they conform to the terms of the specified license.

License (for files):
GNU General Public License version 3

Corresponding Author
You must be logged in to view the contact information.
Versions

Files

Total uncompressed size: 4.8 GB.

Access the files
Folder Navigation: <base>/zipped_binary
Name Size Modified
Parent Directory
SIM_ARR_v3.zip (download) 2.5 GB 2021-08-30