## 2 Materials and Methods
### Synchronous Filtering Concept
For stable operation and filtering of the PLI fundamental harmonic, the integrator time constant must be expanded to compensate for the 20 ms group delay of the two averagers. As the outputs of the averagers are divided by the coefficient \(k_{i}\), the UGF of the integrator is shifted to DC, i.e., the time constant of the integrator is incremented. It should be noted that the frequency response of an ideal integrator can be determined from only one point, e.g., its UGF. The integrator roll-off was known and was 1/f or -20 dB/dec. The coefficient \(k_{i}\) determines the overall stability of the system. It must be carefully tuned to ensure a stable operation with fast transient response and short start-up time. Considering that the cutoff frequency of the two averagers is much higher than the bandwidth of the closed-loop response, we can neglect the averagers' transfer function. Thus, (10) could be expressed by means of \(F_{s}\) and the integrator 1/f roll-off, as shown in (11):  
\[V_{SIG}=V_{s}\sin(\omega\mathrm{t}) \tag{1}\]2  
The coefficient \(k_{i}\) can be regulated by the loop gain (\(LG\)) of the QDR servo loop. The loop gain determines the stability of the control system with a negative feedback. In case \(LG\) = 1 (0 dB), the crossover frequency settles the loop bandwidth and defines \(-\)3 dB cutoff frequency of the closed-loop response (\(f_{3 dB}\)). Deduced from Figure 3, the SF loop gain is expressed by (12):  
\[V_{SIG}=V_{s}\sin(\omega\mathrm{t}) \tag{1}\]3  
\[V_{SIG}=V_{s}\sin(\omega\mathrm{t}) \tag{1}\]4 Closed-loop SF with QDR in the negative feedback: (**a**) SF architecture, (**b**) example SF operation showing the noisy filter input (**top**), settling of the in-phase and quadrature control signals for the remodulator after PLI filter start-up (**middle trace**), and the filter output (**bottom trace**). The input V\({}_{\text{SIG}}\) denotes the differential ECG channel; V\({}_{\text{REF}}\) denotes the common-mode channel. Replacing \(G\) and \(k_{LF}\) in (12) by Equations (5) and (11), \(LG\) becomes:  
\[V_{SIG}=V_{s}\sin(\omega\mathrm{t}) \tag{1}\]5  
Equation (13) shows that the \(LG\) of the SF algorithm is proportional to the squared amplitude of \(V_{REF}\). For a constant closed-loop bandwidth and constant speed of the closed-loop response, the product \(V_{r}2k_{i}\) should keep constant, i.e., when \(V_{r}\) changes, the coefficient \(k_{i}\) should change accordingly. For example, when \(V_{r}\) is increased two times, the coefficient \(k_{i}\) should be decreased four times to maintain the same stability reserve. Equalizing (13) to unity, the cutoff frequency \(f_{3 dB}\) of the closed-loop response could be found:  
\[V_{SIG}=V_{s}\sin(\omega\mathrm{t}) \tag{1}\]6  
The two averages have the same \(-3\) dB cutoff frequency (\(f_{c}=16\) Hz), introducing a 20 ms group delay. If \(f_{3 dB}\) is much lower than \(f_{c}\), e.g., let us say ten times, it guarantees a stable operation with a phase margin of about \(90^{\circ}\). In Equation (14), we could substitute: \(V_{r}=200\) LSB, \(k_{i}=2^{-23}\), \(F_{s}=2\) kHz, thus estimating the closed-loop response at \(f_{3 dB}\) to be about 0.7 Hz. The exact phase margin of the closed-loop response can be calculated taking into account that the two averagers are linear-phase (constant group delay) filters. The group delay of 20 ms corresponds to \(360^{\circ}\) phase lag at 50 Hz. Thus, the phase lag of the two averagers at 0.7 Hz can be calculated using the rule of three, i.e., the phase lag at 1 Hz is \(360^{\circ}/50\) Hz = \(7.2^{\circ}/\)Hz, and at 0.7 Hz it is 0.7 Hz \(\times\)\(7.2^{\circ}/\)Hz \(\approx 5^{\circ}\). Thus, taking into account that the integrator has a constant phase lag of \(90^{\circ}\), the actual phase margin of the closed-loop system is just \(90^{\circ}-5^{\circ}\approx 85^{\circ}\). The crossover frequency \(f_{3 dB}\) has a reserve to be increased up to five times and can preserve a stable response within a phase margin of \(65^{\circ}\).