## 3 Results  
### Optimization of SF Algorithm  
The optimization of the SF algorithm is focused on the choice of the stability coefficient \(k_{i}=2^{-\mu}\) in the loop filter (Figure 6) so that the SF could provide the best performance for different PLI parameters. The optimization process considers a range of scanned values for \(k_{i}=[2^{-23},2^{-22},2^{-21},2^{-20},2^{-19}]\) in the worst-case scenario, wherein PLI parameters are scaled to the maximal settings in this study with respect to the r.m.s. amplitude (1000 \(\mu\)V), amplitude slew rate (\(\pm\)200 \(\mu\)V/s), and frequency slew rate (0.1 Hz/s). Table 1 summarizes the three optimization strategies, namely, PLI constant (PLI with constant amplitude and frequency), PLI with linear amplitude change, and PLI with linear frequency change. While the three PLI optimization scenarios were applied with the CTS-ECG calibration database (CAL records, 1 lead, 10 s), the input SNR was estimated to be \([-7.8\) to \(-8.8\) dB] (mean value), \([-18\) to \(-3\) dB] (min-max range). The optimization performance of the SF algorithm is shown in Figure 7 with respect to MAXE, RMSE, and _SNRimp_. The optimal setting can be read for \(k_{i}=2^{-21}\), seeking for minimization of (MAXE, RMSE) and maximization of (_SNRimp_) as a conciliation between the three scenarios for PLI parameter change. Higher values of \(k_{i}>2^{-21}\) are associated with a reduction in the Q factor and to higher errors during steady state, observed as higher errors for PLI with constant amplitude and frequency as well as for PLI with frequency modulation (Figure 7a,c). Lower values of \(k_{i}<2^{-21}\) are associated with an increased Q factor and a slow adaptation rate to amplitude changes, which therefore leads to higher errors for PLI with amplitude modulation (Figure 7b). \begin{table}
\begin{tabular}{l c c c c} \hline  & **PLI Amplitude** & **PLI Amplitude** & **PLI Frequency** & **PLI Frequency** \\  & \(A_{PLI}\) **r.m.s (μV)** & **Slew Rate \(\Delta A_{PLI}\) (μV/s)** & **Range \(f_{PLI}\) (Hz)** & **Slew Rate \(\Delta f_{PLI}\) (Hz/s)** \\ \hline PLI constant & 1000 & 0 & 50 & 0 \\ \hline PLI linear amplitude change & 1000 & \(\pm\)200 & 50 & 0 \\ \hline PLI linear frequency change & 1000 & 0 & 49–51 & \(\pm\)0.1 \\ \hline \end{tabular}
\end{table} 
Table 1: Simulation parameters of PLI with duration of 10 s for 3 optimization scenarios with CTS-ECG calibration database. Figure 7: Optimization of the stability coefficient \(k_{i}\) in the loop filter (Figure 6): Statistical distributions (median; box: 25–75%; whisker: min–max) of MAXE, RMSE, \(SNR_{imp}\) computed for 10 s with the CTS-ECG CAL database with added PLI sinusoid according to the three settings in Table 1: (**a**) PLI constant, (**b**) PLI linear amplitude change, (**c**) PLI linear frequency change. The red arrows show the optimal choice of \(k_{i}=2^{-21}\), seeking for output error minimization and \(SNR_{imp}\) maximization as a conciliation between the three scenarios for variation in PLI parameters. The real operation of the SF algorithm for the denoising of ECG signals with the optimal stability setting (\(k_{i}=2^{-21}\)) is illustrated in Figure 8. It represents the noisy input \(V_{SIG}\), where the artificial ECG signal (CAL20100, heart rate of 60 bpm) is diagnostically unreadable due to the superimposed large PLI amplitude of 1000 \(\upmu\)V r.m.s. over 10 s, according to the three PLI parameter settings in Table 1. The filter output \(V_{SF}\) contains a denoised ECG waveform with a visually well-distinguishable P, QRS, and T waves, and isoelectric lines in all PLI parameter scenarios. The ECG distortions are estimated by the error of the filter, showing negligible values of RMSE = 1 \(\upmu\)V, MAXE = 2 \(\upmu\)V for constant PLI (Figure 8a) and RMSE = 1.5 \(\upmu\)V, MAXE = 5 \(\upmu\)V for the PLI frequency change in the range of 50-51 Hz (Figure 8c).