# Design and Optimization of ECG Modeling for Generating Different Cardiac Dysrhythmias

^{1}

^{2}

^{3}

^{4}

^{5}

^{*}

## Abstract

**:**

## 1. Introduction

- A simplified mathematical model based on the sum of two Gaussians has been proposed, which does not require baseline adjustment [23], and it is straightforward compared to the current models.
- Most fitting or optimizing techniques are designed to calculate only one Gaussian function, which is not ideal for the proposed method. Therefore, to solve these problems along with the model, two-hybrid optimization methods have been proposed.
- The proposed model’s performance is evaluated using time domain, frequency domain, and time-frequency domain analysis.
- Among various applications, one of the most promising ones is the ECG generator for education and research purpose. A graphical user interface (GUI) has been developed to show the proposed system’s potential use. Besides, noisy ECG generation and data compression have also been presented.

## 2. Background Problems and Proposed Model

#### 2.1. Proposed Model

#### 2.2. Optimization Problem Formulation and Proposed Optimization Method

**a**) Multi-start and (

**b**) Global search. In summary, ApproxiGlo comprises the Approximation method and Global search, whereas ApproxiMul comprises the Approximation method and Multi-start; see Figure 2.

- ⮚
- Step 1.1 After Segmenting ECG, beat into $P,\text{}Q,\text{}R,\text{}S,\text{}T$ components. i.e., $ECG\in P,Q,R,S,T$, minimum and maximum values of ${\sigma}_{1}\text{}$ are calculated based on the number of samples. Assume the total time duration of an ECG component ${x}_{R}$ and the number of samples in this time duration is ${N}_{s}$, the ${\sigma}_{{1}_{min}}$ and ${\sigma}_{{1}_{max}}\text{}$ can be approximated by the following equations:$$\left.\begin{array}{c}{\sigma}_{{1}_{min}}=\frac{\raisebox{1ex}{${x}_{R}$}\!\left/ \!\raisebox{-1ex}{${N}_{s}$}\right.}{5}\\ {\sigma}_{{1}_{max}}=\frac{{x}_{R}}{3}\end{array}\right\}$$
- ⮚
- Step 1.2 Increment the values of ${\sigma}_{1}$ from $\text{}{\sigma}_{{1}_{min}}$ to ${\sigma}_{{1}_{max}}$ at an interval of 0.3 and run through all the different values. Then, construct a Gaussian filter with the Gaussian as follows:$${G}_{filt}={\mathrm{e}}^{-\left[\frac{{S}^{2}}{{\sigma}_{1}\left(i\right)}\right]}\text{}$$$$S=-\left(\lceil \frac{{N}_{s}}{2}\rceil +1\right):1:\u23a3\lceil \frac{{N}_{s}}{2}\rceil \u23a6$$

- ⮚
- Step 1.3 Store the corresponding RMSE and corresponding parameters.
- ⮚
- Step 1.4 Repeat step 1.2 and step 1.3 for all values of ${\sigma}_{1}$.
- ⮚
- Step 1.5 Select the parameters (${A}_{1},\text{}{\sigma}_{1},\text{}{t}_{1}$) for which RMSE is the lowest.
- ⮚
- Step 1.6 Finally, replicate the parameter of the second Gaussian using the calculated Gaussian parameters, i.e., ${A}_{2}={A}_{1},\text{}{\sigma}_{2}={\sigma}_{1},\text{}{t}_{2}={t}_{1}$.

## 3. Databases and Pre-Processing

#### 3.1. Data Collection

#### 3.1.1. Experimental Data Collection

#### 3.1.2. Data Collection from Online

#### 3.2. Denoising

#### 3.3. ECG Components Extraction

## 4. Results

#### 4.1. Performance in Time Domain

#### 4.2. Performance in Frequency Domain

#### 4.3. Performance in Time-Frequency Domain

## 5. Applications of the Proposed Model

#### 5.1. Synthetic ECG Generator

#### 5.2. ECG Compression

## 6. Discussions

- Another limitation of this study is the number of ECG beats used. Few ECG beats were taken into account for model fitting and optimization. However, this work aims to find out an optimization method for ECG model fitting and the possible use of this optimized model in simulating different cardiac dysrhythmias, for example, atrial premature beat, paced beat, etc.
- The automatic classification of different types of ECG beats can be possible to implement by our proposed method. In that case, model parameters can be treated as features. These features can be trained by fuzzy-hybrid neural networks [56], support vector machine (SVM) [57,58], light gradient boosting machine [59], and Bayes maximum-likelihood (ML) classifier [32]. In addition to that, prominent features can also be selected by some feature selection algorithms such as the mRMR method and the Jaya algorithm [60,61,62] to increase the classification accuracy.
- A dictionary can be built based on our model and represent and classify cardiac dysthymias (which is called matching pursuit) [63].
- The proposed model can be used in model-based signal denoising [39].

## 7. Conclusions

## Author Contributions

## Funding

## Institutional Review Board Statement

## Informed Consent Statement

## Data Availability Statement

## Acknowledgments

## Conflicts of Interest

## Appendix A

#### Appendix A.1. Performance Evaluation Metrics

#### Appendix A.1.1. Time-Domain Metrics

#### Appendix A.1.2. Frequency-Domain Metrics

#### Appendix A.1.3. Time-Frequency Domain Measure

#### Appendix A.2. Coefficient to Fit the with Models

Coefficient | Global | Multi Start | ||||||||
---|---|---|---|---|---|---|---|---|---|---|

P | Q | R | S | T | P | Q | R | S | T | |

X(1) | −35.820 | 17.820 | 0.691 | 40.690 | −0.224 | −0.313 | −4.680 | 1.057 | −0.500 | 0.345 |

X(2) | 80.355 | 31.446 | 15.401 | 19.430 | 248.020 | 282.660 | 87.180 | 30.640 | 11.120 | 177.252 |

X(3) | 65.943 | 20.005 | 14.110 | 12.140 | 46.880 | 43.672 | 19.990 | 14.110 | 18.060 | 92.944 |

X(4) | 35.734 | −7.800 | 1.057 | −1.100 | 0.345 | 0.373 | 4.726 | 0.690 | 0.228 | −0.223 |

X(5) | 80.360 | 31.445 | 30.644 | 19.380 | 177.260 | 264.160 | 88.000 | 15.400 | 1.000 | 248.027 |

X(6) | 65.782 | 19.957 | 14.110 | 12.190 | 92.949 | 50.571 | 20.580 | 14.110 | 5.676 | 46.880 |

X(7) | 0.106 | −0.070 | −0.273 | 0.018 | −0.001 | 0.011 | −0.040 | −0.270 | 0.017 | −0.001 |

Size(samples) | 300.000 | 88.000 | 48.000 | 77.000 | 429.000 | 300.000 | 88.000 | 48.000 | 77.000 | 429.000 |

Coefficient | Global | Multi Start | ||||||||
---|---|---|---|---|---|---|---|---|---|---|

P | Q | R | S | T | P | Q | R | S | T | |

X(1) | 0.016 | −2.044 | 0.729 | −0.074 | 0.026 | 0.033 | −0.074 | 0.729 | −0.072 | −0.083 |

X(2) | 17.222 | 5.545 | 4.304 | 2.470 | 129.154 | 13.498 | 17.292 | 4.310 | 4.403 | 84.398 |

X(3) | 3.542 | 5.132 | 3.610 | 1.587 | 45.606 | 7.044 | 3.311 | 3.610 | 0.521 | 14.599 |

X(4) | 0.017 | 2.089 | 1.514 | −0.074 | −0.072 | 0.022 | −0.022 | 1.512 | −0.162 | −0.034 |

X(5) | 11.850 | 5.549 | 8.766 | 2.470 | 85.103 | 31.278 | 5.117 | 8.768 | 2.321 | 6.509 |

X(6) | 3.428 | 5.284 | 3.126 | 1.587 | 12.684 | 10.343 | 1.442 | 3.124 | 1.244 | 44.711 |

X(7) | −0.046 | −0.105 | −0.343 | −0.054 | −0.043 | −0.059 | −0.043 | −0.342 | −0.053 | −0.018 |

Size(samples) | 44.000 | 20.000 | 13.000 | 14.000 | 153.000 | 44.000 | 20.000 | 13.000 | 14.000 | 153.000 |

Coefficient | Global | Multi Start | ||||||||
---|---|---|---|---|---|---|---|---|---|---|

P | Q | R | S | T | P | Q | R | S | T | |

X(1) | −25.17 | −1.417 | 1.831 | −0.031 | 13.230 | 0.419 | −2.782 | 2.037 | −0.081 | 0.140 |

X(2) | 14.950 | 27.038 | 41.721 | 13.774 | 18.728 | 16.873 | 33.428 | 45.414 | 9.594 | 8.616 |

X(3) | 3.134 | 14.110 | 27.310 | 7.210 | 16.199 | 4.196 | 12.516 | 27.310 | 7.210 | 16.170 |

X(4) | 25.684 | −1.417 | −0.358 | −0.031 | −13.10 | 0.891 | −2.222 | 0.549 | −0.067 | 0.077 |

X(5) | 14.910 | 27.038 | 1.000 | 13.774 | 18.762 | 12.133 | 17.133 | 14.904 | 19.700 | 30.850 |

X(6) | 3.215 | 14.110 | 1.782 | 7.210 | 16.119 | 2.199 | 14.110 | 13.717 | 7.210 | 16.210 |

X(7) | −0.118 | −0.354 | 0.203 | 0.046 | −0.057 | −0.117 | 0.528 | −0.051 | 0.084 | −0.065 |

Size(samples) | 22.000 | 48.000 | 92.000 | 25.000 | 55.000 | 22.000 | 48.000 | 92.000 | 25.000 | 55.000 |

Coefficient | Global | Multi Start | ||||||||
---|---|---|---|---|---|---|---|---|---|---|

P | Q | R | S | T | P | Q | R | S | T | |

X(1) | −0.296 | −0.054 | 1.335 | −0.555 | −0.147 | 0.160 | −0.054 | 1.335 | 0.481 | −0.067 |

X(2) | 5.788 | 13.840 | 20.368 | 20.059 | 1.004 | 62.969 | 13.840 | 20.368 | 1.000 | 1.000 |

X(3) | 14.440 | 4.518 | 4.852 | 24.310 | 29.709 | 10.323 | 4.518 | 4.852 | 2.114 | 4.760 |

X(4) | −0.126 | −0.021 | 1.244 | −0.507 | 0.161 | 0.329 | −0.021 | 1.244 | 0.270 | 0.066 |

X(5) | 22.613 | 19.132 | 14.064 | 60.740 | 15.084 | 41.613 | 19.133 | 14.065 | 82.000 | 29.099 |

X(6) | 8.348 | 1.539 | 7.810 | 24.310 | 29.709 | 16.954 | 1.538 | 7.810 | 11.569 | 29.710 |

X(7) | 0.037 | −0.023 | −0.099 | 0.142 | −0.034 | −0.252 | −0.023 | −0.099 | −0.401 | −0.038 |

Size(samples) | 63.000 | 22.000 | 27.000 | 82.000 | 100.000 | 63.000 | 22.000 | 27.000 | 82.000 | 100.000 |

## References

- Benjamin, E.J.; Blaha, M.J.; Chiuve, S.E.; Cushman, M.; Das, S.R.; Deo, R.; Floyd, J.; Fornage, M.; Gillespie, C.; Isasi, C. Heart disease and stroke statistics-2017 update: A report from the American Heart Association. Circulation
**2017**, 135, e146–e603. [Google Scholar] [CrossRef] [PubMed] - Murthy, I.S.; Rangaraj, M.R.; Udupa, K.J.; Goyal, A. Homomorphic analysis and modeling of ECG signals. IEEE Trans. Biomed. Eng.
**1979**, BME-26, 330–344. [Google Scholar] [CrossRef] - Murthy, I.; Prasad, G.D. Analysis of ECG from pole-zero models. IEEE Trans. Biomed. Eng.
**1992**, 39, 741–751. [Google Scholar] [CrossRef] [PubMed] - Kovács, P.; Fridli, S.; Schipp, F. Generalized rational variable projection with application in ECG compression. IEEE Trans. Signal. Process.
**2019**, 68, 478–492. [Google Scholar] [CrossRef][Green Version] - White, M.S.; Flockton, S.J. Adaptive Recursive Filtering Using Evolutionary Algorithms. In Evolutionary Algorithms in Engineering Applications; Dasgupta, D., Michalewicz, Z., Eds.; Springer: Berlin/Heidelberg, Germany, 1997; pp. 361–376. [Google Scholar] [CrossRef]
- Suppappola, S.; Sun, Y.; Chiaramida, S.A. Gaussian pulse decomposition: An intuitive model of electrocardiogram waveforms. Ann. Biomed. Eng.
**1997**, 25, 252–260. [Google Scholar] [CrossRef] - Ryzhii, E.; Ryzhii, M. A heterogeneous coupled oscillator model for simulation of ECG signals. Comput. Methods Programs Biomed.
**2014**, 117, 40–49. [Google Scholar] [CrossRef] - Quiroz-Juarez, M.A.; Jiménez-Ramírez, O.; Vázquez-Medina, R.; Ryzhii, E.; Ryzhii, M.; Aragón, J.L. Cardiac conduction model for generating 12 lead ECG signals with realistic heart rate dynamics. IEEE Trans. Nanobiosci.
**2018**, 17, 525–532. [Google Scholar] [CrossRef] [PubMed] - McSharry, P.E.; Clifford, G.D.; Tarassenko, L.; Smith, L.A. A dynamical model for generating synthetic electrocardiogram signals. IEEE Trans. Biomed. Eng.
**2003**, 50, 289–294. [Google Scholar] [CrossRef] [PubMed][Green Version] - Das, S.; Maharatna, K. Fractional dynamical model for the generation of ECG like signals from filtered coupled Van-der Pol oscillators. Comput. Methods Programs Biomed.
**2013**, 112, 490–507. [Google Scholar] [CrossRef][Green Version] - Cao, D.; Lin, D.; Lv, Y. ECG codebook model for Myocardial Infarction detection. In Proceedings of the 10th International Conference on Natural Computation (ICNC), Xiamen, China, 19–21 August 2014; pp. 797–801. [Google Scholar]
- Dubois, R.; Roussel, P.; Vaglio, M.; Extramiana, F.; Badilini, F.; Maison-Blanche, P.; Dreyfus, G. Efficient modeling of ECG waves for morphology tracking. In Proceedings of the 36th Annual Computers in Cardiology Conference (CinC), Park City, UT, USA, 13–16 September 2009; pp. 313–316. [Google Scholar]
- Baali, H.; Akmeliawati, R.; Salami, M.-J.E.; Khorshidtalab, A.; Lim, E. ECG parametric modeling based on signal dependent orthogonal transform. IEEE Signal. Process. Lett.
**2014**, 21, 1293–1297. [Google Scholar] [CrossRef] - Roonizi, E.K.; Sassi, R. A signal decomposition model-based Bayesian framework for ECG components separation. IEEE Trans. Signal. Process.
**2016**, 64, 665–674. [Google Scholar] [CrossRef] - Vafaie, M.; Ataei, M.; Koofigar, H.R. Heart diseases prediction based on ECG signals’ classification using a genetic-fuzzy system and dynamical model of ECG signals. Biomed. Signal. Process. Control.
**2014**, 14, 291–296. [Google Scholar] [CrossRef] - Ahmadian, A.; Karimifard, S.; Sadoughi, H.; Abdoli, M. An efficient piecewise modeling of ECG signals based on Hermitian basis functions. In Proceedings of the 29th Annual International Conference of the IEEE Engineering in Medicine and Biology Society, Lyon, France, 22–26 August 2007; pp. 3180–3183. [Google Scholar]
- Sornmo, L.; Borjesson, P.O.; Nygards, M.-E.; Pahlm, O. A method for evaluation of QRS shape features using a mathematical model for the ECG. IEEE Trans. Biomed. Eng.
**1981**, BME-28, 713–717. [Google Scholar] [CrossRef] - Do Vale Madeiro, J.P.; Marques, J.A.L.; Han, T.; Pedrosa, R.C. Evaluation of mathematical models for QRS feature extraction and QRS morphology classification in ECG signals. Measurement
**2020**, 156, 107580. [Google Scholar] [CrossRef] - Sandryhaila, A.; Saba, S.; Puschel, M.; Kovacevic, J. Efficient compression of QRS complexes using Hermite expansion. IEEE Trans. Signal. Process.
**2011**, 60, 947–955. [Google Scholar] [CrossRef][Green Version] - Dózsa, T.; Kovács, P. ECG signal compression using adaptive Hermite functions. In Proceedings of the 7th International Conference on ICT Innovations, Ohrid, North Macedonia, 1–4 October 2015; pp. 245–254. [Google Scholar]
- Philips, W.; De Jonghe, G. Data compression of ECG’s by high-degree polynomial approximation. IEEE Trans. Biomed. Eng.
**1992**, 39, 330–337. [Google Scholar] [CrossRef] - Madhukar, B.; Murthy, I. ECG data compression by modeling. Comput. Biomed. Res.
**1993**, 26, 310–317. [Google Scholar] [CrossRef] [PubMed][Green Version] - Abboud, S.; Barnea, O. Errors due to sampling frequency of the electrocardiogram in spectral analysis of heart rate signals with low variability. In Proceedings of the Computers in Cardiology, Vienna, Austria, 10–13 September 1995; pp. 461–463. [Google Scholar]
- Awal, M.A.; Mostafa, S.S.; Ahmad, M. Simplified mathematical model for generating ECG signal and fitting the model using non-linear least square technique. In Proceedings of the International Conference on Mechanical Engineering, Dhaka, Bangladesh, 18–20 December 2011; pp. 1–6. [Google Scholar]
- Tang, Q.; Chen, Z.; Ward, R.; Elgendi, M. Synthetic photoplethysmogram generation using two Gaussian functions. Sci. Rep.
**2020**, 10, 1–10. [Google Scholar] [CrossRef] - Goshtasby, A.; Oneill, W.D. Curve Fitting by a Sum of Gaussians. CVGIP Graph. Models Image Process.
**1994**, 56, 281–288. [Google Scholar] [CrossRef] - Caruana, R.A.; Searle, R.B.; Heller, T.; Shupack, S.I. Fast algorithm for the resolution of spectra. Anal. Chem.
**1986**, 58, 1162–1167. [Google Scholar] [CrossRef] - Kheirati Roonizi, E. A New Algorithm for Fitting a Gaussian Function Riding on the Polynomial Background. Signal. Process. Lett. IEEE
**2013**, 20, 1062–1065. [Google Scholar] [CrossRef] - Al-Nahhal, I.; Dobre, O.A.; Basar, E.; Moloney, C.; Ikki, S. A Fast, Accurate, and Separable Method for Fitting a Gaussian Function [Tips & Tricks]. IEEE Signal. Process. Mag.
**2019**, 36, 157–163. [Google Scholar] - Pflanzer, R.; McMullen, W. Electrocardiography (ECG) II Procedure. In Biopac Student Laboratory Manual; Biopac Systems Inc.: Goleta, CA, USA, 2014. [Google Scholar]
- Awal, M.A.; Mostafa, S.S.; Ahmad, M.; Rashid, M.A. An adaptive level dependent wavelet thresholding for ECG denoising. Biocybern. Biomed. Eng.
**2014**, 34, 238–249. [Google Scholar] [CrossRef] - Edla, S.; Kovvali, N.; Papandreou-Suppappola, A. Electrocardiogram signal modeling with adaptive parameter estimation using sequential Bayesian methods. IEEE Trans. Signal. Process.
**2014**, 62, 2667–2680. [Google Scholar] [CrossRef] - Moody, G.B.; Mark, R.G. The MIT-BIH arrhythmia database on CD-ROM and software for use with it. In Proceedings of the Computers in Cardiology, Chicago, IL, USA, 23–26 September 1990; pp. 185–188. [Google Scholar]
- Van Fleet, P. Discrete Wavelet Transformations: An. Elementary Approach with Applications, 2nd ed.; John Wiley & Sons: Hoboken, NJ, USA, 2011. [Google Scholar]
- Moody, G.B. MIT-BIH Arrhythmia Database Directory; Hypertext edition, 24 May 1997 (Based on the printed third edition, 23 July 1992); Harvard-MIT Division of Health Sciences and Technology, Biomedical Engineering Center: Cambridge, MA, USA, 1997. [Google Scholar]
- Awal, M.A.; Mostafa, S.S.; Ahmad, M. Quality assessment of ECG signal using symlet wavelet transform. In Proceedings of the International Conference on Advances in Electrical Engineering (ICAEE), Dhaka, Bangladesh, 20–22 December 2012. [Google Scholar]
- Addison, P.S. Wavelet transforms and the ECG: A review. Physiol. Meas.
**2005**, 26, R155–R199. [Google Scholar] [CrossRef] [PubMed][Green Version] - Moody, G.B.; Muldrow, W.; Mark, R.G. A noise stress test for arrhythmia detectors. Comput. Cardiol.
**1984**, 11, 381–384. [Google Scholar] - Clifford, G.; Shoeb, A.; McSharry, P.; Janz, B. Model-based filtering, compression and classification of the ECG. Int. J. Bioelectromagn.
**2005**, 7, 158–161. [Google Scholar] - Mahdiani, S.; Jeyhani, V.; Peltokangas, M.; Vehkaoja, A. Is 50 Hz high enough ECG sampling frequency for accurate HRV analysis? In Proceedings of the 37th Annual International Conference of the IEEE Engineering in Medicine and Biology Society (EMBC), Milan, Italy, 25–29 August 2015; pp. 5948–5951. [Google Scholar]
- Pizzuti, G.; Cifaldi, S.; Nolfe, G. Digital sampling rate and ECG analysis. J. Biomed. Eng.
**1985**, 7, 247–250. [Google Scholar] [CrossRef] - Mueller, W.C. Arrhythmia detection program for an ambulatory ECG monitor. Biomed. Sci. Instrum.
**1978**, 14, 81. [Google Scholar] - Imai, H.; Kiraura, N.; Yoshlda, Y. An efficient encoding method for electrocardiography using spline functions. Syst. Comput. Jpn.
**1985**, 16, 85–94. [Google Scholar] [CrossRef] - Ruttimann, U.E.; Pipberger, H.V. Compression of the ECG by prediction or interpolation and entropy encoding. IEEE Trans. Biomed. Eng.
**1979**, 613–623. [Google Scholar] [CrossRef] - Rajoub, B.A. An efficient coding algorithm for the compression of ECG signals using the wavelet transform. IEEE Trans. Biomed. Eng.
**2002**, 49, 355–362. [Google Scholar] [CrossRef] - Clifford, G.D. A novel framework for signal representation and source separation: Applications to filtering and segmentation of biosignals. J. Biol. Syst.
**2006**, 14, 169–183. [Google Scholar] [CrossRef] - Parvaneh, S.; Pashna, M. Electrocardiogram synthesis using a Gaussian combination model (GCM). In Proceedings of the Computers in Cardiology, Durham, NC, USA, 30 September–3 October 2007; pp. 621–624. [Google Scholar]
- Clifford, G.; Villarroel, M. Model-based determination of QT intervals. In Proceedings of the Computers in Cardiology, Valencia, Spain, 17–20 September 2006; pp. 357–360. [Google Scholar]
- De Azevedo Botter, E.; Nascimento, C.L.; Yoneyama, T. A neural network with asymmetric basis functions for feature extraction of ECG P waves. IEEE Trans. Neural Netw.
**2001**, 12, 1252–1255. [Google Scholar] [CrossRef] - Badilini, F.; Vaglio, M.; Dubois, R.; Roussel, P.; Sarapa, N.; Denjoy, I.; Extramiana, F.; Maison-Blanche, P. Automatic analysis of cardiac repolarization morphology using Gaussian mesa function modeling. J. Electrocardiol.
**2008**, 41, 588–594. [Google Scholar] [CrossRef] [PubMed] - Dubois, R.; Maison-Blanche, P.; Quenet, B.; Dreyfus, G. Automatic ECG wave extraction in long-term recordings using Gaussian mesa function models and non-linear probability estimators. Comput. Methods Programs Biomed.
**2007**, 88, 217–233. [Google Scholar] [CrossRef] [PubMed] - Guo, H. A simple algorithm for fitting a Gaussian function. IEEE Signal. Process. Mag.
**2011**, 28, 134–137. [Google Scholar] [CrossRef] - Bsoul, A.A.R.; Ji, S.; Ward, K.; Najarian, K. Detection of P, QRS, and T Components of ECG using wavelet transformation. In Proceedings of the ICME International Conference on Complex Medical Engineering, Tempe, AZ, USA, 9–11 April 2009; pp. 1–6. [Google Scholar]
- Aspuru, J.; Ochoa-Brust, A.; Félix, R.A.; Mata-López, W.; Mena, L.J.; Ostos, R.; Martínez-Peláez, R. Segmentation of the ECG Signal by means of a linear regression algorithm. Sensors
**2019**, 19, 775. [Google Scholar] [CrossRef][Green Version] - Maršánová, L.; Němcová, A.; Smíšek, R.; Goldmann, T.; Vítek, M.; Smital, L. Automatic Detection of P Wave in ECG During Ventricular Extrasystoles. In Proceedings of the World Congress on Medical Physics and Biomedical Engineering, Prague, Czech Republic, 3–8 June 2018; Springer: Singapore, 2019; pp. 381–385. [Google Scholar]
- Osowski, S.; Linh, T.H. ECG beat recognition using fuzzy hybrid neural network. IEEE Trans. Biomed. Eng.
**2001**, 48, 1265–1271. [Google Scholar] [CrossRef] - Osowski, S.; Hoai, L.T.; Markiewicz, T. Support vector machine-based expert system for reliable heartbeat recognition. IEEE Trans. Biomed. Eng.
**2004**, 51, 582–589. [Google Scholar] [CrossRef] [PubMed] - Awal, M.A.; Masud, M.; Hossain, M.S.; Bulbul, A.A.M.; Mahmud, S.M.H.; Bairagi, A.K. A Novel Bayesian Optimization-Based Machine Learning Framework for COVID-19 Detection From Inpatient Facility Data. IEEE Access
**2021**, 9, 10263–10281. [Google Scholar] [CrossRef] - Wang, D.; Meng, Q.; Chen, D.; Zhang, H.; Xu, L. Automatic Detection of Arrhythmia Based on Multi-Resolution Representation of ECG Signal. Sensors
**2020**, 20, 1579. [Google Scholar] [CrossRef] [PubMed][Green Version] - Peng, H.; Long, F.; Ding, C. Feature selection based on mutual information criteria of max-dependency, max-relevance, and min-redundancy. IEEE Trans. Pattern Anal. Mach. Intell.
**2005**, 27, 1226–1238. [Google Scholar] [CrossRef] - Mostafa, S.; Awal, M.; Ahmad, M.; Rashid, M. Voiceless Bangla vowel recognition using sEMG signal. SpringerPlus
**2016**, 5, 1522. [Google Scholar] [CrossRef] [PubMed][Green Version] - Bulbul, A.A.-M.; Abdul Awal, M.; Debjit, K. EEG Based Sleep-Wake Classification Using JOPS Algorithm. In Proceedings of the 19th International Conference Brain Informatics, Padua, Italy, 19 September 2020; Springer: Cham, Switzerland, 2020; pp. 361–371. [Google Scholar]
- Mallat, S.G.; Zhang, Z. Matching pursuits with time-frequency dictionaries. IEEE Trans. Signal. Process.
**1993**, 41, 3397–3415. [Google Scholar] [CrossRef][Green Version] - Awal, M.A.; Ouelha, S.; Dong, S.; Boashash, B. A robust high-resolution time–frequency representation based on the local optimization of the short-time fractional Fourier transform. Digit. Signal. Process.
**2017**, 70, 125–144. [Google Scholar] [CrossRef]

**Figure 2.**Proposed hybrid optimization technique. (

**a**) Step 1: Approximation of the Gaussian parameters. In this step, the effect of adding multiple Gaussians is not taken into account. Step 2: These estimated parameters are regarded as initial parameters in the (

**b**) Multi-start and (

**c**) Global search optimization solver to determine the optimal Gaussian parameters.

**Figure 5.**Model fitting of different cardiac dysrhythmias which are morphologically different and have different pathophysiological conditions.

**Figure 7.**FFT of different types of ECG beats representing physiological or pathophysiological conditions.

**Figure 8.**PSD of different types of ECG beats representing physiological or pathophysiological conditions.

**Figure 9.**Absolute scalogram difference of different types of ECG beats representing physiological or pathophysiological conditions using ApproxiGlo and ApproxiMul methods.

**Figure 12.**ECG simulation by model for 10 s. For bradycardia with BPM (beat per minute) 50, sinus rhythm with BPM 72, tachycardia with BPM 120.

**Table 1.**Comparison between the proposed ApproxiGlo and ApproxiMul and the nonlinear fitting method described in [24] for normal ECGs.

Average Goodness of Fitting | Nonlinear Fitting Method (MIT-BIH Arrhythmia Database) [24] | Proposed Hybrid Method (MIT-BIH Arrhythmia Database) | Proposed Hybrid Method (UCDSA Database) | ||
---|---|---|---|---|---|

ApproxiGlo | ApproxiMul | ApproxiGlo | ApproxiMul | ||

MSE | 0.00779 | 0.00071 | 0.0001 | 0.0007 | 0.0003 |

NMSE | 0.172477 | 0.01724 | 0.0031 | 6.4025 × 10^{−6} | 2.1465 × 10^{−6} |

RMSE | 0.0882615 | 0.02657 | 0.0112 | 0.0267 | 0.0164 |

NRMSE | 0.029748 | 0.1313 | 0.0555 | 0.0089 | 0.0054 |

CORR | 0.9205 | 0.99016 | 0.9983 | 0.9969 | 0.9988 |

Normal(N) | Atrial Premature Beat (A) | ||||
---|---|---|---|---|---|

Average goodness of fitting | ApproxiGlo | ApproxiMul | Average goodness of fitting | ApproxiGlo | ApproxiMul |

MSE | 0.00071 | 0.0001 | MSE | 6.29 × 10^{−5} | 3.33 × 10^{−5} |

NMSE | 0.01724 | 0.0031 | NMSE | 0.00175483 | 0.00092763 |

RMSE | 0.02657 | 0.0112 | RMSE | 0.00793334 | 0.005768 |

NRMSE | 0.1313 | 0.0555 | NRMSE | 0.04189072 | 0.03045697 |

CORR | 0.99016 | 0.9983 | CORR | 0.9991193 | 0.99953455 |

**Table 3.**Comparison between ApproxiGlo and ApproxiMul for paced beat and premature ventricular contraction beat.

Paced Beat (PB) | Premature Ventricular Contraction (V) | ||||
---|---|---|---|---|---|

Average goodness of fitting | ApproxiGlo | ApproxiMul | Average goodness of fitting | ApproxiGlo | ApproxiMul |

MSE | 0.0141746 | 0.0011756 | MSE | 0.00028384 | 0.00075337 |

NMSE | 0.0096177 | 0.0007977 | NMSE | 0.00173033 | 0.00459269 |

RMSE | 0.1190572 | 0.0342873 | RMSE | 0.01684748 | 0.02744755 |

NRMSE | 0.0980699 | 0.0282432 | NRMSE | 0.04159728 | 0.0677694 |

CORR | 0.9951467 | 0.9995984 | CORR | 0.99912836 | 0.9976848 |

Method | Frequency (Hz) | BPM | CR |
---|---|---|---|

Turning Point (TP) [42] | 200 | 75 | 2:1 |

Peak-Picking (spline) with Entropy coding [43] | 500 | 75 | 10:1 |

DPCM-Linear Prediction Interpolation and Entropy Coding [44] | 500 | 75 | 7.8:1 |

DWT using variable length code [45] | 360 | 75 | 22.19:1 |

DWT using direct binary representation [45] | 360 | 75 | 23:1 |

Polynomial transform (PT) [21] | 500 | 75 | 12.6 (N = 100) |

A dynamical model [39] | 128 | 60 | >7:1 |

Proposed method | 1 k | 75 | 20:1 |

200 | 75 | 4:1 | |

500 | 75 | 10:1 | |

360 | 75 | 7.2:1 | |

128 | 60 | 3.2:1 | |

128 | 75 | 2.56:1 |

Reference/Studies | Number of Gaussians | Additional Information | Type of Algorithm to Fit the Model | Outcomes |
---|---|---|---|---|

Suppappola et al. [6] | Between 6 and 14 (for normal ECG) | Chip away decomposition (CHAD) algorithm. Variable number of Gaussians. Prone to noise. | Three optimization methods used: Nelder Mead simplex method, Newton-Raphson and steepest descent method. | NMSE $\le $ 10% |

Clifford et al. [39] | 6 | A 3-D model. Complicated model. Asymmetry of T-wave is not considered. Can be stuck in local minima due to the use of local optimizer i.e. lsqnonlin. | Nonlinear least-squares solver using lsqnonlin function. | Presented visually |

McSharry et al. [9] | 5 | 3-D model. Complicated model. Asymmetry of T-wave is not considered. | Experimental search | Presented visually |

Clifford [46] | Adaptive determination for $p\text{}=\text{}n+2m$ ($n$ = Symmetric turning point, $m\text{}=$ asymmetric turning point) | A dynamical model. Asymmetry of T-wave is considered. Can be stuck in local minima due to the use of local optimizer, i.e., lsqnonlin. | Nonlinear least-squares solver using lsqnonlin function | Presented visually |

Parvaneh and Pashna [47] | Manually or Automatically (up to 133) | Gaussian function. Variable number of Gaussians. Complexity increases as the number of Gaussians increases. | Zero-crossing and minimum bank method | The best area under absolute of local error = 233.2 |

Badilini et al. [50] | 6 | Gaussian Messa Function (GMF) (consists of 5 parameters). GMF has more parameters than the single Gaussian function. | Generalized orthogonal forward regression (GOFR) | (CORR = 0.96) QT |

Dubois et al. [51] | 6 | GMF and nonlinear probability estimators. GMF has more parameters than the single Gaussian function. | GOFR | Used for classification |

Roonizi and Ebadollah [28] | 5 | Gaussian Function Riding on the Polynomial Background. Complex realization. | Non-iterative approximation method | PRD < 0.4 |

Dubois et al. [12] | 6 (GMF) For T wave (BiGaussian) | GMF and BiGaussian. Non-uniform Gaussian waves for different ECG components. | Generalized Orthogonal Forward Regression (GOFR) | QT (CORR = 0.92) |

Elda et al. [32] | Three different polynomials (linear, quadratic, cubic polynomials) | Adaptive Multi-harmonic ECG Modeling and Interacting multiple model (IMM) with sequential Markov chain Monte Carlo (SMCMC) methods. Complex to realize. | Sequential Bayesian-based methods to effectively model and adaptively select parameters ECG modeling techniques using the interacting multiple model (IMM). | ECG-P Wave RMSE = 2.71$\times {10}^{-2}$ for SMCMC and 2.29 $\times {10}^{-2}$ for IMM |

Proposed | 7 | Sum of two Gaussian functions. Simple to realize, adaptive to baseline wander, and does not stuck in local minima. However, the number of parameters is higher than single Gaussian and Bi-Gaussians. | Hybrid optimization techniques namely ApproxiGlo and ApproxiMul. | For ApproxiGlo CORR = 0.99016 RMSE = 0.02657 For ApproxiMul CORR = 0.9983 RMSE =0.0112 |

Average Performance Parameters | Crauna’s Method [27] | Guo’s Method [52] | FAS Method [29] | ApproxiGlo Method | ApproxiMul Method |
---|---|---|---|---|---|

MSE | 0.04314 | 0.05660 | 0.09497 | 0.00074 | 7.56$\times {10}^{-5}$ |

NMSE | 6.71 $\times {10}^{-5}$ | 8.81 $\times {10}^{-5}$ | 0.00015 | 1.17 $\times {10}^{-6}$ | 1.19$\times {10}^{-7}$ |

RMSE | 0.20767 | 0.23791 | 0.30817 | 0.02726 | 0.00869 |

NRMSE | 0.13454 | 0.15414 | 0.19965 | 0.01766 | 0.00563 |

CORR | 0.76189 | 0.73095 | 0.58196 | 0.99082 | 0.99907 |

Runtime (in Sec.) | 0.51107 | 0.00383 | 0.0034 | 4.51996 | 7.54061 |

Publisher’s Note: MDPI stays neutral with regard to jurisdictional claims in published maps and institutional affiliations. |

© 2021 by the authors. Licensee MDPI, Basel, Switzerland. This article is an open access article distributed under the terms and conditions of the Creative Commons Attribution (CC BY) license (http://creativecommons.org/licenses/by/4.0/).

## Share and Cite

**MDPI and ACS Style**

Awal, M.A.; Mostafa, S.S.; Ahmad, M.; Alahe, M.A.; Rashid, M.A.; Kouzani, A.Z.; Mahmud, M.A.P. Design and Optimization of ECG Modeling for Generating Different Cardiac Dysrhythmias. *Sensors* **2021**, *21*, 1638.
https://doi.org/10.3390/s21051638

**AMA Style**

Awal MA, Mostafa SS, Ahmad M, Alahe MA, Rashid MA, Kouzani AZ, Mahmud MAP. Design and Optimization of ECG Modeling for Generating Different Cardiac Dysrhythmias. *Sensors*. 2021; 21(5):1638.
https://doi.org/10.3390/s21051638

**Chicago/Turabian Style**

Awal, Md. Abdul, Sheikh Shanawaz Mostafa, Mohiuddin Ahmad, Mohammad Ashik Alahe, Mohd Abdur Rashid, Abbas Z. Kouzani, and M. A. Parvez Mahmud. 2021. "Design and Optimization of ECG Modeling for Generating Different Cardiac Dysrhythmias" *Sensors* 21, no. 5: 1638.
https://doi.org/10.3390/s21051638