Generalized recursive algorithm for fetal electrocardiogram isolation from non-invasive maternal electrocardiogram

ABSTRACT


INTRODUCTION
The fetal electrocardiogram (ECG) measures the fetus heart electrical activity and shows the pattern of the heartbeats.Monitoring the heart rate is a way to assess fetus well-being as it contains important information on the state of the fetus [1], [2].The usual common methods to diagnose the fetus state can be invasive or non-invasive.In the invasive method, the recordings are gathered by positioning the electrodes directly on the fetus scalp during delivery, but this method is inconvenient and uncomfortable [3].In the noninvasive monitoring method, the fetus ECG can be captured from the mother's abdomen.It is characterized by the higher mother ECG amplitude with respect to the mixed and weak fetal ECG signal, hence the necessity to separate them [4], [5].
Several methods have been used to isolate the fetal ECG from maternal ECG recordings; numerous methods use a multimodal approach in which the ECG recordings are used in addition to the phonocardiography (PCG), based on the recording of the fetal heart sounds and murmurs [6], fetal magnetocardiography (fMCG), where the natural magnetic signals coming from the fetal heart rhythm are 6313 recording [7] or fetal pulsed-wave doppler (PWD) [8].Other works have been based only on maternal ECG recordings for non-invasive methods [9].Several methodologies have been suggested for the isolation and retrieving of sources via the multichannel mother ECG recordings method or by the single mother abdomen ECG signal method.The multichannel method consists on the separation of fetal ECG (FECG) from numerous abdominal mother ECG (MECG) registrations; Tavoosi et al. [10] proposed a combination of two blind sources separation (BSS) algorithms, fast independent component analysis (FastICA) and time-frequency BSS to separate the FECG after estimating the source signals from recorded signals.A deep learning approach has been used in [11] by removing the MECG as the first step, then by denoising the multichannel FECG.Another multichannel method has been presented in [12], in which the authors proceed in two steps, the preprocessing is used preliminarily before the classification step.The spectrogram, which is obtained in the preprocessing step by using the short-time Fourier transform, is transferred to a 2D convolutional neural network (CNN) to be classified.
The objective of the single channel method is using only one recording of abdominal MECG (aMECG) in order to have the FECG separated.The method suggested in [13] consists on the simultaneous extraction of MECG and FECG, applying the Dual-path source separation architecture (DPSS).They first proceeded on denoising the abdominal MECG signals with a generative dual-path long short-term memory (DP-LSTM) network, then they combined FECG and MECG components to obtain the masking maps through a series of (DP-LSTM) maps, and they applied these masking maps on the abdominal ECG recording as the last step to differentiate between the MECG and FECG signals.The end-to-end deep learning network using W-net was adopted in [14] to obtain the FECG, using an actual abdominal MECG recording.A combination of several methods was used in [15], in which independent component analysis (ICA), convolutional neural network (CNN) and singular value decomposition (SVD) have been associated in order to sort the FECG from a single aMECG recording.
In addition to those methods adopted to get the FECG from MECG, adaptive filter algorithms were also used in several other works.The recursive least squares (RLS) and least mean squares (LMS) have been combined with a single reference generation block to obtain an input mode adaptive filter (IMAF) and output mode adaptive filter (OMAF) in [16], where the aMECG serves as the IMAF's input, whereas the signal generated by the BSS block represents the input of the OMAF according to the location of the MECG.Barnova et al. [17] combined ICA, RLS and ensemble empirical mode decomposition (EEMD) to extract the FECG; they proceeded in several steps, initially they used ICA to decompose the aMECG, only two signals with three ICA components were used for the rest of the training; the MECG was the first component, followed by the FECG, mixed with a weak MECG.These two signals served as the RLS system input, and in order to enhance the separation of the FECG, they applied the EEMD method as the final block system.The method proposed in [18] is composed of two stages, the neuro-fuzzy inference system (ANFIS) was applied to get the reference of the adaptive noise canceler (ANC) from the aMECG as the first stage; to extract the fetal ECG, the parallel sub-filter (PSF) was proposed as the last stage.This work suggests a novel adaptive algorithm, which is referred to as the generalized recursive algorithm (GRA) built on minimizing a measure of the accumulated and of any kth power of the absolute observed error.This algorithm was applied to get the FECG, exploiting the abdominal and thoracic mother's ECG.

THE PROPOSED METHOD
The proposed GRA algorithm is developed according to the diagram in Figure 1.This approach necessitates two sources d(n), and x(n), the primary signal is the maternal abdominal ECG (aECG) recording, containing the mixed maternal and fetal ECGs and a secondary ECG signal, namely the reference signal captured at the mother's chest.Within the primary signal, the dominant signal is the MECG.These two signals, the maternal ECG and fetal ECG, are uncorrelated.Figure 1 represents the basic GRA system where the input () is of length l and the output is given by the error (), w is the filter weights vector and is of length l.The proposed algorithm aims at minimizing a cost function based on any power k of (), not only the squared or even powers of the error signal as in [16], [19], [20] respectively.In (2), the exponential weighting factor is a constant that is near and less than one, i and n are positive integers and k is any positive integer.The optimum weights vector for the cost function with respect to  is deduced from the (3). (2) where (), () are vectors containing the L most recent vectors of the input signals  and , and   is the gradient with respect to w.The next step is to take the binomial expansion of (e(i)) k−1 , and take the following approximation [21]: This leads to: Denoting the two sub-expressions in (5) as () and () respectively we obtain: and .
In order to get the minimum of the cost function (2), we equate (6) with zero, and we obtain the optimal value of (), noted  ̂(n), given by (7).

DATA AND PREPROCESSING
Knowing that ECG is a very low power electrical signal, special care must be taken to eliminate the undesired noise contained in the acquired raw data, taking into account that the characteristics of the original signal must be preserved.This section describes the preprocessing steps used to provide useful data for the proposed algorithm.Two kinds of signals, synthetic and real ECG signals, were used in this paper in order to assess the performance of our method.The synthetic signals and actual ECG have been used for quantitative and qualitative analysis, respectively.

Data
This project is based on obtaining a hidden FECG, which cannot be directly recorded using electronic equipment, from a non-invasive MECG.To analyze the performance of our method, we first used some synthetic ECG signals.This type of signal allows a quantitative measurement unlike actual ECG signals.Thus, in order to assess our method, we have used both synthetic and real ECGs.The synthetic ECG signals were analyzed in the MATLAB environment [23].We have used three synthetic 10 seconds long signals, among which the first one was characterized by a heartbeat of 90 beats/min and a 4 kHz sample rate.The two other signals were synthesized to exhibit 85 and 80 beats/min with 3.78 and 3.51 kHz sample rate respectively.A baseline wandering (BW) sine wave signal was added to those signals to simulate the low frequencies respiration artifacts of low frequencies between 0.15 and 0.31 Hz.Additive gaussian white noise was also included in these synthetic signals.Figures 2(a) to 2(d) give an illustration of one of the simulated non-invasive FECGs, synthetic FECG, a synthetic MECG, a synthetic noisy ECG, and a synthetic aMECG, respectively.The other used example of synthetic signals was taken from the PhysioNet fetal ECG Synthetic database [24].Figure 3 illustrates simulated non-invasive adult fetal ECG (NI-FECG) signals Sub01_Snr00db_I4_C0, where Figures 3(a)-(d), illustrate the simulated FECG, the simulated MECG and the synthetic noise, and the synthetic aMECG, respectively.The real ECG signals utilized in this paper were taken from the DaISy real database [25] and the PhysioNet real database [24].The signals from the DaISy Database were recorded from a pregnant woman during a 10 second period.The recordings from the PhysioNet Noninvasive Real ECG Database were obtained from a set of 55 multichannel abdominal electrocardiograms, these were recorded during the last 19 weeks of pregnancy from a single subject.Those signals contain 2 thoracic and 4 abdominal signals.The bandwidth is 1 to 150 Hz; the sampling frequency is 1 kHz [25] with a 16-bit resolution.The thoracic and the abdominal real ECG signals, the 6 th and 8 th signals using the DaISy database, and the data of the 102ecga in the PhysioNet Database are illustrated on Figures 4 and 5 respectively.Where Figures 4(a

Preprocessing
Using the DWT step method [26], the first step of our procedure consists of denoising and removing the BW from the processed ECG signals.This is performed by decomposing the signals using a wavelet decomposition to a certain level L. The BW is detected by an approximation of the coefficients an(L) produced by this decomposition.These approximations are then replaced by zero to remove the undesirable BW.To remove the noise up to a level M (M<L), to each of the detail coefficients dn(i) (i=1 to M) an appropriate threshold level is applied.Finally, to obtain a BW free denoised signal zeroing approximations are applied up to level L, the first M levels of the corrected details, and the last unchanged details from M+1 to the L level.Figures 6(a

RESULTS AND EVALUATION
The assessment of the suggested ECG separation method was improved using some data preprocessing.In order to eliminate the BW and the noise, the one-step DWT method has been applied to significantly improve the results.The performance of the suggested method was tested by employing artificial tested ECG signals together with real recordings from the DaISy and the PhysioNet databases described in section 3.
Figures 9(a) to 9(c) illustrate the aMECG signal, the original synthetic FECG and the separation result of the synthetic corrected aMECG by the proposed GRA method, respectively.In comparison with the original synthetic FECG in Figure 9(c), we can see that our adaptive method is efficient enough to decrease the MECG and was able to extract the FECG even when the two QRS of the FECG and MECG are superposed as shown in Figure 9 by the zooming circles.Figures 10(a  increased.Furthermore, the results of the separation in Figure 12 show that the fetal peaks are well sorted using the GRA method: the mother's peaks are significantly lower than those of the fetus.We can notice that the results of the separation of the fetal peaks in Figure 12 are better than those shown in Figure 11.This fact is due to the shape of the reference input compared to the primary input.Therefore, and in order to improve the results of our adaptive filter, we must have a similar shape of the mother ECG peaks for both of the reference and primary signals, a synchronization between these two signals is also required.
To validate the results and evaluate the separation quality after filtering, a visual inspection is insufficient.This can be enhanced by a quantitative evaluation.For the initial testing and assessment for the proposed algorithm, simulated data were used to evaluate the extraction performance, from an original fetal ECG.This approach is common in Biomedical engineering, where a non-invasive technique is based on placing electrode on the mother abdomen in order to record the ECG signal.In this work, we have used the three following statistical parameters:

Signal to noise ratio (SNR)
The signal to noise ratio (SNR) is the acronym for signal to noise ratio is a common parameter used for comparing the desired signal level to the noise signal level.This parameter could be used for synthetic signals since the actual FECG is inexistent.This is defined in (14), where   is the reference signal of an ideal fetal ECG, and   is the recovered fetal ECG by the adaptive filter:

Relative root mean square error (RRMSE)
The relative root mean square error known as RRMSE is calculated by the root square of the mean square error, defined as (15).
A smaller value of this parameter corresponds to a better filter performance.

Correlation coefficient
The correlation coefficient  is computed using (16).
Where again   is the reference signal of an ideal FECG, and   is the recovered FECG using the adaptive filter.This parameter is between -1 and +1, a positive value indicates a strong connection in a direct way, a negative value indicates a strong relationship in an inverse way and a value near zero indicates a very weak linear relationship.The proposed GRA method, described in Table 1 and applied to the FECG separation, has been carried out with the normalized least mean square (NLMS) algorithm [27].Figure 13 and Table 2 illustrate the obtained results.Quantitative evaluations were conducted using samples 500 to 2,500 of the sub01_snr00dB_I4_c0 signal taken from the PhysioNet Synthetic database.The length of the filter was changed progressively from 10 to 256 with steps of length 20.The parameters used in GRA are as follows, j=3, δ = 10 −09 , λ = 1, the number of iterations= 300.The NLMS parameters used in ( 16) and ( 17) are as follows, α = 0.01, γ = 0.001, where the first signal is the maternal abdominal ECG, and () the second signal designated by the maternal thoracic ECG:  A comparison of the two SNRs is illustrated in Figure 13, where we can see that increasing the GRA filter length results in an increase of the positive GRA SNR, whereas increasing the NLMS filter length the

6321
NLMS SNR fluctuates between negative values.We used the correlation coefficient r between the true and reconstructed FECG as a quantitative parameter for further evaluation.A synthetic signal is used because the true FECG does not actually exist in non-invasive methods.The sub09_snr06dB_l1_c1 signal from the PhysioNet database was used for that purpose.Figure 14 shows the correlation coefficient values for different SNR levels for both the NLMS and the proposed GRA methods.We found that the best values for the NLMS approach start at 20 dB and do not exceed 0.58, whereas our method shows much better values going beyond 0.94 for the same interval of the SNR levels.
The other parameters we used in this paper are the correlation coefficient and the RMSE.These are widely used in biomedical engineering.These two parameters were calculated for both the GRA and NLMS algorithms, for different filter lengths.The results are presented in Table 2.It clearly indicates the robustness of the GRA, where the correlation coefficient is equal to 0.98.This demonstrates a major enhancement over the NLMS, where the correlation coefficient fluctuates between 0.007 and 0.015.For the RMSE evaluation shown in Table 2, we can notice that the GRA RMSE parameter is highly improved compared to the NLMS.

Figure 14. Coefficient correlation variation between true and isolated FECG
To further assess the suggested algorithm and particularly for the detection of an actual fetal ECG peak from real recordings, three parameters were used, the sensitivity (  ), the accuracy (  ) and the positive predictive value (  ); as described in (18).In ( 18) TP stands for true positive, this corresponds to the correctly identified FECG, FP is for false positive i.e., the incorrectly detected FECG identified as a MECG and FN defines the false negative which represents an undetected FECG.
The results of this metrics evaluation are illustrated in Table 3.The assessment has been carried out for both the PhysioNet and DaISy databases, where the eliminated MECG has been considered as nondetected mother peaks.Regarding the calculation of FP, the incorrectly detected fetal peaks are due to the mother and fetal ECG.For a further assessment, we extend our evaluation to the one-way analysis of the variance test (ANOVA) [28].To evaluate the averages of the adaptive filters, the ANOVA test was used, for both RMSE and correlation coefficient parameters.The ANOVA test result for RMSE is F=1274609.29 which is much higher than the critic value F=4.26 and P=3. 1 10 -58 is very low compared to alpha=0.05.For the correlation coefficient F=1025624 which is also much higher than the critic value F=4.26 and P=4.34 10 -57 is very low compared to alpha=0.05 for both the GRA and NLMS, which means that the null statistical difference between GRA and NLMS exists, and the null hypothesis state is rejected.

CONCLUSION
In this paper, an adaptive algorithm was used to isolate the FECG through a non-invasive aMECG abdominal using the thoracic maternal ECG as the reference signal.This new method is based on a generalized version of the recursive algorithm.The efficiency of the suggested GRA method is presented.Updates of the adaptive filter's weight vector, use a cost function constructed on any power of the error.The simulation results indicate that the suggested method outperforms the NLMS algorithm.

Figure 1 .
Figure 1.Model of the GRA algorithm ) and 4(b) represent the abdomen and thoracic data from the DaISy database, Figures 5(a) and 5(b) show the abdomen and thoracic signals from the PhysioNet database. ISSN: 2088-8708 Int J Elec & Comp Eng, Vol. 13, No. 6, December 2023: 6312-6323 6316 ) and 6(b) include the preprocessing synthetic abdominal data results, where the BW and the noise are suppressed, giving the corrected data.Figures 7(a), 7(b), 8(a), and 8(b) show the BW and noise suppression result by the one-step DWT method in the preprocessing of the real abdominal and thoracic ECG from the DaISy and PhysioNet databases.
Figure 10(a)  shows a zoomed fetal ECG as a part of the abdominal maternal ECG.In spite of the weakness of the FECG peaks in comparison with the maternal ECG peaks, the fetal peaks have been totally separated from the abdominal maternal signal by our adaptive method.The real recording signals from the PhysioNet and DaISy databases were separated by the GRA as shown in Figure11and 12 respectively.Figures 11(a) to 11(c) provide the thoracic, the abdominal and separated real recordings ECG from PhysioNet.Figures 12(a) to 12(c) provide the thoracic, the abdominal and the separated real recordings ECG from Daisy.We can see from Figure 11 some deterioration of the mother peaks after the separation by the GRA, but they are considerably reduced, whereas the fetal peaks are  ISSN: 2088-8708 Int J Elec & Comp Eng, Vol. 13, No. 6, December 2023: 6312-6323 6318

Table 2 .
The RMSE and the coefficient correlation variations for the: NLMS, GRA adaptative filters with the synthetic signal