Real Time QRS Detection Based on M-ary Likelihood Ratio Test on the DFT Coefficients Juan Manuel Go ´ rriz 1 *, Javier Ramı´rez 1 , Alberto Olivares 1 , Pablo Padilla 1 , Carlos G. Puntonet 2 , Manuel Canto ´n 3 , Pablo Laguna 4 1 Department of Signal Theory, Telematics and Communications, CITIC, University of Granada, Granada, Spain, 2 Department Computer Architecture and Computer Technology, CITIC, University of Granada, Granada, Spain, 3 Department of Informatics, University of Almerı ´a, Almerı ´a, Spain, 4 Department of Electronic Engineering and Communications, University of Zaragoza, Zaragoza, Spain Abstract This paper shows an adaptive statistical test for QRS detection of electrocardiography (ECG) signals. The method is based on a M-ary generalized likelihood ratio test (LRT) defined over a multiple observation window in the Fourier domain. The motivations for proposing another detection algorithm based on maximum a posteriori (MAP) estimation are found in the high complexity of the signal model proposed in previous approaches which i) makes them computationally unfeasible or not intended for real time applications such as intensive care monitoring and (ii) in which the parameter selection conditions the overall performance. In this sense, we propose an alternative model based on the independent Gaussian properties of the Discrete Fourier Transform (DFT) coefficients, which allows to define a simplified MAP probability function. In addition, the proposed approach defines an adaptive MAP statistical test in which a global hypothesis is defined on particular hypotheses of the multiple observation window. In this sense, the observation interval is modeled as a discontinuous transmission discrete-time stochastic process avoiding the inclusion of parameters that constraint the morphology of the QRS complexes. Citation: Go ´ rriz JM, Ramı ´rez J, Olivares A, Padilla P, Puntonet CG, et al. (2014) Real Time QRS Detection Based on M-ary Likelihood Ratio Test on the DFT Coefficients. PLoS ONE 9(10): e110629. doi:10.1371/journal.pone.0110629 Editor: Luigi Bianchi, University of Rome Tor Vergata, Italy Received July 14, 2014; Accepted September 16, 2014; Published October 30, 2014 Copyright: ß 2014 Go ´ rriz et al. This is an open-access article distributed under the terms of the Creative Commons Attribution License, which permits unrestricted use, distribution, and reproduction in any medium, provided the original author and source are credited. Data Availability: The authors confirm that all data underlying the findings are fully available without restriction. All ECG files are available from the MIT-BIH Arrhythmia Database which can be found at http://www.physionet.org/physiobank/database/mitdb/. Funding: This work has received research funding from the Spanish government (www.micinn.es) under project TEC2012 34306 (DiagnoSIS, Diagnosis by means of Statistical Intelligent Systems, 70KJ) and projects P09-TIC-4530 (300KJ) and P11-TIC-7103 (156KJ) from the Andalusian government (http://www. juntadeandalucia.es/organismos/economiainnovacioncienciayempleo.html). The funders had no role in study design, data collection and analysis, decision to publish, or preparation of the manuscript. Competing Interests: The authors have declared that no competing interests exist. * Email: gorriz@ugr.es Introduction One of the most relevant waveforms in the electrocardiogram (ECG) is the QRS complex since it has been used in several medical applications [1] such as noise cancelation [2], the automated determination of the heart rate [3] or computer-based arrhythmia monitoring [4]. The QRS ECG segment reflects the electrical activity during ventricular contraction, thus the time of its occurrence as well as its shape provide relevant diagnostic and prognostic information in clinical practice [5–7]. In the past decades several approaches to QRS detection based on different paradigms have been successfully proposed. Examples of such approaches are based on the field of artificial neural networks [8], genetic algorithms [9], wavelet transform [10] or filter banks [11], analyses of signal parameters such as slope, amplitude and width [12], as well as other heuristic [13] and non linear transforms. Most QRS detectors have been developed following a three-step structure [3], that is, a linear filter suppressing noise and artifacts followed by a nonlinear transfor- mation for signal enhancement. The output of these two stages is then fed to a third decision rule stage for detection. The main target of this paper is focused on the third stage, therefore the proposed method could be used in combination with detectors described in the literature which have been developed from ad hoc reasoning and experimental insight. Up to our knowledge the first approach based on maximum a posteriori (MAP) estimation for QRS detection was proposed in [14]. In the latter work a complex mathematical model in the time domain was introduced to find several ECG parameters such as amplitudes, widths or arrival times, which provide an appropriate fit to that model using a pre-defined matched filter. As the authors acknowledge, this method was computationally unfeasible [14], thus additional simplifications and approximations on the MAP estimation were needed to be introduced to reduce the compu- tation time [15], but still the method could not be considered as a real time approach, i.e. the estimation of arrival times are not necessarily found in temporal order [15]. This problem can, of course, be solved if the size of the observation window is reduced, as shown in the experimental part of this paper where this method is analyzed as a baseline. This is mainly motivated by the long- term observation window of the model which assumes that the observation vector contains an unknown number q of pulse-shaped waveforms. On the other hand, the asymptotic properties of the Discrete Fourier Transform (DFT) coefficients [16] could be as well analyzed in the definition of the signal model, that is they are PLOS ONE | www.plosone.org 1 October 2014 | Volume 9 | Issue 10 | e110629