1 Introduction

Heart rate variability (HRV) is useful signal for understanding the status of the autonomic nervous system (ANS) [1]. HRV analysis involves three major procedures. After the ECG recording is digitized, the R waves of the ECG are detected through a QRS complex detection algorithm such as Pan-Tomkins QRS detection algorithm [2]. Then, the RR interval time series is obtained from the time interval between consecutive R waves. Finally, the time-domain, frequency-domain, and nonlinear HRV-related parameters can be computed by analyzing the time series [3, 4].

Numerous methods of quantifying HRV have been proposed [57]. Because the HRV signals are highly nonlinear and complex, analysis of these signals using linear statistics does not characterize the nonlinearity or the chaoticity of the signals [7]. Since HRV signals are regulated by complex mechanisms (ANS), it is rationale presume that HRV also contains nonlinear properties. One simple and easy measure to visualize the nonlinear properties of RR interval series data is the Poincare plot [710]. It is graphic representation of the correlation between consecutive RR interval series and characterizes current status of ANS. ANS is a part of nervous system that nonvoluntary controls all organs and systems of the body. ANS has its central and peripheral components accessing all internal organs.

There are two branches of the ANS system—sympathetic and parasympathetic (vagal) nervous system that always work as antagonist in their effect on target organs. The sympathetic nervous system stimulates organs’ functioning. An increase in sympathetic stimulation causes increase in HR. In contrast, the parasympathetic nervous system inhibits functioning of those organs. The actual balance between them is constantly changing in an attempt to achieve optimum considering all internal and external stimuli. HRV analysis provides ability to assess overall cardiac health and the state of ANS responsible for regulating cardiac activity. The normal variability in HR is due to autonomic neural regulation of the heart. Increased sympathetic nervous system or diminished parasympathetic nervous system results in cardio-acceleration and vice versa. The both branches of ANS operate at distinct frequencies [11]. Spectral analysis of HRV was applied in order to obtain noninvasive indices of sympathetic and parasympathetic regulation [12, 13]. Research studies [3, 4] have demonstrated that the high-frequency (HF: 0.15–0.40 Hz) power of HRV is an index associated with parasympathetic activity, while the low-frequency (LF: 0.04–0.15 Hz) power of HRV is an index associated with both sympathetic and parasympathetic activities. Moreover, the LF/HF ratio has been considered to reflect sympathetic modulations or sympathovagal balance [1417].

Tochi et al. [18] have recommended two measures, the cardiac vagal index (CVI) and the cardiac sympathetic index (CSI), which indicate vagal and sympathetic function separately. These two indices have found to be more reliable than those obtained by the other methods. Che-Wei Lin, Jeen-Shing Wang, and Pau-Choo Chung [19] have developed methodology for mining physiological condition from HRV analysis using CVI and CVS indexes.

In this work, an attempt is made to retrieve correlation between indexes that are related to ANS—LF, HF, and LF/HF and indexes that qualify the nonlinearity and the chaoticity of the HRV signal—CVI and CSI. That system should be able to show which of the two ANS parts are more active for certain therapy [2024] and to estimate ANS influence on HRV. Adaptive neuro-fuzzy inference system (ANFIS) [25] is used for system modeling where CSI and CVI indexes are inputs and spectral indexes LF, HF, and LF/HF are outputs. ANFIS is a soft computing methodology. Yardimci [26] demonstrates the possibilities of applying soft computing (SC) to medicine-related problems. Some of these SC methodologies have already been applied for ECG and HRV signals processing for classification [29, 32, 3437, 39], analysis [30], recognition [31, 35], diagnosis [33], and prediction [38]. ANFIS has been used only for the classification of ECG signals [27, 28].

2 Material and method

ECG data for the analysis were obtained from PhysioBank database. For this work, MIT-BIH Arrhythmia Database was used which contains 48 half-hour ECG recordings. The subjects were 25 men aged 32–89 years, and 22 women aged 23–89 years. Each of the 48 records is slightly over 30 min long. The signals group is intended to serve as a representative sample of the variety of waveforms and artifact that an arrhythmia detector might encounter in routine clinical use and some records were chosen to include complex ventricular, junctional, and supraventricular arrhythmias and conduction abnormalities. The recordings were digitized at 360 samples per second per channel with 11-bit resolution over a 10-mV range.

The procedure involves three major steps. The first step is to record and digitize ECG signals. After the ECG recording is digitized, the R waves of the ECG are detected through a QRS complex detection algorithm such as Pan-Tomkins QRS detection algorithm [2]. The RR interval time series is obtained from time between consecutive R waves. Then, the HRV-related parameters are computed in frequency-domain LF, HF, and LF/HF and nonlinear parameters cardiac vagal index (CVI) and cardiac sympathetic index (CVS).

3 Input and output parameters

Input parameters are CVI and CSI, and outputs are spectral indexes LF, HF, and LF/HF for adaptive neuro-fuzzy inference system.

3.1 Cardiac vagal index (CVI) and cardiac sympathetic index (CSI)

The Poincare plot is a two-dimensional nonlinear plot, which was originally designed for the application in metrology and has recently been applied in the field of electrophysiology. When the sequence of the consecutive RR interval is expressed by I 1, I 2, …, I n , the Poincare plot is constructed by plotting I k+1 against I k (k = 1, 2, …, n − 1). Figure 1 shows the Poincare plot for one of the subjects. In this plot, the RR fluctuation is transformed into the points distributed on a two-dimensional plane which form an ellipsoid configuration.

Fig. 1
figure 1

Poincare plot geometry of a subject

We calculated two components of the RR fluctuations from Poincare plot such as this one: the length of the transverse axis SD1 which is vertical line I k  = I k+1, and that of the longitudinal axis SD2 which is parallel with the line I k  = I k+1. When two adjacent intervals I m and I m+1 in the sequence differ greatly (large beat-to-beat variation), the point (I m , I m+1) is plotted distant from the line I k  = I k+1 on the plane, resulting in large SD1. On the other hand, when the fluctuation is great but continuous (large amplitude, but small beat-to-beat variation), the plotted points are distributed widely but along the line I k  = I k+1, resulting in large SD2 and small SD1. Thus, the two components reflect different aspects of the RR fluctuation. SD1 describes short-term variability, and SD2 describes long-term variability. SD1 is influenced by both the sympathetic and parasympathetic nervous system, whereas SD2 is affected only by the parasympathetic nervous system.

Tochi et al. [18] have been showed that product SD1 × SD2 is a sensitive index of cardiac parasympathetic function, which is not affected by sympathetic activity. Since the measure SD1 × SD2 showed a wide range of values, a logarithm was employed to accommodate the measure to statistical analysis. Thus, the component log10 (SD1 × SD2) is influenced only by vagal nervous system. Tochi termed this measure the “cardiac vagal index” (CVI). According to Tochi, SD1/SD2 ratio is an index of cardiac sympathetic function, which is not affected by vagal activity, and this measure is termed as “cardiac sympathetic index” (CSI).

3.2 Frequency-domain parameters

Frequency-domain measures pertain to HR variability at certain frequency ranges associated with specific physiological processes. Before frequency-domain analysis is performed, all abnormal heartbeats and artifacts must be detected and removed, and then cardiotachogram (sequence of RR intervals) must be resampled to make it as if it a regularly sampled signal. A standard spectral analysis routine is applied to such modified recording, and the following parameters evaluated on 5-min time interval: total power (TP), high frequency (HF), low frequency (LF), and very low frequency (VLF). When long-term data are evaluated, an additional frequency band is derived—ultra low frequency. The TP is net effect of all possible physiological mechanisms contributing in HR variability that can be detected in 5-min recording.

The HF power spectrum is in the range from 0.15 to 0.4 Hz, and this band reflects parasympathetic (vagal) tone and fluctuations caused by respiration known as respiratory sinus arrhythmia. Th LF spectrum is in the range from 0.04 to 0.15 Hz, and this band reflects both sympathetic and parasympathetic tone. The VLF power spectrum is evaluated in the range from 0.0033 to 0.04 Hz. With longer recordings, it is considered representing sympathetic tone. The ULF power spectrum is evaluated below 0.0033 Hz. The LF/HF ratio is used to indicate balance between sympathetic and parasympathetic tone. A decrease in this score might indicate either increase in parasympathetic or decrease in sympathetic tone. It must be considered together with absolute values of both LF and HF to determine what factor contributes in autonomic imbalance.

The frequency-domain analysis is traditionally performed by means of Fast Fourier Transformation (FFT). This method is simple in calculation for steady-state process and fair representation of all frequency-domain of HRV scores for at least 5-min data that should be collected. Some most recent studies implemented an alternative way to estimate power spectrum of HRV. It is based on autoregression methods (AR). One of its major advantages is that it does not require to have analyzed data series to be in steady state. Thus, any HRV data can be analyzed and fair HRV information still derived. Such analyses can be also performed at relatively shorter time intervals (less than 5 min) without missing meaningful HRV information. AR method is sensitive to rapid changes in HR properly showing tiny changes in autonomic balance. The drawback of this approach is a necessity to perform massive calculations to find best order of autoregression model.

In this work, the autoregressive method is applied for spectral analysis of HRV signals. The estimation of AR parameters can be done easily by solving some linear equations. The input and output parameters scopes were shown in Table 1.

Table 1 Input and output parameters scopes

4 Adaptive neuro-fuzzy inference system for function approximation

Jang [25] describes adaptive neuro-fuzzy inference system (ANFIS), which can be used for classification, approximation of highly nonlinear functions, online identification in discrete control system and to predict a chaotic time series. Jang proves the resulting fuzzy inference system has unlimited approximation power to match any nonlinear functions arbitrarily well on compact set and proceed this in a descriptive way.

In this work, we used first-order Sugeno model with two inputs. We formed three ANFIS models because there are three outputs LF, HF, and LF/HF and we used fuzzy if–then rules of Takagi and Sugeno’s type [90]:

$$ {\text{if}}\,x\,{\text{is}}\,A_{1} \,{\text{and}}\,y\,{\text{is}}\,B_{1} \,{\text{then}}\,f_{1} = p_{1} x + q_{1} y + r_{1} $$

In the first layer, every node is an adaptive node with a node function \( O = \mu_{{A_{i} }} \left( x \right) \) where \( \mu_{{A_{i} }} \left( x \right) \) is membership function. In this work, we chose to be bell shaped with maximum equal to 1 and minimum equal to 0, such as

$$ \mu_{{A_{i} }} \left( x \right) = \frac{1}{{1 + \left[ {\left( {\frac{{x - c_{i} }}{{a_{i} }}} \right)^{2} } \right]^{{b_{i} }} }} $$

where \( \left\{ {a_{i} , b_{i} ,c_{i} } \right\} \) is the parameter set and in this layer are referred to as premise parameters. X is the input to node in this layer, and it is CVI and CSI.

Every node in the second layer is nonadaptive, and this layer multiplies the incoming signals and sends the product out like \( w_{i} = \mu_{{A_{i} }} \left( x \right)x\mu_{{B_{i} }} \left( y \right) \). Each node output represents the firing strength of a rule.

The third layer is also nonadaptive, and every node calculates the ratio of the rule’s firing strength to the sum of all rules’ firing strength like \( \bar{w}_{i} = \frac{{w_{i} }}{{w_{1} + w_{2} }},\quad i = 1,2. \) The outputs of this layer are called normalized firing strengths.

Every node in the fourth layer is adaptive node with node function \( O_{i}^{4} = \bar{w}_{i} f_{i} = \bar{w}(p_{i} x + q_{i} y + r_{i} ) \) where \( \left\{ {p_{i} , q_{i} ,r} \right\} \) is parameter set and in this layer are referred to as consequent parameters.

The single node in the fifth layer is not adaptive, and this node computes the overall output as the summation of all incoming signals

$$ O_{i}^{4} = \mathop \sum \limits_{i} \bar{w}_{i} f_{i} = \frac{{\mathop \sum \nolimits_{i} w_{i} f_{i} }}{{\mathop \sum \nolimits_{i} w_{i} }} $$

This type of an adaptive network is functionally equivalent to a type-3 fuzzy inference system. We applied the hybrid learning algorithms to identify the parameters in the ANFIS architectures. In the forward pass of the hybrid learning algorithm, functional signals go forward till layer 4 and the consequent parameters are identified by the least squares estimate. In the backward pass, the error rates propagate backward and the premise parameters are updated by the gradient descent. The ANFIS architectures for all three outputs are shown in Fig. 2.

Fig. 2
figure 2

ANFIS network used for approximation. These three outputs make three ANFIS models

5 Results

In this paper, we extracted 48 ECG recordings from MIT-BIH Arrhythmia Database. All of these signals were used for ANFIS training because the group serves as a representative sample of the variety of waveforms and artifacts that an arrhythmia detector might encounter, and these data contain all the necessary representative features so we do not need for ANFIS testing and validating. The main goal was to find optimal ANFIS parameters where final decision surfaces in all three cases are thorough positive—no negative parts, because spectral parameters LF, HF, and LF/HF are always positive. After several testings, we have found optimal ANFIS parameters that are shown in Table 2.

Table 2 General characteristics of ANFIS architectures which was found to be optimal

The mean squared errors (MSE) are acceptable for this purpose of research. The MSE for HF and LF are in order 10−3, and for ratio LF/HF even 10−7. Minimal number of membership functions for which is thorough final decision surfaces positive are shown in Table 2. This ANFIS algorithm is useful for the input and output parameters in range shown in Table 1. For the wider input/output parameters range, we must add ECG recordings with new features and abnormalities. The final decision surfaces after training were shown in Figs. 3, 4, and 5.

Fig. 3
figure 3

Final decision surface for input1 = CVI, input2 = CVS, and output = HF

Fig. 4
figure 4

Final decision surface for input1 = CVI, input2 = CVS, and output = LF

Fig. 5
figure 5

Final decision surface for input1 = CVI, input2 = CVS, and output = LF/HF

Figure 6 shows the real measurements of HRV activity and one predicted by ANFIS. This system could detect automatic nervous system branches activity in real time. There are differences between predicted and real curves. It is clear for better prediction that we need more membership functions and training epochs. The ANFIS network was trained with two membership functions, 16 fuzzy rules and 104 total number of parameters.

Fig. 6
figure 6

Comparisons between real measurements of low and high frequency of HRV and ANFIS predictions

6 Conclusion

One of the most important features of the ANFIS networks is real-time detection and online identification of the automatic nervous system (ANS) branches activity. It is useful for ANS treatment if the branches did not have optimal state characteristics. In this paper, HRV nonlinear parameters are used as a reliable indicator of ANS diseases.

Heart rate signal can be used as certain indicator of heart disease. We have used the spectral analysis for the ANS monitoring—sympathetic activity increase/decrease and parasympathetic activity increase/decrease. It is an indicator of HRV activity. We have used cardiac vagal index (CVI) and cardiac sympathetic index (CSI) which indicate vagal and sympathetic function separately. It is found to be more reliable than those obtained by the other methods. Those parameters are in reasonable ranges as the measures to statistical analysis. For simplicity, we have not applied the ANFIS validating and testing because the signals group is intended to serve as a representative sample of the variety of waveforms and artifact. Addition of the new signals increases training time for the ANFIS models, and it is not insignificant. Therefore, we must choose optimal number and type of ECG recordings for the new databases, which will cover wider variations spectra of ECG abnormalities.

Future demands are increasing the input parameters ranges without the ANFIS training time increasing. One of the possible solutions is to create three different ECG group recordings. Each of group will be used for ANFIS training, validation, and testing separately. The three ECG groups will cover different variation of ECG recordings, and the main goal will be determining optimal ANFIS parameters which approximate all the three ECG groups. This model has a drawback. It is larger mean squared error than the recommended ANFIS model in this paper, but the ANIFS time training would be much shorter in this new model.