## 4 Discussion

Table 3: Extremity PLI parameters for which SF algorithm fulfils the standard for powerline filers in diagnostic electrocardiographs [41]. Maximal SF errors are reported as median value (min–max range) found in lead II (PTB Diagnostic ECG database) and V2 (CTS-ECG analytical database), where denoted with *. networks (50 or 60 Hz), as well as to the specific power frequency of some railway systems (16.67 Hz). The PLI frequency and amplitude could be automatically measured by the MCU; thus, the corresponding parameters and coefficients could be automatically adapted, such as averaging windows, coefficients \(k_{i}\) in the servo loops, common-mode gain \(\mathrm{A_{cm}}\) in the AFE, etc. It is worth noting that PLI filtering with a frequency of 16.67 Hz (limits 15.7 and 17.4 Hz) is a very challenging task because one PLI period is approaching the QRS duration, and thus unideal filtering has been shown to disturb the rhythm analysis of normal rhythms and slow ventricular tachycardias in automated external defibrillators (AEDs) [51]. Similarly, in settings where the ECG represents rapid heart rates, it is difficult to filter 50 Hz or 60 Hz without ECG distortions, leading, for example, to slightly reduced rhythm detection performance in AEDs [51] or affected laboratory ECG measurements in humans and animals [52]. The presented approach does not have such problems and is particularly suitable for these applications. The described SF approach is based on quadrature demodulation, integration (low-pass filtering), and subsequent modulation. This operation performs frequency domain filtering in a relatively simple approach. The classical frequency domain filters are based on FFT followed by inverse IFFT [32; 33]. Thus, the time-domain signals are converted to the frequency domain by FFT, multiplied with a dedicated filter function, and then again restored in the time domain by IFFT. FFT/IFFT transforms are complex calculations; their complexity depends on the analysis window and are not suitable for real-time processing in general. In contrast, the SF approach performs frequency domain filtering in a relatively simple way, suitable for real-time operation. Furthermore, the SF approach has the advantage of not introducing a group delay in the processed signal. It automatically adapts the amplitude and phase of the PLI and tracks their variations in time. It is worth noting that for PLI amplitudes as high as 1000 \(\mathrm{\SIUnitSymbolMicro V}\) r.m.s., frequencies in the full range (48-52 Hz), and frequency slew rates as high as 0.1 Hz/s, the maximal MAXE error does not exceed 15 \(\mathrm{\SIUnitSymbolMicro V}\) for any record and any lead, which satisfies the standard requirements for peak ringing noise below 25 \(\mathrm{\SIUnitSymbolMicro V}\)[41]. With the setup stability coefficient \(k_{i}\) = 2\({}^{-21}\), the SF filter can operate within the standards for PLI amplitude slew rates up to a 40 \(\mathrm{\SIUnitSymbolMicro V}\)/s r.m.s. amplitude change. The SF filter does not produce ringing artifacts. ECG distortions of \(<\)15 \(\mathrm{\SIUnitSymbolMicro V}\) are practically invisible to the human eye in standard 12-lead ECG plots (Figures 14 and 16), and they have to be put into serious consideration in automated ECG measurement systems. The computed output metrics are standard and can be used for direct comparison of the presented SF filter with other published PLI filtering techniques. The comparative study in Table 4 is a survey on published papers for PLI filtering in ECG, including only those with a numerical evaluation of their filter outputs, represented by at least one of the performance metrics (\(SNR_{imp}\), \(SNR_{out}\), MAXE, RMSE, or some equivalent that can be directly recomputed). The list of 18 studies in Table 4 is not reduced to those with statistical summaries in the ECG databases (the approach of this study) but also includes studies with limited experimental tests with one short-duration ECG lead.