Adaptive Filtering for the Maternal Respiration Signal Attenuation in the Uterine Electromyogram

The electrohysterogram (EHG) is the uterine muscle electromyogram recorded at the abdominal surface of pregnant or non-pregnant woman. The maternal respiration electromyographic signal (MR-EMG) is one of the most relevant interferences present in an EHG. Alvarez (Alv) waves are components of the EHG that have been indicated as having the potential for preterm and term birth prediction. The MR-EMG component in the EHG represents an issue, regarding Alv wave application for pregnancy monitoring, for instance, in preterm birth prediction, a subject of great research interest. Therefore, the Alv waves denoising method should be designed to include the interference MR-EMG attenuation, without compromising the original waves. Adaptive filter properties make them suitable for this task. However, selecting the optimal adaptive filter and its parameters is an important task for the success of the filtering operation. In this work, an algorithm is presented for the automatic adaptive filter and parameter selection using synthetic data. The filter selection pool comprised sixteen candidates, from which, the Wiener, recursive least squares (RLS), householder recursive least squares (HRLS), and QR-decomposition recursive least squares (QRD-RLS) were the best performers. The optimized parameters were L = 2 (filter length) for all of them and λ = 1 (forgetting factor) for the last three. The developed optimization algorithm may be of interest to other applications. The optimized filters were applied to real data. The result was the attenuation of the MR-EMG in Alv waves power. For the Wiener filter, power reductions for quartile 1, median, and quartile 3 were found to be −16.74%, −20.32%, and −15.78%, respectively (p-value = 1.31 × 10−12).


Introduction
Premature birth, defined by the World Health Organization (WHO) as any birth occurring before 37 completed weeks of gestation [1], carries significant risks for both the mother's and newborn's health. According to reports provided by this entity, about 15 million premature births occur annually, of which, more than 1 million children die each year due to its complications. Those who survive often face impairments that include learning, visual, respiratory, and hearing deficiencies [2]. According to the same source, prematurity is the leading cause of newborn death in the world and second leading cause of death in all children. For all these reasons, the prediction of preterm births has been a topic that has attracted researchers' attention. Some risk factors for premature birth, such as the previous history of preterm birth, ethnicity, low socio-economic status, maternal required. Moreover, with Alv waves being low-amplitude events, noise contamination can be exceedingly detrimental for the results of the downstream algorithms to be applied.
Given this, a denoising step is required to be applied to the EHG and specifically designed to target the noise contamination that may affect Alv waves. Granted, this denoising process will also improve the EHG, in general. As mentioned earlier in this section, adaptive filters seem to be an appropriate technique for attenuating the MR-EMG from the EHG, a requirement for the reasons presented above. So, the scope of the herein presented work regards the application of adaptive filters for the task under study.
A survey was conducted focusing on the literature, concerning the adaptive filtering applications to the EHG. Upon literature inspection, it was considered advantageous to highlight the adaptive filtering publications in three categories, according to the following criteria: • Retrieval of the fECG [36][37][38]; • Maternal ECG, and electronic electromagnetic interferences attenuation [20,39]; • Pre-term and term prediction and signal-to-noise ratio improvement in the EHG [19,40].
Regarding the retrieval of the fECG, the comments are as follows: in 2011, Liu et al. [36] presented an application of RLS and the normalized least mean squares (NLMS) adaptive filters to the EHG. The goal of this study was to extract the fetal ECG (fECG) from the collected abdominal signal, which contained both the mother's and fetus's ECG signals. It was concluded that the RLS algorithm is a signal processing technique suitable for fECG extraction. The parameters' filter selection criteria were not disclosed, and neither was the population under study. The paper seems to investigate the adaptive filters' capability to detect the fECG in the EHG, as a proof of concept. In 2013, Khalaf et al. [37] demonstrated that it was possible to obtain the fECG using the EHG. A combination of a blind source separation method with adaptive filtering (LMS) attenuated the noise arising from the maternal ECG. The parameter information was undisclosed. The studied population included five subjects. Blind source separation techniques were combined with adaptive filtering to attenuate the maternal ECG signal. Kahankova et al. [38] studied the application of the RLS and fast transversal filter (FTF) algorithms to the EHG signal to extract the fECG. The results demonstrated that the output of the RLS adaptive filter was identical to the reference signal, which supported the hypothesis that this algorithm would be advantageous for extracting the fECG from the EHG signal. A comparative analysis with previously used adaptive filtering algorithms was performed, which demonstrated that the standard RLS algorithm significantly outperforms the remaining tested methods. Synthetic data were used for parameter optimization using a grid of values. The authors suggest using real data in future works. These studies highlight the RLS filter as the best performer, except for Khalaf et al., where the LMS was used, along with independent components analysis (ICA) techniques. In this last study, a comparison between the LMS and other filter architectures seemed not to have been performed. Additionally, the authors reported a successful retrieval of the fECG and, consequently, adequate attenuation of the maternal ECG.
Regarding the maternal ECG and electronic electromagnetic interferences attenuation, the comments were as follows. In 2016, Limem et al. [20] looked into the efficiency of using the LMS and RLS algorithms for noise attenuation from the EHG signals, using the simulations performed via the MATLAB ® and Simulink ® platforms. The filter parameters were undisclosed. Four subjects were under study. The adaptive filter results were compared with the band-pass and wavelet filters. In a more recent study [39], in 2019, the same research group validated the previous results. Similar to the aforementioned studies, the RLS was the best performer for the task under study.
Concerning pre-term and term predictions and signal-to-noise ratio improvement in the EHG, the comments are as follows. J. Terrien et al. [19] used adaptive filters, namely least mean squares (LMS) and recursive least squares (RLS) to increase the signal-to-noise ratio in the monopolar EHG. Afterward, he compared the results with those using the Laplacian filter and concluded that the RLS filtering algorithm provides a higher signal- to-noise ratio than the LMS method or Laplacian filter. An accurate parameter selection is deemed to be a future work task, as well as the need to include a higher number of uterine contractions. This was a forerunner work, regarding EHG and adaptive filters. On the other hand, Smrdel et al. [40] used adaptive autoregression as one of the methods to estimate the spectrograms of the EHG signal. The goal was to separate and classify the delivery date as term or preterm. A set of filter parameters were tested. Frequency bands up to 4 Hz were under investigation. The study raises the possibility of pre-term delivery prediction from as early as the 23rd gestational week. These two studies highlight the RLS filter as a competent method to generally denoise the EHG; although, the second study did not include the exploration of other adaptive filter configurations.
Despite the following study not using the EHG, it is still a contribution to the pregnancy monitoring field. Cardiotocography was used, instead of the EHG. Huiling Tong et al., in 2017, presented a study regarding the application of adaptive filters to the intrapartum cardiotocography method for fetal monitoring [41]. Three adaptive filtering algorithms were used for the fetal monitoring system's automated analysis. The proposed algorithms outperformed the classical filtering method for recognizing uterine contractions. It was observed that adaptive filtering provided the highest performance, compared with the two classical algorithms. A dedicated user interface was developed in Matlab ® . Table 1 provides detailed information about the aforementioned studies. Outside of the context of the EHG, adaptive filters have been used to attenuate noise in other types of biomedical signals, such as the ECG [42,43], shoulder and neck electromyogram [44], electroencephalogram [45], and electrogastrogram [46]. • Contractions' segmentation was performed manually.

•
The RLS filter provides a higher signal-to-noise ratio than the LMS filter.

•
The RLS filter is less sensitive to the filter order than the LMS filter.

•
The highest signal-to-noise ratio was obtained for an RLS filter of order 4.

•
For the LMS filter, the signal-to-noise ratio gets worse as the filter order increases.  RLS (λ = 1; L = 30); FTF (L = 15; δ = 0.01). These parameters were optimized for the used synthetic data.

•
The FTF algorithm is unstable and, therefore, not suitable for extracting the fECG.

•
The RLS filter is a more robust algorithm for the application. • A grid of parameters was tested for optimization. fs: sampling frequency; ε: smoothing factor; λ: forgetting factor; µ: step size; L: filter length; σ: low positive constant; δ: soft constraint initialization factor.
Despite the wide applicability of adaptive filters in the noise attenuation of biomedical signals, so far, to the best of the authors' knowledge, the herein presented study is the first endeavour, regarding MR-EMG reduction in the EHG for improved Alv waves retrieval. The performance of adaptive filters, in turn, depends on the choice of their parameters at the time of implementation. This is one of the main challenges in the adaptive filtering context. Often, the selection of parameters is achieved based on previous studies. Thus, the propagation of parameter values that are not optimized for the application under study may occur. In the herein presented work, an automatic optimization process for adaptive filtering parameters' selection is presented, regarding the application under study. This optimization process includes the selection of the best-performing adaptive filter architectures amongst a pool of 16 possibilities. This innovative approach can be used in other adaptive filter applications for noise attenuation, namely in the biomedical field. The next step is the application of the optimized filters to the real EHG signals.
As mentioned earlier, Alv waves have been pointed out as crucial components with the potential for term and pre-term birth prediction. If Alv waves are contaminated with maternal respiration, this may compromise its possible use as a tool to predict term or pre-term labour. Additionally, medical decision-making, regarding tocolytic therapy, whose side effects must be considered, can potentially benefit from Alv waves signal integrity, which will improve with the application of adaptive filtering.

Generation of Synthetic Data
The exploration and evaluation of adaptive filters will be performed using both synthetic and real data. The need for using synthetic signals can be explained as follows:

•
In real-life signals, for non-invasive acquisition systems, the Alv waves are substantially contaminated with MR-EMG interference. Therefore, it is not possible, in this case, to have the pure Alv waves, unless invasive electrodes are placed directly on the uterine muscle. However, this procedure may raise ethical concerns in most situations and, therefore, it is not practical.

•
The aforementioned fact prevents an accurate filter and parameters optimization, regarding MR-EMG attenuation.

•
Hence, the need to use analytically defined signals for the MR-EMG and Alv waves, which can only be achieved using synthetic data.

•
These synthetic signals should be generated using features and properties as close as possible to the corresponding real data.
Concerning the breathing signal pattern, it is known that the respiratory signal depends on the physiological and pathological parameters of each subject and their physical activity at the time of the EHG signal acquisition (talking, chewing and swallowing, coughing, normal sleep, and sleep with apnea, amongst others). Thus, in this work, three situations were simulated, all with the respiratory signal covering the entire frequency band that is established as being typical of the majority of the population: 0.2 to 0.34 Hz [15]. Three respiratory signals were simulated:

•
Smooth (chirp) breathing variation: a linear variation between temporal and frequency limits, from slow to fast breathing. The study for this case will be designated as the first simulation.

•
Breathing variation in a triangular wave shape from smooth to fast in 250 seconds for eight cycles. The study for this case will be referred to as the second simulation. • Random variation of the breathing regime in the previously mentioned band. The study for this case will be referred to as the third simulation.
The Alv waves atoms will be simulated according to the results presented in [9]. The parameters for these cases will be based on the central frequency (f_atom), fractional bandwidth (fract_bw), and fractional bandwidth reference level (fract_bw_r), which adopts the default value of −6 dB and pulse envelope level (pulse_level) corresponding to −60 dB. The −60 dB for the pulse envelope level was chosen because it allows for a time duration that approximates the empirical values.
The central time, which is the location of the Alv atoms in the EHG signal, was selected to achieve overlap with the respiration signal. This corresponds to the worst-case scenario for testing the adaptive filters. Figure 1 shows the normalized power spectral density for the AlvL and AlvH (solid line) and their simulated versions (dotted line). The bandwidth has been reduced to separate the multiple Alv contributions in the frequency marginals. This subject will be explained further ahead.
The simulated Alv and respiratory signals were added up. A white noise component was also included. Figure 2 represents the obtained signals and respective spectrograms for the three simulated cases. In the chirp and triangular respiration cases, it is possible to observe a time and frequency overlap between this signal and Alv atoms. This is considered to challenge the adaptive filters, regarding attenuating respiration and keeping the atoms.      Table 2.

Adaptive Filters and Parameters Optimization and Selection
For non-stationary signals, whose instantaneous frequency and bandwidth vary in time, classical filters may not be the optimal solution, since the filter parameters are set a priori. In this case, the use of a digital filter capable of readjusting its parameters as time progresses, according to the characteristics of the input signal, is a better solution. These filters are called adaptive filters. One important application of adaptive filters is noise control, which is the subject of the herein presented work. As seen in Figure 3, the input signal is often designated as the desired signal d(n), and it contains the clean signal s(n) added to the noise component N(n). An estimation of the interference signal, x(n), which should ideally be similar to N(n), must be present. The value n is the discrete sample. The adaptive filter block output y(n) is an estimation of N(n), which will be, in the next block, subtracted from the desired signal to produce the e(n) output, also called the error signal [47]. The subtractor block is what makes the adaptive filter special, since the removal of the offending interference is performed through a subtraction operation, in contrast with the classical filters' convolutional algorithms.  The used metric was the root mean square error (RMSE) between the EHG, with original simulated Alv waves (without noise component), and output of the filter, where the noise respiration signal (MR-EMG) was the chirp, triangular, or random waveshape, as seen in Figure 2.
The flowchart depicting the overall methodology in this work is presented in Figure  4, where blue and green blocks correspond to the synthetic data analysis; yellow and red refer to the real data application. In the top blocks, and after the simulated data generator, the optimal regions for L, μ, and λ are obtained for the fourteen adaptive filters. The best exploratory region is the first step for a coarse determination of the optimal parameters. The operation for this involves finding the minimum value in the tridimensional surface The following adaptive filters have been tested: least mean squares (LMS), normalized least mean squares (NLMS), frequency domain adaptive filter (FDAF), block least mean squares (BLMS), filtered-X least mean square (FXLMS), sign-error least mean squares (SELMS), sign-data least mean squares (SDLMS), sign-sign least mean squares (SSLMS), least-squares lattice (LSL), fast transversal filter (FTF), recursive least squares (RLS), householder recursive least squares (HRLS), sliding-window recursive least squares (SWRLS), householder sliding-window recursive least squares (HSWRLS), QR-decomposition recursive least squares (QRD-RLS), and Wiener. The selection criterium was to be as comprehen-sive as possible, considering the computational platform and time planning. Additionally, the code availability and confidence for the selected filters were taken into consideration, and the adaptive filters found in the literature survey for biomedical applications were also considered whenever possible.
For each adaptive filter, a set of parameters should be selected. Often, the authors do not justify their selection criteria. Additionally, frequently, the used parameters' justification is presented as an inheritance from previous similar studies. In the latter case, there is a risk of non-optimal parameter propagation. Additionally, parameters used for a particular biomedical signal may not be optimized for another one or, indeed, a different framework. In this study, an effort was made to obtain the optimal parameters for all the sixteen tested adaptive filters applied for the maternal respiration interference reduction in the Alv waves contained in the EHG. Additionally, the best performer adaptive filters are quantitatively identified amongst the sixteen candidates.
The used metric was the root mean square error (RMSE) between the EHG, with original simulated Alv waves (without noise component), and output of the filter, where the noise respiration signal (MR-EMG) was the chirp, triangular, or random waveshape, as seen in Figure 2.
The flowchart depicting the overall methodology in this work is presented in Figure 4, where blue and green blocks correspond to the synthetic data analysis; yellow and red refer to the real data application. In the top blocks, and after the simulated data generator, the optimal regions for L, µ, and λ are obtained for the fourteen adaptive filters. The best exploratory region is the first step for a coarse determination of the optimal parameters. The operation for this involves finding the minimum value in the tridimensional surface representing the RMSE variation, due to filter parameters' different values. Figure 5 shows this operation, as performed for the LMS filter. The coarse determination of the optimal region, for the L and µ LMS filter values, for the third simulation signal, is represented by the red pin. In the flowchart, for each filter and each simulated signal, a tridimensional surface is obtained. In total, 42 surfaces are accounted for. The computational burden of this operation is significant, and this requires widening the sampling intervals of the parameters under testing. This strategy leads to the need for a second step for the fine-tuning of the mentioned parameters. Overall, this two-step strategy allows for substantial savings in the computational execution time. This approach was applied to the sixteen adaptive filters and three simulated signals. The fine-tuning operation was performed by finding the minimum RMSE, using a reduced interval in the tested parameters, which allows for testing a higher number of combinations, without incurring excess computational execution time.
The next step is the selection of the best-performing adaptive filters amongst the sixteen studied options. The best-performing adaptive filters will produce the lower RMSE in the majority of the three simulation cases (majority criteria). It turns out that the best performer was the Wiener filter. Given that the real-time implementation of this filter may be, in certain applications, a challenging task, it was decided to score the second-best filter. In this study, three filters break even in second place: RLS, HRLS, and QRD-RLS. In the following step, two outcomes are possible:

•
For each filter, if one of the parameters is equally valued in the three simulated cases, it will be selected.

•
For each filter, one of the parameters is different for at least two simulation cases. In this case, the parameter corresponding to the second simulation is selected. This corresponds to the worst-case scenario, since this simulated signal contains abrupt changes that are challenging for the adaptive filters.
At this point, the description of the algorithms involving simulated data in the flowchart in Figure 4 is complete.  . Flowchart for the methodology to obtain the optimized adaptive filters and their parameters for the synthetic EHG data (blue and green blocks). The optimal filters with the obtained optimal parameters are then applied to real EHG data (yellow and red blocks). The results were statistically analyzed. . Flowchart for the methodology to obtain the optimized adaptive filters and their parameters for the synthetic EHG data (blue and green blocks). The optimal filters with the obtained optimal parameters are then applied to real EHG data (yellow and red blocks). The results were statistically analyzed. These results were obtained for the third simulation signal. The red dot represents the center of the optimal region corresponding to the minimum RMSE. For further information, please see the text.

Application of the Selected Filters to Real Data
For the real data, the Iceland Uterine Electromyography database [48] was used. It comprises 123 EHG recordings from 45 pregnant subjects. The EHG was collected noninvasively from the abdominal surface, with a sampling frequency of 200 Hz. Sixteen (4 × 4) acquisition channels were used. The gestational age at delivery was 39.76 ± 1.40 weeks (mean ± standard deviation).
Alv waves dataset from previous work was available, for which they have been automatically detected in the EHG [17]. These components were identified in bipolar channels, shown in Figure 6, where the 4 × 4 Icelandic database electrode structure was represented.
After selecting the four best performance adaptive filters for the reduction of the respiratory signal in the EHG and, consequently, in the Alv waves, as has been explained in previous sections, the next step was to apply these selected filters to the Icelandic EHG data.
It should be emphasized that this step of the work was not about validating the previously executed filter selection or the parameters. As mentioned before, that operation should be performed with simulated data, where the pure and noise signal components are known beforehand, which is only possible with synthetic data.
In this section, the effect of the selected adaptive filters in real data will be explored, namely in the Alv waves. The following features will be included in the study, regarding comparing the periodograms of filtered Alv waves with the non-filtered: • Bandwidth (bw) defined as the frequency band that contains 75% of the energy of each Alv wave, Hz. The frequency corresponding to the amplitude peak (freq_peak), Hz.
The rationale for using the Welch periodogram for Alv waves analysis is described in [17]. The flowchart in Figure 7 highlights the methodology in this section.
For the real data, the respiration signal was obtained through the application of the EDR method to the maternal ECG [49], followed by a post-processing step that includes outlier removal and wavelet filtering between 0.20-0.34 Hz. The used EDR technique produced a signal that was an interpolated time series of the QRS areas in maternal ECG. These results were obtained for the third simulation signal. The red dot represents the center of the optimal region corresponding to the minimum RMSE. For further information, please see the text.

Application of the Selected Filters to Real Data
For the real data, the Iceland Uterine Electromyography database [48] was used. It comprises 123 EHG recordings from 45 pregnant subjects. The EHG was collected noninvasively from the abdominal surface, with a sampling frequency of 200 Hz. Sixteen (4 × 4) acquisition channels were used. The gestational age at delivery was 39.76 ± 1.40 weeks (mean ± standard deviation).
Alv waves dataset from previous work was available, for which they have been automatically detected in the EHG [17]. These components were identified in bipolar channels, shown in Figure 6, where the 4 × 4 Icelandic database electrode structure was represented.
After selecting the four best performance adaptive filters for the reduction of the respiratory signal in the EHG and, consequently, in the Alv waves, as has been explained in previous sections, the next step was to apply these selected filters to the Icelandic EHG data.
It should be emphasized that this step of the work was not about validating the previously executed filter selection or the parameters. As mentioned before, that operation should be performed with simulated data, where the pure and noise signal components are known beforehand, which is only possible with synthetic data.
In this section, the effect of the selected adaptive filters in real data will be explored, namely in the Alv waves. The following features will be included in the study, regarding comparing the periodograms of filtered Alv waves with the non-filtered: • Bandwidth (bw) defined as the frequency band that contains 75% of the energy of each Alv wave, Hz. The frequency corresponding to the amplitude peak (freq_peak), Hz.
The rationale for using the Welch periodogram for Alv waves analysis is described in [17]. The flowchart in Figure 7 highlights the methodology in this section.
For the real data, the respiration signal was obtained through the application of the EDR method to the maternal ECG [49], followed by a post-processing step that includes outlier removal and wavelet filtering between 0.20-0.34 Hz. The used EDR technique produced a signal that was an interpolated time series of the QRS areas in maternal ECG. This requires normalization and rescaling to realistic interference levels. A z-core normalization was applied in the first step, followed by a rescaling using the EHG standard deviation and a division by four. The maternal ECG data was retrieved from the current EHG electrodes. This signal was used as the estimated interference to be input to the adaptive filters. A significant fact here is that the estimation was not obtained from an extra sensor. standard deviation and a division by four. The maternal ECG data was retrieved from the current EHG electrodes. This signal was used as the estimated interference to be input to the adaptive filters. A significant fact here is that the estimation was not obtained from an extra sensor.
In this work, for each recording, the bipolar channel with a higher number of Alv waves was selected to improve statistical validation. Since it has been reported that bipolarity can reduce the respiratory component in the EHG [11], a decision was made to apply the adaptive filters to the monopolar channels arising from the respective bipolar arrangement. This was followed by returning the filtered monopolar channels to the corresponding bipolar arrangement. This last step was mandatory, since the original Alv waves were detected in bipolar channels. Figure 6. Electrodes arrangement for the Icelandic EHG database. Circles represent monopolar electrodes, and the green, blue, and orange arrows represent the ten bipolar (BP) arrangements selected in [50].

Statistical Validation Method
In the following step, statistical validation was performed, regarding the above features, to understand how the optimal adaptive filters modify the original Alv waves. For each feature, the mean value of the raw signal was compared with its filtered version by performing the following two bilateral tests: The superscripts in the null and alternative hypotheses , , j = 1,2, distinguish between the comparison of the raw signal with the Wiener and RLS/HRLS/ QRD-RLS filtered signals, respectively.
To carry out the above hypotheses testing, paired z-tests were performed; therefore, no distributional assumptions were made to the underlying populations [51]. The p-values were adjusted by the Bonferroni procedure, since there are two hypotheses for each feature.

Let
, j = 1,2 denote the unadjusted p-value of the j-th hypothesis testing for the i-th feature; Figure 6. Electrodes arrangement for the Icelandic EHG database. Circles represent monopolar electrodes, and the green, blue, and orange arrows represent the ten bipolar (BP) arrangements selected in [50].  Flowchart of the optimally selected adaptive filters' application to real EHG data. Blue blocks correspond to previously developed and published work [17]. For further information, please see the text.

Application to Synthetic Data
In the first run, the boundaries and steps for the filter parameters were established empirically, with the following constraint: a minimum would have to be present in RMSE values of the surface plot, whose independent variables are the parameters, as seen in Figure 5 and Section 2.2. Table 3 summarizes the initial values that will be the seed for the remaining algorithms.
The next step is to input these seed values to build a three-dimensional plot, where the interest optimal region was defined as the area around the minimum in the surface Figure 7. Flowchart of the optimally selected adaptive filters' application to real EHG data. Blue blocks correspond to previously developed and published work [17]. For further information, please see the text.
In this work, for each recording, the bipolar channel with a higher number of Alv waves was selected to improve statistical validation. Since it has been reported that bipolarity can reduce the respiratory component in the EHG [11], a decision was made to apply the adaptive filters to the monopolar channels arising from the respective bipolar arrangement. This was followed by returning the filtered monopolar channels to the corresponding bipolar arrangement. This last step was mandatory, since the original Alv waves were detected in bipolar channels.

Statistical Validation Method
In the following step, statistical validation was performed, regarding the above features, to understand how the optimal adaptive filters modify the original Alv waves. For each feature, the mean value of the raw signal was compared with its filtered version by performing the following two bilateral tests: To carry out the above hypotheses testing, paired z-tests were performed; therefore, no distributional assumptions were made to the underlying populations [51]. The p-values were adjusted by the Bonferroni procedure, since there are two hypotheses for each feature. Let p j i , j = 1,2 denote the unadjusted p-value of the j-th hypothesis testing for the i-th feature; then, the Bonferroni adjusted p-value is given by p j Bon f , i = min{1, kp j i }, j = 1,2, where k is the number of hypotheses under study, which, in this work, is k = 2 [52,53].

Application to Synthetic Data
In the first run, the boundaries and steps for the filter parameters were established empirically, with the following constraint: A minimum would have to be present in RMSE values of the surface plot, whose independent variables are the parameters, as seen in Figure 5 and Section 2.2. Table 3 summarizes the initial values that will be the seed for the remaining algorithms. The next step is to input these seed values to build a three-dimensional plot, where the interest optimal region was defined as the area around the minimum in the surface plot. This minimum corresponded to the lowest RMSE value on this surface. This is illustrated in the first line of the flowchart in Figure 4. However, the Wiener filter was not coarse optimized, since it depends on one parameter only, L. For the FTF filter, it is recommended that the λ value be within the [1-0.5/L, 1] interval, so the coarse optimization was also skipped.
Fine-tuning was then applied to the interest region to obtain optimal values for L, µ, and λ for each filter and simulation type. Table 4 summarizes the optimized values for three simulation signals and each adaptive filter. Using the optimized parameters in Table 4, for the three simulation signals and the sixteen filters, the RMSE error was obtained between the pure EHG and filtered one. The results are shown in Table 5, with Figure 8 being the corresponding pictorial representation.      Table 5.    Table 5.
The lowest RMSE in the majority of the simulation cases is the criterium for optimal filter selection. In Table 5 (blue cells correspond to low RMSE values), the following comments apply:

•
The lowest RMSE for the three simulation signals corresponded to the Wiener filter. This filter implementation may be challenging for certain real-time applications. Hence, the need to score other filters.

•
In the first and third simulations, the lowest RMSE values corresponded to the RLS; HRLS and QRD-RLS tied.

•
Since the lowest RMSE value of the second simulation corresponded to the SELMS and, using a majority criterion, the winners after the Wiener filter were: RLS, HRLS, and QRD-RLS alike.
For the Wiener, RLS, HRLS, and QRD-RLS filters, the optimal parameters for the three simulation cases were identical (L = 2 for all of them and λ = 1 for the RLS, HRLS, and QRD-RLS). If the parameters were different, the criterium would be to select those corresponding to the second simulation case, which is considered the worst-case scenario, regarding the respiration signal. Figure 9 summarizes the input and output for the RLS and Wiener filters for the second simulation case. For further explanation regarding this figure, please refer to its caption. and QRD-RLS). If the parameters were different, the criterium would be to select those corresponding to the second simulation case, which is considered the worst-case scenario, regarding the respiration signal. Figure 9 summarizes the input and output for the RLS and Wiener filters for the second simulation case. For further explanation regarding this figure, please refer to its caption. Figure 9. In the first subplot: representation of the EHG signal with eight Alv atoms (red) and filtered output for Wiener (green) and RLS (blue) filters. The filtered Alv atoms are shown in green and blue (practically overlapped). Second subplot: the time-frequency representation of the EHG signal containing the respiration interference and eighth Alv atoms, which are visible and purposedly placed over the respiration signal. Third subplot: output of the RLS filter, where the respiration signal is attenuated and Alv waves are well-preserved. The blue arrows represent two cases, where the amplitude of the filtered Alv atoms increased after filtering (note the darker atoms' color). This reveals a counter-phase relation between the respiratory signal and Alv waves in the original signal. Fourth subplot: output of the Wiener filter, where a further attenuation of the respiratory component can be observed. This is consistent with the obtained result, whereas the Wiener filter is the best performer.
The frequency marginal, which is represented in Figure 10, is herein used for qualitative analysis only, since a quantitative metric using this data would be negatively affected by the fact that this representation arises from a projection of the signal into the Figure 9. In the first subplot: representation of the EHG signal with eight Alv atoms (red) and filtered output for Wiener (green) and RLS (blue) filters. The filtered Alv atoms are shown in green and blue (practically overlapped). Second subplot: the time-frequency representation of the EHG signal containing the respiration interference and eighth Alv atoms, which are visible and purposedly placed over the respiration signal. Third subplot: output of the RLS filter, where the respiration signal is attenuated and Alv waves are well-preserved. The blue arrows represent two cases, where the amplitude of the filtered Alv atoms increased after filtering (note the darker atoms' color). This reveals a counter-phase relation between the respiratory signal and Alv waves in the original signal. Fourth subplot: output of the Wiener filter, where a further attenuation of the respiratory component can be observed. This is consistent with the obtained result, whereas the Wiener filter is the best performer. The frequency marginal, which is represented in Figure 10, is herein used for qualitative analysis only, since a quantitative metric using this data would be negatively affected by the fact that this representation arises from a projection of the signal into the timefrequency domain that may not respect their ideal properties, such as time support and total energy. Further insight regarding the frequency marginals is provided in the caption of Figure 10.
Sensors 2022, 22, x 18 time-frequency domain that may not respect their ideal properties, such as time suppor total energy. Further insight regarding the frequency marginals is provided in the ca of Figure 10. Figure 10. Frequency marginals for the second simulation data. The analysis should be perfo relative to the EHG + resp (red dash) and pure EHG (blue) curves. The best-performing filter o using the marginal criterium should approach the pure EHG curve. In that respect, the bes worst performers are the Wiener and HSWRLS filters, respectively. The RLS/HRLS/QRD-RLS are the second-best performers after the Wiener. The LMS filter performs below RLS/HRLS/QRD-RLS filters.

Application to Real Data
Using the bipolar montage to reduce respiratory interference should be perfo with caution, since the reverse outcome can happen. Figure 11 depicts a case w bipolarity led to the amplitude enhancement of the respiratory interference. This c explained by the counter-phase respiratory signals in each of the monopolar electr possibly generated by certain patterns of respiratory muscle movements. This beh has been observed in several EHG recordings of the database in use. Figure 12 represents an example of the application of the Wiener filter to a real recording retrieved from the used dataset. There are 75 Alv waves in this signa readability reasons, only 11 are represented, in purple colour. The time-frequency allow for the observation of the filter impact, leading to the attenuation of the MR-E For further details, please refer to the Figure 12 caption. Figure 13 represents the original Alv waves for the bipolar channel 9 EHG record It is possible to compare the original version of the waves (blue dash) with the outp different filters (see caption for details). The 1st, 10th, and 11th subplots, horizon wise, depict the cases where the filtered signal amplitudes are above the origina waves. This indicates a counter-phase effect between the Alv waves and MR-EMG 3rd, 4th, and 9th subplots represent the reverse situation, indicating that Alv wave the MR-EMG are in-phase. In Figure 14, the Welch periodograms of the above wave illustrated, for which the comments presented in Figure 13 apply, regarding the rel amplitudes of these frequency representations. For example, the last two Alv w (horizontally wise) in Figures 12 and 13 show the following trend: the output o Wiener filter produces a higher amplitude signal and, consequently, higher ampl periodogram, compared to the non-filtered Alv. In classical theory, digital filters desi without a gain feature are not, generally, supposed to display this behavior, whi Figure 10. Frequency marginals for the second simulation data. The analysis should be performed, relative to the EHG + resp (red dash) and pure EHG (blue) curves. The best-performing filter output using the marginal criterium should approach the pure EHG curve. In that respect, the best and worst performers are the Wiener and HSWRLS filters, respectively. The RLS/HRLS/QRD-RLS filters are the second-best performers after the Wiener. The LMS filter performs below the RLS/HRLS/QRD-RLS filters.

Application to Real Data
Using the bipolar montage to reduce respiratory interference should be performed with caution, since the reverse outcome can happen. Figure 11 depicts a case where bipolarity led to the amplitude enhancement of the respiratory interference. This can be explained by the counter-phase respiratory signals in each of the monopolar electrodes, possibly generated by certain patterns of respiratory muscle movements. This behavior has been observed in several EHG recordings of the database in use. Figure 12 represents an example of the application of the Wiener filter to a real EHG recording retrieved from the used dataset. There are 75 Alv waves in this signal. For readability reasons, only 11 are represented, in purple colour. The time-frequency plots allow for the observation of the filter impact, leading to the attenuation of the MR-EMG. For further details, please refer to the Figure 12 caption. Figure 13 represents the original Alv waves for the bipolar channel 9 EHG recordings. It is possible to compare the original version of the waves (blue dash) with the output of different filters (see caption for details). The 1st, 10th, and 11th subplots, horizontally-wise, depict the cases where the filtered signal amplitudes are above the original Alv waves. This indicates a counter-phase effect between the Alv waves and MR-EMG. The 3rd, 4th, and 9th subplots represent the reverse situation, indicating that Alv waves and the MR-EMG are in-phase. In Figure 14, the Welch periodograms of the above waves are illustrated, for which the comments presented in Figure 13 apply, regarding the relative amplitudes of these frequency representations. For example, the last two Alv waves (horizontally wise) in Figures 12 and 13 show the following trend: the output of the Wiener filter produces a higher amplitude signal and, consequently, higher amplitude periodogram, compared to the non-filtered Alv. In classical theory, digital filters designed without a gain feature are not, generally, supposed to display this behavior, which is, however, in many instances, observed in this study, from which the above-mentioned Alv waves are just an example. The frequency marginals presented in Figure 15 are a helpful tool for understanding this behavior. Please see the figure caption for more details. however, in many instances, observed in this study, from which the above-mentioned Alv waves are just an example. The frequency marginals presented in Figure 15 are a helpful tool for understanding this behavior. Please see the figure caption for more details. Figure 11. Illustration of how bipolar channels may enhance the respiratory signal, instead of reducing it. This can be explained by counter-phase respiratory signals in each of the monopolar electrodes, possibly generated by certain patterns of respiratory muscle movements. Figure 11. Illustration of how bipolar channels may enhance the respiratory signal, instead of reducing it. This can be explained by counter-phase respiratory signals in each of the monopolar electrodes, possibly generated by certain patterns of respiratory muscle movements. Figure 16 illustrates the boxplots for the Alv waves before (non-filtered) and after being filtered by the Wiener, RLS, HRLS, and QRD-RLS filters. All the filtered boxplots show a decrease in the power of the filtered periodograms. For details, please see the figure caption. For the other five features, similar boxplots are also available. However, to restrain this document length, a table with the general result is otherwise presented. Table 6 represents the features' variation between non-filtered Alv waves and their versions after adaptive filtering for respiration attenuation in real data. The green line represents the Wiener EHG filtered signal, and the pink line is the signal difference. The second subplot represents the EDR estimation respiratory signal. The third subplot represents the scalogram of the EHG signal, where the respiratory component is present, overlapped with Alv waves. In the fourth subplot, which represents the scalogram for the Wiener filter, it was observed that the respiratory signal has been substantially reduced. Regarding Alv waves, two behaviors are present the yellow arrows represent cases where Alv waves amplitude increased after filtering and otherwise (blue arrows). This reveals, in the first case, that the respiratory signal and Alv waves are in a counter-phase, whereas, in the second case, they are in phase. The fifth subplot represents the scalogram for the EDR estimated respiratory signal. The scalograms are obtained using the cmor-25-1 wavelet [11]. The green line represents the Wiener EHG filtered signal, and the pink line is the signal difference. The second subplot represents the EDR estimation respiratory signal. The third subplot represents the scalogram of the EHG signal, where the respiratory component is present, overlapped with Alv waves. In the fourth subplot, which represents the scalogram for the Wiener filter, it was observed that the respiratory signal has been substantially reduced. Regarding Alv waves, two behaviors are present the yellow arrows represent cases where Alv waves amplitude increased after filtering and otherwise (blue arrows). This reveals, in the first case, that the respiratory signal and Alv waves are in a counter-phase, whereas, in the second case, they are in phase. The fifth subplot represents the scalogram for the EDR estimated respiratory signal. The scalograms are obtained using the cmor-25-1 wavelet [11].      , it was observed that, for frequencies under 0.29 Hz, the filtered output has an amplitude below the input EHG (blue), whereas, above this frequency, an amplitude increase relative to the blue line is registered. This means that, in the first case, there was an in-phase subtraction between the EHG signal and estimated noise filter output; in the second case, a counter-phase subtraction occurred. The two side plots explain this behaviour using sinusoidal waves. Figure 16 illustrates the boxplots for the Alv waves before (non-filtered) and after being filtered by the Wiener, RLS, HRLS, and QRD-RLS filters. All the filtered boxplots show a decrease in the power of the filtered periodograms. For details, please see the figure caption. For the other five features, similar boxplots are also available. However, to restrain this document length, a table with the general result is otherwise presented. Figure 15. A frequency marginal example for an EHG recording (blue) and filtered EHG: Wiener (red), RLS (brown), HRLS (pink), and QRD-RLS (cyan). The number of Alv waves included in this computation was 75. The last three marginal curves are overlapped. For the Wiener filter (red), it was observed that, for frequencies under 0.29 Hz, the filtered output has an amplitude below the input EHG (blue), whereas, above this frequency, an amplitude increase relative to the blue line is registered. This means that, in the first case, there was an in-phase subtraction between the EHG signal and estimated noise filter output; in the second case, a counter-phase subtraction occurred. The two side plots explain this behaviour using sinusoidal waves.  Figure 16. Boxplots for the Alv waves before (non-filtered) and after being filtered by the Wiener, RLS, HRLS, and QRD-RLS filters. The studied metric is the occupied bandwidth power. A decrease in median and quartiles was observed for all the filtered boxplots. This reveals that the adaptive digital filters attenuated the respiratory interference. Additionally, it reveals that interference is mostly in-phase, and the Wiener filter produces a higher attenuation. All the Bonferroni's adjusted p-values, based on paired z-tests, validated this hypothesis. Table 6 represents the features' variation between non-filtered Alv waves and their versions after adaptive filtering for respiration attenuation in real data.

•
A substantial power decrease (∆power) was observed for the Wiener filter (p = 1.31 × 10 −12 ). For the other filters (p = 3.82 × 10 −5 ), the power decrease was roughly halved in the median and quartiles, relative to the Wiener filter. This may reflect the Wiener filter outperforming the attenuation of respiratory signal, as has been verified in the simulation data. This also highlights that the in-phase subtraction between the noise estimation and Alv waves was prevalent, relative to the counter-phase one.

•
The bandwidth increase (∆bw) for all filters (p = 1.20 ×10 −45 for Wiener and p = 1.66 × 10 −12 for other filters) was a direct consequence of the reduction of the power (∆power).
To allow for the 75% energy ratio, the bandwidth must increase.

•
To allow for the bandwidth increase, the frequency limits ∆flo (p = 0.00 for Wiener and p = 4.44 × 10 −16 for other filters) and ∆fhi (p = 2.46 × 10 −28 for Wiener and p = 6.39 × 10 −9 for other filters) decreased and increased, respectively. • A substantial decrease in the periodograms peak (∆peak) was observed, which is consistent with the above-reported decrease in the power (∆power) for the Wiener filter (p = 4.11 × 10 −13 ). For the other filters, the ∆peak decrease (p = 1.46 × 10 −5 ) was roughly halved in the median and quartiles, relative to the Wiener filter.

•
Since the ∆flo decrease was higher than the ∆fhi increase, the peak frequency deviation (∆freq_peak) was negative or negligible in all cases (p = 1.19 × 10 −8 for Wiener and p = 3.59 × 10 −4 for other filters). This indicates that the attenuation of the respiratory signal led to a lower frequency peak. Figure 16. Boxplots for the Alv waves before (non-filtered) and after being filtered by the Wiener, RLS, HRLS, and QRD-RLS filters. The studied metric is the occupied bandwidth power. A decrease in median and quartiles was observed for all the filtered boxplots. This reveals that the adaptive digital filters attenuated the respiratory interference. Additionally, it reveals that interference is mostly in-phase, and the Wiener filter produces a higher attenuation. All the Bonferroni's adjusted p-values, based on paired z-tests, validated this hypothesis.
• A substantial power decrease (∆power) was observed for the Wiener filter (p = 1.31 × 10 −12 ). For the other filters (p = 3.82 × 10 −5 ), the power decrease was roughly halved in the median and quartiles, relative to the Wiener filter. This may reflect the Wiener filter outperforming the attenuation of respiratory signal, as has been verified in the simulation data. This also highlights that the in-phase subtraction between the noise estimation and Alv waves was prevalent, relative to the counter-phase one.

•
The bandwidth increase (∆bw) for all filters (p = 1.20 ×10 −45 for Wiener and p = 1.66 × 10 −12 for other filters) was a direct consequence of the reduction of the power (∆power). To allow for the 75% energy ratio, the bandwidth must increase.

•
To allow for the bandwidth increase, the frequency limits ∆flo (p = 0.00 for Wiener and p = 4.44 × 10 −16 for other filters) and ∆fhi (p = 2.46 × 10 −28 for Wiener and p = 6.39 × 10 −9 for other filters) decreased and increased, respectively. • A substantial decrease in the periodograms peak (∆peak) was observed, which is consistent with the above-reported decrease in the power (∆power) for the Wiener filter (p = 4.11 × 10 −13 ). For the other filters, the ∆peak decrease (p = 1.46 × 10 −5 ) was roughly halved in the median and quartiles, relative to the Wiener filter.

•
Since the ∆flo decrease was higher than the ∆fhi increase, the peak frequency deviation (∆freq_peak) was negative or negligible in all cases (p = 1.19 × 10 −8 for Wiener and p = 3.59 × 10 −4 for other filters). This indicates that the attenuation of the respiratory signal led to a lower frequency peak.

Discussion and Conclusions
The innovative components in this work are as follows: • Maternal respiratory signal (MR-EMG) attenuation in the EHG, which is a problem often overlooked or dealt with, in many cases, using bipolar channels. • Algorithm development to find the optimal adaptive filters and their parameters for the MR-EMG attenuation in the EHG. • A contribution to adaptive filtering behavior insight, which is important for the interpretation of the results. This information could be relevant for other researchers in the biomedical signal processing field.
Maternal respiration is one of the most relevant interferences in the EHG, given that its frequency band (0.2-0.34 Hz) overlaps with important EHG components, such as Alv waves. Typically, bipolar channels are mounted, in an attempt to cancel the common mode MR-EMG in the respective monopolar configuration. However, this operation, as mentioned earlier in this work, can have the exact opposite effect of enhancing the respiratory signal. This can be explained by the counter-phase MR-EMG presence in each monopolar channel from which the bipolar one was obtained. Moreover, bipolarity can attenuate the signal of interest if it is present in both monopolar channels, mainly if they are relatively close by. Classical filtering, designed to reduce the MR-EMG, will also affect the signal of interest in the shared bandwidth, so it is not the ideal solution.
Adaptive filters seem to overcome these predicaments, since, as explained earlier, their operation is based on the subtraction of the estimated interference from the composite signal of interest. In optimal conditions, this behavior allows for the attenuation of the offending signal, which is added to the composite one, without disturbing the bandwidth of the signal of interest. In terms of the work herein presented, the composite signal is the EHG that inevitability contains the offending MR-EMG. Therefore, the application of adaptive filters may preclude the need for the montage of bipolar channels.
An estimation of the MR-EMG, which is necessary as an input to the adaptive filters, is unavailable on the existing open-source EHG databases. In this work, an innovative approach included the estimation of the MR-EMG from the maternal ECG recorded in the EHG electrode locations, using the well-established EDR technique.
An algorithm was developed to obtain the optimal filter and respective parameters for the task at hand. The filters available for selection were Wiener, LMS, NLMS, BLMS, FXLMS, FDAF, SELMS, SDLMS, SSLMS, FTF, LSL, RLS, HRLS, SWRLS, HSWRLS, and QRD-RLS. In the selection step, synthetic data was used. The best performers were Wiener (L = 2), RLS, HRLS, and QRD-RLS (L = 2 and λ = 1). This algorithm can be used for other scenarios, where the users are looking for the optimal adaptive filter and parameters' solutions for their applications.
As a complementary work component, the obtained optimal filters were applied to real data from the Icelandic Reykjavik University EHG database. This step was not meant to be for the filter and parameters validation, but rather a study regarding the effect of the optimal filters on the Alv waves, before and after MR-EMG attenuation. A set of Alv waves features were selected for analysis. It was found that, in all cases, the respiration signal was attenuated from the original Alv waves, which led to an increase in bandwidth and decrease in their power content. In practical setups of algorithm development using Alv waves, it would make sense to apply one of the selected filters to the EHG as a first pre-processing step.