**2. Methods**

responses expected in hypoxia (metabolic acidosis, myocardial glycogenolysis, etc.). For a

**Figure 3.** Real-time ST Analysis (Fetal Heart Rate, T wave and QRS complex ratio) using Matlab application.

classification problems in different areas of medicine including Obstetrics.

and nonbiological) affecting the quality of aECG signals.

diography research.

A critical review of the current signal processing literature reveals that adaptive signal processing and soft computing methods are rapidly growing research areas and offer great promise to address some of the most challenging signal separation, pattern recognition, and

Driven by these advancements and promises, in the methods section we will first present a theoretical overview of the advanced signal processing (both nonadaptive and adaptive) techniques that have been applied to the extraction (separation) of fECG from aECG signals, and will choose a subset based upon their advantages. We will mainly focus on the Least Mean Squares (LMS) and Recursive Least Squares (RLS) algorithms [62]. Secondly, we will look at soft computing methods and describe how they have the ability to enhance the performance of adaptive signal processing algorithms in achieving better outcomes when processing biomedical signals. Then we will pay special attention to adaptive neuro-fuzzy inference systems (ANIFS) [60,63], which are considered to be the most significant in fetal electrocar‐

To provide a comparative analysis of the performance of our selected adaptive algorithms and their enhanced realizations using soft computing approaches, in the results section, we will report the outcomes of a number of experiments that we devised by using aECG (identical to clinical) signals generated by our novel LabVIEW-Based Multi-Channel Noninvasive Ab‐ dominal Maternal-Fetal Electrocardiogram Signal Generator [7,8]. This abdominal fECG signal generator allows us to realistically simulate all types of signal contaminations (both biological

Our experimental results were evaluated using both subjective and objective criteria. For the objective evaluation, we used the SNR values before and after processing, the RMSE value,

more detailed explanation please see Reference [1].

58 Advanced Biosignal Processing and Diagnostic Methods

### **2.1. fECG signal elicitation or extraction**

Interference elimination can be implemented using a single-or a multi-channel source signal. These signals are then processed by various methods, which are used for fECG signal extrac‐ tion, as shown in **Figure 4**. These methods are divided into two categories: nonadaptive and adaptive, depending on the system's inability or ability to accommodate unexpected changes.

**Figure 4.** Summary of methods for fECG elicitation.

#### **2.2. Nonadaptive methodologies**

The Nonadaptive methodologies used for fECG signal extraction include Wavelet Transform-Based Techniques [9–11], Correlation Methods [12], Subtraction Methodologies [13], Single Value Decomposition (SVD) [14], Independent Component Analysis (ICA) and Blind Subspace Separation (BSS) [15–17], as well as Averaging Techniques [18].

The drawback of the nonadaptive techniques is that they are time-invariant in nature. Their time-invariance limitation has been overcome by the adaptive methods, which are more effective in reducing the overlapping noise (such as mECG) in time and frequency domains. Nonadaptive methods are useful for data pre-processing or for noise elimination in case of classic ECGs [4].

#### **2.3. Adaptive methodologies**

Different variants of adaptive filters have been used for mECG signal cancellation and fECG signal extraction. These methods consist of training an adaptive or a matched filter for either removing the mECG signal using one or several maternal reference channels [19] or directly training the filter for extracting the fetal QRS complexes [20].

The existing adaptive filtering methods for maternal component elimination require a reference mECG channel that is morphologically similar to the contaminating waveform, or require several linearly independent channels to reconstruct any morphologic shape from the Ref. [21].

**Figure 5.** A theoretical multichannel adaptive noise (mECG and interferences) cancelation system.

Several approaches for mECG signal cancellation and fECG signal extraction have been used. The adaptive filters can be trained to extract the fetal QRS complexes directly or to estimate and remove the mECG component using reference maternal channels. The reference mECG signal can be recorded from the electrodes placed on the mother's thorax, or reconstructed from several abdominal channels that are linearly independent. The limitation of these approaches, which influences their performance, is that the morphology of the mECG signals highly depends on the electrode locations. Thus, the reconstruction of the complete ECG morphology from a linear combination of the reference electrodes is not always possible.

There are many different methodologies to extract fECG signals using adaptive filters based on one or several maternal reference channels (as shown in **Figure 5**). These methodologies include the LMS and RLS Algorithms, Artificial Intelligence (AI) Techniques, Fuzzy Inference Systems (FISs) [22,23], Genetic Algorithms (GA), and Bayesian Adaptive Filtering Frameworks which comprise Kalman Filters.

## *2.3.1. Linear adaptive methods*

Nonadaptive methods are useful for data pre-processing or for noise elimination in case of

Different variants of adaptive filters have been used for mECG signal cancellation and fECG signal extraction. These methods consist of training an adaptive or a matched filter for either removing the mECG signal using one or several maternal reference channels [19] or directly

The existing adaptive filtering methods for maternal component elimination require a reference mECG channel that is morphologically similar to the contaminating waveform, or require several linearly independent channels to reconstruct any morphologic shape from the

**Figure 5.** A theoretical multichannel adaptive noise (mECG and interferences) cancelation system.

Several approaches for mECG signal cancellation and fECG signal extraction have been used. The adaptive filters can be trained to extract the fetal QRS complexes directly or to estimate and remove the mECG component using reference maternal channels. The reference mECG signal can be recorded from the electrodes placed on the mother's thorax, or reconstructed from several abdominal channels that are linearly independent. The limitation of these approaches, which influences their performance, is that the morphology of the mECG signals highly depends on the electrode locations. Thus, the reconstruction of the complete ECG morphology from a linear combination of the reference electrodes is not always possible.

There are many different methodologies to extract fECG signals using adaptive filters based on one or several maternal reference channels (as shown in **Figure 5**). These methodologies include the LMS and RLS Algorithms, Artificial Intelligence (AI) Techniques, Fuzzy Inference Systems (FISs) [22,23], Genetic Algorithms (GA), and Bayesian Adaptive Filtering Frameworks

training the filter for extracting the fetal QRS complexes [20].

classic ECGs [4].

Ref. [21].

**2.3. Adaptive methodologies**

60 Advanced Biosignal Processing and Diagnostic Methods

which comprise Kalman Filters.

As mentioned before, adaptive methods can be linear or nonlinear. The linear methods for fECG signal extraction include algorithms such as LMS [24,25] RLS [24,26], Comb Filter [27], Adaptive Voltera Filter [28], Kalman Filter [29,30] or Adaptive Linear Networks (ADALINE) [31].

An adaptive filter is one that is characterized by the ability to self-adjust its coefficients according to an optimized training algorithm which is driven by a back-propagated error signal. Adaptive filters are used in noise cancellation applications to remove the noise adaptively from a signal and to improve the Signal to Noise Ratio (SNR) [4].

Simply said, it is a technique for the adaptive elimination of undesired signals (such as the maternal component) from the abdominal signal to obtain the fECG signal. The system can self-adjust to the existing circumstances and optimize its results.

### *2.3.2. An example: an adaptive noise cancellation system for fECG signal extraction*

A theoretical multichannel adaptive noise cancellation system, shown in **Figure 5**, illustrates an adaptive elicitation technique of the fECG as an example. It consists of two kinds of input signals recorded from multiple leads: the abdominal ECG signals (AB1–ABn) and the thoracic ECG signals (TH1–THn). Each abdominal signal consists of both maternal and fetal signals and serves as the primary input. The thoracic signal is considered to be completely maternal and is used as the reference input. Finite Impulse Response (FIR) Filter weights of the adaptive systems are updated by training algorithms based on the back-propagated error signal, which is the desired fECG signal (fECG1–fECGn). The maternal component is considered as noise to be eliminated. Each of the adaptive systems produces a signal, which is an approximation of the noise. This signal is subtracted from the abdominal ECG (aECG) signal so that the error signal that is back-propagated to the training algorithm is the fetal ECG signal with some noise.

Linear methods have limited performance in processing nonlinear or degenerate mixtures of signal and noise. In fact, fECG signals are not always linearly separable from undesirable signals contaminating them [32]. That is also a reason why linear algorithms yield better results when tested with synthetic data compared to those tested with real data. As the underlying physiological processes in the human body exhibit nonlinear behavior it seems more reason‐ able to use nonlinear methods for the construction of accurate and functional adaptive filters [22,32] to achieve better outcomes.

This chapter primarily focuses on the LMS- and RLS-based FIR Adaptive Filtering Methods. In the sections below we present mathematical descriptions for the most important methods such as LMS, Normalized LMS (NLMS), RLS, and Fast Transversal Filter (FTF).

#### **2.4. Theoretical background**

The Least Mean Squares (LMS) Algorithms are classified as adaptive filters that can change their coefficients to become a system that produces the least mean squares of the error (the difference between the desired and the actual) signal. It is a stochastic gradient descent method in that the filter is only adapted based on the error at the current time [33].

#### *2.4.1. Standard LMS*

The Standard LMS Algorithm performs the following operations to update the coefficients of an adaptive filter:

**•** Calculates the corresponding output signal from the adaptive filter by using the following equation:

$$\mathbf{y}\left(k\right) = \sum\_{i=0}^{N-1} \mathbf{w}\left(k\right)\mathbf{x}\left(k-i\right) = \mathbf{w}^{\top}\left(k\right)\mathbf{x}\left(k\right). \tag{1}$$

**•** Calculates the error signal *e*(*k*) that denotes the difference between additional input signal *d*(*k*) and *y*(*k*) by using the following equation:

$$e(k) = d(k) - \chi(k). \tag{2}$$

**•** Updates the filter coefficients by using the following equation:

$$\mathbf{w}(k+l) = \mathbf{w}(k) + 2\mu \mathbf{e}(k)\mathbf{x}(k),\tag{3}$$

where *μ* is the step size of the adaptive filter, is the filter coefficients vector, and **w**(*k*) is the input signal to a linear filter at time. Step size is a crucial parameter that can improve the convergence speed of the adaptive filter. It determines both how quickly and how closely the adaptive filter converges to the filter solution [34].

#### *2.4.2. Normalized LMS (NLMS) algorithm*

The NLMS Algorithm is a modified form of the standard LMS Algorithm. The NLMS Algo‐ rithm updates the coefficients of an adaptive filter by using the following equation:

$$\mathbf{w}(k+l) = \mathbf{w}(k) + \mu \mathbf{e}(k) \frac{\mathbf{x}(k)}{\mathbf{x}(k)}.\tag{4}$$

It is obvious that the NLMS Algorithm is almost identical to the Standard LMS Algorithm except that the NLMS Algorithm has a time-varying step size *μ*(*k*), [34].

#### *2.4.3. The recursive least square (RLS) algorithm*

Unlike the LMS Algorithm, which reduces the mean square error, the principle of the RLS Algorithm is that it recursively finds the coefficients that minimize a weighted linear least squares cost function relating to the input signals. In the case of the RLS Algorithm, the input signals are considered deterministic, while for the LMS Algorithm, they are considered stochastic. Compared to most of its competitors, the RLS Algorithm exhibits extremely fast convergence. However, this benefit comes at the cost of high computational complexity.

The standard RLS Algorithm performs the following operations to update the coefficients of an adaptive filter:

**•** Calculates the output signal of the adaptive filter:

difference between the desired and the actual) signal. It is a stochastic gradient descent method

The Standard LMS Algorithm performs the following operations to update the coefficients of

**•** Calculates the corresponding output signal from the adaptive filter by using the following

**•** Calculates the error signal *e*(*k*) that denotes the difference between additional input signal

<sup>=</sup> <sup>=</sup> å - = **w x** (1)

*ek dk yk* ( ) ( ) ( ). = - (2)

(3)

( ) ( ) ( ) ( ) ( ) <sup>1</sup> <sup>T</sup> <sup>0</sup> . *<sup>N</sup>*

> **ww x** ( 1) ( ) 2 ( ) ( ), *k k ek k* += + m

where *μ* is the step size of the adaptive filter, is the filter coefficients vector, and **w**(*k*) is the input signal to a linear filter at time. Step size is a crucial parameter that can improve the convergence speed of the adaptive filter. It determines both how quickly and how closely the

The NLMS Algorithm is a modified form of the standard LMS Algorithm. The NLMS Algo‐

2

**<sup>x</sup> w w <sup>x</sup>** (4)

*k*

rithm updates the coefficients of an adaptive filter by using the following equation:

+= +

except that the NLMS Algorithm has a time-varying step size *μ*(*k*), [34].

( ) ( 1) ( ) ( ) . ( ) *<sup>k</sup> k k ek*

m

It is obvious that the NLMS Algorithm is almost identical to the Standard LMS Algorithm

Unlike the LMS Algorithm, which reduces the mean square error, the principle of the RLS Algorithm is that it recursively finds the coefficients that minimize a weighted linear least

*<sup>i</sup> yk wk xk i k k* -

*d*(*k*) and *y*(*k*) by using the following equation:

adaptive filter converges to the filter solution [34].

*2.4.2. Normalized LMS (NLMS) algorithm*

*2.4.3. The recursive least square (RLS) algorithm*

**•** Updates the filter coefficients by using the following equation:

in that the filter is only adapted based on the error at the current time [33].

*2.4.1. Standard LMS*

62 Advanced Biosignal Processing and Diagnostic Methods

an adaptive filter:

equation:

$$\mathbf{y}(k) = \mathbf{w}^{\mathsf{T}}(k-1)\mathbf{x}(k). \tag{5}$$

**•** Calculates estimation error *e*(*k*) by using the following equation:

$$e(k) = d(k) - \chi(k). \tag{6}$$

**•** Updates the filter coefficients by using the following equation:

$$\mathbf{w}(k+l) = \mathbf{w}^{\top}(k) + e(k)\mathbf{K}(k),\tag{7}$$

where **w**(*k*) is the filter coefficients vector and **K**(*k*) is the gain vector and is defined by the following equation:

$$\mathbf{K}(k) = \frac{P(k)\mathbf{u}(k)}{\lambda + \mathbf{u}^T(k)P(k)\mathbf{u}(k)}. \tag{8}$$

*P*(*k*) is the inverse correlation matrix of the input signal. *P*(*k*) has the following initial value:

$$P(k) = \begin{bmatrix} \delta^{-1} & 0 & \dots & 0 \\ 0 & \delta^{-1} & \dots & 0 \\ \dots & \dots & \dots & \dots \\ 0 & 0 & \dots & \delta^{-1} \end{bmatrix},\tag{9}$$

where *δ* is the regularization factor. The standard RLS Algorithm uses the following equation to update this inverse correlation matrix.

$$P\left(k+1\right) = \mathcal{X}^{-1}P\left(k\right) - \mathcal{X}^{-1}\mathbf{K}(k)\mathbf{u}^{\top}\left(k\right)P(k). \tag{10}$$

**•** Repeats all the steps for the next iteration (*k* + 1).

The selection of the forgetting factor *λ* depends on the number of the samples *k* as follows:

$$k = \frac{\lambda}{1 - \lambda}.\tag{11}$$

If the analyzed signal is stationary, *λ* should be chosen as unity. Otherwise, *λ* should be smaller than the unity to track the nonstationary portion of the signals. The performance index takes into account the most recent errors as calculated by the most recent *kth* iteration [35].

#### *2.4.4. Fast transversal filter (FTF)*

The complexity of the classical RLS Algorithm (related to the speed of convergence) was the main reason for the inclusion of the FTF (Fast Transversal Filter) Algorithm. A detailed description of the algorithm is very extensive, complicated, and beyond the scope of this chapter. Its detailed formula derivation can be found in Ref. [36].

## **2.5. Soft computing methods**

Biological systems including the human body and most of the real-world physical systems are highly involved nonlinear dynamical systems with a large degree of variability, imprecision, and uncertainty. As such, it is impossible for humans to find tractable solutions to problems associated with these systems without using powerful computing technologies. This is mainly attributable to the extensive amount of required data and processing time. In general, a nonlinear system is capable of generating quantitative or qualitative information. Quantitative information is represented by accurate numerical values, which are acquired by conventional modeling and mathematics. These conventional methods of data acquisition are rigorous and their results have to be precise, certain or categorically true or false. Precision and certainty of calculations are attainable at a higher computational cost. On the contrary, qualitative information contains knowledge or experience that can be expressed in natural language (e.g., big, medium, small). Qualitative information is processed by "soft" approaches called soft computing or artificial intelligence. Soft computing is a collection of methodologies that are able to tolerate imprecision and uncertainty and exploit these attributes to achieve robust and low-cost solutions. These methods aim to imitate the way the human brain processes infor‐ mation.

It is very difficult to describe real-world systems by classical mathematics, and it has been established that processing purely quantitative information is not efficient and represents a huge computational burden. New research has shown that nonlinear systems are substantially better modeled by artificial intelligence. These facts have led to the development of new intelligent soft computing methods. In current practice, these methods find various applica‐ tions in software engineering, signal processing, and optimization. Soft computing methods comprised of fuzzy logic, artificial neural networks, evolutionary algorithms, and hybrid algorithms, are distinguishable from other computational techniques by exhibiting a tolerance for imprecision and uncertainty. Another advantage of soft computing methods is in their ability to adapt and learn, which makes them very suitable for adaptive filtering applications where their training algorithms allow them to adapt the system's parameters to existing conditions.

The application of soft computing methods in the processing of fECG signals is still in its infancy. However, the rapid development of computing processor technology and computa‐ tional intelligent algorithms in the last three decades has provided new impetus for advancing fetal cardiology. To date, a number of soft computing-based approaches have been introduced to tackle fECG signal extraction. These include Adaptive Linear Neural Network (ADALINE), [8,37], Genetic Algorithms (GA), [20,21], ANFIS [32,34,38], and ANFIS trained with Particle Swarm Optimization (PSO) [1,2]. In [37] authors used an ADALINE trained with the LMS Algorithm for suppression of mECG signals. The ADALINE was trained to eliminate the maternal component from the aECG. This was carried out by subtraction of the mECG from the aECG. The resultant error signal was equal to the fECG. Neural networks were also used in [8], in combination with FIR filters. Taking advantage of the combined capabilities of soft computing methods and digital FIR or IIR (Infinite Impulse Response) filters is now common. For example, in [20] authors proposed to apply low pass FIR filtering optimized by a Genetic Algorithm (GA). The GA-modified coefficients of the FIR filter produced the best possible results for fECG signal extraction. A comparison of the results yielded by this method with those produced by methods using the LMS and NLMS Algorithms showed that the quality of filtering using the GA with eight bits and ten iterations was equal to those of the other methods. Better results were achieved by using IIR instead of FIR filters [21]. An ANFIS tuned by PSO was considered to be an efficient tool for the extraction of not only the QRS complexes, but also all the components of the fECG signal. This level of performance has not been achieved by leveraging any other two leading methods to date. With this overview in mind, in the section below we describe the extraction of fECG signals by using ANFIS.

#### *2.5.1. ANFIS theoretical background*

. <sup>1</sup>

into account the most recent errors as calculated by the most recent *kth* iteration [35].

chapter. Its detailed formula derivation can be found in Ref. [36].

*2.4.4. Fast transversal filter (FTF)*

64 Advanced Biosignal Processing and Diagnostic Methods

**2.5. Soft computing methods**

mation.

l

If the analyzed signal is stationary, *λ* should be chosen as unity. Otherwise, *λ* should be smaller than the unity to track the nonstationary portion of the signals. The performance index takes

The complexity of the classical RLS Algorithm (related to the speed of convergence) was the main reason for the inclusion of the FTF (Fast Transversal Filter) Algorithm. A detailed description of the algorithm is very extensive, complicated, and beyond the scope of this

Biological systems including the human body and most of the real-world physical systems are highly involved nonlinear dynamical systems with a large degree of variability, imprecision, and uncertainty. As such, it is impossible for humans to find tractable solutions to problems associated with these systems without using powerful computing technologies. This is mainly attributable to the extensive amount of required data and processing time. In general, a nonlinear system is capable of generating quantitative or qualitative information. Quantitative information is represented by accurate numerical values, which are acquired by conventional modeling and mathematics. These conventional methods of data acquisition are rigorous and their results have to be precise, certain or categorically true or false. Precision and certainty of calculations are attainable at a higher computational cost. On the contrary, qualitative information contains knowledge or experience that can be expressed in natural language (e.g., big, medium, small). Qualitative information is processed by "soft" approaches called soft computing or artificial intelligence. Soft computing is a collection of methodologies that are able to tolerate imprecision and uncertainty and exploit these attributes to achieve robust and low-cost solutions. These methods aim to imitate the way the human brain processes infor‐

It is very difficult to describe real-world systems by classical mathematics, and it has been established that processing purely quantitative information is not efficient and represents a huge computational burden. New research has shown that nonlinear systems are substantially better modeled by artificial intelligence. These facts have led to the development of new intelligent soft computing methods. In current practice, these methods find various applica‐ tions in software engineering, signal processing, and optimization. Soft computing methods comprised of fuzzy logic, artificial neural networks, evolutionary algorithms, and hybrid algorithms, are distinguishable from other computational techniques by exhibiting a tolerance for imprecision and uncertainty. Another advantage of soft computing methods is in their ability to adapt and learn, which makes them very suitable for adaptive filtering applications

<sup>=</sup> - (11)

l

*k*

An Adaptive Neuro-fuzzy System (ANFIS) is a hybrid adaptive network based on a Sugenotype fuzzy interference system (FIS) implemented into a feed-forward artificial neural network framework [39–44]. It uses a neuro-adaptive learning algorithm to determine the relationship between the input and output data sets. This learning algorithm can be hybrid or use back propagation. The advantage of an ANFIS lies in its ability to combine the "cleverness" of the Artificial Neural Networks (ANNs) and Fuzzy Inference Systems (FISs) in learning nonlinear‐ ities, which complement each other. A FIS incorporates human knowledge into the system in contrast to an ANN, which is capable of optimizing the ANFIS' parameters in implementing the learning process. To ensure correct and smooth running of the ANFIS, a number of fundamental considerations has to be made:


#### *2.5.2. ANFIS architecture*

The original Jang's ANFIS architecture consists of five feed-forward interconnected layers, namely: a fuzzy layer, a product layer, a normalized layer, a de-fuzzification layer, and a total output layer [45]. In each layer several nodes are included and described by the node function. The nodes in these layers have an adaptive or a fixed nature and the difference between them is shown graphically in **Figure 6**, in which circles indicate the fixed nodes whereas squares represent the adaptive ones. The elementary ANFIS architecture has two initial inputs and one total single-value output. The rule base of the Sugeno FIS model is constituted by two IF-THEN rules in the following form [45]:

$$\text{IF}\left(\mathbf{x}\text{ is }A\_{\mathbf{i}}\right)\text{and}\left(\mathbf{y}\text{ is }B\_{\mathbf{i}}\right)\text{THEN}\left(f\_{\mathbf{i}}=p\_{\mathbf{i}}\mathbf{x}+q\_{\mathbf{i}}\mathbf{y}+r\_{\mathbf{i}}\right).\tag{12}$$

$$\text{IF}(\mathbf{x}\mathbf{is}\,A\_2)\text{and}\left(\mathbf{y}\,\mathbf{is}\,B\_2\right)\text{THEN}\left(f\_2 = p\_2\mathbf{x} + q\_2\mathbf{y} + r\_2\right). \tag{13}$$

**Figure 6.** Fundamental scheme of ANFIS architecture.

where *x* and *y* are initial inputs; *Ai* and *Bi* are the nonlinear fuzzy sets also called a remise section; *fi* is the output of the system; and *pi* , *qi* , and *ri* are linear design parameters, which are determined during the training process.

**Layer 1:** The first layer of this architecture is an adaptive layer used for fuzzification of input variables. Each node represents the input value of a linguistic variable. The node function associated with the output of each node is

$$O\_{1,i} = \mu\_{\preccurlyeq}(\mathbf{x}); \text{for } i = \mathbf{l}, \mathbf{2}, \tag{14}$$

$$O\_{1,i} = \mu\_{\mathcal{B}\_i - 2}(\mathbf{y}); \text{for } i = 3, 4, \tag{15}$$

where *x* (or *y*) are inputs of the node *i, Ai* (or *Bi*−1) are linguistic labels and *μAi*(*x*), respectively; *μBi*−2 (*y*) can accept any fuzzy membership function. In conclusion, 01,*<sup>i</sup>* is an expression of the membership function, in other words a membership grade, which indicates how much given *x* (or *y*) satisfies quantifier *Ai* (or *Bi* ). The membership function can acquire several shapes including bell-shaped, triangular, and trapezoidal or Gaussian. For illustration we will use a bell-shaped Membership Function (MF) (Eq. 16).

*2.5.2. ANFIS architecture*

66 Advanced Biosignal Processing and Diagnostic Methods

rules in the following form [45]:

**Figure 6.** Fundamental scheme of ANFIS architecture.

determined during the training process.

associated with the output of each node is

is the output of the system; and *pi*

and *Bi*

, *qi* , and *ri*

1, ;for 1,( 2.,) *<sup>i</sup> O xi i A* = = m

1, <sup>2</sup> ;for 3,4) ,( *<sup>i</sup> O yi i B* = =

m

**Layer 1:** The first layer of this architecture is an adaptive layer used for fuzzification of input variables. Each node represents the input value of a linguistic variable. The node function

where *x* and *y* are initial inputs; *Ai*

section; *fi*

The original Jang's ANFIS architecture consists of five feed-forward interconnected layers, namely: a fuzzy layer, a product layer, a normalized layer, a de-fuzzification layer, and a total output layer [45]. In each layer several nodes are included and described by the node function. The nodes in these layers have an adaptive or a fixed nature and the difference between them is shown graphically in **Figure 6**, in which circles indicate the fixed nodes whereas squares represent the adaptive ones. The elementary ANFIS architecture has two initial inputs and one total single-value output. The rule base of the Sugeno FIS model is constituted by two IF-THEN

IF is and THEN ( *x A yis B f p x q y r* 1 1 11 1 1 ) ( ) ( =++ ). (12)

IF is and THEN ( *x A yis B f p x q y r* 2 2 22 2 2 ) ( ) ( =++ ). (13)

are the nonlinear fuzzy sets also called a remise

(14)


are linear design parameters, which are

$$\mu\_{A\_i}(\mathbf{x}) = \frac{1}{1 + \left| \frac{(\mathbf{x} - \mathbf{c}\_i)}{a\_i} \right|^{2h\_i}}, \mu\_{A\_i}(\mathbf{x}) = \frac{1}{1 + \left| \frac{(\mathbf{x} - \mathbf{c}\_i)}{a\_i} \right|^{2h\_i}}. \tag{16}$$

Parameters *ai* , *bi* , and *ci* in Eq. (16) change the shape of the MF degree. Its value ranges from 0 to 1, where 0 is equal to the minimum value and 1 is equal to the maximum value.

**Layer 2:** The nodes in the second layer multiply the output signals from the previous layer. The output of this layer denotes *O*2,*<sup>i</sup>* and is described as:

$$\mathcal{O}\_{2,i} = \mathbf{w}\_i = \mu\_{\mathcal{A}}(\mathbf{x})\mu\_{\mathcal{B}i}(\mathbf{y});\ \text{for}\ i = 1, 2. \tag{17}$$

**Layer 3:** The normalized layer labeled N contains a function to calculate the normalized firing strength. The output is labeled *O*3,*<sup>i</sup>* .

$$O\_{3,i} = \overline{\mathbf{w}}\_i = \frac{\mathbf{w}\_i}{\mathbf{w}\_1 + \mathbf{w}\_2}; \text{ for } i = 1, 2. \tag{18}$$

**Layer 4:** All nodes in this layer are adaptive. The node function has the form given below:

$$\mathcal{O}\_{4,i} = \overline{\mathbf{w}}\_i f\_i = \overline{\mathbf{w}}\_i \left( p\_i \mathbf{x} + q\_i \mathbf{y} + r\_i \right), \text{for } i = 1, 2,\tag{19}$$

where output *O*4,*<sup>i</sup>* defines a de-fuzzified (crisp) relationship between the input and output of this layer, is a firing strength desired in the normalized layer *pi* , *qi* , and *ri* are linear adaptive parameters also called consequent parameters.

**Layer 5:** The last and fixed layer calculates the total output of the system.

$$O\_{\mathcal{S},i} = \sum\_{i} \overline{\mathbf{w}}\_{i} f\_{i} = \frac{\sum\_{i} \overline{\mathbf{w}}\_{i} f\_{i}}{\sum\_{i} \overline{\mathbf{w}}\_{i}}. \tag{20}$$

The output *O*5,*<sup>i</sup>* is derived from the summation of incoming signals from Layer 4.

#### *2.5.3. Hybrid learning algorithm*

The hybrid learning algorithm in the ANFIS tunes the parameters of the Sugeno type FIS. It is a combination of the LMS and the Back-propagation Gradient Descent Algorithm (BPG). Each part of the hybrid algorithm is focused on a different part of the rule base in the ANFIS architecture. The premise (antecedent) parameters are adjusted by the BPG Algorithm and the consequent parameters are tuned by the LMS Algorithm. With respect to this distribution, the hybrid learning algorithm is divided into two passes, which are regularly repeated with every epoch. These passes are called "forward" and "backward" passes. **Figure 7** depicts the scheme of the hybrid learning algorithm. This hybrid algorithm converges much faster than the original pure back-propagation algorithm, as the latter reduces the search space dimensions [46,47].

**Figure 7.** Block diagram for the hybrid-learning algorithm.

#### **2.6. Definition of the parameters**

The measurement of the quality of the fECG extraction procedures is based on the absence of noise and the degree of similarity between the recovered fECG signals and the ideal fECG signals, where the main parameters can be helpful to control the effectiveness of the fECG extraction and Signal to noise ratio (SNR).

#### *2.6.1. Signal to noise ratio (SNR)*

The relation between signal and noise is described by the SNR. To evaluate the filtering quality by the SNR, it is essential to calculate this ratio before and after filtering. The SNR before filtering is labeled SNRIN and the SNR after filtrating is labeled SNROUT. Based on SNRIN and SNROUT, it is possible to track the improvement of the SNR after filtering. Their expressions are as follows:

$$\text{SNR}\_{\text{IN}} = 10 \cdot \log\_{10} \log\_{10} \left( \frac{\sum\_{i=1}^{N-1} \left[ \text{sig}\_{\text{og}}(i) \right]^2}{\sum\_{i=1}^{N-1} \left[ \text{sig}\_{\text{noise}}(i) - \text{sig}\_{\text{avg}}(i) \right]^2} \right), \tag{21}$$

where sigorg is the desired signal equal to an ideal fECG and signoise is a disturbing noise. This signal corresponds to a simulated mECG after passing through the unknown environment of the human body. Please clarify this sentence. Since the disturbance noise is a sum of the ideal fECG and mECG after they pass through the human body, it is necessary to subtract these two signals from each other in the denominator, SNROUT defines:

$$\text{SNR}\_{\text{OUT}} = 10 \cdot \log\_{10} \left( \frac{\sum\_{i=1}^{N-1} \left[ \text{sig}\_{\text{og}}(i) \right]^2}{\sum\_{i=1}^{N-1} \left[ \text{sig}\_{\text{rec}}(i) - \text{sig}\_{\text{og}}(i) \right]^2} \right), \tag{22}$$

where sigorg denotes the original signal (ideal fECG) and sigrec (*i*) the signal recovered by the algorithm.

It is possible to evaluate the effectiveness of the proposed adaptive method by finding the difference between SNRIN and SNROUT .

The SNR quantifies the relation between the fetal ECG signal and the rest of the undesired components (mECG). In the general fECG inverse problem, this is not an operative definition of the SNR, since it requires knowing the contribution of the fetal ECG signal and the noise. Since our signals are synthetic, this information is available.

#### *2.6.2. Mean square error (MSE) and root mean square error (RMSE)*

The primary statistical measure used is a mean or a squared prediction error function. This evolved into widespread use of the mean squared prediction error as a performance measure, often shortened to simply the mean square error (MSE). It is a useful tool used for an evaluation of prediction, which reflects the degree of inaccuracy between an estimated and an original output described by:

$$MSE = \frac{1}{n} \sum\_{i=1}^{n} \left( \text{sig}\_{\text{rec}}(i) - \text{sig}\_{\text{org}}(i) \right)^{2},\tag{23}$$

where sigorg denotes the original signal (ideal fECG) and sigrec the signal recovered by the algorithm.

MSE is often replaced by RMSE defined by:

*2.5.3. Hybrid learning algorithm*

68 Advanced Biosignal Processing and Diagnostic Methods

**Figure 7.** Block diagram for the hybrid-learning algorithm.

extraction and Signal to noise ratio (SNR).

**2.6. Definition of the parameters**

*2.6.1. Signal to noise ratio (SNR)*

are as follows:

[46,47].

The hybrid learning algorithm in the ANFIS tunes the parameters of the Sugeno type FIS. It is a combination of the LMS and the Back-propagation Gradient Descent Algorithm (BPG). Each part of the hybrid algorithm is focused on a different part of the rule base in the ANFIS architecture. The premise (antecedent) parameters are adjusted by the BPG Algorithm and the consequent parameters are tuned by the LMS Algorithm. With respect to this distribution, the hybrid learning algorithm is divided into two passes, which are regularly repeated with every epoch. These passes are called "forward" and "backward" passes. **Figure 7** depicts the scheme of the hybrid learning algorithm. This hybrid algorithm converges much faster than the original pure back-propagation algorithm, as the latter reduces the search space dimensions

The measurement of the quality of the fECG extraction procedures is based on the absence of noise and the degree of similarity between the recovered fECG signals and the ideal fECG signals, where the main parameters can be helpful to control the effectiveness of the fECG

The relation between signal and noise is described by the SNR. To evaluate the filtering quality by the SNR, it is essential to calculate this ratio before and after filtering. The SNR before filtering is labeled SNRIN and the SNR after filtrating is labeled SNROUT. Based on SNRIN and SNROUT, it is possible to track the improvement of the SNR after filtering. Their expressions

IN 10 10 1 2

æ ö é ù ç ÷ ë û = ×

å

*N i*

*N i*


sig ( ) SNR 10 log log ,

1 2 org 1

*i i i*

<sup>å</sup> (21)

sig ( ) s )ig (

noise org 1

é ù - è ø ë û

$$RMSE = \frac{1}{n} \sqrt{\sum\_{i=1}^{n} \left( \text{sig}\_{nc}(i) - \text{sig}\_{\text{og}}(i) \right)^{2}}. \tag{24}$$

where sigorg denotes the original signal (ideal fECG) and sigrec the signal recovered by the algorithm.

RMSE is a measure of the differences between values predicted by a model or an estimator and the values observed. The closer this value is to zero the more accurate is the system.

#### **2.7. Generation of test data form experiments**

To objectively assess the results of fECG signal extraction approaches by using the quality metrics defined above (SNR, RMSE, and others), knowledge of the reference signals (mECG and ideal fECG) is essential. That is not possible in case of the clinical (real) data (as the reference fECG signal is missing). On the other hand, most commonly used synthetic data are often too idealized and do not include the influence of the nonlinear environment of the human body. That is the reason why most fECG signal extraction methods, which are considered successful when tested with idealized synthetic data do not produce useful results when tested with clinical (real) data.

Acknowledging the limitations associated with idealized synthetic data used in testing fECG signal processing algorithms, we took advantage of our novel fECG signal generator [7,8] to generate clinically realistic data [42] for our experiments. Our fECG signal generator is unique in many respects. It is designed to simulate the fetal heart activity while special attention is given to the fetal heart development in relation to the fetus' anatomy, physiology, and pathology. The noninvasive signal generator enables many parameters to be set, including Fetal Heart Rate (fHR), Maternal Heart Rate (mHR), Gestational Age, fECG interferences (biological and technical artifacts), as well as other fECG signal characteristics. Furthermore, based on the change in the fHR and in the T wave-to-QRS complex ratio (T/QRS), the generator enables manifestations of hypoxic states (hypoxemia, hypoxia, and asphyxia) to be monitored while complying with clinical recommendations for classifications in cardiotocography (CTG) and fECG ST segment analysis (STAN).

As described in detail elsewhere [7,8], the generator can produce realistic synthetic signals (identical to those acquired in clinical practice) with pre-defined properties for as many input as desired (n), see **Figure 5**. Such signals are well suited to the testing of existing and new methods of fECG processing [22,23,42].

The experiments were realized with six inputs, i.e., four channel combinations (TE2 ↔ BA1; TE2 ↔ BA2; TE2 ↔ BA3; TE1 ↔ BA4), which were processed collaterally by four independent adaptive systems.

For all the analyzed methods, the same starting parameters were selected according to clinical recommendations for CTG and STAN evaluations [42] as follows:


**Figure 8.** (a) Ideal fECG signal modelled by generator, (b) noisy fECG recordings modelled by generator.

To implement the required computational complexity, all experiments were performed by using a Personal Computer (PC) with a 3 GHz quad-core processor and 4 GB of RAM, please see Ref. [6]. **Figure 8a** shows the waveforms of the ideal and (**Figure 8b**) noisy fECG signals for the channel combination TE1 ↔ BA1, which were generated using the software-controlled generator.
