Validation of an algorithm to reveal the U wave in atrial fibrillation

Major cardiac organisations recommend U wave abnormalities should be reported during ECG interpretation. However, U waves cannot be measured in patients with atrial fibrillation (AF) due to the obscuring fibrillatory wave. The aim was to validate a U wave measurement algorithm for AF patients. Multi-beat averaging was applied to ECGs of 25 patients during paroxysms of AF and the presence of U waves compared to those from the same patients during sinus rhythm (SR). In a further database of 10 long-term AF recordings, the number of beats for effective U wave extraction by the algorithm was calculated. U waves were revealed in all AF recordings and there was no significant difference between the presence of U waves in AF and SR (p = 0.88). U wave amplitude was significantly increased in AF (mean (s.d.) amplitude 55 (39) AF vs 37 (28) μV SR, p = 0.005). The presence of U waves could easily be discerned when as few as 10 beats were used in the algorithm. The study demonstrates the validity of the algorithm to reveal U waves in AF recordings. The algorithm offers the potential to detect U wave abnormalities in patients with AF.

The aims of the present work were two-fold: (i) First, to validate the beat averaging algorithm. Our preliminary study 8 provided no validation of the U wave extraction algorithm, so the first aim was to validate the algorithm. Here we validate the algorithm by comparing U waves extracted from AF recordings to U waves readily observable in SR recordings for the same patients. This is referred to as the 'validation study'. Assuming U waves are unchanged during AF, validation implies the presence of U waves in both AF and SR recordings. (ii) Second, to define the requirements for effective U wave extraction in terms of the number of beats needed for beat averaging. Since the quality of the extracted U wave is dependent upon the number of beats used to generate the average beat, the second aim was to establish the number of beats required for effective U wave extraction in AF recordings. This is referred to as the 'number of beats study'. It has important implications for the clinical application of the algorithm since the number of beats determines the ECG recording duration.

Results
Validation study. From the database of 25 patients for which recordings in both AF and SR were available, 3 patients were excluded because fast heart rates during SR caused the U waves to be obscured by following P waves in these patients. After applying the beat averaging algorithm to the recordings of the remaining 22 patients all 22 patients had visible U waves in both AF and SR. There were no discrepancies between the reporting of the presence of U waves by the two observers. Table 1 provides the contingency table for U waves extracted from AF and those in SR. There was no significant difference in the presence of U waves in AF compared to SR (p = 0.88). Figure 1 shows a representative example of U waves extracted from AF and SR recordings for the same subject. Figure 1a illustrates the difficulty of discerning the U wave in AF. It shows a 5 second strip of ECG in which the irregular beat intervals and atrial fibrillatory wave obscure the underlying U wave. The U wave was revealed by the beat averaging algorithm as shown in Fig. 1b where the U wave extracted from the AF recording is clear and, as expected, follows the T wave. Further validation of the algorithm is provided in Fig. 1c,d which show the 5 s strip and average beat respectively for the same patient but in SR. The U wave extracted by the algorithm in AF was of the same morphology to that in SR but with increased amplitude.
Patients exhibited a wide range of U wave amplitudes. Figure 2 shows the paired relationship between U wave amplitudes in SR and AF recordings. The patient with the largest U waves in SR recordings also had the largest U waves in AF recordings but the mapping was not consistent across all patients. Interestingly, U wave amplitudes during AF were significantly larger than during SR (mean (s.d.) 55 (39) vs 37 (28) μV, p = 0.005) with the majority of patients (73% (16/22)) exhibiting larger U waves during AF compared to SR. Figure 3 shows the effect on U wave amplitudes by changing the number of beats (N beats ) used to generate the average beat in the U wave extraction algorithm for all recordings. The effect of reducing the number of beats from the maximum of 100 beats (reference, N beats = 100) was to increase the U wave amplitude in all cases. The amplitude increase can be explained by the presence of increasing levels of noise contaminating the extracted U wave as the number of beats is reduced. Theory predicts that as the number of beats is reduced the effectiveness of noise reduction by beat averaging decreases.

Number of beats study.
Combining the data for all subjects and analysing the difference of U wave amplitude (ΔU amp) relative to the reference U wave amplitude, Fig. 4a shows that there was a mean amplitude difference of 5 μV when using 10 beats rather than 100 beats to generate the average U wave. In other words, residual noise increased to 5 μV when only 10 beats are used in the algorithm compared to 100 beats. Mean amplitude differences were significantly greater than zero across the trials (p = 0.0000183, within-subject ANOVA) and post-hoc analysis suggested that there were no significant differences in amplitude with respect to reference when at least 70 beats were used (mean (s.d.) ΔU amp = 0.2 (0.4) μV, N beats = 70 beats, p = 0.1063). When expressed as a percentage of the U wave reference amplitude the mean amplitude increase was less than 1% when using 70 or more beats and increased to 14% when using only 10 beats. Nonetheless, it was observed that with as few as 10 beats (N beats = 10) the presence of U waves could readily be visually discerned as illustrated in Fig. 4b.

Discussion
This is the first study which validates an algorithm to reveal the U wave in AF patients. In the 'validation study' U waves were present in all 22 patients during episodes of AF for which U waves could be seen in corresponding SR recordings in the same patients. U waves in AF had the same polarity and morphology as those in SR but with increased amplitude in most subjects. The increased amplitude in AF could not be accounted for by residual noise (i.e. residual atrial fibrillatory wave) since none could be seen in the resulting average beats after close visual inspection and as illustrated in the example shown in Fig. 1. With the ability to now measure U waves during AF the algorithm provides the opportunity for researchers to explore potential mechanisms which might explain differences in U waves during AF and SR. Interestingly, when we applied our algorithm to the AF recordings of the 3 patients which had no observable U wave in SR, U waves were present during AF as illustrated in the example of Fig. 5. Although U waves could  not be seen in the 3 SR recordings it seems likely that U waves were present but simply obscured by the P waves of the next cardiac cycle due to the fast heart rates in these SR recordings. Surawicz stated that the U wave cannot be seen at fast heart rates 1 .
Although the mechanism of U wave genesis is unknown, the U wave is a reliable feature unvarying in its occurrence at the end of the ventricular cycle in every ventricular beat. The algorithm exploits this feature by using the beat averaging technique to reveal the low amplitude U wave [12][13][14] . By averaging a number of ventricular beats the overall noise components in the ECG signal are reduced [12][13][14] . It is effective because the U wave and noise, which includes the atrial fibrillatory wave, are uncorrelated. The noise is effectively 'averaged out' over a number of ventricular beat cycles.
The number of beats to use in the calculation of the average beats is an important consideration since the greater the number of beats the greater the noise reduction. On the other hand, the greater the number of beats, the longer duration of recording which is required with associated resource implications. The 'number of beats study' showed that decreasing the number of beats from 100 to 70 did not significantly affect the U wave amplitude. However, the U wave was readily observable when the average beat was generated from as few as 10 beats with an average increase in noise amplitude of only 5 μV or 14% of reference amplitude. The study can be used to guide the requirement for the number of beats to use dependent upon the required application.
While in SR recordings the beat averaging algorithm removed some of the noise inherent in all clinical ECG recordings, the U wave can be seen without beat averaging in SR with good recording technique. However, at high heart rates the U wave becomes obscured by the following P wave 1 .
The algorithm satisfies an unmet clinical need because until now it has not been possible to report U waves in AF. Many studies have noted the diagnostic value of U wave abnormalities, particularly inverted U waves [17][18][19] . Although we did not detect any abnormal U waves in our cohort the algorithm facilitates the reporting of U wave abnormalities in AF patients as recommended by the important cardiac associations 2,7 . Further, the algorithm can be used to provide mechanistic insight into the origin of the U wave since AF is unique in its rapidly changing ventricular beat intervals. Preceding RR interval is known to affect ventricular filling dynamics 20,21 which are implicated in the genesis of the U wave through the electro-mechanical hypothesis of the U wave 1,4,5,7,22 . In conclusion, ventricular beat averaging reveals the U wave in AF patients. The algorithm facilitates the detection and reporting of U waves and their abnormalities in AF patients.

ECG databases.
Two ECG databases were used in this work according the requirements of the sub-studies as described below. The study was approved by the University of Hull and Northumberland Local Research Ethics committees and all methods were performed in accordance with the relevant guidelines and regulations.
Validation study. The database comprised recordings from 25 patients for which both AF and SR recordings in the same patient were available. Fourteen suitable recordings were available from the PAF Prediction Challenge database from PhysioNet 23 . A further 11 historical recordings from routinely collected ECG during electrophysiological studies at Castle Hill Hospital were used. The requirement for individual patient consent was waived as the study did not impact clinical care and all data were anonymised. Recording duration for AF or SR was a minimum of 4 minutes and recordings had sampling rate of either 128 Hz (PhysioNet) or 1953Hz. The PhysioNet recordings comprised two unspecified leads 23 whereas the others had standard 12-lead ECG. As the lead with the most prominent U wave 8 lead V4, or if V4 was not available (i.e. PhysioNet recordings) the lead with the most prominent U wave, was analysed.
Number of beats study. The requirement for this database was the availability of long duration AF recordings to ensure a large number of ventricular beats to be used in the beat averaging algorithm. For this purpose, an existing database of 15 minute, 12-lead ECG recordings from 10 AF patients was used. Patients gave informed consent for these recordings. It is the same database used in our preliminary study 8 . The sampling rate was 500 Hz and lead V4 was analysed in this study. U wave extraction algorithm. AF recordings. U waves were extracted using a beat averaging algorithm.
The average beat was formed using only beats with similar preceding RR interval. Careful selection of qualifying beats with respect to preceding RR interval and their alignment ensured optimum U wave extraction and minimised the effects of heart rate dependency of U wave timing and amplitude. The ECG processing workflow is illustrated in Fig. 6 and comprises (i) R wave detection, (ii) RR histogram, (iii) selection of qualifying beats and (iv) calculation of the average beat and identification of the U wave. R wave peaks (R i ) were detected automatically and confirmed by visual inspection (Fig. 6a). If present, ectopic beats and their adjacent intervals were removed. RR intervals were calculated (RR i−1 = R i − R i−1 ). The RR histogram with bin size (RR bin ) of 100 ms was constructed so that the number of beats (N beats ) at specific RR intervals could be identified (Fig. 6b). To ensure the average beat was generated using the maximum number of beats with similar RR intervals, only beats falling within the bin with the most number of beats were selected (Fig. 6c). In other words, qualifying beats had RR i−1 = RR mode ± 50 ms, where RR mode was the histogram bin with most number of beats. A further requirement was to exclude beats with short following RR intervals (RR i ) that would otherwise contaminate the averaged U wave, therefore beats with RR i less than a threshold (RR min ) of 650 ms were excluded. All qualifying beats were aligned to their R wave peak (R i ) (Fig. 6c), and the average beat in each lead was calculated as the mean amplitude across the beats (Fig. 6d). The presence of a U wave was identified from the average beat (Fig. 6d). It is important to note that it is the preceding RR interval (RR i-1 ) which is important to consider rather than the RR interval containing the U wave (RR i ) since our preparatory work indicated that the preceding RR interval is the major determinant of U wave amplitude.
SR recordings. With good quality SR recordings, the U wave can be readily seen without significant processing. However most clinical recordings present some noise and by applying the same beat averaging algorithm as for the AF recordings the resulting noise reduction allows for optimal presentation of U waves. Hence SR recordings were processed by the same algorithm used for the AF recordings. However, in SR at fast heart rates the P wave can impinge on the U wave so it was necessary to extend the RR min interval to ensure that any following P waves would not contaminate the beat averaged U wave.

Data analysis. Validation study.
For each patient the presence or absence of U waves in the average beat was assessed visually and independently by two observers (MSA, PL). A positive validation outcome was defined as the presence of U waves of same polarity and morphology in both SR and AF recordings from the same patient, otherwise a negative validation outcome was recorded. Validation outcomes were recorded in a contingency table and statistical significance of agreement between U wave presence in AF and SR assessed by McNemar's test. U wave amplitude from baseline to U peak was measured automatically but confirmed visually. Stable baseline amplitude was estimated from a 10-sample window in the electrically quiescent period before the onset of the QRS complex in AF recordings and before the onset of the P wave in SR recordings. Significance of differences in amplitude between SR and AF recordings was assessed by paired t-test.

Number of beats study.
To determine the effect of the number of beats (N beats ) on the quality of extracted U waves in AF recordings, the algorithm was systematically iterated with diminishing number of beats used for beat averaging at each iteration. Trials were conducted where the number of beats was systematically reduced from 100 beats (reference) in steps of 10 down to 10 beats (i.e. N beats = {100, 90, 80, 70, 60, 50, 40, 30, 20, 10}).
Rather than discard some beats for trials where N beats was less than 100, multiple sub-trials were conducted so that all 100 beats were analyzed across all the sub-trials. This was achieved by dividing the 100 beats into contiguous groups of 10 beats. For each N beats trial, 10 sub-trials were conducted, systematically including the appropriate number of groups of 10 beats so that over the 10 trials all the beats were used. See the example in Figure A1 (supplementary document).

Figure 6.
Signal processing workflow to extract U waves from AF recordings. R wave peaks ( ) were detected in the ECG lead (a) from which the RR histogram (bin size RR bin = 100 ms) was created (b). Beats meeting the selection criteria (RR i−1 = RR mode ± 50 ms and RR i > RR min ) were extracted from the ECG lead and aligned to the R peak (R i ) (c). The average beat (d) was calculated from the collection of beats over the interval corresponding to the grey area in (c) revealing the U wave.
SCiENTiFiC RePoRtS | (2018) 8:11946 | DOI:10.1038/s41598-018-30493-8 Noise reduction and hence U wave quality was quantified by U wave amplitude since U waves contaminated by noise have larger amplitude than clean U waves. Amplitude measurement was as described for the validation study. Differences between U wave amplitude for each N beats trial and reference U wave (N beats = 100 beats) were calculated as ΔU amp = U amp (N beats ) − U amp (N beats = 100)) and statistical differences with respect to zero amplitude difference assessed by within subjects ANOVA and post-hoc t-test. All tests were two-sided and p-values less than 0.05 considered statistically significant.