Sequential Total Variation Denoising for the Extraction of Fetal ECG from Single-Channel Maternal Abdominal ECG

Fetal heart rate (FHR) is an important determinant of fetal health. Cardiotocography (CTG) is widely used for measuring the FHR in the clinical field. However, fetal movement and blood flow through the maternal blood vessels can critically influence Doppler ultrasound signals. Moreover, CTG is not suitable for long-term monitoring. Therefore, researchers have been developing algorithms to estimate the FHR using electrocardiograms (ECGs) from the abdomen of pregnant women. However, separating the weak fetal ECG signal from the abdominal ECG signal is a challenging problem. In this paper, we propose a method for estimating the FHR using sequential total variation denoising and compare its performance with that of other single-channel fetal ECG extraction methods via simulation using the Fetal ECG Synthetic Database (FECGSYNDB). Moreover, we used real data from PhysioNet fetal ECG databases for the evaluation of the algorithm performance. The R-peak detection rate is calculated to evaluate the performance of our algorithm. Our approach could not only separate the fetal ECG signals from the abdominal ECG signals but also accurately estimate the FHR.


Introduction
Identification of fetal distress is important in fetal monitoring during pregnancy. A noninvasive fetal monitoring method for measuring the fetal heart rate (FHR) is essential to assess the health of a fetus [1]. Cardiotocography (CTG) and fetal electrocardiogram (ECG) are common methods for monitoring the FHR [2]. The Doppler ultrasonic technique measures the FHR from the fetal heart activity using the Doppler effect. However, fetal movements and the blood flow through the maternal blood vessels always influence the Doppler ultrasound signal [3]. As the ultrasound signal includes these influences, the R-peak detection of the FHR becomes very challenging. Moreover, the mother should maintain a reclining position for one hour while the FHR data is being collected. Therefore, this approach is not suitable for long term continuous monitoring [4].
Various techniques have been proposed to extract the fetal ECG from the abdominal ECG signals of pregnant women [5][6][7]. Long-term monitoring is possible using these techniques; currently, independent component analysis (ICA) and principle component analysis (PCA) has been applied to the maternal ECG signal from the abdomen to extract the fetal ECG [7]. However, multichannel data are required for the ICA. If the number of ECG signals from the maternal abdomen is insufficient, the pure fetal ECG signals cannot be extracted using ICA [8].
On the other hand, various FHR estimation methods have been developed for single-channel data in several studies [9][10][11][12]. The template subtraction (TS) method, in particular, was commonly used for Sensors 2016, 16 removing the maternal ECG components and extracting the fetal ECG [9,10]. However, the residual signal after removing the maternal ECG is still affected by several artifacts. This makes it difficult to find the exact location of the fetal ECG R-peaks using the TS method. The extended Kalman filter (EKF) framework has shown good performance for the extraction of the FHR [11][12][13][14]; it focuses on the cancellation of the maternal ECG. However, this method cannot extract the R-peak of the fetal ECG if the residual signal after eliminating the maternal ECG has a low-amplitude fetal ECG. Furthermore, when the QRS complexes of the maternal ECG and fetal ECG overlap, the residual signal can lose the QRS-complex segment of the fetal ECG. Therefore, the EKF framework may miss the detection of the fetal R-peak. Another estimation method is the wavelet-based approach [15]. Wavelet analysis is a time-frequency decomposition approach that can simultaneously eliminate the baseline and the high-frequency noises from the abdominal ECG and then, efficiently detect the fetal R-peaks from the filtered abdominal ECG. Although the wavelet-based approach also shows satisfactory results, the R-peak of the fetal ECG cannot be detected from the noisy residual signals after cancelling the maternal ECG.
Recently, sparse representations for signal processing have been studied for noise reduction [16,17]. Total variation denoising (TVD) has been widely used to reduce noise in image processing [18]. This approach can preserve the sharp edges of the underlying signal. Recently, Ning et al. proposed sparse derivative denoising for ECG enhancement using TVD [19]. This method can be used as a preprocessing stage for ECG analysis.
In this paper, we propose a method for measuring the FHR from the single-channel abdominal ECG signal of a pregnant woman using sequential TVD (STVD). To extract the fetal ECG, we established an abdominal ECG model and then, TVD [18] was applied twice, sequentially. Recent advanced research provided a standard methodology for benchmarking of fetal ECG extraction methods [20,21]. We followed the testing methodology to evaluate our proposed method. The remainder of this paper is organized as follows. In Section 2, the proposed STVD algorithm is described. In Section 3, we compare the performance of this method with those of three other single-channel fetal-ECG-extraction methods including the EKF and TS PCA using simulation signals and real signals from medical databases [22]. To prove the importance of the second TVD step, a method in which TVD is applied only once to extract the fetal ECG, i.e., a combining TVD and TS PCA (TVD + TS PCA ) is also compared with the proposed method. Finally, a discussion about the results of our proposed method and the conclusions are presented in Section 4.

Preprocessing
The abdominal ECG signal is usually contaminated by baseline wandering, electromyogram (EMG) noise, and power-line noise. We applied a third-order Butterworth band-pass filter with 3-Hz and 90-Hz cutoff frequencies to remove both the baseline wandering and EMG noise [10]. A 50 or 60-Hz notch filter was used to eliminate the power-line noise [10].

Proposed Method: Sequential TVD with TS PCA
The proposed algorithm consists of three steps. First, the abdominal ECG is filtered using TVD. Then, the maternal ECG is extracted from the abdominal ECG using the TS PCA method. Finally, TVD is applied again as a cascaded process to the residual signal for estimating the fetal ECG. Figure 1 briefly illustrates the processes in our proposed algorithm.   y x e (1) where the vector x is a clean abdominal signal of length N and 1 e is the residual noise. 1 y is the contaminated measurement of x . The clean abdominal signal x is given by: where the vectors MECG x and FECG x with N time points represent the maternal ECG and fetal ECG signals, respectively. x can be extracted using the TVD problem as follows: where n  is the ℓ n (n = 1, 2) norm in ℝ N (N: data length), the regularization parameter λ1 > 0, and 2 D is the second-order difference matrix. As the ECG can be approximated by piecewise linear function [18], 2 D makes the signal sparser. By increasing λ1, more weight is given to the second term that measures the fluctuation of the signal x . The second-order difference matrix is given by: In general, 2 D is a Toeplitz matrix of size To extract a clean abdominal ECG, Equation (3) must be solved. However, this optimization problem cannot be solved explicitly. The Majorization-Minimization (MM) algorithm is a method for finding the solution to the optimization problem [23]. A convex function ) (x Q was minimized using iteration as follows: arg min ( 0, 1,2 ) , should be a majorizer of The maternal abdominal ECG signal y 1 is given by: where the vector x is a clean abdominal signal of length N and e 1 is the residual noise. y 1 is the contaminated measurement of x. The clean abdominal signal x is given by: x " x MECG`xFECG (2) where the vectors x MECG and x FECG with N time points represent the maternal ECG and fetal ECG signals, respectively. x can be extracted using the TVD problem as follows: x˚" argmin where ||¨|| n is the n (n = 1, 2) norm in R N (N: data length), the regularization parameter λ 1 > 0, and D 2 is the second-order difference matrix. As the ECG can be approximated by piecewise linear function [18], D 2 makes the signal sparser. By increasing λ 1 , more weight is given to the second term that measures the fluctuation of the signal x. The second-order difference matrix is given by: In general, D 2 is a Toeplitz matrix of size pN´2qˆN.
L i pxq should be a majorizer of Qpxq, that is, and L i pxq should satisfy Qpxq at x i , where L i pxq and Qpx i q are a convex function. x i converged to the minimizer of Qpx i q by the MM algorithm. When L i px i q coincide with Qpx i q at x i , x i`1 can be obtained by the minimizing L i pxq using the MM approach. Finally, we can solve the minimization problem. The MM algorithm is briefly summarized as follows: Set x i`1 as the minimizer of L i pxq, 4.
Set i = i + 1 and go back to step 2.

TS PCA : Elimination of Maternal ECG
Several TS methods were implemented for the extraction of fetal ECG. Locating the maternal QRS complexes is necessary to remove the maternal ECG using TS. In this study, TS PCA method was used since this showed better performance than other TS methods in the previous study [10,19]. TS PCA is described in the TS PCA section (see Section 2.3.3).

Second TVD: Extracting Fetal ECG
After removing the maternal ECG segments from the abdominal ECG, we can obtain the fetal ECG signal from the residual signal. However, the fetal ECG signal will still contain the maternal ECG and noise components. Hence, additional TVD is applied to the residual signal to enhance the fetal ECG signal as shown below: xF ECG " argmin x FECG 1 2 ||y 2´xFECG || 2`λ 2 ||D 2 x FECG || 1 (10) where the vector e 2 represents the residual artifacts including remains of the maternal ECG and noise. The same optimization process, which uses the MM approach to solve the TVD problem, is repeated. Finally, the fetal ECG R-peaks are detected from the final estimated fetal ECG.

Extended Kalman Filter
The EKF is the nonlinear version of the standard Kalman filter. When we consider a discrete-time nonlinear system with the state vector p k and measurement vector q k at time instant k, this model is written with nonlinear functions f p¨q and hp¨q: where the random variables w k and v k correspond to the process and measurement noises vectors, related to the process noise covariance Q and measurement noise covariance R, respectively. In this paper, we used a synthetic dynamic ECG model [24] to extract fetal ECG from the abdominal ECG [11][12][13][14]. One heartbeat ECG cycle is generally represented by the letters P, Q, R, S, and T. We used five Gaussian functions to establish one ECG signal model defined by peak amplitude (α i ), width (b i ), and each center of Gaussian function (ξ i ) with respect to the PQRST sub-waveform [13]. The index i represents the number of Gaussian function. p k is defined by θ k and z k : p k " rθ k , z k s T , where θ k and z k are phase and amplitude of the maternal ECG at time instant k. The state equation can describe the ECG nonlinear dynamics such as the PQRST morphology by assuming a small sampling period δ and w k " r0, η k s T as follows: where η k is a random additive noise. Here, the phase θ k is used as an additional observation [13]. The R-peak of ECG is set to be located at θ k " 0, and the ECG segments between two consecutive R-peaks are assumed to have a phase between 0 and 2π [13]. Consequentially, the observed phase represents the observed amplitude. The maternal ECGs can be estimated by consecutive EKF steps. The first EKF extracts the maternal ECG from the abdominal ECG. After subtracting the maternal ECG from the abdominal ECG, the second EKF estimate fetal ECG from the residual signal.

TVD + TS PCA
The process of the TVD + TS PCA is similar to the STVD method. This approach first filters the abdominal ECG signal using TVD and then applies TS PCA to filtered abdominal ECG signal to eliminate the maternal ECG. After applying TS PCA , fetal R-peak detection is performed on the residual signal. In the TVD + TS PCA , λ was set to the same value as the λ 1 in the STVD approach.

TS PCA
TS PCA was introduced by Kanjilal et al. [25]. The design matrix X was built with several rows in which each row corresponds to one maternal ECG cycle with all R-peaks lying at the same column as follows: where m and n represents the number of maternal ECG cycles and sample sizes. The principle components (PCs) of X can be obtained using singular value decomposition. The PCs related to maternal ECG can be subtracted from the overall cycles as follows: where p is the number of PCs and w j is the direction vector of the j-th PC. The residual signal X r is then the fetal ECG. This method needs to update the design matrix.

Data
There is no standard tool for the evaluation of the single-channel fetal ECG recording [11]; simulations are required to provide quantitative assessments for the proposed method. The fecgsyn, a non-invasive fetal ECG model simulator [26], can generate several types of maternal and fetal ECG mixed signals. Recently, Andreotti et al. developed the Fetal ECG Synthetic Database (FECGSYNDB) using the fecgsyn for benchmarking of fetal ECG extraction and detection algorithms [20]. This database includes 1750 realistic simulated abdominal ECG signal with 34 channels (2 channels: maternal ECG, Sensors 2016, 16, 1020 6 of 15 32 channels: abdominal ECG), generated at a 250 Hz sampling frequency for 5 min. The simulation signals were divided into seven cases with five signal-to-noise ratio (SNR) levels (0, 3, 6, 9 and 12 dB) and 10 different maternal and fetal heart dipole's arrangements. Each simulation signal was generated five times for statistical purposes. Table 1 represents several cases of simulation signal. A recent work selected 8 channels (1,8,11,14,19,22,25 and 32) among 34 channels for evaluating algorithms [20]. We also used the same channels.  Figure 2a shows the simulated maternal ECG. The fetal ECG was also constructed using the simulator (Figure 2b). The simulated fetal ECG was added to the simulated maternal ECG along with motion and EMG artifacts produced by the simulator to generate the final simulated signal (Figure 2c). To verify the efficiency of the proposed method on real data, we used PhysioNet fetal ECG databases with varying SNRs [10,21]. The database is the 2013 PhysioNet/Computing in Cardiology Challenge Database (PCDB) [22]. PCDB consisted of three data sets (set-a, set-b and set-c). We used set-a for the assessment of extraction algorithms since reference fetal QRS locations were offered. This database contained 1-min abdominal ECGs from four abdominal ECG channels at 1000 Hz. This database includes 75 datasets. However, records a33, a38, a47, a52, a54, a71, and a74 have inaccurate fetal QRS annotations. Therefore, we excluded these data and used a total of 68 datasets.
Sensors 2016, 16, 1020 6 of 14 using the fecgsyn for benchmarking of fetal ECG extraction and detection algorithms [20]. This database includes 1750 realistic simulated abdominal ECG signal with 34 channels (2 channels: maternal ECG, 32 channels: abdominal ECG), generated at a 250 Hz sampling frequency for 5 min. The simulation signals were divided into seven cases with five signal-to-noise ratio (SNR) levels (0, 3, 6, 9 and 12 dB) and 10 different maternal and fetal heart dipole's arrangements. Each simulation signal was generated five times for statistical purposes. Table 1 represents several cases of simulation signal. A recent work selected 8 channels (1,8,11,14,19,22,25 and 32) among 34 channels for evaluating algorithms [20]. We also used the same channels.  Figure 2a shows the simulated maternal ECG. The fetal ECG was also constructed using the simulator (Figure 2b). The simulated fetal ECG was added to the simulated maternal ECG along with motion and EMG artifacts produced by the simulator to generate the final simulated signal (Figure 2c). To verify the efficiency of the proposed method on real data, we used PhysioNet fetal ECG databases with varying SNRs [10,21]. The database is the 2013 PhysioNet/Computing in Cardiology Challenge Database (PCDB) [22]. PCDB consisted of three data sets (set-a, set-b and set-c). We used set-a for the assessment of extraction algorithms since reference fetal QRS locations were offered. This database contained 1-min abdominal ECGs from four abdominal ECG channels at 1000 Hz. This database includes 75 datasets. However, records a33, a38, a47, a52, a54, a71, and a74 have inaccurate fetal QRS annotations. Therefore, we excluded these data and used a total of 68 datasets.  For the best channel selection, we used beat comparison measure (BCM) in each database [10]. BCM scans the maternal QRS position already removed along the residual signal, and then selects the channel in which the amplitudes of maternal QRS segments are the lowest. After selecting the best channel, the extraction fetal ECG procedure was performed. When EKF and TS PCA were applied for the extraction of fetal ECG, we used open-source code in the FECGSYN toolbox [26].

Evaluation and Detection of Fetal ECG R-Peak
To analyze the simulation results, we detected the fetal ECG R-peaks to compare the four techniques according to the sensitivity (Se), positive predictive value (PPV) and the F 1 -measure. The formulae for Se, PPV, and F 1 are as follows [20]: PPV " TP TP`FP (16) where TP, FP, and FN denote the true positive rate, false positive rate, and false negative rate, respectively. TP indicates that true fetal ECG R-peaks were detected. FP indicates that an artifact was detected as a true fetal ECG R-peak, while FN indicates false R-peak misdetection. In addition, Se indicates the ability to detect the R-peak, and PPV provides the probability that the true fetal ECG R-peaks are detected. F 1 indicates the overall probability that the fetal ECG R-peaks are detected correctly. The acceptance interval between detection and reference location of fetal R-peak was defined to be˘50 ms [10,20]. For fetal R-peak detection, many detection algorithms were offered as open-sources. Since the detection performance varies depending on algorithms, we selected the adapted version of the Pan and Tompkins algorithm which is commonly used for ECG R-peak detection [10,20]. The FECGSYN toolbox also includes this source code. Moreover, the mean absolute error (MAE) of the absolute time difference between the reference fetal R-peak location and detected fetal R-peak location was calculated to compare the four methods-STVD, EKF, TVD + TS PCA , and TS PCA , in diverse situations. MAE is expressed as: where a i andâ i are the reference R-peak time location and detected R-peak time location. N TP is the total number of TP.

Parameter Optimization
Grid search was performed to find optimal parameters for STVD and EKF. On the other hand, we chose the number of maternal ECG cycles with the highest F 1 to build the maternal ECG template for TS PCA . Figure 3 shows heat map and performance change with different numbers of maternal ECG cycles for each database (simulation: FECGSYNDB, real data: set-a). In this study, we multiplied covariance matrix Q and R by their gains to obtain the best performance for EFK [10]. Two gains were denoted as G Q and G R , respectively. We found optimized G Q and G R values using grid search. In TS PCA case, the number of PCs and the number of maternal ECG cycles influence on the performance of TS PCA . When the number of PCs was set to 2, we got the best result for all databases. Therefore, we searched for only the optimal number of maternal ECG cycles. Table 2 illustrates optimal parameters Sensors 2016, 16, 1020 8 of 15 of each algorithm for different databases. For set-a, optimal parameters of EKF and TS PCA had the same values as previous work [10].

Simulation
Realistic simulated signals were used to assess the performance of the STVD method for comparison with the performances of the other methods. The extraction of the fetal ECG signals by several algorithms is shown in Figure 4. As shown in Figure 4, the fetal ECG signals extracted by TVD + TSPCA and TSPCA are still influenced by artifacts. That is, as TVD + TSPCA and TSPCA had considerable amounts of remaining noise, it was difficult to find the exact R-peak (see red boxes in Figure 4). Moreover, the EKF could not extract the R-peaks of the fetal ECG occasionally (see red circles in Figure 4). However, the STVD method could extract all R-peaks accurately in Figure 4. Tables 3 and 4 show various results for evaluating the performance of each algorithm. The STVD method performs much better than other three algorithms with higher F1 for all cases. Especially, STVD has the highest F1 in uterine contraction (case 3) and ectopic beats (case 4) cases. However, the MAE results of STVD are higher than EKF method (STVD: 3.9 ms, EKF: 3.8 ms).

Simulation
Realistic simulated signals were used to assess the performance of the STVD method for comparison with the performances of the other methods. The extraction of the fetal ECG signals by several algorithms is shown in Figure 4. As shown in Figure 4, the fetal ECG signals extracted by TVD + TS PCA and TS PCA are still influenced by artifacts. That is, as TVD + TS PCA and TS PCA had considerable amounts of remaining noise, it was difficult to find the exact R-peak (see red boxes in Figure 4). Moreover, the EKF could not extract the R-peaks of the fetal ECG occasionally (see red circles in Figure 4). However, the STVD method could extract all R-peaks accurately in Figure 4. Tables 3 and 4 show various results for evaluating the performance of each algorithm. The STVD method performs much better than other three algorithms with higher F 1 for all cases. Especially, STVD has the highest F 1 in uterine contraction (case 3) and ectopic beats (case 4) cases. However, the MAE results of STVD are higher than EKF method (STVD: 3.9 ms, EKF: 3.8 ms).   One case includes five box plots, one for each SNR level (0, 3, 6, 9, 12 dB); * indicates p < 0.05, and B is baseline. C0-C5 means 5 cases in Table 1.    Figure 5 shows results of F 1 after applying noninvasive fetal ECG extraction methods in various cases with different SNR levels. We used a Kruskal-Wallis test to identify a significant effect of the SNR [19]. In particular, this test was meant to determine whether there is a statistically significant difference of F 1 value according to different SNR levels. If p-values are smaller than 0.05, it means that the performance of extraction methods is influenced by SNR levels. As shown in Figure 5, EKF, TVD + TS PCA , and TS PCA are vulnerable to high noise levels (p < 0.05), while STVD shows significant noise robustness as in case 3, 4, and 5. Furthermore, we performed a post hoc analysis using Sign test for the assessment of paired differences between fetal ECG extraction methods (see Figure 6) [20]. Since the significant differences could not be identified, we excluded plots for SNR 9 and 12 dB in Figure 6. Figure 6 illustrates that results of STVD are significantly different from other methods for low SNR 0 and 3 dB (p < 0.05).

Figure 4.
Extracting fetal ECG from the simulated abdominal ECG signal using four different methods. EKF sometimes eliminates the R-peaks of fetal ECG (red circles). Considerable noise remains after the extraction of fetal ECG by TVD + TSPCA and TSPCA methods (red boxes).
Sensors 2016, 16, 1020 10 of 14 Figure 5 shows results of F1 after applying noninvasive fetal ECG extraction methods in various cases with different SNR levels. We used a Kruskal-Wallis test to identify a significant effect of the SNR [19]. In particular, this test was meant to determine whether there is a statistically significant difference of F1 value according to different SNR levels. If p-values are smaller than 0.05, it means that the performance of extraction methods is influenced by SNR levels. As shown in Figure 5, EKF, TVD + TSPCA, and TSPCA are vulnerable to high noise levels (p < 0.05), while STVD shows significant noise robustness as in case 3, 4, and 5. Furthermore, we performed a post hoc analysis using Sign test for the assessment of paired differences between fetal ECG extraction methods (see Figure 6) [20]. Since the significant differences could not be identified, we excluded plots for SNR 9 and 12 dB in Figure 6. Figure 6 illustrates that results of STVD are significantly different from other methods for low SNR 0 and 3 dB (p < 0.05). Figure 6. Results of the post hoc analysis using the Sign test over single-channel fetal ECG extraction methods. The post hoc analysis was performed regarding F1. Black square refers to significant differences (p < 0.05) and white means that there is no significant difference (p > 0.05). Results of SNR 9 and 12 dB are excluded because of no significant differences across methods.

PhysioNet Database
STVD was also applied to PhysioNet databases, and the estimated fetal ECG signals for set-a are shown in Figure 7. As shown in Figure 7c, the EKF might remove the fetal ECG from set-a dataset (see red circle). Moreover, the residual signals of the TVD + TSPCA and TSPCA methods are still influenced by artifacts (see Figure 7d,e). Meanwhile, we have confirmed from the set-a data that our proposed method can extract the fetal ECG accurately (see Figure 7b). Table 5 presents the results of the comparison of our proposed method with the other three methods for set-a. STVD presents higher F1 scores (F1: 89.9%) than the other methods (EKF: 81.1%, TVD + TSPCA: 87.4%, TSPCA: 86.7%). Moreover, this dataset generally has lower SNR; hence, TVD + TSPCA and TSPCA showed worse performances than STVD. In addition, the time-frequency presentation using the Stockwell-transform [27] in Figure 8 demonstrates that the EKF could extract the fetal ECG for set-a. However, we can confirm from Figure 8 that the EKF might detect incorrect fetal ECG R-peaks (see red arrows). Only the STVD could extract all the R-peaks of the fetal ECGs exactly in Figure 8. As can be observed in Figure 8, the spectral content of artifacts still remains in the fetal ECG signal extracted via TVD + TSPCA and TSPCA, while STVD could isolate the spectral contents in the fetal ECG. Figure 6. Results of the post hoc analysis using the Sign test over single-channel fetal ECG extraction methods. The post hoc analysis was performed regarding F 1 . Black square refers to significant differences (p < 0.05) and white means that there is no significant difference (p > 0.05). Results of SNR 9 and 12 dB are excluded because of no significant differences across methods.

PhysioNet Database
STVD was also applied to PhysioNet databases, and the estimated fetal ECG signals for set-a are shown in Figure 7. As shown in Figure 7c, the EKF might remove the fetal ECG from set-a dataset (see red circle). Moreover, the residual signals of the TVD + TS PCA and TS PCA methods are still influenced by artifacts (see Figure 7d,e). Meanwhile, we have confirmed from the set-a data that our proposed method can extract the fetal ECG accurately (see Figure 7b). Table 5 presents the results of the comparison of our proposed method with the other three methods for set-a. STVD presents higher F 1 scores (F 1 : 89.9%) than the other methods (EKF: 81.1%, TVD + TS PCA : 87.4%, TS PCA : 86.7%). Moreover, this dataset generally has lower SNR; hence, TVD + TS PCA and TS PCA showed worse performances than STVD. In addition, the time-frequency presentation using the Stockwell-transform [27] in Figure 8 demonstrates that the EKF could extract the fetal ECG for set-a. However, we can confirm from Figure 8 that the EKF might detect incorrect fetal ECG R-peaks (see red arrows). Only the STVD could extract all the R-peaks of the fetal ECGs exactly in Figure 8. As can be observed in Figure 8, the spectral content of artifacts still remains in the fetal ECG signal extracted via TVD + TS PCA and TS PCA , while STVD could isolate the spectral contents in the fetal ECG.      Total 68 datasets were used (record a33, a38, a47, a52, a54, a71, and a74 were excluded).

Discussion and Conclusions
In this paper, we proposed sequential total variation denoising (STVD) for fetal electrocardiogram (ECG) extraction from the abdominal ECGs of pregnant women. In this method, two total variation denoising (TVD) steps were used sequentially. The first TVD reduced the noise components of the abdominal ECG for effective cancellation of the maternal ECG by template subtraction (TS PCA ) and then the second TVD enhanced the fetal ECG component. The extended Kalman filter (EKF) framework [11][12][13][14], TS PCA [10], and combined TVD with TS PCA (TVD + TS PCA ) methods were compared with our proposed method. TS PCA has been widely used for extracting the fetal ECG from single-channel abdominal ECGs. However, the results from simulation and real datasets showed that the TS PCA method was not suitable for noisy abdominal ECGs. The performance of the TS PCA approach heavily depends on accurate detection of maternal ECG R-peaks. When accurate maternal R-peak cannot be detected because of noise, the TS PCA method cannot remove maternal ECG segments. Thus, TS PCA showed poor performance for low SNR levels in the simulation. Moreover, the residual signal, after extracting the maternal ECG from the noisy abdominal ECG using TS PCA , was still noisy; this makes it difficult to confirm the fetal ECG.
Recently, several studies have employed the EKF framework to extract the fetal ECG [11][12][13][14] as the EKF demonstrates good performance. The drawbacks of the EKF framework were shown by the simulation and real dataset. When the R-peaks of the fetal ECG and maternal ECG overlapped, it was difficult for the EKF to distinguish the fetal ECG from the maternal ECG (see Figures 4 and 8) [11]. Therefore, the fetal ECG was also eliminated during the maternal ECG cancellation. Furthermore, if the amplitude of the fetal ECG was small, this method could not detect the true fetal ECG peaks (see Figure 7). As the EKF framework requires strong assumptions to establish a dynamic model, it requires reliable prior information about the fetal ECG R-peaks [28]. The EKF method showed worse performance than all other approaches for simulation and a real dataset (see Tables 3 and 5). As the EKF approach removed the fetal ECG R-peak during the process of maternal ECG cancellation, the number of FNs increased for the two real datasets. Meanwhile, STVD could detect true fetal ECG R-peaks correctly because of the fetal ECG enhancement by the additional TVD step [18]. Therefore, STVD had higher Se values than other methods. However, EKF had the best results for MAE. This is because that EKF method estimated fetal ECG R-peaks using prior information about the fetal ECG R-peaks. On the other hand, the morphology of fetal ECG was distorted by TVD, even though STVD performed better to extract fetal ECG R-peaks from single-channel abdominal ECG. Figure 9 shows the morphological changes of fetal ECG extracted using STVD with different values of λ 2 . We can confirm from Figure 9 that the amplitude of PQRST waves was reduced by the TVD method. Furthermore, location of fetal R-peaks was also distorted. Therefore, MAE results of STVD had higher than EKF. However, if we can find suitable regularization parameters, STVD can extract fetal ECG with minimal fetal ECG signal distortion (See Figure 9).
Finally, to verify the importance of the second TVD step, we compared STVD with the combination of TVD and TS PCA . As shown in Tables 3 and 4, TVD + TS PCA showed better performance than TS PCA , since the TVD step could enhance the abdominal ECG. After the cancellation of the maternal ECG segments, the residual signal was less influenced by artifacts than the residual signal produced by the TS PCA method. However, TVD + TS PCA could not enhance the fetal ECG adequately because of its residual noise. In contrast, the STVD method could extract the fetal ECG by means of a second TVD step. The ECG waveform generally includes spike peaks. We could establish the ECG model as an approximate piecewise linear model. As the 1 norm term of the TVD problem measures the fluctuation of the signal, TVD could preserve the signal with high total variation, such as a QRS complex. This characteristic enhanced the fetal ECG R-peaks [19,29]. Thus, STVD showed much better performance than the TVD + TS PCA for both simulations and real data. Moreover, the F 1 of STVD was higher than that of TVD + TS PCA . Overall, STVD could effectively detect true fetal ECG R-peaks and decrease the error rate of detection. Altogether, the results of this study suggest that the STVD is a promising tool for monitoring the FHR using single-channel abdominal ECGs of pregnant women. Therefore, our proposed method would help in the continuous detection of changes in the normal FHR pattern. Moreover, one of the issues for FHR monitoring is the real-time implementation. Since we already recognized low computational load in our approach, we plan to develop a real-time FHR monitoring system for future work. monitoring is the real-time implementation. Since we already recognized low computational load in our approach, we plan to develop a real-time FHR monitoring system for future work.