## 1 Introduction  
Recording myocardial electrical activity, namely, an electrocardiogram (ECG), through electrodes placed on the human body skin is a standard clinical diagnostic practice for noninvasive screening of the heart status and timely detection of rhythm and conduction disturbances [1,2]. The human body is a volume conductor, which collects interference currents like antennas. The power grid is the major source of interference currents. The capacitance between the body and the ground (neutral wire) is considered to be about 200 pF. The coupling capacitance to the live wire is usually about 2 pF [2,3]. The maximum values of these stray capacitances have been measured up to 4 nF and 5 pF [4,5]. These capacitive couplings conduct a powerline interference (PLI) current of nearly 200 nA that flows through the body to the ground. PLI currents partially pass through the electrodes directed to the signal ground of the amplifier. Therefore, bioamplifiers with a high common-mode rejection ratio (CMRR) are demanded to prevent the voltage drop to the common-mode input impedances. The unshielded leads are a kind of antenna collecting PLI currents. In highly isolated front ends, they pass the electrodes in a direction toward the earth via the body capacitance. Finally, the total amount of PLI currents flowing via electrodes is multiplied by the electrode impedance imbalance, thus producing the differential PLI voltage drop [6]. This is adversely amplified along with the useful ECG signal and then has to be filtered by analog or digital band-rejection filters. The analog notch filters are the simplest and most routinely applied PLI suppression techniques. Due to their transient response effect, the impulse response has an oscillatory behavior [7], which appears as ringing artifacts in ST segments after sharp QRS transitions [8,9]. Furthermore, they cause attenuation of the signal components in the stop band around the central frequency (50 or 60 Hz), thus potentially distorting diagnostic ECG components. Contemporary biomedical devices contain analog-to-digital converters (ADC) and microcontrollers (MCU) that allow the application of efficient algorithms for digital filtering, combined with artificial intelligence for feature extraction and diagnostic interpretation [10]. The requirements for the ADC resolution and sampling rate are demanding for precise numerical computations, such that 1 mV/LSB with a sampling frequency higher than 1 kHz is a common practice when processing high-resolution ECG signals. The simplest and most common options for PLI suppression are the low-pass averaging digital comb filters with a first notch at the PLI main harmonic [10]. These are also known as averages, smoothers, or moving-average, rolling-average, or running-mean filters. In spite of their simple structure and linear phase response, such filters limit the signal bandwidth and can significantly attenuate important frequency components. A repeatable filtration-addition-subtraction approach can partially improve their high-frequency response [11]. While PLI frequency can vary, an adaptive moving-average filter with a variable length could lower the output filter error [12]. More complex are the infinite impulse response (IIR) filters, which have a simple structure but provide a non-linear phase response, and for minimal distortions should have a high Q and slow reaction time [13]. Implementing high Q leads to reduced performance when PLI frequency varies from its nominal value. If the filter does not have a comb response, a multiple notch IIR filtering could cancel the higher PLI harmonics [14]. Common ECG signal distortions are, however, caused by the transient impulse response of high-Q IIR filters, majorly triggered by the QRS complexes as the steepest parts of the ECG signal. The resulting damped oscillations and ringing artifacts in ST segments could be suppressed if the ECG is preliminarily low-pass filtered by a moving-average filter [15].