<?xml version="1.0" encoding="UTF-8"?><!DOCTYPE article  PUBLIC "-//NLM//DTD Journal Publishing DTD v3.0 20080202//EN" "http://dtd.nlm.nih.gov/publishing/3.0/journalpublishing3.dtd"><article xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:xlink="http://www.w3.org/1999/xlink" dtd-version="3.0" xml:lang="en" article-type="research article"><front><journal-meta><journal-id journal-id-type="publisher-id">JCC</journal-id><journal-title-group><journal-title>Journal of Computer and Communications</journal-title></journal-title-group><issn pub-type="epub">2327-5219</issn><publisher><publisher-name>Scientific Research Publishing</publisher-name></publisher></journal-meta><article-meta><article-id pub-id-type="doi">10.4236/jcc.2014.212004</article-id><article-id pub-id-type="publisher-id">JCC-50800</article-id><article-categories><subj-group subj-group-type="heading"><subject>Articles</subject></subj-group><subj-group subj-group-type="Discipline-v2"><subject>Computer Science&amp;Communications</subject></subj-group></article-categories><title-group><article-title>
 
 
  A Nonparametric Derivative-Based Method for R Wave Detection in ECG
 
</article-title></title-group><contrib-group><contrib contrib-type="author" xlink:type="simple"><name name-style="western"><surname>iyun</surname><given-names>Su</given-names></name><xref ref-type="aff" rid="aff1"><sup>1</sup></xref><xref ref-type="corresp" rid="cor1"><sup>*</sup></xref></contrib><contrib contrib-type="author" xlink:type="simple"><name name-style="western"><surname>Min</surname><given-names>Sun</given-names></name><xref ref-type="aff" rid="aff1"><sup>1</sup></xref><xref ref-type="corresp" rid="cor1"><sup>*</sup></xref></contrib><contrib contrib-type="author" xlink:type="simple"><name name-style="western"><surname>Chenlong</surname><given-names>Li</given-names></name><xref ref-type="aff" rid="aff1"><sup>1</sup></xref></contrib><contrib contrib-type="author" xlink:type="simple"><name name-style="western"><surname>Xiangwu</surname><given-names>Peng</given-names></name><xref ref-type="aff" rid="aff1"><sup>1</sup></xref></contrib></contrib-group><aff id="aff1"><addr-line>School of Mathematics and Statistics, Chongqing University of Technology, Chongqing, China.</addr-line></aff><author-notes><corresp id="cor1">* E-mail:<email>cloudhopping@163.com(IS)</email>;<email>441377991@qq.com(MS)</email>;</corresp></author-notes><pub-date pub-type="epub"><day>08</day><month>10</month><year>2014</year></pub-date><volume>02</volume><issue>12</issue><fpage>26</fpage><lpage>38</lpage><history><date date-type="received"><day>21</day>	<month>August</month>	<year>2014</year></date><date date-type="rev-recd"><day>19</day>	<month>September</month>	<year>2014</year>	</date><date date-type="accepted"><day>12</day>	<month>October</month>	<year>2014</year></date></history><permissions><copyright-statement>&#169; Copyright  2014 by authors and Scientific Research Publishing Inc. </copyright-statement><copyright-year>2014</copyright-year><license><license-p>This work is licensed under the Creative Commons Attribution International License (CC BY). http://creativecommons.org/licenses/by/4.0/</license-p></license></permissions><abstract><p>
 
 
   QRS detection is very important in cardiovascular disease diagnosis and ECG (electrocardiogram) monitor, because it is the precondition of the calculation of correlative parameters and diagnosis. This paper presents a non-parametric derivative-based method for R wave detection in ECG signal. This method firstly uses a digital filter to cut out noises from ECG signals, utilizes local polynomial fitting that is a non-parametric derivative-based method to estimate the derivative values, and then selects appropriate thresholds by the difference, and the algorithm adaptively adjusts the size of thresholds periodically according to the different needs. Afterwards, the position of R wave is detected by the estimation of the first-order derivative values with nonparametric local polynomial statistical model. In addition, in order to improve the accuracy of detection, the method of redundant detection and missing detection are applied in this paper. The clinical experimental data are used to evaluate the effectiveness of the algorithm. Experimental results show that the method in the process of the detection of R wave is much smoother, compared with differential threshold algorithm and it can detect the R wave in the ECG signals accurately. 
 
</p></abstract><kwd-group><kwd>ECG Signal</kwd><kwd> R Wave Detection</kwd><kwd> Local Polynomial Fitting</kwd><kwd> Adaptive Adjustment</kwd></kwd-group></article-meta></front><body><sec id="s1"><title>1. Introduction</title><p>QRS wave is the most visible part of the changes in the ECG (electrocardiogram) and the synthetic performance of the multi-myocardial cells. So detecting QRS wave accurately not only provides important basis for the diagnosis of arrhythmia, but also makes it possible to count the heart rate and the variability of heart rate in this base. By doing so, it can lay the foundation for further detecting and analyzing other detailed information. So the key is to detect reliable QRS wave in the analysis of ECG signals accurately.</p><p>However QRS waves are difficult to be detected; not only are there the physiological variability of the QRS waves but also several various types of noises that would present in ECG signals. The main several noises sources include muscle noises, artifacts due to electrode motion, 50 Hz power frequency interference, and baseline wander. Therefore we use a digital filter to cut out noises from the original ECG signals before detecting R wave in this paper, and select appropriate thresholds by the difference to deal with the data smoothly. Thus we can obtain more stable signals to prepare for the further R wave detection.</p><p>The QRS waves detection of ECG signals have been researched for many years. There have been mainly several investigations dealing with the QRS wave detection for ECG signals [<xref ref-type="bibr" rid="scirp.50800-ref1">1</xref>] -[<xref ref-type="bibr" rid="scirp.50800-ref5">5</xref>] . For instance, difference thresholds method [<xref ref-type="bibr" rid="scirp.50800-ref6">6</xref>] -[<xref ref-type="bibr" rid="scirp.50800-ref10">10</xref>] can effectively reduce low frequency interference and it is easier to be implemented. Wavelet transform method [<xref ref-type="bibr" rid="scirp.50800-ref11">11</xref>] -[<xref ref-type="bibr" rid="scirp.50800-ref16">16</xref>] has good time frequency localization characteristics and high adaptability to time-varying signals. But it computes tediously and costs long time and it is not conducive to the timely processing. Filter bank method [<xref ref-type="bibr" rid="scirp.50800-ref17">17</xref>] -[<xref ref-type="bibr" rid="scirp.50800-ref19">19</xref>] is based on wavelet transform, while its implementation is more flexible and has higher accuracy than wavelet transform. Geometrical matching approach [<xref ref-type="bibr" rid="scirp.50800-ref20">20</xref>] -[<xref ref-type="bibr" rid="scirp.50800-ref21">21</xref>] has strong anti- interference but computes a lot of time. Neural network approach [<xref ref-type="bibr" rid="scirp.50800-ref22">22</xref>] -[<xref ref-type="bibr" rid="scirp.50800-ref25">25</xref>] has a strong adaptability and good discriminant results, but the training takes a long time. The algorithm of mathematical morphology [<xref ref-type="bibr" rid="scirp.50800-ref26">26</xref>] -[<xref ref-type="bibr" rid="scirp.50800-ref29">29</xref>] can effectively protrude the peaks and valleys of the signal by using the local characteristics of signal. The QRS waves can be eliminated by a series of morphological operations. Then the start points and the end points of P2 wave and T2 wave can be decided and the waves of ECG are separated qualitatively and quantitatively. The above approaches have advantages and disadvantages. Meanwhile they have their own ranges of adaption. Because the adaptive difference threshold algorithm is easy to be implemented, this paper still uses difference threshold algorithm to select thresholds and self-learning strategies are used to compute thresholds. A non-parametric derivative-based method was proposed for the detection of R wave in ECG with local polynomial regression which is used in many fields [<xref ref-type="bibr" rid="scirp.50800-ref30">30</xref>] -[<xref ref-type="bibr" rid="scirp.50800-ref39">39</xref>] . Finally, clinical experimental data is used to evaluate the effectiveness of the algorithm. Experimental results show that the method in the process of the detection of R wave is much smoother, comparing with difference threshold algorithm, and it can detect the R wave in the ECG accurately.</p><p>The rest of the paper is organized following. R wave detection with local polynomial regression and its derivative’s estimation is depicted in Section 2. Experiments results and discussions are given in Section 3. Conclusions are obtained in Section 4.</p></sec><sec id="s2"><title>2. R Wave Detection with Local Polynomial Nonparametric Regression</title><p>After the original ECG signal data is preprocessed, we use the local polynomial nonparametric statistical regression to fit these data and compute its values of first-order derivative which can be applied in the algorithm of R- wave detector in ECG signal. In view of these values of first-order derivative, we find they have relatively large changes; there is a fixed position relationship with the steep waveform R wave. Firstly, we set three initial thresholds, comparing with derivative values based on the local polynomial nonparametric estimation. Then through the adaptive learning to adjust the size of thresholds, thus derivative values that can meet the threshold conditions are able to determine the location of R wave roughly. Last setting different RR intervals to discuss redundancies and lacks of R wave and fix.</p><sec id="s2_1"><title>2.1. Preprocessing Data and ECG Signal De-Noise</title><p>Since it is difficult to detect QRS wave complexes. Not only because of the physiological variability of the QRS complexes, but also the various types of noises that can present in ECG signals. The main several noises sources include artifacts due to electrode motion, power-line interference, baseline wander. Therefore the first thing is to preprocess data and signals filtering before detecting ECG signals in this paper. The work is divided into the following three steps to complete:</p><p>1) Because the data most front excess zeros is meaningless, we process the data in front of extra zeroes method is using a threshold to judge. The method is that from the first point that its absolute value is greater than this threshold to start account, the following data as the signals data to be processed.</p><p>2) Data judgment: first, expand the amplitude of the signals up to 100 times of the original (For convenience of signal-detection, the amplitude does not have to be expanded.). Take the first two seconds signals data to identify the position of one of the largest difference, there must be a QRS wave before or after the largest difference value. Finding the maximum pre-max and minimum pre-min value within the interval [−fs/8 fs/8] before and after the origin (fs is sample rate). Meanwhile based on the interval value ranking, we choose its mean value pre-mid. According to distance between the maximum, minimum and mean value to judge whether the signals data is positive or negative and adjust signals.</p><p>3) In the process of ECG signals acquisition, amplification and transformation, it can cause all kinds of interference. The main interference is 50 Hz power frequency interference and baseline wander. We use a multi band-pass digital filter to smooth signals after A/D converted. The filter is a 280-order FIR digital filter design with rectangular window. Based on difference of sampling rate, the choice of band-pass has lightly changes. When sampling frequency fs = 5000, the band-pass W = [5.5 40 60 90 110 140 160 190]/fs*2, other smaller fs, W = [5.5 48 52 98 102 148 152 198]/fs*2. It is verified that this multi band-pass rectangular window can filter most of 50 Hz and some harmonic power frequency interference and baseline wander.</p><p>The original ECG signal is plotted in <xref ref-type="fig" rid="fig1">Figure 1</xref>. <xref ref-type="fig" rid="fig1">Figure 1</xref> shows the original ECG heart rate is relatively stable. That is, the interference is so small that we can use multi band-pass digital filter to cut out noises from the original ECG signals easily.</p></sec><sec id="s2_2"><title>2.2. Thresholds Setting and RR Interval</title><p>After the original ECG signal data is preprocessed, the first 500 samples would be divided equally. Then we make T = round (1.1*RR) and calculate the difference maximum of the first five T. After removing a maximum and a minimum, the remaining values are taken arithmetic average to obtain threshold benchmark<inline-formula><inline-graphic xlink:href="http://html.scirp.org/file/4-1730134x5.png" xlink:type="simple"/></inline-formula>. We set</p><p>three constants <inline-formula><inline-graphic xlink:href="http://html.scirp.org/file/4-1730134x6.png" xlink:type="simple"/></inline-formula> through<inline-formula><inline-graphic xlink:href="http://html.scirp.org/file/4-1730134x7.png" xlink:type="simple"/></inline-formula>, and use initial benchmark determine<inline-formula><inline-graphic xlink:href="http://html.scirp.org/file/4-1730134x8.png" xlink:type="simple"/></inline-formula>, which is the threshold for preparing R de-</p><p>tection, according to three cycles to adjust thresholds in the adaptive phase. We also need obtain benchmark R wave amplitude HR and benchmark R wave interval RR: first taking the first 12 seconds signals preprocess to find the maximum difference, next using the maximum difference of 0.65 times as the threshold, we could obtain a general RR interval that we set h. Then we compute the maximum difference and the maximum amplitude value and its corresponding position. We obtain RR interval and space HR.</p></sec><sec id="s2_3"><title>2.3. Local Polynomial Nonparametric Regression of ECG Data</title><p>1) Local polynomial fitting</p><fig id="fig1"  position="float"><label><xref ref-type="fig" rid="fig1">Figure 1</xref></label><caption><title> The original signals</title></caption><graphic mimetype="image"   position="float"  xlink:type="simple"  xlink:href="http://html.scirp.org/file/4-1730134x9.png"/></fig><p>For data set <inline-formula><inline-graphic xlink:href="http://html.scirp.org/file/4-1730134x10.png" xlink:type="simple"/></inline-formula> in each period, where <inline-formula><inline-graphic xlink:href="http://html.scirp.org/file/4-1730134x11.png" xlink:type="simple"/></inline-formula> is the response and <inline-formula><inline-graphic xlink:href="http://html.scirp.org/file/4-1730134x12.png" xlink:type="simple"/></inline-formula> is time variable. One may fit a regression curve <inline-formula><inline-graphic xlink:href="http://html.scirp.org/file/4-1730134x13.png" xlink:type="simple"/></inline-formula> through the data to establish the relationship between the response and time variable. Discrepancies between the regression curve and the data are usually treated as noise. Therefore, we have the model:</p><disp-formula id="scirp.50800-formula382"><label>(1)</label><graphic position="anchor" xlink:href="http://html.scirp.org/file/4-1730134x14.png"  xlink:type="simple"/></disp-formula><p>where <inline-formula><inline-graphic xlink:href="http://html.scirp.org/file/4-1730134x15.png" xlink:type="simple"/></inline-formula> Often one can assume that<inline-formula><inline-graphic xlink:href="http://html.scirp.org/file/4-1730134x16.png" xlink:type="simple"/></inline-formula>, <inline-formula><inline-graphic xlink:href="http://html.scirp.org/file/4-1730134x17.png" xlink:type="simple"/></inline-formula>and <inline-formula><inline-graphic xlink:href="http://html.scirp.org/file/4-1730134x18.png" xlink:type="simple"/></inline-formula> are mutually independent. Let <inline-formula><inline-graphic xlink:href="http://html.scirp.org/file/4-1730134x19.png" xlink:type="simple"/></inline-formula> be the <inline-formula><inline-graphic xlink:href="http://html.scirp.org/file/4-1730134x20.png" xlink:type="simple"/></inline-formula>-th derivative of the regression function defined in (1). The local polynomial technique is very convenient to use for estimating<inline-formula><inline-graphic xlink:href="http://html.scirp.org/file/4-1730134x20.png" xlink:type="simple"/></inline-formula><inline-formula><inline-graphic xlink:href="http://html.scirp.org/file/4-1730134x21.png" xlink:type="simple"/></inline-formula>, including the regression function itself <inline-formula><inline-graphic xlink:href="http://html.scirp.org/file/4-1730134x20.png" xlink:type="simple"/></inline-formula><inline-formula><inline-graphic xlink:href="http://html.scirp.org/file/4-1730134x21.png" xlink:type="simple"/></inline-formula><inline-formula><inline-graphic xlink:href="http://html.scirp.org/file/4-1730134x22.png" xlink:type="simple"/></inline-formula> and its the first-order derivative functions<inline-formula><inline-graphic xlink:href="http://html.scirp.org/file/4-1730134x20.png" xlink:type="simple"/></inline-formula><inline-formula><inline-graphic xlink:href="http://html.scirp.org/file/4-1730134x21.png" xlink:type="simple"/></inline-formula><inline-formula><inline-graphic xlink:href="http://html.scirp.org/file/4-1730134x22.png" xlink:type="simple"/></inline-formula><inline-formula><inline-graphic xlink:href="http://html.scirp.org/file/4-1730134x23.png" xlink:type="simple"/></inline-formula>. Since the form of the function <inline-formula><inline-graphic xlink:href="http://html.scirp.org/file/4-1730134x20.png" xlink:type="simple"/></inline-formula><inline-formula><inline-graphic xlink:href="http://html.scirp.org/file/4-1730134x21.png" xlink:type="simple"/></inline-formula><inline-formula><inline-graphic xlink:href="http://html.scirp.org/file/4-1730134x22.png" xlink:type="simple"/></inline-formula><inline-formula><inline-graphic xlink:href="http://html.scirp.org/file/4-1730134x23.png" xlink:type="simple"/></inline-formula><inline-formula><inline-graphic xlink:href="http://html.scirp.org/file/4-1730134x24.png" xlink:type="simple"/></inline-formula> is</p><p>not specified, a remote data point from <inline-formula><inline-graphic xlink:href="http://html.scirp.org/file/4-1730134x25.png" xlink:type="simple"/></inline-formula> provides very little information about<inline-formula><inline-graphic xlink:href="http://html.scirp.org/file/4-1730134x25.png" xlink:type="simple"/></inline-formula><inline-formula><inline-graphic xlink:href="http://html.scirp.org/file/4-1730134x26.png" xlink:type="simple"/></inline-formula>. Hence, we can only use the local data points around<inline-formula><inline-graphic xlink:href="http://html.scirp.org/file/4-1730134x25.png" xlink:type="simple"/></inline-formula><inline-formula><inline-graphic xlink:href="http://html.scirp.org/file/4-1730134x26.png" xlink:type="simple"/></inline-formula><inline-formula><inline-graphic xlink:href="http://html.scirp.org/file/4-1730134x27.png" xlink:type="simple"/></inline-formula>. Assume that <inline-formula><inline-graphic xlink:href="http://html.scirp.org/file/4-1730134x25.png" xlink:type="simple"/></inline-formula><inline-formula><inline-graphic xlink:href="http://html.scirp.org/file/4-1730134x26.png" xlink:type="simple"/></inline-formula><inline-formula><inline-graphic xlink:href="http://html.scirp.org/file/4-1730134x27.png" xlink:type="simple"/></inline-formula><inline-formula><inline-graphic xlink:href="http://html.scirp.org/file/4-1730134x28.png" xlink:type="simple"/></inline-formula> has the (p + 1) derivative at the point<inline-formula><inline-graphic xlink:href="http://html.scirp.org/file/4-1730134x25.png" xlink:type="simple"/></inline-formula><inline-formula><inline-graphic xlink:href="http://html.scirp.org/file/4-1730134x26.png" xlink:type="simple"/></inline-formula><inline-formula><inline-graphic xlink:href="http://html.scirp.org/file/4-1730134x27.png" xlink:type="simple"/></inline-formula><inline-formula><inline-graphic xlink:href="http://html.scirp.org/file/4-1730134x28.png" xlink:type="simple"/></inline-formula><inline-formula><inline-graphic xlink:href="http://html.scirp.org/file/4-1730134x29.png" xlink:type="simple"/></inline-formula>. By Taylor expansion, for <inline-formula><inline-graphic xlink:href="http://html.scirp.org/file/4-1730134x25.png" xlink:type="simple"/></inline-formula><inline-formula><inline-graphic xlink:href="http://html.scirp.org/file/4-1730134x26.png" xlink:type="simple"/></inline-formula><inline-formula><inline-graphic xlink:href="http://html.scirp.org/file/4-1730134x27.png" xlink:type="simple"/></inline-formula><inline-formula><inline-graphic xlink:href="http://html.scirp.org/file/4-1730134x28.png" xlink:type="simple"/></inline-formula><inline-formula><inline-graphic xlink:href="http://html.scirp.org/file/4-1730134x29.png" xlink:type="simple"/></inline-formula><inline-formula><inline-graphic xlink:href="http://html.scirp.org/file/4-1730134x30.png" xlink:type="simple"/></inline-formula> in the local neighborhood of<inline-formula><inline-graphic xlink:href="http://html.scirp.org/file/4-1730134x25.png" xlink:type="simple"/></inline-formula><inline-formula><inline-graphic xlink:href="http://html.scirp.org/file/4-1730134x26.png" xlink:type="simple"/></inline-formula><inline-formula><inline-graphic xlink:href="http://html.scirp.org/file/4-1730134x27.png" xlink:type="simple"/></inline-formula><inline-formula><inline-graphic xlink:href="http://html.scirp.org/file/4-1730134x28.png" xlink:type="simple"/></inline-formula><inline-formula><inline-graphic xlink:href="http://html.scirp.org/file/4-1730134x29.png" xlink:type="simple"/></inline-formula><inline-formula><inline-graphic xlink:href="http://html.scirp.org/file/4-1730134x30.png" xlink:type="simple"/></inline-formula><inline-formula><inline-graphic xlink:href="http://html.scirp.org/file/4-1730134x31.png" xlink:type="simple"/></inline-formula>, we have:</p><disp-formula id="scirp.50800-formula383"><label>(2)</label><graphic position="anchor" xlink:href="http://html.scirp.org/file/4-1730134x32.png"  xlink:type="simple"/></disp-formula><p>In terms of statistical modeling, locally around<inline-formula><inline-graphic xlink:href="http://html.scirp.org/file/4-1730134x33.png" xlink:type="simple"/></inline-formula>, we model <inline-formula><inline-graphic xlink:href="http://html.scirp.org/file/4-1730134x33.png" xlink:type="simple"/></inline-formula><inline-formula><inline-graphic xlink:href="http://html.scirp.org/file/4-1730134x34.png" xlink:type="simple"/></inline-formula> as</p><disp-formula id="scirp.50800-formula384"><label>(3)</label><graphic position="anchor" xlink:href="http://html.scirp.org/file/4-1730134x35.png"  xlink:type="simple"/></disp-formula><p>The parameters <inline-formula><inline-graphic xlink:href="http://html.scirp.org/file/4-1730134x36.png" xlink:type="simple"/></inline-formula> depend on <inline-formula><inline-graphic xlink:href="http://html.scirp.org/file/4-1730134x36.png" xlink:type="simple"/></inline-formula><inline-formula><inline-graphic xlink:href="http://html.scirp.org/file/4-1730134x37.png" xlink:type="simple"/></inline-formula> and are called local parameters. Clearly, the local parameter <inline-formula><inline-graphic xlink:href="http://html.scirp.org/file/4-1730134x36.png" xlink:type="simple"/></inline-formula><inline-formula><inline-graphic xlink:href="http://html.scirp.org/file/4-1730134x37.png" xlink:type="simple"/></inline-formula><inline-formula><inline-graphic xlink:href="http://html.scirp.org/file/4-1730134x38.png" xlink:type="simple"/></inline-formula></p><p>Fitting the local model (3) using the local data, one minimizes</p><disp-formula id="scirp.50800-formula385"><label>(4)</label><graphic position="anchor" xlink:href="http://html.scirp.org/file/4-1730134x39.png"  xlink:type="simple"/></disp-formula><p>where <inline-formula><inline-graphic xlink:href="http://html.scirp.org/file/4-1730134x40.png" xlink:type="simple"/></inline-formula> is a bandwidth controlling the size of the local neighborhood and <inline-formula><inline-graphic xlink:href="http://html.scirp.org/file/4-1730134x40.png" xlink:type="simple"/></inline-formula><inline-formula><inline-graphic xlink:href="http://html.scirp.org/file/4-1730134x41.png" xlink:type="simple"/></inline-formula> is a kernel function. In this paper, after many experiments that we choose the bandwidth<inline-formula><inline-graphic xlink:href="http://html.scirp.org/file/4-1730134x40.png" xlink:type="simple"/></inline-formula><inline-formula><inline-graphic xlink:href="http://html.scirp.org/file/4-1730134x41.png" xlink:type="simple"/></inline-formula><inline-formula><inline-graphic xlink:href="http://html.scirp.org/file/4-1730134x42.png" xlink:type="simple"/></inline-formula>, kernel function is</p><p><inline-formula><inline-graphic xlink:href="http://html.scirp.org/file/4-1730134x43.png" xlink:type="simple"/></inline-formula>. Let:</p><disp-formula id="scirp.50800-formula386"><graphic  xlink:href="http://html.scirp.org/file/4-1730134x44.png"  xlink:type="simple"/></disp-formula><disp-formula id="scirp.50800-formula387"><label>(5)</label><graphic position="anchor" xlink:href="http://html.scirp.org/file/4-1730134x45.png"  xlink:type="simple"/></disp-formula><p>Then the problem of weighted least squares estimation can be written as follows:</p><disp-formula id="scirp.50800-formula388"><label>(6)</label><graphic position="anchor" xlink:href="http://html.scirp.org/file/4-1730134x46.png"  xlink:type="simple"/></disp-formula><p>where<inline-formula><inline-graphic xlink:href="http://html.scirp.org/file/4-1730134x47.png" xlink:type="simple"/></inline-formula>. The i-th element of W is<inline-formula><inline-graphic xlink:href="http://html.scirp.org/file/4-1730134x47.png" xlink:type="simple"/></inline-formula><inline-formula><inline-graphic xlink:href="http://html.scirp.org/file/4-1730134x48.png" xlink:type="simple"/></inline-formula>, its solution vector is:</p><disp-formula id="scirp.50800-formula389"><label>(7)</label><graphic position="anchor" xlink:href="http://html.scirp.org/file/4-1730134x49.png"  xlink:type="simple"/></disp-formula><p>where<inline-formula><inline-graphic xlink:href="http://html.scirp.org/file/4-1730134x50.png" xlink:type="simple"/></inline-formula>,<inline-formula><inline-graphic xlink:href="http://html.scirp.org/file/4-1730134x50.png" xlink:type="simple"/></inline-formula><inline-formula><inline-graphic xlink:href="http://html.scirp.org/file/4-1730134x51.png" xlink:type="simple"/></inline-formula>.</p><p>For the nonparametric local polynomial estimator, there are three important problems which have significant influence to the estimation accuracy and computational complexity.</p><p>First of all, there is the choice of the bandwidth, which plays a rather crucial role. The most important thing is to find the bandwidth. In theory, there exists a optimal bandwidth <inline-formula><inline-graphic xlink:href="http://html.scirp.org/file/4-1730134x52.png" xlink:type="simple"/></inline-formula> in the meaning of mean integrated square error (MISE), fulfilling the equality</p><disp-formula id="scirp.50800-formula390"><label>(8)</label><graphic position="anchor" xlink:href="http://html.scirp.org/file/4-1730134x53.png"  xlink:type="simple"/></disp-formula><p>However, the theoretical bandwidth <inline-formula><inline-graphic xlink:href="http://html.scirp.org/file/4-1730134x54.png" xlink:type="simple"/></inline-formula> in Formula (8) can not be directly calculated. Here, we apply a search method to select the bandwidth: Compare values of the objective function as the bandwidth <inline-formula><inline-graphic xlink:href="http://html.scirp.org/file/4-1730134x54.png" xlink:type="simple"/></inline-formula><inline-formula><inline-graphic xlink:href="http://html.scirp.org/file/4-1730134x55.png" xlink:type="simple"/></inline-formula> from small to large, and then find out the optimal bandwidth which minimizes the objective function.</p><p>Suppose that <inline-formula><inline-graphic xlink:href="http://html.scirp.org/file/4-1730134x56.png" xlink:type="simple"/></inline-formula> where <inline-formula><inline-graphic xlink:href="http://html.scirp.org/file/4-1730134x56.png" xlink:type="simple"/></inline-formula><inline-formula><inline-graphic xlink:href="http://html.scirp.org/file/4-1730134x57.png" xlink:type="simple"/></inline-formula> is the minimum, <inline-formula><inline-graphic xlink:href="http://html.scirp.org/file/4-1730134x56.png" xlink:type="simple"/></inline-formula><inline-formula><inline-graphic xlink:href="http://html.scirp.org/file/4-1730134x57.png" xlink:type="simple"/></inline-formula><inline-formula><inline-graphic xlink:href="http://html.scirp.org/file/4-1730134x58.png" xlink:type="simple"/></inline-formula>is coefficient of expansion. We search a bandwidth <inline-formula><inline-graphic xlink:href="http://html.scirp.org/file/4-1730134x56.png" xlink:type="simple"/></inline-formula><inline-formula><inline-graphic xlink:href="http://html.scirp.org/file/4-1730134x57.png" xlink:type="simple"/></inline-formula><inline-formula><inline-graphic xlink:href="http://html.scirp.org/file/4-1730134x58.png" xlink:type="simple"/></inline-formula><inline-formula><inline-graphic xlink:href="http://html.scirp.org/file/4-1730134x59.png" xlink:type="simple"/></inline-formula> to minimize the objective function in the interval<inline-formula><inline-graphic xlink:href="http://html.scirp.org/file/4-1730134x56.png" xlink:type="simple"/></inline-formula><inline-formula><inline-graphic xlink:href="http://html.scirp.org/file/4-1730134x57.png" xlink:type="simple"/></inline-formula><inline-formula><inline-graphic xlink:href="http://html.scirp.org/file/4-1730134x58.png" xlink:type="simple"/></inline-formula><inline-formula><inline-graphic xlink:href="http://html.scirp.org/file/4-1730134x59.png" xlink:type="simple"/></inline-formula><inline-formula><inline-graphic xlink:href="http://html.scirp.org/file/4-1730134x60.png" xlink:type="simple"/></inline-formula>, where the objective function refers to the prediction mean square error (MSE), denoted by<inline-formula><inline-graphic xlink:href="http://html.scirp.org/file/4-1730134x56.png" xlink:type="simple"/></inline-formula><inline-formula><inline-graphic xlink:href="http://html.scirp.org/file/4-1730134x57.png" xlink:type="simple"/></inline-formula><inline-formula><inline-graphic xlink:href="http://html.scirp.org/file/4-1730134x58.png" xlink:type="simple"/></inline-formula><inline-formula><inline-graphic xlink:href="http://html.scirp.org/file/4-1730134x59.png" xlink:type="simple"/></inline-formula><inline-formula><inline-graphic xlink:href="http://html.scirp.org/file/4-1730134x60.png" xlink:type="simple"/></inline-formula><inline-formula><inline-graphic xlink:href="http://html.scirp.org/file/4-1730134x61.png" xlink:type="simple"/></inline-formula>.</p><p>Firstly, we assume<inline-formula><inline-graphic xlink:href="http://html.scirp.org/file/4-1730134x62.png" xlink:type="simple"/></inline-formula>, then increase <inline-formula><inline-graphic xlink:href="http://html.scirp.org/file/4-1730134x62.png" xlink:type="simple"/></inline-formula><inline-formula><inline-graphic xlink:href="http://html.scirp.org/file/4-1730134x63.png" xlink:type="simple"/></inline-formula> by efficient of expansion <inline-formula><inline-graphic xlink:href="http://html.scirp.org/file/4-1730134x62.png" xlink:type="simple"/></inline-formula><inline-formula><inline-graphic xlink:href="http://html.scirp.org/file/4-1730134x63.png" xlink:type="simple"/></inline-formula><inline-formula><inline-graphic xlink:href="http://html.scirp.org/file/4-1730134x64.png" xlink:type="simple"/></inline-formula> and calculate value of objective function for each<inline-formula><inline-graphic xlink:href="http://html.scirp.org/file/4-1730134x62.png" xlink:type="simple"/></inline-formula><inline-formula><inline-graphic xlink:href="http://html.scirp.org/file/4-1730134x63.png" xlink:type="simple"/></inline-formula><inline-formula><inline-graphic xlink:href="http://html.scirp.org/file/4-1730134x64.png" xlink:type="simple"/></inline-formula><inline-formula><inline-graphic xlink:href="http://html.scirp.org/file/4-1730134x65.png" xlink:type="simple"/></inline-formula>. Stop down when<inline-formula><inline-graphic xlink:href="http://html.scirp.org/file/4-1730134x62.png" xlink:type="simple"/></inline-formula><inline-formula><inline-graphic xlink:href="http://html.scirp.org/file/4-1730134x63.png" xlink:type="simple"/></inline-formula><inline-formula><inline-graphic xlink:href="http://html.scirp.org/file/4-1730134x64.png" xlink:type="simple"/></inline-formula><inline-formula><inline-graphic xlink:href="http://html.scirp.org/file/4-1730134x65.png" xlink:type="simple"/></inline-formula><inline-formula><inline-graphic xlink:href="http://html.scirp.org/file/4-1730134x66.png" xlink:type="simple"/></inline-formula>, and choose a bandwidth <inline-formula><inline-graphic xlink:href="http://html.scirp.org/file/4-1730134x62.png" xlink:type="simple"/></inline-formula><inline-formula><inline-graphic xlink:href="http://html.scirp.org/file/4-1730134x63.png" xlink:type="simple"/></inline-formula><inline-formula><inline-graphic xlink:href="http://html.scirp.org/file/4-1730134x64.png" xlink:type="simple"/></inline-formula><inline-formula><inline-graphic xlink:href="http://html.scirp.org/file/4-1730134x65.png" xlink:type="simple"/></inline-formula><inline-formula><inline-graphic xlink:href="http://html.scirp.org/file/4-1730134x66.png" xlink:type="simple"/></inline-formula><inline-formula><inline-graphic xlink:href="http://html.scirp.org/file/4-1730134x67.png" xlink:type="simple"/></inline-formula> which minimizes <inline-formula><inline-graphic xlink:href="http://html.scirp.org/file/4-1730134x62.png" xlink:type="simple"/></inline-formula><inline-formula><inline-graphic xlink:href="http://html.scirp.org/file/4-1730134x63.png" xlink:type="simple"/></inline-formula><inline-formula><inline-graphic xlink:href="http://html.scirp.org/file/4-1730134x64.png" xlink:type="simple"/></inline-formula><inline-formula><inline-graphic xlink:href="http://html.scirp.org/file/4-1730134x65.png" xlink:type="simple"/></inline-formula><inline-formula><inline-graphic xlink:href="http://html.scirp.org/file/4-1730134x66.png" xlink:type="simple"/></inline-formula><inline-formula><inline-graphic xlink:href="http://html.scirp.org/file/4-1730134x67.png" xlink:type="simple"/></inline-formula><inline-formula><inline-graphic xlink:href="http://html.scirp.org/file/4-1730134x68.png" xlink:type="simple"/></inline-formula> as the</p><p>approximate optimal bandwidth. <inline-formula><inline-graphic xlink:href="http://html.scirp.org/file/4-1730134x69.png" xlink:type="simple"/></inline-formula>can be taken place by a estimation<inline-formula><inline-graphic xlink:href="http://html.scirp.org/file/4-1730134x69.png" xlink:type="simple"/></inline-formula><inline-formula><inline-graphic xlink:href="http://html.scirp.org/file/4-1730134x70.png" xlink:type="simple"/></inline-formula></p><p>In this paper, we choose</p><disp-formula id="scirp.50800-formula391"><label>(9)</label><graphic position="anchor" xlink:href="http://html.scirp.org/file/4-1730134x71.png"  xlink:type="simple"/></disp-formula><p>where <inline-formula><inline-graphic xlink:href="http://html.scirp.org/file/4-1730134x72.png" xlink:type="simple"/></inline-formula> Compared with other methods, this method is more convenient.</p><p>In order to closer to the ideal optimal bandwidth, we search once again by narrowing the interval on the basis of the above searching process. Supposing <inline-formula><inline-graphic xlink:href="http://html.scirp.org/file/4-1730134x73.png" xlink:type="simple"/></inline-formula> is the bandwidth which make <inline-formula><inline-graphic xlink:href="http://html.scirp.org/file/4-1730134x73.png" xlink:type="simple"/></inline-formula><inline-formula><inline-graphic xlink:href="http://html.scirp.org/file/4-1730134x74.png" xlink:type="simple"/></inline-formula> optimal in the above sear-</p><p>ching process. Now, divide the small interval <inline-formula><inline-graphic xlink:href="http://html.scirp.org/file/4-1730134x75.png" xlink:type="simple"/></inline-formula> into <inline-formula><inline-graphic xlink:href="http://html.scirp.org/file/4-1730134x75.png" xlink:type="simple"/></inline-formula><inline-formula><inline-graphic xlink:href="http://html.scirp.org/file/4-1730134x76.png" xlink:type="simple"/></inline-formula> equal intervals. Supposing</p><disp-formula id="scirp.50800-formula392"><label>(10)</label><graphic position="anchor" xlink:href="http://html.scirp.org/file/4-1730134x77.png"  xlink:type="simple"/></disp-formula><p>among these <inline-formula><inline-graphic xlink:href="http://html.scirp.org/file/4-1730134x78.png" xlink:type="simple"/></inline-formula> bandwidths, the approximate optimal bandwidth is the one that makes <inline-formula><inline-graphic xlink:href="http://html.scirp.org/file/4-1730134x78.png" xlink:type="simple"/></inline-formula><inline-formula><inline-graphic xlink:href="http://html.scirp.org/file/4-1730134x79.png" xlink:type="simple"/></inline-formula> minimize. Obviously, this search method can quickly select the right bandwidth.</p><p>Another issue in multivariate local polynomial fitting is the choice of the order of the polynomial. For a given bandwidth<inline-formula><inline-graphic xlink:href="http://html.scirp.org/file/4-1730134x80.png" xlink:type="simple"/></inline-formula>, a large value of <inline-formula><inline-graphic xlink:href="http://html.scirp.org/file/4-1730134x80.png" xlink:type="simple"/></inline-formula><inline-formula><inline-graphic xlink:href="http://html.scirp.org/file/4-1730134x81.png" xlink:type="simple"/></inline-formula> would expectedly reduce the modeling bias, but would cause a large variance and a considerable computational cost. Since the bandwidth is used to control the modeling complexity, and due to the sparsity of local data in multi-dimensional space, a higher-order polynomial is rarely used. So we apply the local quadratic regression to fit the model (that is to say,<inline-formula><inline-graphic xlink:href="http://html.scirp.org/file/4-1730134x80.png" xlink:type="simple"/></inline-formula><inline-formula><inline-graphic xlink:href="http://html.scirp.org/file/4-1730134x81.png" xlink:type="simple"/></inline-formula><inline-formula><inline-graphic xlink:href="http://html.scirp.org/file/4-1730134x82.png" xlink:type="simple"/></inline-formula>).</p><p>The third issue is the selection of the kernel function. In this paper, we choose the spherical Epanechnikov kernel as kernel function</p><disp-formula id="scirp.50800-formula393"><label>(11)</label><graphic position="anchor" xlink:href="http://html.scirp.org/file/4-1730134x83.png"  xlink:type="simple"/></disp-formula><p>where <inline-formula><inline-graphic xlink:href="http://html.scirp.org/file/4-1730134x84.png" xlink:type="simple"/></inline-formula> represents <inline-formula><inline-graphic xlink:href="http://html.scirp.org/file/4-1730134x84.png" xlink:type="simple"/></inline-formula><inline-formula><inline-graphic xlink:href="http://html.scirp.org/file/4-1730134x85.png" xlink:type="simple"/></inline-formula> function. This is the optimal kernel function.</p><p>500 data are contained in a cycle in <xref ref-type="fig" rid="fig2">Figure 2</xref>. The samples number of data which is used in local polynomial nonparametric statistical method is 500. This is as same as original data. Compared with original signals, the first-order derivatives which we estimate have fixed position with it. There must be R peak between the maximum and minimum of the first-order derivative. Thus we can choose appropriate thresholds to limit first-order derivative values range so that the position of R wave can be determined approximately.</p><p>2) Algorithm of R wave detection</p><p>We put<inline-formula><inline-graphic xlink:href="http://html.scirp.org/file/4-1730134x86.png" xlink:type="simple"/></inline-formula>, any of the three estimated values in each period are<inline-formula><inline-graphic xlink:href="http://html.scirp.org/file/4-1730134x86.png" xlink:type="simple"/></inline-formula><inline-formula><inline-graphic xlink:href="http://html.scirp.org/file/4-1730134x87.png" xlink:type="simple"/></inline-formula>, <inline-formula><inline-graphic xlink:href="http://html.scirp.org/file/4-1730134x86.png" xlink:type="simple"/></inline-formula><inline-formula><inline-graphic xlink:href="http://html.scirp.org/file/4-1730134x87.png" xlink:type="simple"/></inline-formula><inline-formula><inline-graphic xlink:href="http://html.scirp.org/file/4-1730134x88.png" xlink:type="simple"/></inline-formula>, <inline-formula><inline-graphic xlink:href="http://html.scirp.org/file/4-1730134x86.png" xlink:type="simple"/></inline-formula><inline-formula><inline-graphic xlink:href="http://html.scirp.org/file/4-1730134x87.png" xlink:type="simple"/></inline-formula><inline-formula><inline-graphic xlink:href="http://html.scirp.org/file/4-1730134x88.png" xlink:type="simple"/></inline-formula><inline-formula><inline-graphic xlink:href="http://html.scirp.org/file/4-1730134x89.png" xlink:type="simple"/></inline-formula>, if</p><disp-formula id="scirp.50800-formula394"><label>(12)</label><graphic position="anchor" xlink:href="http://html.scirp.org/file/4-1730134x90.png"  xlink:type="simple"/></disp-formula><p>we can determine <inline-formula><inline-graphic xlink:href="http://html.scirp.org/file/4-1730134x91.png" xlink:type="simple"/></inline-formula> is an R wave. The <xref ref-type="fig" rid="fig3">Figure 3</xref> is generally detection of R wave flow chart, which</p><fig id="fig2"  position="float"><label><xref ref-type="fig" rid="fig2">Figure 2</xref></label><caption><title> Results of fitting with local polynomial nonparametric regression</title></caption><graphic mimetype="image"   position="float"  xlink:type="simple"  xlink:href="http://html.scirp.org/file/4-1730134x92.png"/></fig><fig id="fig3"  position="float"><label><xref ref-type="fig" rid="fig3">Figure 3</xref></label><caption><title> R wave detection flowchart</title></caption><graphic mimetype="image"   position="float"  xlink:type="simple"  xlink:href="http://html.scirp.org/file/4-1730134x93.png"/></fig><p>give the detailed description for the R detection of ECG signal. Firstly, the local polynomial nonparametric regression is applied to fitting and estimate the ECG signal. Then, the initial thresholds are given. Finally, iterations steps are conducted for the R wave detection.</p></sec><sec id="s2_4"><title>2.4. Check and Correction for R Wave in ECG Signal</title><p>Firstly, we need to judge whether it is a real QRS wave when an R wave is detected. We determine the redundant detection occurs according to whether the current RR interval is larger than 0.8*RR or not. Then we decide the missing detection occurs according to whether the RR is more than 3.1*RR or not. If redundant detection or missing detection occurs, we need detect the sample paragraph again before the current sample paragraph be detected and increase range in order to detect the R wave conveniently.</p><p>It is possible that the judgment includes redundant detection or missing detection though we have done above. Therefore we also need further determine whether RR is in the interval between 1.66*RR and 2.5*RR. If it is in this interval, it shows that it is possible to be a missing R wave.</p><p>From <xref ref-type="fig" rid="fig4">Figure 4</xref>, our solution is as follows: we should judge whether the signal in [0.5*HR, 1.5*HR] lies in [0.7*RR, 1.2*RR]. If it occurs, we can draw a conclusion that an R wave is missed. Then we supplement it to the sequence of the R wave position. If it can not occur, we should check whether an invert R wave exists. If it exists, we should supplement it to above sequence. If the testing program runs to the last data and finds that the distance between the position of the last R wave and the end of the data exceeds 1.66*RR, we detect the last part of the signals once more.</p><p>From <xref ref-type="fig" rid="fig5">Figure 5</xref>, the algorithm is summarized as follows:</p><fig id="fig4"  position="float"><label><xref ref-type="fig" rid="fig4">Figure 4</xref></label><caption><title> Fix check detection redundancies</title></caption><graphic mimetype="image"   position="float"  xlink:type="simple"  xlink:href="http://html.scirp.org/file/4-1730134x94.png"/></fig><fig id="fig5"  position="float"><label><xref ref-type="fig" rid="fig5">Figure 5</xref></label><caption><title> Fix detection lacks</title></caption><graphic mimetype="image"   position="float"  xlink:type="simple"  xlink:href="http://html.scirp.org/file/4-1730134x95.png"/></fig><p>Step 1: Using the given threshold to removal the data most front excess zeros, and the finding difference of maximum and minimum values to judge the data.</p><p>Step 2: Choosing a multi band-pass digital filter to filter and smooth signals after A/D converted.</p><p>Step 3: Calculating thresholds and obtaining the RR intervals by the difference method.</p><p>Step 4: Using local polynomial fitting to process data and obtain the values of its first-order derivative.</p><p>Step 5: By fourth step calculated first-order derivative values, combined with thresholds, we can detect the a- pproximate location of R wave by satisfying the three conditions (Formula 7).</p><p>Step 6: Setting different RR intervals and discussing redundancies and missing R wave and correcting it.</p></sec></sec><sec id="s3"><title>3. Experiment Results and Discussions</title><p>The purpose of by using local polynomial nonparametric fitting modeling process in R wave detection of ECG signal is to obtain the values of its first-order derivative of the original ECG data in each point. For smaller calculation of the proposed approach, we determine the order <inline-formula><inline-graphic xlink:href="http://html.scirp.org/file/4-1730134x96.png" xlink:type="simple"/></inline-formula> for the local polynomial in the fitting process. In addition, there are two parameters of the model which must be selected in some sense of optimization. The one is the size of the bandwidth<inline-formula><inline-graphic xlink:href="http://html.scirp.org/file/4-1730134x96.png" xlink:type="simple"/></inline-formula><inline-formula><inline-graphic xlink:href="http://html.scirp.org/file/4-1730134x97.png" xlink:type="simple"/></inline-formula>, the other is choice of kernel function in local polynomial nonparametric estimation process. In this paper, we choose the bandwidth <inline-formula><inline-graphic xlink:href="http://html.scirp.org/file/4-1730134x96.png" xlink:type="simple"/></inline-formula><inline-formula><inline-graphic xlink:href="http://html.scirp.org/file/4-1730134x97.png" xlink:type="simple"/></inline-formula><inline-formula><inline-graphic xlink:href="http://html.scirp.org/file/4-1730134x98.png" xlink:type="simple"/></inline-formula> is 0.005, by according to the optimal in mean square. Also because ECG data values are small, we should estimate all observations in a cycle. The difference between the observed values is 0.001. If the bandwidth is less than 0.005, it would result in under smooth, obtain noisy estimates, where if a bandwidth is too large, it would cause over smooth, and create excessive modeling bias. The bandwidth can be chosen subjectively by users by visually inspecting resulting estimates or chosen automatically by data by minimizing a depicted former theoretical approach. The order <inline-formula><inline-graphic xlink:href="http://html.scirp.org/file/4-1730134x96.png" xlink:type="simple"/></inline-formula><inline-formula><inline-graphic xlink:href="http://html.scirp.org/file/4-1730134x97.png" xlink:type="simple"/></inline-formula><inline-formula><inline-graphic xlink:href="http://html.scirp.org/file/4-1730134x98.png" xlink:type="simple"/></inline-formula><inline-formula><inline-graphic xlink:href="http://html.scirp.org/file/4-1730134x99.png" xlink:type="simple"/></inline-formula> has been identified. The kernel function has been selected according to the optimal theory.</p><sec id="s3_1"><title>3.1. Feasibility Test</title><p>We choose ECG signals randomly to test the algorithm. We also choose 500 data in accordance with the above steps to detect the R wave in ECG signal. The <xref ref-type="fig" rid="fig6">Figure 6</xref> is some results.</p><p><xref ref-type="fig" rid="fig6">Figure 6</xref> shows that the algorithm is feasible for R wave detection in regular ECG signals. The symbol * represents R peaks which have been detected. We can find easily R waves are detected exactly and wave peaks are marked. Thus we can judge whether this period of R intervals are equal consistent so that it can provide reference for the clinical ECG diagnosis.</p></sec><sec id="s3_2"><title>3.2. R-Wave Detection with Local Polynomial Nonparametric Regression</title><p>In experiments we select 500 samples in a cycle as the optimal number of samples. Then we fit the original data using local polynomial nonparametric method in a period. The fitted data are all the same as data of the original data. So we can locate R wave position with its first derivative accurately. We adjust the size of the thresholds by the use of adaptive learning in order to complete the redundant detection and missing detection of the R wave successfully.</p><p>Experiments show that the method of local polynomial fitting can also smooth the original data during the progress of real-time detecting R wave. The method can detect R wave more accurately and stably, comparing with the difference threshold method.</p><p>The <xref ref-type="fig" rid="fig7">Figure 7</xref> are the parts of the figures of the experimental result and the corresponding instantaneous heart rate chart that we get when we detect the R wave by using local polynomial fitting.</p><p>Because the QRS waves we detect are stable normal heart rate and we fit the original data by using local polynomial estimation, the instantaneous heart rate detection is almost in a straight line. The result shows that it is stable. We can also conclude that the algorithm detection is more accurate.</p></sec><sec id="s3_3"><title>3.3. Comparing with the Differential Threshold Algorithm</title><p>Compared with the difference threshold algorithm, for our investigated nonparametric local polynomial method, the main difference is data preprocessing. The differential threshold algorithm is that ECG waveform amplitude which is calculated directly by the differential relative to the variation rate of time compared with the set threshold to meet the threshold condition is considered to be an R wave. The <xref ref-type="fig" rid="fig8">Figure 8</xref> is the chart for the comparison.</p><fig id="fig6"  position="float"><label><xref ref-type="fig" rid="fig6">Figure 6</xref></label><caption><title> The results of feasibility test</title></caption><graphic mimetype="image"   position="float"  xlink:type="simple"  xlink:href="http://html.scirp.org/file/4-1730134x100.png"/></fig><fig id="fig7"  position="float"><label><xref ref-type="fig" rid="fig7">Figure 7</xref></label><caption><title> Corresponding instantaneous heart rate chart</title></caption><graphic mimetype="image"   position="float"  xlink:type="simple"  xlink:href="http://html.scirp.org/file/4-1730134x101.png"/></fig><fig id="fig8"  position="float"><label><xref ref-type="fig" rid="fig8">Figure 8</xref></label><caption><title> Comparison of local polynomial fitting and differential threshold method</title></caption><graphic mimetype="image"   position="float"  xlink:type="simple"  xlink:href="http://html.scirp.org/file/4-1730134x102.png"/></fig><p>It can be seen from <xref ref-type="fig" rid="fig8">Figure 8</xref> in the signals amplitude of ECG after preprocessing. The effect of using local- polynomial fitting is smoother than the difference threshold method. Signals data obtained by the first method is better to maintain variations of the original signals data, especially in some of the inflection points at the fluctuation which are more accurate than the effect of the difference method. So in the use of adaptive threshold detection of R wave process, the data of using local polynomial fitting is even easier to detect the R wave accurately.</p></sec><sec id="s3_4"><title>3.4. The Discussion of Redundant Detection and Missing Detection</title><p>When we obtain the position of the R wave, it is also necessary to discuss redundant detection and missing detection in ECG signal. The reason is that in the process of automatically updating thresholds, not all thresholds could satisfy rang of R wave peak. It is possible for some signals judged as R wave peak incorrectly in ECG signal so that we could not detect R wave accurately and efficiently. Therefore we could detect R wave and give corresponding correction accurately through researching redundant detection and missing detection.</p><p>From <xref ref-type="fig" rid="fig9">Figure 9</xref> and <xref ref-type="fig" rid="fig1">Figure 1</xref>0, the symbol * represents R wave peaks which have been detected. Obviously some not-R wave peaks also have been detected wrongly. It is not enough to depend on the size of thresholds to</p><fig id="fig9"  position="float"><label><xref ref-type="fig" rid="fig9">Figure 9</xref></label><caption><title> The diagram before redundant detecting</title></caption><graphic mimetype="image"   position="float"  xlink:type="simple"  xlink:href="http://html.scirp.org/file/4-1730134x103.png"/></fig><fig id="fig10"  position="float"><label><xref ref-type="fig" rid="fig1">Figure 1</xref>0</label><caption><title> The diagram after correcting</title></caption><graphic mimetype="image"   position="float"  xlink:type="simple"  xlink:href="http://html.scirp.org/file/4-1730134x104.png"/></fig><p>define range of R wave without making discussion of redundant detection. While after dealing with situation, some camouflage signals are detected. Then we set different RR intervals so that getting rid of these unnecessary signals. By doing so, the accuracy is improved greatly.</p></sec><sec id="s3_5"><title>3.5. The Discussion of Redundant Detection and Missing Detection</title><p>When we obtain the position of the R wave, it is also necessary to discuss redundant detection and missing detection in ECG signal. The reason is that in the process of automatically updating thresholds, not all thresholds could satisfy rang of R wave peak. It is possible for some signals judged as R wave peak incorrectly in ECG signal so that we could not detect R wave accurately and efficiently. Therefore we could detect R wave and give corresponding correction accurately through researching redundant detection and missing detection.</p></sec></sec><sec id="s4"><title>4. Conclusion</title><p>In this paper we propose a non-parametric derivative-based method for R wave detection in ECG signal. After using a digital filter to cut out noises from noisy ECG signals, we utilize local polynomial nonparametric statistical regression to estimate the original signal and its derivative values, and then select appropriate thresholds by the difference. The algorithm automatically adjusts the size of thresholds periodically according to the different needs. Then the position of R wave is detected by the estimation of the values of the first-order derivatives which are obtained by using local polynomial nonparametric statistical fitting technique. In addition, the methods of redundant detection and missing detection are applied in this paper in order to improve the accuracy of detection. The clinical experimental data are used to evaluate the effectiveness of the algorithm based on derivatives of nonparametric statistical model. The results of the experiment show that using local polynomial fitting of original data in the algorithm can suppress some noises effectively and smooth the original data. At the same time, we can detect out the R wave timely and accurately. This is further improvement comparing with the former difference threshold method. However, heart rate variability can not be researched in this paper; it needs study further.</p></sec><sec id="s5"><title>Acknowledgments</title><p>Project was supported by Natural Science Foundation Project of China (Grant No. 11471060), Fundamental and Advanced Research Project of CQ CSTC of China (Grant No. cstc2014jcyjA40003), and Natural Science Foun- dation Project of CQ CSTC of China (Grant No. CSTC2012jjA00037).</p></sec></body><back><ref-list><title>References</title><ref id="scirp.50800-ref1"><label>1</label><mixed-citation publication-type="other" xlink:type="simple">Bellout, H., Neustupa, J. and Penel, P. (2004) On the Navier-Stokes Equation with Boundary Conditions Based on Vorticity. Mathematische Nachrichten, 269, 59-72.</mixed-citation></ref><ref id="scirp.50800-ref2"><label>2</label><mixed-citation publication-type="other" xlink:type="simple">Girault, V. and Raviart, P.A. (1979) Finite Element Approximation of the Navier-Stokes Equations. Lecture Notes in Mathematics, Springer Verlag, Berlin, 749.</mixed-citation></ref><ref id="scirp.50800-ref3"><label>3</label><mixed-citation publication-type="other" xlink:type="simple">Hopf, E. (1951) Uber die Anfangswertaufgabe für die Hydrodynamischen Grundgleichungen. Mathematische Nachrichten, 4, 213-231. http://dx.doi.org/10.1002/mana.3210040121</mixed-citation></ref><ref id="scirp.50800-ref4"><label>4</label><mixed-citation publication-type="other" xlink:type="simple">He, P., Kong, G., Su. Z. and Kato, T. (1972) Non-Stationary Flows of Viscous and Ideal Fluids in  . Journal of Functional Analysis, 9, 296-305. http://dx.doi.org/10.1016/0022-1236(72)90003-1</mixed-citation></ref><ref id="scirp.50800-ref5"><label>5</label><mixed-citation publication-type="other" xlink:type="simple">Serrin, J. (1962) On the Interior Regularity of Weak Solutions of the Navier-Stokes Equations. Archive for Rational Mechanics and Analysis, 9, 187-195.&lt;/br&gt;http://dx.doi.org/10.1007/BF00253344</mixed-citation></ref><ref id="scirp.50800-ref6"><label>6</label><mixed-citation publication-type="other" xlink:type="simple">Su, L., Zhao, G.L. and Li, D.M. (2005) Study of Algorithms of QRS Complexes Detection in Electrocardiogram Signalse. Journal of Harbin Engineering University, 26, 513-517.</mixed-citation></ref><ref id="scirp.50800-ref7"><label>7</label><mixed-citation publication-type="other" xlink:type="simple">Zhang, S., Wu, Z.G. and Li, Z. (2008) An Adaptive Detection of ECGs R-Wave. Journal of Sichuan University (Natural Science Edition), 45, 498-502.</mixed-citation></ref><ref id="scirp.50800-ref8"><label>8</label><mixed-citation publication-type="other" xlink:type="simple">Tian, Y.Q., Sun, X.J., Hao, D.M., et al. (2001) Research on Automatic Diagnosis System of Electrocardiogram. Chinese Journal of Medical Instrumentation, 25, 204-206.</mixed-citation></ref><ref id="scirp.50800-ref9"><label>9</label><mixed-citation publication-type="other" xlink:type="simple">Friesen, G.M., Jannett, T.C., Jadallah, M.A., Yates, S.L., Quint, S.R. and Nagle, H.T. (1990) A Comparison of the Noises Sensitivity of Nine QRS Detection Algorithms. IEEE Transactions on Biomedical Engineering, 37, 85-98. &lt;/br&gt;http://dx.doi.org/10.1109/10.43620</mixed-citation></ref><ref id="scirp.50800-ref10"><label>10</label><mixed-citation publication-type="other" xlink:type="simple">Su, L.Y., Kong, T., et al. (2010) R-Wave Detection of ECG Signals Submerged in Fractal Noises. Journal of Chongqing University of Technology (Natural Science), 24, 86-90.</mixed-citation></ref><ref id="scirp.50800-ref11"><label>11</label><mixed-citation publication-type="other" xlink:type="simple">Saxena, S.C., Kumar, V. and Hamde, S.T. (2002) QRS Detection Using New Wavelets. Journal of Medical Engineering &amp; Technology, 26, 7-15. http://dx.doi.org/10.1080/03091900110096038</mixed-citation></ref><ref id="scirp.50800-ref12"><label>12</label><mixed-citation publication-type="other" xlink:type="simple">Legarreta, I.R., Addison, P.S., Grubb, N., et al. (2003) R-Wave Detection Using Continuous Wavelet Modulus Maxima. IEEE international Conference on Computers in Cardiology, 30, 565-568.</mixed-citation></ref><ref id="scirp.50800-ref13"><label>13</label><mixed-citation publication-type="other" xlink:type="simple">Mourad, T., Akram, A., Lotfi, S. and Adnane, C. (2011) New Method of R-Wave Detection by Continuous Wavelet Transform. Signal Processing: An International Journal, 5, 165-173.</mixed-citation></ref><ref id="scirp.50800-ref14"><label>14</label><mixed-citation publication-type="other" xlink:type="simple">Li, C.W., Zheng, C.X. and Tai, C.F. (1995) Detection of ECG Characteristic Points Using Wavelet Transforms. IEEE Transactions on Biomedical Engineering, 42, 21-28.&lt;/br&gt;http://dx.doi.org/10.1109/10.362922</mixed-citation></ref><ref id="scirp.50800-ref15"><label>15</label><mixed-citation publication-type="other" xlink:type="simple">Xu, X.M. and Liu, Y. (2006) Adaptive Threshold for QRS Complex Detection Based on Wavelet Transform. IEEE Engineering in Medicine and Biology Society, 7, 7281-7284.</mixed-citation></ref><ref id="scirp.50800-ref16"><label>16</label><mixed-citation publication-type="other" xlink:type="simple">Mallat, S. (1989) A Theory of Multiresolution Signals Decomposition: The Wavelet Transform. IEEE Transactions on Pattern Analysis and Machine Intelligence, 11, 674-693. &lt;/br&gt;http://dx.doi.org/10.1109/34.192463</mixed-citation></ref><ref id="scirp.50800-ref17"><label>17</label><mixed-citation publication-type="other" xlink:type="simple">Afonso, V.X., Tompkins, W.J., Nguyen, T.Q. and Luo, S. (1999) ECG Beat Detection Using Filter Banks. IEEE Transactions on Biomedical Engineering, 46, 192-202. http://dx.doi.org/10.1109/10.740882</mixed-citation></ref><ref id="scirp.50800-ref18"><label>18</label><mixed-citation publication-type="other" xlink:type="simple">Chen, H.C. and Chen, S.W. (2003) A Moving Average Based Filtering System with Its Application to Real-Time QRS Detection. Computers in Cardiology, 30, 585-588.</mixed-citation></ref><ref id="scirp.50800-ref19"><label>19</label><mixed-citation publication-type="other" xlink:type="simple">Li, X.Y., Wang, T., Feng, H.Q. and Zhan, C.G. (2000) Removal of ECG Baseline Drift Using Adaptive Filter Based on Wavelet Transform. Journal of China University of Science and Technology, 30, 450-454.</mixed-citation></ref><ref id="scirp.50800-ref20"><label>20</label><mixed-citation publication-type="other" xlink:type="simple">Chen, Y.Q., Li, G., Ye, W.Y., et al. (2002) An Improved Algorithm of Adaptive Coherent Model in the Application of Electrocardiogram. Signal Processing, 18, 244-248.</mixed-citation></ref><ref id="scirp.50800-ref21"><label>21</label><mixed-citation publication-type="other" xlink:type="simple">Chen, X.M., Lin, J.S. and Zhang, Z.G. (1999) An Improved Template Matching Method for High Resolution ECG. Chinese Journal of Biomedical Engineering, 18, 89-96.</mixed-citation></ref><ref id="scirp.50800-ref22"><label>22</label><mixed-citation publication-type="other" xlink:type="simple">Ng, F., Mora, F., Wong, S., et al. (1997) Comparison between Neural-Network-Based Adaptive Filtering and Wavelet Transform for ECG Characteristic Points Detection. IEEE Engineering in Medicine and Biology Society, 1, 272-274.</mixed-citation></ref><ref id="scirp.50800-ref23"><label>23</label><mixed-citation publication-type="other" xlink:type="simple">Xie, Q.Z., Hu, Y.H. and Tompkins, W.J. (1992) Neural Network Based Adaptive Matched Filtering of QRS Detection. IEEE Transactions on Biomedical Engineering, 39, 317-329. &lt;/br&gt;http://dx.doi.org/10.1109/10.126604</mixed-citation></ref><ref id="scirp.50800-ref24"><label>24</label><mixed-citation publication-type="other" xlink:type="simple">Hudson, D.L., Cohen, M.E. and Anderson, M.F. (1991) Use of Neural Network Techniques in a Medical Expert System. International Journal of Intelligent Systems, 6, 213-223. &lt;/br&gt;http://dx.doi.org/10.1002/int.4550060208</mixed-citation></ref><ref id="scirp.50800-ref25"><label>25</label><mixed-citation publication-type="other" xlink:type="simple">Zhang, J.Z., Zhang, L.X., Wei, D.X. and Zhang, G.L. (2008) Research on ECG Automatic Classification Used Neural Network K. Beijing Biomedical Engineering, 27, 41-43.</mixed-citation></ref><ref id="scirp.50800-ref26"><label>26</label><mixed-citation publication-type="other" xlink:type="simple">Gao, Y. and Hu, Y. (2001) An ECG Waves Separation Technique Based on Mathematical Morphology. Journal of Biomedical Engineering, 18, 55-59.</mixed-citation></ref><ref id="scirp.50800-ref27"><label>27</label><mixed-citation publication-type="journal" xlink:type="simple"><name name-style="western"><surname>Trahanias</surname><given-names> P.E. </given-names></name>,<etal>et al</etal>. (<year>1993</year>)<article-title>An Approach to QRS Complex Detection Using Mathematical Morphology</article-title><source> IEEE Transactions on Biomedical Engineering</source><volume> 40</volume>,<fpage> 201</fpage>-<lpage>205</lpage>.<pub-id pub-id-type="doi"></pub-id></mixed-citation></ref><ref id="scirp.50800-ref28"><label>28</label><mixed-citation publication-type="other" xlink:type="simple">Chen, Y.L. and Duan, H.L. (2007) The QRS Wave Detection Based on Mathematical Morphology and Extraction of Signals Envelope. Chinese Journal of Biomedical Engineering, 26, 332-335.</mixed-citation></ref><ref id="scirp.50800-ref29"><label>29</label><mixed-citation publication-type="other" xlink:type="simple">Tian, X.Z., Yang, J. and Huang, L.Y. (2012) Morphological Filter to Remove Power-Line Interference and Baseline Wander in Electrocardiogram. Computer Engineering &amp; Applications, 48, 124-126.</mixed-citation></ref><ref id="scirp.50800-ref30"><label>30</label><mixed-citation publication-type="other" xlink:type="simple">Fan, J.Q. and Yao, Q.W. (2003) Nonlinear Time Series: Nonparametric and Parametric Methods. Springer, New York.</mixed-citation></ref><ref id="scirp.50800-ref31"><label>31</label><mixed-citation publication-type="other" xlink:type="simple">Su, L.Y. (2010) Prediction of Multivariate Chaotic Time Series with Local Polynomial Fitting. Computers &amp; Mathematics with Applications, 59, 737-744. http://dx.doi.org/10.1016/j.camwa.2009.10.019</mixed-citation></ref><ref id="scirp.50800-ref32"><label>32</label><mixed-citation publication-type="other" xlink:type="simple">Jackson, R.H., Wu, A.C.F. and Verboncoeur, J.P. (2012) Numerical Solution of the Cylindrical Poisson Equation Using the Local Taylor Polynomial Technique. Journal of Computational Physics, 231, 5421-5442.</mixed-citation></ref><ref id="scirp.50800-ref33"><label>33</label><mixed-citation publication-type="other" xlink:type="simple">Su, L.Y., Zhao, Y.Y., Yan, T.S. and Li, F.L. (2012) Local Polynomial Estimation of Heteroscedasticity in a Multivariate Linear Regression Model and Its Applications in Economics. PLoS ONE, 7, e43719. &lt;/br&gt;http://dx.doi.org/10.1371/journal.pone.0043719</mixed-citation></ref><ref id="scirp.50800-ref34"><label>34</label><mixed-citation publication-type="other" xlink:type="simple">Su, L.Y., Zhao, Y.Y. and Yan, T.T. (2012) Two-Stage Method Based on Local Polynomial Fitting for a Linear Heteroscedastic Regression Model and Its Application in Economics. Discrete Dynamics in Nature and Society, 2012, Article ID: 696927.</mixed-citation></ref><ref id="scirp.50800-ref35"><label>35</label><mixed-citation publication-type="other" xlink:type="simple">Martins-Filho, C. and Saraiva, P. (2012) On Asymptotic Normality of the Local Polynomial Regression Estimator with Stochastic Bandwidths. Communications in Statistics-Theory and Methods, 41, 1052-1068. http://dx.doi.org/10.1080/03610926.2010.535632</mixed-citation></ref><ref id="scirp.50800-ref36"><label>36</label><mixed-citation publication-type="other" xlink:type="simple">Su, L.Y., Ma, Y.J. and Li, J.J. (2010) Application of Local Polynomial Estimation in Suppressing Strong Chaotic Noise. Chinese Physics B, 21, Article ID: 020508.&lt;/br&gt;http://dx.doi.org/10.1088/1674-1056/21/2/020508</mixed-citation></ref><ref id="scirp.50800-ref37"><label>37</label><mixed-citation publication-type="other" xlink:type="simple">Su, L.Y. and Li, F.L. (2010) Deconvolution of Defocused Image with Multivariate Local Polynomial Regression and Iterative Wiener Filtering in DWT Domain. Mathematical Problems in Engineering, 2010, Article ID: 605241.</mixed-citation></ref><ref id="scirp.50800-ref38"><label>38</label><mixed-citation publication-type="other" xlink:type="simple">Su, L.Y., Yan, T.S., Zhao, Y.Y. and Li, F.L. (2012) Local Polynomial Regression Solution for Partial Differential Equations with Initial and Boundary Values. Discrete Dynamics in Nature and Society, 2012, Article ID: 201678.</mixed-citation></ref><ref id="scirp.50800-ref39"><label>39</label><mixed-citation publication-type="other" xlink:type="simple">Su, L.Y. (2011) Multivariate Local Polynomial Regression with Application to Shenzhen Component Index. Discrete Dynamics in Nature and Society, 2011, Article ID: 930958.</mixed-citation></ref></ref-list></back></article>