## 1 Introduction  
ECG conveys valuable diagnostic information about heart functioning. Its analysis and processing play an important and significant role in the diagnosis of heart diseases. A typical electrocardiogram consists of five characteristic waves: P, Q, R, S, and T waves. This series of waveforms correspond to each phase of cardiac activities [1]. The identification of these waves is a critical step in analyzing the ECG signal and has been made possible by analyzing their morphological patterns. The heartbeats of the MIT-BIH DB are classified into five types according to the AAMI standard [2]. The normal sinus rhythm (N or NSR), left bundle branch block (L or LBBB), right bundle branch block (R or RBBB), atrial escape (e) and nodal (junctional) escape (j) beats belong to class N (non-ectopic). Class S includes atrial premature (A), aberrated atrial premature (a), nodal (junctional) premature (J), and supra-ventricular premature (S). Class V includes premature ventricular contraction (V) and ventricular escape (E). Class F includes fusion of ventricular and normal (F), class Q includes paced (_/_), fusion of paced and normal (f), and unclassified (Q). Figure 1 shows four representative heart beats concerning arrhythmia in the MIT-BIH DB: the atrial premature beat (APB), junctional premature beat (JPB), premature ventricular contraction (PVC), and atrial fibrillation (AF). APB occurs when an ectopic focus in the atria discharges before the next sinus impulse [3]. The premature impulse may depolarize the atria and subsequently the ventricles, provided that the myocardium and conduction system have repolarized. This appears as a premature P-wave and QRS complex occurring earlier than expected. Additionally, the P wave morphology of APBs is different from sinus P wave and may be a deformed or negative P wave. JPBs arise from an ectopic focus within the atrioventricular (AV) junction [4]. These cause premature QRS complexes without a preceding P wave, and the QRS morphology is very similar to sinus complexes. A PVC is caused by an ectopic cardiac pacemaker located in the ventricle. PVCs are characterized by premature and bizarrely shaped QRS complexes that are unusually long (typically \(>\)120 ms) and appear wide on the ECG. These complexes are not preceded by a P wave, and a T wave is usually large and oriented in a direction opposite the major deflection of QRS [5; 6]. AF is an irregular and often rapid heart rate that can increase your risk of strokes, heart failure and other heart-related complications [7]. Likewise, an arrhythmia is a problem with the rate or rhythm of your heartbeat. This means that the heart beats too quickly, too slowly, or with an irregular pattern. The most basic and important step for detecting arrhythmias with various aspects is R-peak or QRS complex detection. Recent technological advances in sensors, low-power integrated circuits, and wireless communications have accelerated the tremendous growth of medical wearable devices. This advance originates from the need to monitor a patient over an extensive period of time. Especially, Internet of Medical Things (IoMT)-based wearable devices can monitor long-term physiological signals and upload data to the cloud via a wireless communication system [8]. Figure 2 shows the concept of a wireless patient monitoring system. The system consistently monitors the bio-signals of patients and sends the measured bio-signals to the wearable smart device or central monitoring system [9; 10]. For cardiac patients, wearable heart monitoring sensors have already become a life-saving intervention ensuring continuous monitoring during daily life. Patients can be equipped with wireless, miniature and lightweight sensors [11]. The sensors store the bio-signals in real-time and then periodically upload the data to a DB server [11]. The recorded bio-signals may be analyzed in the wearable device itself to predict a warning level. If the early analyzed result is above a threshold, a warning alarm is sent to the medical staff of the hospital [12].