ECG-based monitoring of blood potassium concentration: Periodic versus principal component as lead transformation for biomarker robustness

Objective: The aim of this study is to compare the performance of two electrocardiogram (ECG) lead-space reduction (LSR) techniques in generating a transformed ECG lead from which T-wave morphology markers can be reliably derived to non-invasively monitor blood potassium concentration ([K]) in end-stage renal disease (ESRD) patients undergoing hemodialysis (HD). These LSR techniques are: (1) principal component analysis (PCA), learned on the T wave, and (2) periodic component analysis (πCA), either learned on the whole QRST complex (πCB) or on the T wave (πCT). We hypothesized πCA is less sensitive to non-periodic disturbances, like noise and body position changes (BPC), than PCA, thus leading to more reliable T wave morphology markers. Methods: We compared the ability of T wave morphology markers obtained from PCA, πCB and πCT in tracking [K] in an ESRD-HD dataset, including 29 patients, during and after HD (evaluated by correlation and residual fitting error analysis). We also studied their robustness to BPC using an annotated database, including 20 healthy individuals, as well as to different levels of noise using a simulation set-up (assessed by means of Mann–Whitney U test and relative error, respectively). Results: The performance of both πCB and πCT-based markers in following [K]-variations during HD was comparable, and superior to that from PCA-based markers. Moreover, πCT-based markers showed superior robustness against BPC and noise. Conclusion: Both πCB and πCT outperform PCA in terms of monitoring [K] in ESRD-HD patients, as well as of robustness against BPC and low SNR, with πCT showing the highest stability for continuous post-HD monitoring. Significance: The usage of πCA (i) increases the accuracy in monitoring dynamic [K] variations in ESRD-HD patients and (ii) reduces the sensitivity to BPC and noise in deriving T wave morphology markers.


Introduction
Continuous cardiac monitoring using electrocardiogram (ECG) recordings has become increasingly important for early detection of cardiovascular risk [1][2][3]. Over the last years, numerous ECG-based markers have been proposed for early stratification of individuals at high-risk of sudden cardiac death [4][5][6][7], among which are end-stage renal disease (ESRD) patients undergoing hemodialysis (HD) therapy [8]. One of the main causes of sudden cardiac death in ESRD-HD patients is ventricular arrhythmia appearing consequence of blood potassium concentrations ([K + ]) out of the normal range [9]. Therefore, a reliable, non-invasive and affordable method for continuous monitoring of [K + ] and its associated cardiovascular risk in ESRD-HD patients is crucial.
The effects of [K + ] on the ECG have been investigated for many years, mainly involving T-wave morphological changes [10,11] which led to the development of several T-wave derived biomarkers able to noninvasively quantify [K + ] [12][13][14]. Recently, we proposed and investigated the feasibility of several T-wave morphology-based markers derived from T-wave time-warping analysis [15] in tracking [K + ] [16][17][18][19]. These T-wave descriptors were obtained by applying principal component analysis (PCA) as a lead space reduction (LSR) technique, so that morphology analysis is performed over the transformed lead (TL) maximizing the T-wave variance. However, this approach may not be the best strategy for emphasizing clinically relevant information, which is the main focus of this work. Indeed, PCA's maximum-variance criterion might be problematic when there is a low signal-to-noise ratio (SNR) or in the presence of body position changes (BPC) [20,21]. In other words, PCA may not be able to distinguish between noise and the useful [K + ]-driven T-wave morphological variations, thus jeopardizing the potential clinical significance of PCA time-warping based markers. An alternative LSR technique to PCA is periodic component analysis (πCA) [22,23], which transforms the multi-lead ECG signal by maximizing the periodic components on the TL. This technique has already been applied to the ECG to detect T-wave alternans [24], demonstrating superior performance to PCA in noisy scenarios.
Starting from studies in the literature where πCA is used to emphasize every-second beat periodicity (alternans) [24], this work was performed by applying πCA to enhance the one-beat periodicity under the hypothesis that it would outperform PCA in minimizing the contribution of noise and other non-cardiac, no-beat periodic sources before deriving time-warping based T-wave morphology markers to monitor [K + ] variations. T-wave changes can also occur as a consequence of causes other than [K + ] variations including (i) BPC which have been shown to influence T-wave morphology, in particular its amplitude [25,26] and (ii) different noise sources [27]. These sources could affect the specificity and robustness of T-wave morphological markers as surrogate of electrolyte changes, thus jeopardizing their clinical validity. In this work, a detailed analysis was carried out to understand how both BPC and noise influence the T-wave-based biomarkers as function of the TL.
The aim of this work is to compare the performance of πCA and PCA as LSR techniques prior to T-wave time-warping analyses for deriving robust T-wave-based biomarkers for [K + ] monitoring. For that purpose, we analysed 12-lead ECG signals from two datasets: the first includes ECG recordings from 29 ESRD-HD patients, while the second includes ECG recordings from 20 healthy subjects undergoing controlled body position changes. The two datasets are fully described in Section 2. Finally, the novelty of this work is the proposal, definition and evaluation of a new πCA strategy based on emphasizing beat-to-beat periodic structures in ECG. Preliminary results were presented in a conference [28].

Study population
The ESRD-HD study population included 29 patients from the Nephrology ward from Hospital Clínico Universitario Lozano Blesa (Zaragoza, Spain). Inclusion criteria were (i) 18-year-old or older, (ii) being diagnosed with ESRD and (iii) undergoing HD at least three times per week, with venous or cannula access. Table 1 shows the population characteristics. The study protocol was approved by the Aragon's research ethics committee (CEICA, ref. PI18/003) and all patients and/ or their legal guardians signed informed consent. Further details can be found in [17].

Blood sample analysis
For each patient, six blood samples were extracted and analysed during the HD session: the first one at the HD onset and the following three, at each subsequent hour (Fig. 1, h 0 to h 3 in red). The 5th blood sample (h 4 ) was collected at the HD end (minute 215th or 245th, depending on the HD session duration), while the 6th blood sample was taken after 48 h (h 5 ), immediately before the next HD session. The median and interquartile range (IQR) of [K + ] values, measured from the blood samples extracted each hour are presented in Table 2.

ECG measurements
A 48 h, standard 12-lead ECG Holter recording (H12+, Mortara Instruments, Milwaukee, WI, USA, sampling frequency of 1 kHz, amplitude resolution of 3.75 μV) was acquired for each enrolled patient, starting 5 min before the HD onset ( Fig. 1, blue line). Recordings from this dataset were also used to generate simulated ECG signals to evaluate  the robustness against noise of the proposed markers, as described in section III.D. Due to battery exhaustion, 27 out of the 29 ECG recordings did not last the planned 48 h, being 44 h the average ECG duration in our database.

BPC dataset
The BPC study population included 20 healthy individuals (11 males and 9 females, 32 ± 9 years old) performing the following sequence of BPC: supine (S), right side (R), and left side (L): S → R → S → L. The complete sequence was repeated five times with a duration of 1 min per body position, so that muscular activity and other artifacts were allowed to decay before the next BPC was initiated. A standard 12-lead ECG was simultaneously acquired at a sampling rate of 1 kHz and amplitude resolution of 0.6 μV. More details can be found in [26,29]. All participants gave explicit consent to participate in the study. The experimental procedures involving healthy volunteers described in this data collection were in agreement with the principles outlined in the Helsinki Declaration. Further details on this dataset can be found in the following publication [29].

Methods
This section describes the general methodology used to derive the Twave markers, which is applied to the ESRD-HD and BPC datasets, as well as to the simulated ECGs.

ECG pre-processing and standard single-lead analysis
First, removal of baseline wander was done with a 0.5 Hz cut-off high-pass filter, implemented with a forward-backwards 6th order Butterworth filter [30]. Then, residual noise out of the T-wave band was removed with a 40 Hz cut-off frequency 6th order low-pass Butterworth filter. An example of this implementation is depicted in Fig. 2(a) and (b). QRS complexes were then detected and T waves delineated using a wavelet-based single-lead delineation method applied to each of the 12 leads [31].

Standard single-lead analysis
Standard lead analysis was performed for ESRD-HD ECGs, with the T waves selected in leads II, V4 and V6 and delineated with [31]. Waveforms from leads V4 and V6 were used in a previous study [12] for estimating [K + ] while lead II is the most popularly used in patient monitoring [32]. Then, time-warping based markers were computed as later described in Section 3.3.

Lead space reduction
For each ECG recording, a transformation matrix Ψ was obtained using πCA and PCA and applied to the 8 independent leads (I, II, V1, V2, V3, V4, V5 and V6) to obtain 8 TLs named periodic components (πC#) and PC#, respectively. Since the different datasets investigated in this study were recorded under different conditions, πCA and PCA learning period locations were specifically defined for each of them and summarized in Table 3. The portion of heartbeat (onset and end points) considered in the learning of each LSR technique are summarized in Table 4.

Principal component analysis
PCA separates the orthogonal components of the 8 independent leads in descending order of variance [21]. The matrix Ψ PCA defining the transformation was obtained from the eigenvectors of the 8 × 8 inter-lead ECG auto-correlation matrix computed using the samples in the T waves [15,21] within the corresponding learning window (see Table 4). As a result, PC1 (first PC) is the TL maximizing the T-wave energy.

Periodic component analysis, πCA
This technique aims to emphasize the periodic structure of the 8 independent leads, instead of the variance as in PCA. In this work, we applied Ψ πCA to maximize the beat-to-beat periodic components on the

Window location for reference MWTW computation
End of HD [17] First supine position Last 60 beats simulating the end of HD transformed signal, in contrast to [24], where it was used to emphasize the every-second-beat periodicity for T-wave alternans detection. To avoid spurious variability due to errors in QRS detection (Section 3.1), a pre-alignment of QRS complexes falling within the learning period (see Table 3) at each lead was performed. Then, T-waves were extracted using a window from R wave peak (R p ) plus 60 ms to R p + 400 ms. The complete QRST complex, defined as the segment from R p − 80 ms to R p + 400 ms, was also extracted ( Table 4). Then πCA was computed by learning either at the T-waves or at the complete QRST complexes, resulting in πC T #s, or πC B #s, respectively.

Transformation matrix Ψ πCA computation
Let K be the number of aligned T waves (or QRST complexes) in the learning window, having N samples each, for L available leads. Let x k,l (n) denote the nth selected sample of the kth beat in the lth lead of the filtered ECG signal. In vector notation, represents the T wave (or QRST complex) from the kth beat of the lth lead, which are piled together in the L × N matrix X k : where the nth column of X k contains the amplitudes of the L leads at a given sample n. Two data matrices X and X (m) were then constructed by concatenating K consecutive matrices X k , and the m-beat delayed version To maximize the m = 1 − beat periodicity of the signal, the desired πCA transformation must minimize the following residual measure of periodicity [24]: By the Rayleigh-Ritz theorem, it can be shown that the weight vector (4) is given by the generalized eigenvector corresponding to the smallest generalized eigenvalue of the that accomplishes the following equation: being Λ a diagonal matrix containing the eigenvalues at the diagonal, R X the spatial correlation matrix of X, estimated as and A (1) X the spatial correlation of the non-beat-to-beat periodic residue, estimated as: Then, the transformation matrix Ψ πCA is taken as the generalized , with the eigenvectors (columns) sorted according to the corresponding eigenvalues in ascending order of magnitude. In this way, the transformation Y = Ψ T πCA X projects the component with smaller relative non-periodic residuum (i.e., the most periodic component) into the first row of Y.

Fig. 2(c)-(e)
shows an example of πC B #, πC T # and PC# obtained from one ESRD-HD patient ECG. In agreement with our hypothesis, the high-energy artifact in second 3 in panel (b) is preserved in PC1 but much more attenuated in the first two πC B and πC T components. Also note that πC B dominantly emphasizes the QRS at πC B 1, while the T wave is dominantly emphasized at πC T 1.

T-wave morphology markers
For all datasets, T waves were delineated using the same technique mentioned in Section 3.1 [31]. Then, πC T 1 and PC1 were taken for subsequent analyses. The optimal πC B # for analysis was chosen as the one (πC B 1 or πC B 2) having the highest T wave energy content, by computing the total T wave energy within the same period used for learning (see Table 3). This is done since there is no guarantee that the highest T wave energy content is in πC B 1 or in πC B 2, a result of the interplay between T-wave and QRS dominance at TL energy projection, see Fig. 2(c).
All T waves from the selected πCA or PCA TL were further low-pass filtered at 20 Hz using a 6th order Butterworth filter to remove remaining out-of-band frequency components. Then, the specific analysis windows (see Table 3) were selected to perform the T-wave timewarping. The duration of these windows was selected to be small enough to hold the assumptions of heart rate and [K + ] values stability (the latter only applicable to the ESRD-HD dataset). In each window, a mean warped T wave (MWTW) was computed as in [15,17]. Finally, the warping markers were computed by comparing each MWTW with respect to a reference MWTW, estimated from the time excerpts locations described in Table 3.
T-wave time-warping: T-wave time-warping markers definition is include here, referring to the works where they were introduced for a more detailed description [15,17].
We denote as T are the corresponding time vector having a total of N r and N i samples, respectively (Table 3). Let γ(t r ) be the warping function that relates t r and t i such that the composition [f i ∘γ](t r ) = f i (γ(t r )) denotes the re-parameterization or time domain warping of f i (t i ) using γ(t r ). Then the above-mentioned markers where computed as: where γ * i (t r ) is the optimum warping function [15] and s d (i) accounts for the sign of d w (i) as: with N u r being the number of samples within the T-wave up-slope. Then, the non-linear component of the above mentioned d NL w (i) was quantified as: where γ * i,l (t r ) is the best linear fitting to γ * i (t r ) according to the least absolute residual criterion [33]. Finally, a heart rate corrected version of d w (i), denoted as d w,c (i), is obtained as: where RR i and RR r are the mean RR intervals corresponding to the ith analysis window and the reference point (see Table 3), and ĉ is a patient specific parameters estimated as in [17]. Table 5 provides an overview of the T wave morphology markers investigated in this work.

ECG simulation
To validate the usage of both πCA and PCA in extracting timewarping parameters in ESRD-HD ECG signals and to assess their performance against noise, a Monte Carlo simulation approach was adopted. Each trial was generated as the sum of a clean 8-lead ECG and an 8- …, 4} denotes each of the 5 h time points corresponding to the blood sample extractions during HD with the noise being of one of these three types: baseline wander (bw), muscle activity (ma) and electrode motion artifacts (em) as described next.

Clean ECG signal
A set of clean beats were extracted from a patient in the ESRD-HD dataset. Then, two-min ECG windows were selected at each hour during the HD session, in correspondence to each blood sample and in each lead, the beats were detected, aligned and averaged to get a clean representative beat per lead and hour. Each of those representative beats were repeated 60 times and then concatenated for the five hours getting a clean 300-beat 8-lead synthetic ECG.

Noise generation
The three types of noise used in this work (i.e., bw, ma and em) were extracted from the MIT-BIH Noise Stress Test Database (NSTDB) [34,35]. For each type of noise, 100 different realizations V hi were extracted, to be added to the same clean ECG (see Section 3.4.1). Each realization starts at an arbitrary point in one of the two leads of the NSTDB recording also randomly selected. In real signals, noise is spatially correlated but due to the its generation setup V hi wasn't. Therefore, to correlate V hi a realistic way, the first step was to estimate the spatial correlation of the real ECG noise from which the clean beats were extracted. Thus, at each ith hour, up to 150 segments of ECG, assumed to contain only noise (50 ms intervals following the T-wave end), were selected from each independent lead. These segments were concatenated creating the noise component of the 8-lead vectors which were then normalized to be zero-mean and unit standard deviation recordings from where the noise correlation matrix R V h i was estimated.
The Cholesky decomposition [36] was applied to R V h i , obtaining a whitening matrix D hi . The inverse of D hi was used to generate a spatially These zero-mean, unitary-standard deviation V ′ hi noise components were modulated and added to the clean ECG to create five different SNR levels, SNR ∈ {10, 15, 20, 25, 30} dB.

Transformation matrix Ψ estimation
A transformation matrix Ψ (using πCA or PCA) was estimated from the learning period in each noisy ECG, and later applied over: (i) the corresponding entire noisy signal, making both the learning and the lead transformation phases done over the noisy signal, and denoted "NtoN" and (ii) the simulated clean ECG, having the learning phase in noisy conditions while lead transformation done over the clean ECG, denoted "NtoC".

LSR performance quantification and statistical analysis
The analysis and statistical tests carried out to evaluate LSR technique performance in each dataset are presented in this section.

ESRD-HD dataset
Two different analysis were performed on the results obtained from the ESRD-HD dataset.
Marker performance assessment during the HD: Pearson's (r) correlation coefficients were computed to test the linear association between each T-wave morphology marker d(i) (d ∈ {d w ,d w,c , d NL w }) and the corresponding relative [K + ] variations computed as: being [K + ] hi the blood potassium concentration at the ith hour of the HD, i ∈ {0, …, 4}, and [K + ] r = [K + ] h4 , the concentration at the end of the treatment (see Fig. 1).
Marker dynamics evaluation in post HD: For every patient, a fitting error (ϵ) between each LSR-specific marker series d(i) and its linear regression fit between the 12th and 44th hours after HD onset was computed [28]. This ϵ provides information on the marker's deviation from a gradual linear trend along time, hypothesized a surrogate of the trend followed by [K + ]. A trend example with its linear fit is presented in Fig. 3.

BPC dataset
Biomarkers extracted from BPC dataset by warping MWTWs from each BPC with respect to the reference taken at first supine position (see Table 3) were tested to check their robustness against postural changes and, for that purpose, two different tests were performed.
The warping markers were grouped by body position type and the non-parametric Kruskal-Wallis test was applied to check for statistically significant differences (p ≤ 0.05) between the supine, right and left positions medians. This allowed to assess whether or not the T wave markers were influenced by the body position.
To check if the marker values generated by the Δ[K + ] during HD therapy are larger or comparable, and thus indistinguishable, to those generated by a BPC, we compared the values from each marker from the ESRD-HD dataset with those from the BPC using the Mann-Whitney Utest. For this, markers from the BPC dataset were pooled together and, since the same BPC could occur in both directions (e.g., S → L, but also L → S), resulting in markers with the same magnitude but opposite sign,   we extended the pool by duplicating each value and reverting its sign.

ECG simulation
For each LSR technique, noise type, marker (d), SNR (n), and simulation run (j), normalized relative errors e were computed as: where n ∈ {10, 15, 20, 25, 30} dB accounts for the SNR, j ∈ {1, …, 100} accounts for the simulation run for each noise type, i ∈ {0, …, 4} for the ith hour where the markers are estimated, and d ∈ {d w ,d w,c , d NL w }. We considered the d NtoC marker series as the reference for evaluation of markers under noisy conditions. The transformation matrix was learnt in the same noisy conditions, at the reference as when applied to estimate the marker, so the error really quantifies how the noise affects the computation of the marker rather than Ψ PCA or Ψ πCA estimation.

ESRD-HD dataset
When considering the πC B strategy, πC B 1 was selected over πC B 2, in 19 out of 29 patients (66%) as the TL having the highest T wave energy.
The intra-patient Pearson's (r) correlation coefficients, calculated between Δ[K + ](i) and each time-warping markers d(i) computed with the LSR techniques (πC B , πC T and PCA) and the standard leads (II, V4 and V6) are shown in Table 6.
The temporal evolution for πCAs and PCA-based d w is depicted in Fig. 4(a) up to the 44th hour, the average ECG duration in the ESRD-HD dataset. Similar dynamics were found for d w,c markers (not displayed). A zoomed view of the first 10 h is also presented in an inset of Fig. 4(a), allowing a proper time dynamics comparison with the 10 h-long [K + ]-recovery curve ( Fig. 4(b)) available in the literature [37,38].
Values of the fitting error ϵ for the trends of biomarkers, expressed as median and IQR across patients, are given in Table 7. Finally, to further evaluate the relations among TL derived markers, Pearson's correlation between makers derived from πC B , πC T , PC along the whole ECG was computed for each patient, and presented in Table 8.      The results in each dataset can be evaluated by themselves or jointly, based on the concurrency/non-concurrency of the underlying mechanism that generates the T wave change (i.e., only postural changes in BPC dataset and controlled SNR in the simulate ECG). Thus, reference results are obtained that can be compared to the markers' behaviour in the ESRD-HD dataset, to better assess the reliability of our findings. Time-warping markers were derived from the different transformed and standard leads and compared in terms of their ability for [K + ] monitoring, as well as robustness against BPC and noise. Note that we are interested in understanding the markers dynamics and behaviour under controlled events that can be found on regular ECG monitoring. Therefore, conclusions are not affected by the duration of the different signals, as long as it ensures the correct evaluation of the mean warped T-waves as detailed in Section 3.3.

ESRD-HD dataset
The ability of πCA and PCA to emphasize [K + ]-induced T-wave variations, in order to later calculate the markers described in Section 3, was tested on the ESRD-HD dataset. In addition, the same warping markers were computed from the standard leads II, V4 and V6 to evaluate if the LSR techniques (either πCA or PCA) improve the performance of the T-wave morphology markers in following Δ[K + ] over the standard leads. In previous works, we successfully applied PCA as the LSR technique before extracting T-wave morphology markers and we compared d w , d w,c and d NL w performance in tracking [K + ] with respect to the state-ofthe-art [17]. There, it was demonstrated that T wave time-warping based markers resulted in Spearman's and Pearson's correlation with Δ[K + ], in median, higher than other descriptors proposed in the literature. Nevertheless, πCA has already been found to be more robust against noise in other ECG applications [24], supporting the use of πCA in this [K + ]-tracking context. For each marker, two performance metrics were investigated: Pearson's correlation with Δ[K + ] during the HD as presented in [17] and marker deviation from a linear trend in the late post-HD period, as in [28].
Note from Table 2 that [K + ] is higher at h 0 than at h 5 , a result attributable to the fact that at h 5 all patients were ending a two-day inter-dialysis pause, while at h 0 most of the patients, 27 out of 29, were at the end of a three-day inter-dialysis pause.

Correlation between T-wave markers and Δ[K + ]
Results from Table 6 reveal that d w and d w,c are the descriptors having the highest r median values (r ≥ 0.89). Also, single-lead-based markers were outperformed by those obtained by applying a LSR technique, PCA or πCA, as already proved in [17]. Moreover, πC T -based indices are slightly better correlated with Δ[K + ] (higher median r and lower deviation, i.e., d NL w ). This can be a consequence of the fact that with πC B , the overall ventricular activity is considered to learn the transformations, and then the more energetic QRS complex could had prevailed over the T-wave, while for πC T the learning is fully driven by tracking during the HD period.

Post-HD marker trend and linear fitting error
Throughout the first 10 h of recording, d w as well as d w,c , Fig. 4(a), showed (in median) dynamics similar to [K + ]-recovery curve from the literature [37,38], Fig. 4(b). After that period, both markers settled on an apparent linear trend, a behaviour in agreement with an expected gradual increase of [K + ] over time in ESRD-HD patients [37,38]. This led us to conjecture about the deviation from a linear trend, measured by ϵ, as a metric to evaluate each method's performance in the interval where no blood samples were collected. Therefore, for a given LSR technique the smaller the ϵ, the more coherent of the proposed markers measurements across patients. The idea of a linear polynomial to fit marker values was already presented by Attia et al. [12] to generate a patient specific regression model. Results reported in Table 7   2) and (c.2), respectively-includes the zero-mean distribution of markers obtained from the BPC dataset. Mann-Whitney U-test significance level (p-value) between BPC and both h 2 and h 3 of HD are given in each panel, where ns stands for "not significant" (p-value > 0.05). Note that for the first two groups (i.e., HD onset h 0 , and h 1 ) p-values were always lower than 0.05 and, hence, not displayed. Red + indicate outliers. that πC B , πC T and PCA-based markers outperform standard lead estimations, and we may conclude that πC T is the most consistent LSR technique in terms of trend dispersion (post-HD period), and r (during the HD therapy) for some markers.

Clinical Significance
According to these results, markers extracted from a TL outperform those obtained from standard single leads. In particular, πC T appears to be the most suitable LSR technique to extract the T-wave morphology marker best correlated with Δ[K + ], thus allowing a more reliable continuous monitoring of ESRD-HD patients during the HD as well as in the post-HD period.

BPC dataset
The relative position of the heart electric axis with respect to the surface electrodes changes with body position, influencing the shape of the ECG waveform [26,25] and, consequently, the T-wave morphology markers measured on the signal. We tested the proposed LSR techniques to figure out if any of them resulted in higher marker robustness against BPC. The analysis of marker distributions, Fig. 5, evidences that all markers are affected by BPC. For all LSR techniques, the S position showed the smallest median and IQR values as a result of the election of the warping reference in S position, see Table 3, followed by R and L.
However, only πC T showed non-significant differences in Kruskal-Wallis test between d w and d w,c when computed and compared in different body positions suggesting that πC T is the method less affected by the patient's posture.

Clinical significance
According to these results, the proposed T wave time-warping markers to quantify morphology changes are not significantly affected by the subject's posture when evaluated at πC T TL. This suggests that πC T should be the preferred TL for daily life continuous monitoring of ESRD-HD patients.

Comparative results from ESRD-HD and BPC datasets
To elucidate up to what extend d w , d w,c and d NL w can capture waveform alterations generated by Δ[K + ] remaining no-significantly affected by concomitant BPC, we compared markers from HD with those from BPC. Patients in HD therapy remained still (usually seated) during the whole session, ensuring that no marker alteration occurred due to BPC. Conversely, in the BPC dataset, where healthy subjects were enrolled, the ECG waveform and thus marker values alterations were mainly attributed to postural changes. As explained above, the length of the recording does not play a relevant role provided that it ensures the correct evaluation of the MWTW as detailed in Section 3.3. According to Fig. 6, significant differences can be observed for any given LSR and marker when comparing distributions from h 0 , h 1 , h 2 and BPC, probably due to the [K + ] being outside the normal range (considered to be in h 4 , Table 2) thus being the main factor in the ECG waveform shaping. On the contrary, as HD final stage approaches, h 3 , the value of Δ[K + ] reduces and the ECG waveforms returns close to shapes at reference in h 4 . At h 3 , all markers computed from the ESRD-HD dataset but d NL w , showed median values similar to those obtained in the BPC signals. This different behaviour of d NL w could be attributed to the fact that a BPC generates a rotation of the electrical axis, not introducing any non-linearity across time behaviour to be captured by d NL w , therefore making it insensitive to BPC. No preferential behaviour in this respect is observed as a function of the chosen LSR.

Clinical significance
These results suggest that the marker reflecting T wave nonlinear morphological changes, d NL w , is able to still capture relevant information describing small Δ[K + ] that are not affected by concomitant BPC. These results can be of great interest when choosing a marker to robustly monitor ESRD-HD patients [K + ] in daily life, see also [39].

ECG simulation
Synthetic ECG signals with controlled noise contamination, emulating ESRD-HD recordings, were used to test the robustness of the d w , d w,c and d NL w against noise for the different LSR techniques. Noise signals were taken from real Holter recordings and forced to be spatially correlated as in the 12-lead recordings [40].
According to Fig. 7 for a given SNR in any LSR technique, em and ma noises resulted in the highest e, possibly due to their spectra are comparable to that of the ECG, and so preprocessing is less efficient. Because of that, em and ma filtration was not as effective as bw which showed the smallest e median and IQR. However, a general decreasing error trend with increasing SNR can be observed. Moreover, these graphs would confirm that πCA outperforms PCA for low SNR (10 dB and 15 dB) as hypothesized. In addition, it appears that πC T has median e smaller than πC B in the majority of the proposed biomarkers. This outcomes can be attributable to the fact that the QRS complex, despite having larger SNR, has different spatial distribution than the T wave and thus favouring πC T spatial transformation. Finally, no clear advantages in using πCA over PCA can be appreciated for high SNR (i.e., SNR > 20 dB). Nevertheless, these results would confirm our hypothesis that πCA performs better than PCA for low SNR values as it was evidenced in [24] for alternans detection.

Clinical significance
These results indicate that at low SNR, πC T -based markers are the most robust against ECG noises meaning that πC T is the most suitable LSR to extract relevant multilead T wave morphology information from noisy records (i.e., Holters) in non-invasive ambulatory [K + ] monitoring of ESRD-HD patients.

Limitations and future works
Despite the encouraging results, several limitations deserve to be mentioned. First, a direct correlation study between biomarkers and Δ[K + ] was only possible during the HD therapy since no [K + ] samples were collected in the post-HD period until the 48th hour. In other words, an explicit relation between d w , d w,c and d NL w and Δ[K + ] in the post-HD period could not be assessed nor inferred from the linear fitting error ϵ since there is no certainty that [K + ]-recovery trend is exactly linear. However, [K + ] dynamics tend to appear slow, gradual and monotonic [37,38], making the deviation from a linear trend still a plausible indirect indicator to assess the marker robustness. Other regression types could be further investigated, together with studies including regular blood samples extraction during the post-HD period.
Second, the sample size in ESRD-HD dataset is smaller than the study population in similar investigations [39]. Thus, even if the usage of πC T as LSR technique is a step toward robust T-wave morphology feature extraction from the ECG, it needs to be validated in larger cohorts to be finally translated to clinical practice. Third, the BPC series only contained lying-based changes, thus excluding daily-life postural changes (e.g., lying-seated-standing), representing a limitation for the generalization of the results. However, we believe that this limitation is attenuated when considering the fact that the analyzed BPC can be considered as the most strenuous in terms of heart rotations with respect to electrodes positions [26].
Finally, in addition to producing T-wave changes generated by [K + ] variations, HD can trigger myocardial ischaemia events [41][42][43][44], which could also affect the T-wave morphology and the marker validity. This fact raises a question for future investigations.

Conclusion
Results from this work highlight the advantages of applying onebeat-period πCA, and, in particular, πC T rather than PCA as LSR technique before deriving T-wave morphology markers to monitor [K + ] variations in ESRD-HD. The main advantages concern a greater robustness against BPC and noise, improving the accuracy of T-wave time-warping based markers in monitoring Δ[K + ]. The πC T -derived d w and d w,c markers seem to be the most suitable (better correlated) for [K + ] monitoring in both HD therapy and recovery periods. Nevertheless, d NL w , computed by using either πCA or PCA, appears to be the least affected by BPC, offering a new starting point when evaluating [K + ]-driven T-wave morphological changes.