The subtraction procedure for PL elimination was first elaborated some two decades ago [22]. This procedure does not affect the ECG components neighbouring the PL frequency. This theoretical study is carried out for the basic PL frequency, but the conclusions are also valid for its harmonics and, consequently, for an arbitrary interference waveform. The efficiency of the procedure does not depend on the amplitude of the interference, as long as the amplifier is not saturated. Moreover, the procedure copes successfully with changes in amplitude and frequency of the interference. The procedure has been continuously improved over the years [12, 13, 23–32], and implemented in thousands ECG instruments and computer-aided systems [33, 34]. Similar approaches have also been published by other researchers [35–41].
Principles
The subtraction procedure is applied originally with sampling frequency f
S
, a multiple of, and hardware synchronized with the PL frequency f
PL
. The procedure consists of the following steps [22]:
-
ECG segments with frequency band near zero are continuously detected using an appropriate criterion. They are referred to as linear segments and are found mainly in the PQ and TP intervals, but also in sufficiently long straight parts of the R and T waves.
-
The samples of these segments are moving averaged, i.e., subjected to a linear phase comb filter [42] with first zero set at f
PL
. Thus, the filtered samples do not contain interference.
-
Interference amplitudes, called corrections, are calculated for each of the phase-locked samples, n, in the PL period, T
PL
, by subtracting the filtered samples from the corresponding ones of the contaminated (original) ECG signal.
-
The set of corrections obtained is continually updated in linear segments and used in non-linear segments (usually around QRS complexes and high-amplitude T waves) to subtract the interference from the original ECG signal.
One of the first results obtained by the subtraction method is shown in Fig. 1 [22]. Interference was added to a clean simulated ECG signal in order to evaluate the errors and the efficiency of the method.
Linear criterion
A linear criterion, Cr, usually corresponds to the second difference of the signal (mathematical evaluation of the linearity). The first Cr [22] is defined in the following manner. Six consecutive first differences, FD
i
, are calculated using signal samples, X
i
, spaced at one T
PL
:
FD
i
= X
i+n
- X
i
, for i = 1 ... 6 (1)
The PL interference in the first differences is suppressed if n = f
S
/f
PL
. In this case n = 5, since the procedure was developed initially for rated f
PL
= 50 Hz and f
S
= 250 Hz. Furthermore, the maximum FD
max
and minimum FD
min
values are taken to determine Cr:
Cr = | FD
max
- FD
min
| <M, (2)
where M is the threshold value.
Typical linear and non-linear segments are shown in Fig. 2. Real ECG signal (trace a) is superimposed by interference (trace b). The linear segments include low frequency signal and power-line frequency components. An approximate frequency spectrum of such linear segments is shown in Fig. 3.
This criterion works accurately, but can hardly be applied in real time because its relatively slow implementation. This drawback is overcome by Christov and Dotsinsky [23] who use a modified criterion of just two subsequent differences.
Cr = | FDi+1- FD
i
| <M. (3)
The first sample, which does not fulfill equation (3), is associated with the beginning of a non-liner segment. In the non-linear to linear transition, equation (3) should be satisfied consecutively n times in order to avoid premature detection of the linear segment. The criterion is implemented in real time for f
S
= 400 Hz and n = 8.
Later, Dotsinsky and Daskalov [13] defined the criterion as two non-subsequent differences:
Cr = |FDi+k- FD
i
| <M, for k >1 (4)
This approach makes the transition from linear to non-linear segment more precise.
Compensation of PL amplitude variations
The more frequently the corrections are updated, the better compensation of the amplitude variations of the PL is achieved. Therefore, the linear criterion threshold, M, has to be reasonably less restrictive so that the errors, committed by averaging some segments that depart from the ideal linear signal, are smaller than the errors, that will appear if M initiates sporadic updating of the correction. Initially, M was fixed at 160 μV [22]. Later, heuristic values were found to be M = 150 μV [23] and M = 100 μV [13].
Linear filtering
For odd sample number n = 2m + 1 in one period of the PL interference, the filtered value:
is phase-coincident with the non-filtered one.
In case of even number n = 2m, the two values are phase-shifted by a half of the sample period:
but become in-phase coincidence using the formula
It is possible to take for averaging every second, third or qthsample if n/q is integer. Depending on whether n/q is odd or even, equation (7) or (8) is used, respectively.
A special case of maximum sample reducing arises with q = n/2 [28]. The corresponding formula:
is called 'three-points' filter. In addition to equation (8), the following formula
can also be applied if q is even. In case of q = n/2, the filter becomes 'two-points' and is represented by:
Reduced sample number in a period of the interference will lead to enhanced steep slope of the comb filter lobes and will shorten the computation time. However, these 'advantages' must be assessed carefully in order not to violate the Nyquist rule with a large amount of the third harmonic present. The other harmonics are not taken into consideration since the highest odd harmonics are usually suppressed by low-pass filters with cut-off in the range of 100–150 Hz, while the even ones are practically absent because of the precise pole manufacturing of the electric power station generators.
Compensation of PL frequency variation
The allowed deviation from the rated PL frequency is limited in some countries up to 1% by the standards. In practice, deviation is oftentimes higher. Kumaravel et al. [43] reported for variation of 3%. McManus et al. [44] found considerable changes in the interference frequency, which is superimposed on recordings taken from the Common Standards for Electrocardiography (CSE) database.
Frequency variations lead to a special case of non-multiple sampling with real n, instead of integer one. This complication can be bypassed if the deviations are detected by continuous hardware measurement of f
PL
and corrected by small adjustments of the sample interval t
S
around its rated (R) value, t
RS
= T
RPL
/n (here, T
RPL
= 20 ms is the rated T
PL
for f
RPL
= 50 Hz). For f
PL
, deviation between 49.5 and 50.1 Hz, the t
S
variations are in the range of 1%, and consequently they do not introduce errors beyond the accepted measuring accuracy of parameters that are usually used for automatic ECG classification.
A first approach associates the triggering of each first sample, S
1
, of the sequences S
k
(k = 1, 2...n) in the periods T
PL
with arbitrary chosen but constant amplitude of the PL voltage. The next samples, S
k
(k = 2...n), are spaced at t
S
, which is obtained by t
S
= T
RTL
/n. For 50 Hz, and n = 5, t
S
= 4 ms. Two types of errors committed using this approach are studied by Dotsinsky and Daskalov [13]. The first, due to inter-sample irregularities, may reach 1% at f
S
= 400 Hz and 1.2% at f
S
= 250 Hz, in case of 1% deviation around the f
RPL
. The second type of error does not exceed 3% and is a consequence of the additionally shifted location of the filtered sample.
Dotsinsky and Daskalov [13] reported an improved approach. The ongoing period T
PL
is measured and divided by n. The obtained t
S
is used in the subsequent T
PL
.
Efficiency assessment of the procedure
Subtraction procedure examples are shown in Fig. 4 and Fig. 5. The ECG signals are taken from the American Heart Association database. The signals are notch filtered to suppress the 60 Hz (PL frequency in the US) interference. Then, the signals are mixed with 50 Hz interference, amplitude modulated from 0 through 3.2 mVp-p by a slew rate of 200 μVs-1. The traces are identified as follows: i) input signal; ii) synthesized interference; iii) mixed signal; iv) processed signal; v) difference between original and processed signals and vi) zoomed difference. Actually, the discarded components also include electromyographic (EMG) and other noises. A non-suppressed part of the signal, together with small residual interference and distortions due to compromise with the M value are also present in the differences.
Two signals are used to assess the efficiency of the subtraction procedure with respect to the interference only. The first, taken from our own database, is called conditionally 'clean' (Fig. 6). The result shows small differences between input and processed signals, visually due to the noise presented in the input. This result is verified with the second synthesized signal, which does not contain any disturbances (Fig. 7). As can be seen, no distortions are introduced. The same synthesized signal is superimposed by interference and processed (Fig. 8). No residual interference can be found.
Influence of EMG noise
Sometimes EMG noise is so high that the linear segment finding is hampered. As a consequence, inaccurate corrections, which do not correspond to the last change of the interference amplitude, will cause errors (see the residual noise between the 11th and 14th s in Fig. 9).
A very simple approach for suppression of EMG noise influence on the procedure introduces an additional parallel buffer where ongoing portions of the signal are unconditionally averaged [31]. This buffer is used for accurate linearity detection. Fig. 10 and Fig. 11 show the comparison of results without and with the parallel buffer. The traces 'a' represent ECG signal mixed with interference and EMG noise. The traces 'b' in Fig. 10 and 'c' in Fig. 11 indicate transitions from linear to non-linear segments (on-off functions). As can be seen, the averaged signal part in Fig. 10 is very limited. As a consequence, the procedure efficiency is reduced (Fig. 10c and 10d. In contrast, the parallel buffer allows detection of long linear segments (Fig. 11c and the residual noise in the processed signal (Fig. 11d is low. However, the noise is not totally suppressed because a part of it participates in the correction calculation.
Further improvement in EMG noise suppression is obtained by Christov [29] by using adaptive threshold value M, which is calculated with respect to the noise/signal ratio Rt, defined as Rt = S
NL
/S
F
, where the noise level S
NL
equals the summary width of the non-linear segments in an epoch S
F
, approximately corresponding to the RR interval under consideration. Linearity search with a criterion of M = 150 μV for 'clean' ECG (Fig. 12a) and for the same signal, but contaminated with EMG noise (Fig. 12b) show different S
NL
, (Fig. 12c and 12d). The method is developed in MATLAB environment. The initial threshold M is chosen equal to 30 μV. Then, it is gradually increased until Rt reaches 10%, after which the subtraction procedure is started. The level Rt ≤ 0.1 value is suggested by the ratio 'QRS width versus its RR interval', which is usually around 10%. The elimination of both interference and EMG noise can be observed in Fig. 13b and 13d, where M = 420 μV is used. For comparison, the 'clean' ECG signal is processed with M = 35 μV (Fig. 13a and 13c).
Linear segments cannot be regularly found in patients with atrial and ventricular fibrillation. However, the total preservation of the wave shape is not necessary for fibrillation detection and therefore, all kinds of traditional filters may be applied.
Interference suppression in high-resolution ECG
The subtraction procedure is not directly applicable to the body-surface His-ECG, as the low amplitude and relatively low frequency His-wave can not be distinguished in linear segments. Thus, the His-wave will be, in practice, suppressed or even removed from the signal. The EMG noise is usually of higher amplitude and with much higher frequency content compared to the surface His-wave. Therefore, simple change of the threshold value, M, does not result in acceptable delineation of linear and nonlinear segments.
Bazhina et al. [45, 46] implemented the following modification. The beginning of the detected non-linear segment before a QRS complex is shifted 100 ms to the left, thus defining the His-wave region as a non-linear segment by default (Fig. 14).
The subtraction procedure and three other methods: notch filters, spectral interpolation [47], and regression subtraction [35] are tested against minimal distortion of the original signal [45]. The subtraction and the regression-subtraction procedures proved to be the best, as Baratta et al. [35] use a similar concept for noise estimation in linear segments. Regression-subtraction deals poorly with amplitude changes of the interference within the current segment.
Case of battery-supplied devices and computer aided ECG systems
The hardware measurement of f
PL
, necessary for compensation of the interference frequency modulation, is not feasible in battery-supplied devices and in some computer aided ECG systems. Dotsinsky and Stoyanov [12] studied the range of frequency changes of interference with constant amplitude, for which the residual part is restricted to acceptable levels without use of synchronized sampling. They found that residual interference below 20 μVp-p could be obtained with the procedure by: i) interference amplitude ≤ 0.4 mVp-p and ii) frequency change with a rate ≤ 0.0125 Hzs-1. Since such requirements for the power-supply can often be exceeded, a software interference measuring was developed.
The ECG signal is processed initially by a 49–51 Hz band-pass filter. The amplitudes of two adjacent samples, Br
L
and Br
R
, taken from a positive-going slope of the interference, located below and above the zero line, are measured (Fig. 15). The distance, t
CP
, between the crossing point CP and the right sample, Br
R
, is computed continually by:
In case of T
PL
change, t
S
is redefined using
This approach was implemented in the MATLAB environment. For sampling frequency f
S
= 500 Hz and f
RPL
= 50 Hz, n is equal to 10. The product kn determines the time recommended to elapse before calculating and substituting new tCP,i + knfor the previous tCP,i. Fig. 16 shows a processed 1 mV ECG signal after being mixed by interference with 2 mVp-p constant amplitude and extremely fast varying by 1 Hz per 8 s frequency (first trace). To assess the efficiency obtained, the zoomed difference without synchronized sampling (last trace) is also presented.
The next logical step to be taken consists of: i) keeping the rated t
S
of the ECG instrument, ii) re-sampling the signal according to the ongoing measured f
PL
in order to eliminate the interference and iii) returning to the rated t
S
. The first results of such an approach are highly promising [48]. Thus, the software compensation of the variable f
PL
, as well as a total implementation of the subtraction procedure in an instrument, including automatic adjustment for f
RPL
of 50 or 60 Hz, will be completed regardless of the hardware circuits and the corresponding software.
Automatic adaptation to the rated PL frequency
A common program for alternative interference subtraction in 50 and 60 Hz environment leads to non-multiple sampling, i.e. to real n. Widely used values of t
S
for f
RPL
= 50 Hz, such as 250, 500 and 1000 Hz, correspond to irrational n of 4.1(6), 8.3(3) and 4.1(6) if 60 Hz interference has to be eliminated. In the inverse case, f
S
= 360 Hz requires n = 7.2. Rounded values n* are unacceptable to use, since they would introduce considerable error.
A very simple solution not needing f
S
change was found by Dotsinsky and Stoyanov [30]. The original procedure applies a comb filter over one period, T
PL
, of the interference. Thus, the program runs faster. Generally, n may be taken from k > 1 entire periods. The procedure is operated if:
n = kT
PL
/t
S
is an integer.
For t
S
= 2 ms (f
S
= 500 Hz) and f
RPL
= 50 Hz, the smallest value of k satisfying equation (14) is really k = 1. However, in case of 60 Hz, k equals 3. Zeros associated with the sub-harmonics 20 and 40 Hz will appear too but they have no influence on the procedure. Therefore, it is quite enough to switch n between 10 (k = 1) and 25 (k = 3) in order to operate with both interferences. For this purpose two digital band-pass filters check the incoming signal. Fig. 17 shows that the filter with frequency band overlapping the interference generates an order of magnitude higher output signal than the other filter.
Theoretical procedure development
The theory of the subtraction procedure was developed further by Mihov [27], Levkov and Mihov [28], and Mihov et al. [32]. They proposed four types of filters, implemented in a generalized structure that may overcome the problems with almost all cases of non-multiple sampling, including interference frequency variations, without using synchronized AD conversion.
The so-called D-filter in multiple sampling is defined as is Cr in equation (2), where the second difference, D
i
, is obtained with FD s that are spaced at one T
PL
:
D
i
= (X
i+n
- X
i
) - (X
i
- X
i-n
) = X
i-n
- 2X
i
+ X
i+n
(15)
The transfer function of the D-filter has zeros at f = 0 and f = f
PL
Hz, which is shown equal to 50 Hz in Fig. 18.
The K-filter describes the moving average presented by equations (5) and (6). Its transfer function is given in Fig. 19 for n = 5 in case of odd multiplicity.
The equation used for ongoing calculation of the interference components:
B
i
= X
i
- Y
i
(16)
actually defines a digital filter called (1-K)-filter.
Furthermore, the filters are re-defined for non-multiple sampling, and f
S
= 250 Hz in conjunction with f
RPL
= 60 Hz is taken in consideration to illustrate the software improvement.
In order to preserve the transfer function zeros, the D-filter has to be subtracted with a correction filter with zero at f = 0 and gain of D
RPL
at f = f
RPL
, equal to the gain of the D-filter for the same frequency, f
RPL
. The correction filter synthesis is based on a three-points auxiliary filter given by the equation:
where (n/2)* is the rounded value of n/2.
Since A
RPL
is the gain of the auxiliary filter for f = f
RPL
, the correction filter is multiplied by the ratio D
RPL
/A
RPL
. Using the corresponding transfer functions, D
RPL
and A
RPL
are computed in advance by:
Finally, the corrected D*-filter is presented as
and is shown in Fig. 20 by trace 'c', where traces 'a' and 'b' are the D-filter and the correction filter, respectively.
The transfer function of the K-filter must preserve zero for f = f
RPL
, unity gain for f = 0 and linear phase response. The procedure of the K-filter correction is similar to the previous one. An auxiliary filter is given by the formula used for corrections computation:
A
i
= X
i
- Y
i
, (20)
The filter gain is equal to 1 - K
RPL
for f = f
RPL
, where K
RPL
is the K-filter gain for the same frequency f
RPL
. The auxiliary filter is multiplied by K
RPL
/(1 - K
RPL
) and subtracted from the K-filter. The equation for the corrected K*-filter is:
The constant K
RPL
can be estimated by:
for odd or even multiplicity, respectively.
An example of K-filter correction is shown in Fig. 21, where traces 'a', 'b' and 'c' represent the primary K-filter, the auxiliary filter, and the corrected K*-filter.
In case of non-multiple sampling, a phase difference appears between the ongoing ECG samples and the interference components B
i
(equation 16) usually located in a temporary first-in-first-out (FIFO) buffer. Therefore, B
i
must be modified being subtracted from the ECG samples during non-linear segments. The compensation procedure is relatively complicated. Fig. 22 shows the contents of the temporary buffer. The current interference sample, B
i-n
*, does not coincide with the restored sample, B
i
. Its amplitude must be recalculated in order to compensate the phase difference between them. This is accomplished by a new filter with linear phase response and unity gain for f = f
RPL
, denoted as the B-filter. It is synthesized from the known K-filter, with a window equal to the interference period. In case of odd n*, it can be described as:
where K
RPL
is the gain for the interference of the averaging filter given by equation (22).
The restored buffer value B
i
can be calculated by:
In case of even n*:
The B-filter transfer function is shown in Fig. 23.
The generalized structure is presented in Fig. 24, where the modules of the subtraction procedure are as follows:
-
Linearity detection. D-filter is applied to evaluate the linearity of each signal sample neighbourhood.
-
Interference extraction. (1-K)-filter is used to calculate the interference component.
-
Criterion. The condition Cr <M sends either extracted or restored PL interference to Subtraction.
-
Interference temporary buffer. The extracted or restored interference component used as correction in non-linear segment is saved at the position locked with the ongoing phase of the power-line interference.
-
Interference restoring. B-filter is called in case of non-multiple sampling in order to restore the true correction values, which have to be subtracted from the input signal samples in non-linear segments.
-
Delay buffer. Compensates the delay, which appears with the D-filter and (1-K)-filter and is imperative if the procedure is run in quasi-real time. Otherwise, the buffer could be disregarded.
-
Subtraction. Extracted or restored interference value is subtracted from the delayed input signal to output 'clean' ECG signal. In case of non-linearity both Interference extraction and Subtraction implement the K-filter.
An improved algorithm according to the generalized structure has been tested off-line. The results for f
S
= 250 Hz and f
RPL
= 60 Hz are shown in Fig. 25.