Owing to possible disruptions during the initial and concluding 30 s of signal acquisition, analysis was confined to the stable signals captured in the central 4 min of each experiment. These samples were categorized as “fatigued” (labeled as “Y”) and “non-fatigued” (labeled as “N”) for the purpose of this study. The protocol for signal preprocessing is detailed as follows.
2.4.1. ECG Signal Processing
The original ECG signal
was initially subjected to Kalman filtering to remove random noise, followed by a discrete wavelet transform (DWT), where the signals
underwent multi-level wavelet decomposition. Noise components were eliminated based on predefined thresholds, and the signal was then reconstructed. After denoising, the signals were further processed for baseline drift correction to eliminate low-frequency drifts caused by respiration or limb movements, and the denoised ECG signal
was obtained as shown in Equations (1) and (2):
- (1)
Kalman Filter
This process can be divided into the following two steps: prediction and updating, where the prediction process is formulated as follows in Equations (3) and (4):
where
is the state estimate,
is the state transfer matrix,
is the matrix that transforms the inputs into states,
represents the measurement noise,
represents the covariance matrix prediction, and
is the covariance. The updated formula is shown in Equations (5)–(7):
where
is the Kalman gain coefficient,
is the scaling factor,
is the actual measurement of the ECG, and
is the average of the measurement noise of
.
- (2)
Wavelet Denoising
Wavelet denoising employs wavelet transforms to refine signals by converting them from the time domain to the wavelet domain, where denoising occurs, followed by a reconstitution into the time domain. This method yields a time–frequency representation, ideal for analyzing non-stationary signals, and is adept at enhancing signal quality by mitigating interference [
26].
The first step is to select the appropriate wavelet function. In order to enhance the ability to capture signal details and maximize the retention of important physiological information, this paper uses the Daubechies series wavelet, which is more suitable for signal feature extraction, as the mother wavelet and sets the decomposition level to 4 layers [
27]. The advantages of Daubechies wavelets in denoising and feature extraction include the following:
(1) Multi-scale analysis: They are capable of capturing the details and overview of a signal at multiple scales simultaneously, which is suitable for the analysis of complex signals.
(2) Energy compression: Daubechies wavelets are able to concentrate the energy of the signal in a few coefficients, making the features more prominent for subsequent processing.
(3) Edge preservation: This type of wavelet is better able to preserve these features when processing signals with sharp jumps or edges, which is especially important for biomedical signals.
The wavelets of the Daubechies series are defined by the number of their vanishing moments. The more vanishing moments there are, the higher the smoothness and resolution of the wavelet. In specific applications, db4 is a popular choice because it provides well-balanced performance for a wide range of physiological signals. The wavelet decomposition is shown in Equation (8):
where
is the signal that has been processed by Kalman filtering,
is the approximation coefficient of the
th layer,
is the detail coefficient of the
th layer, and
and
are the scale function and wavelet function of the wavelet, respectively.
When performing the wavelet transform, it is necessary to set the appropriate number of decomposition layers
. This choice depends on the characteristics of the signal and the desired resolution and noise level. In general, the more layers of approximation coefficients there are, the larger the time scale of the analysis which is suitable for capturing the low-frequency characteristics of the signal [
28]. In order to balance performance and resource consumption, in this paper, the number of decomposition layers
is set to 5.
Finally, only the approximation coefficients are retained for signal reconstruction, which can effectively remove high-frequency noise. The signal reconstruction process is shown in Equation (9):
where
represents the signal that has been reconstructed. This approach strengthens the main components of the signal and suppresses high-frequency noise in the level of detail.
The wavelet denoising results are shown in
Figure 8.
It can be seen that the noise waveform has been significantly eliminated, while the linear correlation of the signal is quite strong. In order to provide a quantitative analysis of the denoising effect, three specific index parameters are introduced to be used for evaluation: the signal-to-noise ratio (SNR), root mean square error (RMSE), and correlation coefficient (CC). These parameters are defined in Equations (10)–(12):
where
is the
th point of the original signal,
is the
th point of the denoised signal, and
is the total number of data points in the signal. Here,
focuses more on the quantization error of the signal (i.e., the magnitude of the difference between the predicted value and the actual value):
where
and
represent the data points of the two signals and
and
are the mean values of
and
, respectively. Summing is carried out for all paired data points
.
provides a measure of the linear relationship between two signals, with values closer to 1 or −1 indicating a stronger linear relationship.
The results of the three evaluation indicators are shown in
Table 4.
The outcomes reflected by these performance metrics demonstrate that the DWT denoising process is effective, significantly reducing noise while preserving the signal’s primary characteristics. Such improvement is instrumental in enhancing the accuracy of downstream analyses, including feature extraction and disease diagnosis.
- (3)
Comparison of Signal Processing Methods
To underscore the effectiveness of integrating a Kalman filter with a DWT for ECG signal denoising, this study also examined three established signal processing techniques—the Fourier transform, adaptive filter, and independent component analysis (ICA)—for a comparative performance analysis. The findings are presented in
Table 5.
The results clearly demonstrate that the combination of the Kalman filter with the DWT, as utilized in this research, outperformed the others. Conversely, ICA was less effective, likely due to its prevalent application in multi-channel analyses.
- (4)
Correction for Baseline Drift
Baseline drift is a common problem in ECG signals, caused mainly by respiratory movements and small changes in electrode position. Methods of calibration usually include high-pass filtering and polynomial fitting and subtraction.
(1) High-pass filtering: A high-pass filter can be used to effectively remove baseline drift by setting a suitable cutoff frequency (usually less than 1 Hz). For example, a 0.05 Hz high-pass filter can be used to remove low-frequency interference caused by breathing.
For this research, a Butterworth filter was employed to establish a high-pass filter. This approach effectively removes baseline drift occurring at low frequencies while concurrently preserving the ECG signal components at higher frequencies. The high-pass filtering can be represented by the following transfer function in Equation (13), in which
is the cutoff frequency:
where
was set to 0.5 Hz, which was based on the value commonly used in ECG signal processing for effectively removing baseline drift without affecting the main frequency components of the ECG signal. Meanwhile, the order of the filter was set to 5 in order to balance the filtering effect and computational complexity.
(2) Polynomial fitting and subtraction: A more sophisticated approach is to fit a polynomial to the baseline of the ECG signal and then subtract this baseline model from the original signal. This method can dynamically adapt to baseline changes in the signal. However, this process involves inverse operations of matrices, and matrix multiplication requires a great amount of arithmetic power in its operation [
29]. Moreover, its solution process is rather sensitive to small changes in the input data and requires additional numerical stability measures such as regularization to handle it. This method is difficult to apply to application scenarios with limited computing power or which require real-time processing. Therefore, it was not chosen in this study.
Figure 9 illustrates a comparison of the ECG signals before and after denoising and baseline drift correction. The signal-to-noise ratio improved by 37%, which greatly improved the signal quality.
This refinement not only decisively expunged noise and interference but also guaranteed the preservation of essential physiological information within the signal. This elevated signal quality lays a robust groundwork for ensuing signal analysis and feature extraction, securing the reliability of the processed data.
2.4.2. EEG Signal Processing
By utilizing a DWT coupled with soft thresholding, the wavelet basis
and scale function
of the adapted processed signal were set, and the denoised EEG signal was taken out through signal reconstruction as shown in Equation (14):
where the input of captured brainwave signals in
. The signal is decomposed into a series of wavelet coefficients using the discrete wavelet transform (DWT). Unlike the continuous wavelet transform, which produces a large amount of redundant information when processing signals, the discrete wavelet transform is used to effectively remove the high-frequency noise in the original data and retain the low-frequency effective data by discretizing the translation factor and scale factor in the continuous wavelet transform [
30].
As in the case of ECG signal processing, Daubechies wavelets with smoother shapes and longer support lengths are used as wavelet bases for EEG signal processing, with the number of layers set to 5 and the detail components set from level 1 to level 5, which roughly correspond to the bands
,
,
,
, and
, respectively. In addition, a filter bank is generated by the wavelet and the scaling function for iterative filtering and downsampling of the signals as shown in Equations (15) and (16):
where
and
are the low-pass and high-pass filter coefficients of the wavelet, respectively,
is an approximation factor for the upper level, and
is the detail factor for the current level.
The threshold
is determined based on the distribution of the wavelet coefficients, and a common method for this is to set the threshold to half of the standard deviation of the coefficients, which is calculated by the formula shown in Equation (17):
where
denotes the coefficient of the most detailed layer after wavelet decomposition and
is a function that calculates the standard deviation. This threshold will be used for soft thresholding for noise reduction or removal.
Then, soft thresholding is applied to all wavelet coefficients to attenuate or remove the noise component while maintaining as much signal detail as possible:
where
is the wavelet coefficients,
is the calculated threshold, and
is the thresholded coefficients. This means that coefficients less than the threshold are set to 0, and coefficients greater than the threshold
are subtracted. This processing removes the noise and maintains the shape of the signal, and it is particularly effective in maintaining important features of the signal.
The EEG results before and after denoising are shown in
Figure 10.
The results of the three evaluation indicators regarding EEG signals after noise reduction by a DWT are shown in
Table 6.