## 1 Introduction
In order to acquire accurate response with  
Figure 1: Four representative heart beats concerning arrhythmia; (**a**) atrial premature beat (APB), (**b**) junctional premature beat (JPB), (**c**) premature ventricular contraction (PVC), and (**d**) atrial fibrillation (AF). less computational complexity as well as a light weight and long battery time, the development of a fast and accurate algorithm for wearable heart monitoring sensors is needed. For a remote ECG monitoring application, R or QRS detection is a preliminary step for detecting the heartbeat for the subsequent rhythm classification. A computationally efficient R or QRS detection algorithm is indispensable for the low-power operation of a wearable ECG device. The QRS detection algorithms developed to date can be categorized as derivative [13], digital filters [14; 15; 16], Wavelet transform [17; 18], Hilbert transform [19; 20], phasor transform [21], adaptive threshold [22; 23], morphology [24; 25], and signal energy [14; 26; 27; 28] based algorithms. The mentioned methods show superb QRS detection performance; however, major issues under the mobile environment include the low-complexity algorithms and real-time processing methods related to power efficiency and processing speed. Recently, derivative-based QRS detection methods are still being studied due to their low complexity [29; 30]. [PERSON] et al. [29] have presented a pulse-triggered R peak detection algorithm for ECG signals based on the second derivative. This method uses a QRS morphology for R peak detection and is computationally inexpensive. However, in this method, the detection of the Q wave, a trough in the ECG signal, should precede R peak detection. Therefore, if a Q wave is contaminated by noise or there is no trough point of the Q wave, the R point detection performance is significantly lowered. [PERSON] et al. [30] proposed a QRS detector using derivation and adaptive thresholding. In this method, the accuracy of the initial maximum peak detected as the R peak greatly affects the overall performance and has a disadvantage of being sensitive to noise. The derivative-based method has been placed in the spotlight again with the development of wearable ECG devices: however, it is sensitive to noise. In addition, the existing methods do not have a criterion to determine whether the detected R peak is a true R peak or noise due to the absence of a noise detection function, which may cause errors in the RR interval calculation and further HRV analysis. This paper proposes an efficient real-time R or QRS detection technique with low computational complexity and high accuracy for portable and wearable ECG monitoring systems. First, we introduce a simple method of connecting R peaks detected for each sliding window for real-time processing and describe an avoidance technique of R peaks with low reliability caused by noise and the R peak mismatch problem between sling windows for extracting precise RR intervals. Furthermore, an R peak detection method by using a pair of first-order derivative filters is introduced, and a detection method of the negative R peak or premature ventricular contraction (PVC), which is different from general R peak, is expressed mathematically. The proposed method is verified by the MIT-BIH DB [2] and CYBHi DB [31; 32]. Besides this, the HRV analysis is performed using actual ECG data measured by the portable ECG monitoring device developed in this study. The paper is organized as follows. Section 2 introduces the sliding window processing for real-time processing, simple and efficient noise detection using a vertical histogram, the proposed real-time R  
Figure 2: Portable wireless patient monitoring system. ECG: electrocardiogram, SpO2: Oxygen saturation, NIBP: Non-invasive blood pressure. peak detection method using a pair of derivative filters, and an exclusion technique for unreliable RR intervals. In Section 3, the detection performance of the proposed method is demonstrated using the MIT-BIH DB and actual ECG data measured from the developed ECG patch.