In spite of the fact that some people, having read glossy ads of various firms, think that there are no problems in ECG recording, severe practice of post-soviet (and other as well) medical institutions reveal, sometimes-somewhere, the trends. Especially during Holter examinations. And they considerably hamper the medical analysis. What concerns radio monitoring systems and bedside monitors, the trend for them is especially unpleasant, as the analysis is real-time by definition. All the more the operator reacts to what he sees on the screen here and now. And when the curves are spread all over the screen or, even worse, have reached its boundaries, the situation becomes disgusting indeed.
The cause of appearance of electrocardiogram trends can be both the electrodes themselves and the electrode contact with the connecting cable. Theoretically, with a high-quality modern electrode and normal state of the contact there should be no trends. However, these conditions are seldom met at actual operation of devices.
One must take into account that the users:
Never check up the electrode impedance after placing it on the body.
Never discard electrodes with expired shelf-life.
Never (till complete failure) replace connecting cables.
Never take into account the type and specific features of an electrode – they simply do not know that there are electrodes of different types (for long-term and short-term recording and so on).
More dangerous than “doltish” users are only “advanced” ones, who clean skin with spirit prior to placing an electrode in spite of the manufacturer’s direct prohibition (they haven’t read it) or resolder damaged electrode cables themselves. However, all kinds of reproaches addressed to the user are useless – this is the objective reality that designers and manufacturers of equipment constantly encounter.
So, the reason of trends during ECG recording can be the electrode variable impedance, polarizing potential drift and the third state of electrode-cable connector. We will also take into account that the indicated causes can lead not only to smooth trends, but also to voltage surges accompanied by subsequent trend.
When considering the question of trend compensation, we must take into account the value of interference: if it exceeds the dynamic range of the first stage of electrocardiograph, then the problem can be solved only by eliminating the interference cause, that is brining the electrodes and cable to the normal state. But the necessity of these actions causes hardly explainable irritation in the majority of users. They would rather declare the equipment “unsuitable” and try to fish out ECG fragments from interference, but will never agree to teach and control the nurses, who are in the majority of cases responsible for ugly quality of recording. However, it was always being so: expression “Murphy’s Law”, which has become a popular saying in America, appeared in 1949 when the causes of aircraft crashes were investigated. Captain Murphy, estimating the work of technicians of one of laboratories, gloomily declared that if something can be done wrong, these technicians will inevitably do so.
And if the interference value is less than the crucial one and the first stage dynamic band is not “depleted”, i.e. “rudders did not hit the stops”, we can try to compensate the appeared trend. It is clear that with a surge, in contrast to trend, we can do nothing, but the ECG isoelectric line can and must be brought to place, the sooner the better.
Thus, one must start to fight against the appeared trend starting from the amplifier’s second stage, i.e. the capacitor of the differentiating RC circuit between the first and the second stage with the time constant more than 3.2 sec must be discharged. This method was used in the “manual” version already in the very old electrocardiographs (the button was called “damper”). However, the manual version in a Holter recorder is unacceptable by obvious reasons, and instantaneous complete discharge of the capacitor also is not the best solution due to inevitable appearance of additional surge on the curve.
The only solution will be a parametric device, which lowers the time constant of the RC chain upon detection of impermissible shift at the output of the first stage. And the law of the time constant variation is of little significance, it is sufficient to connect an additional resistor, which will lower the circuit τ in four to eight times. That is at a surge or large trend (the modulus of which exceeds 1/3 of the dynamic range) the controlling processor connects via an analog gate an additional resistor, which, in its turn, reduces the time constant. As a result the isoline quickly returns to its place and there is no additional surge and the electrocardiogram in this case remains suitable for analysis and the process itself is intuitively understandable for the operator.
The described solution is simple in realization and does not require large computational resources, however in some cases such signal processing is not sufficient. If trends are observed on the ECG, but modulus of their amplitude is lower than 1/3 of the dynamic range, the suppression system will not be turned on, and, consequently, the trend will not be eliminated. Such trends can be observed, e.g. when a patient with incorrectly placed electrodes moves. And for full value compensation of trends it is necessary to use together with the described hardware-implemented algorithm, additional software processing of the signal.
The software compensator of trends must meet the following requirements. In the absence of surges and low-frequency (lower than 2 Hz) the time constant must be not less than 3.2 s, and when a surge or trend appears it must be suppressed so as to minimize the number of affected QRS complexes. That is, in order not to hamper the ECG analysis, the surge or trend must be suppressed in the shortest time.
The authors of the article have proposed the following algorithm of signal processing (see Fig.1).
Fig. 1. Simplified block-diagram of proposed algorithm of trend compensation.
The initial signal with surges or trends arrives at a HP filter and DC offset detector, which is an ordinary FIR filter with all coefficients equal to 1, that is performing averaging over time 1.0 s.
The obtained after the averaging signal is taken by modulus and used for determining at each moment of time the HP filter cut-off frequency. At zero DC offset the cut-off frequency is equal to 0.01 Hz; at the DC component of 3 mV and higher – 2 Hz (see Fig. 2).
Fig 2. HP filter cut-off frequency vs DC offset absolute value.
As the HP filter a first-order Bessel filter is used.
Figure 3 shows the AFR of the described parametric filter vs the absolute value of the input signal DC offset.
Fig. 3. 3D diagram of parametric filter AFR.
Thus, the proposed filter meets all the put forward requirements. In the absence of trends the time constant not less than 3.2s is ensured, and in the presence of trends the HP filter cut-off frequency is increased, thus compensating appeared surges or low-frequency oscillations.
Examples of the filter operation on actual electrocardiograms
Fig. 4. Example of processing of ECG with artificially added surge. Both charts represent lead II signal.
As can be seen from Fig.4, the surge has been successfully suppressed with the minimum number of appeared artifacts, and the isoline has been returned to the place over the minimal time.
The figure below shows the same ECG with indication of the observed path (region that the operator sees during recording).
Fig. 5. Initial ECG fragment with visible area indicated.
In the illustrated case, when a surge appears, the ECG signal will be outside the observed path for a dozen of seconds more, which can substantially hamper the analysis.
Fig. 6. The same ECG fragment with performed parametric filtering.
In case of parametric filter usage the ECG part, which earlier was outside the observed window, now is accessible for analysis, and only one QRS complex was damaged. In this case the last three beats are recorded with time constant of not less than 3 seconds.
The parametric filter can be used also for suppression of small trends, which substantially improves the quality of electrocardiogram perception and simplifies its analysis.
Fig. 7. Filtering example of electrocardiogram filtering with artificially added trend.
When recording an electrocardiogram under real conditions (especially in the case of poorly placed electrodes) appearing surges exceed the dynamic range value of the recording equipment. In the situation illustrated below the surge caused by electrode disconnection has been suppressed by the software compensation system, but, as the next trend exceeded the electrocardiograph dynamic range, the software suppression system was insufficient and part of the data has been lost.
Fig. 8. Filtering result of the ECG fragment, corresponding to the moment of electrode disconnection. The surge value exceeded the device dynamic range, therefore after the artifact the absence of ECG signal is visible during several seconds.
On the shown fragment of electrocardiogram at the moment of the electrode disconnection the hardware system of trend compensation was automatically used as well, and its operation has substantially reduced the number of lost counts.
During operation of the electrocardiograph with built-in parametric filter many recordings have been made, on which the electrode resistance reached 1-2MOhm. Shown below are several fragments of electrocardiograms of patients, recorded during execution of physical exercises, which can be seen due to the presence of muscular artifacts.
Рис. 9. Два фрагмента ЭКГ с мышечными артефактами.
Active movements of patients cause, apart from muscular artifacts, large trends that were suppressed by the software compensation system, and as a result the ECG signal does not go outside the limits of the visible UI window and is suitable for analysis.
Fig. 10. One more record obtained during physical loads on patients. The electrode resistance was impermissibly high (about 0.5MOhm). Nevertheless there are no substantial trends (they are suppressed), the ECG is suitable for analysis, and the automatic QRS beats detector (indicated with red triangles on top) worked correctly.
Conclusions
The authors think that the parametric filtration of electrocardiogram surges and trends substantially simplifies and eases its analysis. We believe that no other method can provide such result at comparable expenses.
Attachment
AntitrendFilter.zip – archive with the source code of one of implementations of the described parametric filter on С++. Uses DspFilter library.