Noninvasive Monitoring of Potassium Fluctuations During the Long Interdialytic Interval

Hemodialysis patients are susceptible to life-threatening arrhythmias whose incidence is markedly higher during the long interdialytic interval due to electrolyte fluctuations. Noninvasive monitoring of electrolyte fluctuations, particularly those of potassium, would enable restoring electrolyte balance before the onset of arrhythmias. This study investigates the feasibility of continuous long-term monitoring of potassium fluctuations using a single-lead electrocardiogram. We evaluate patient-specific T-wave morphology changes in the electrocardiogram using two descriptors: 1) a model-based descriptor, <inline-formula> <tex-math notation="LaTeX">$\theta _\delta $ </tex-math></inline-formula>, developed to account for overall morphology changes, and 2) the currently available descriptor, <inline-formula> <tex-math notation="LaTeX">$T_{SA}$ </tex-math></inline-formula>, sensitive to potassium levels in single-lead electrocardiograms. Electrocardiograms of 15 hemodialysis patients with pre-existent cardiac diseases were acquired continuously over the long interdialytic interval along with blood samples at predetermined time instants. Results reveal that <inline-formula> <tex-math notation="LaTeX">$\theta _\delta $ </tex-math></inline-formula> and <inline-formula> <tex-math notation="LaTeX">$T_{SA}$ </tex-math></inline-formula> respond concordantly with potassium levels, and reacts to potassium lowering medication. The overlapping index of the daily distributions of <inline-formula> <tex-math notation="LaTeX">$\theta _\delta $ </tex-math></inline-formula> and <inline-formula> <tex-math notation="LaTeX">$T_{SA}$ </tex-math></inline-formula> are moderately correlated with changes in potassium levels (<inline-formula> <tex-math notation="LaTeX">$r=- {\mathrm {0.56\,\,}}$ </tex-math></inline-formula> and <inline-formula> <tex-math notation="LaTeX">$r=- {\mathrm {0.57\,\,}}$ </tex-math></inline-formula>, respectively). <inline-formula> <tex-math notation="LaTeX">$\theta _\delta $ </tex-math></inline-formula> exhibits circadian variation, peaking amidst morning and decreasing until evening. <inline-formula> <tex-math notation="LaTeX">$\theta _\delta $ </tex-math></inline-formula> appears to be less affected by motion-induced noise, which is preferable for ambulatory monitoring. Although long-term monitoring of potassium fluctuations is feasible even in complicated hemodialysis patients, the presence of concomitant electrolyte (calcium and bicarbonate) imbalances should be accounted for since it can hamper a reliable estimation. Considering that intradialytic T-wave morphologies may differ from the ones manifested between hemodialysis sessions, future studies should also strive to collect blood samples outside of hemodialysis to improve electrolyte estimation methods.


I. INTRODUCTION
Hemodialysis (HD) patients have a considerably higher risk of sudden death due to cardiac arrhythmias, such as extreme The associate editor coordinating the review of this manuscript and approving it for publication was Mohammad Zia Ur Rahman . bradycardia and ventricular tachycardia [1], which are more frequent during the long interdialytic interval [2]- [4]. Electrolyte fluctuations, particularly those of potassium, are reckoned to be among the primary triggers of these dangerous arrhythmias [2], [4]. Unfortunately, the asymptomatic nature of electrolyte fluctuations, along with the fact that blood FIGURE 1. Data acquisition protocol. Lead-I ECG signals of hospitalized and ambulatory patients were acquired throughout the long interdialytic interval using an ambulatory recorder. Blood samples of hospitalized patients were collected twice during each HD (start and end) and at least once during the long interdialytic interval. Blood samples of ambulatory patients were collected only through the course of each HD (start, mid, and end).
testing is neither routinely requested, nor can be performed at home, often engenders life-threatening conditions [4]. Accordingly, long-term noninvasive monitoring of electrolyte fluctuations could be of clinical importance [5], [6] as it would allow a timely correction of electrolyte imbalance by performing early HD.
Electrolyte fluctuations are often reflected in the electrocardiogram (ECG) since non-homeostatic serum electrolyte levels perturb the resting membrane potential of heart cells [7], [8]. For instance, an altered T-wave morphology, caused by disturbances in ventricular repolarization, is a manifestation of anomalous serum potassium [8], [9]. However, identifying electrolyte fluctuations from an ECG is challenging [10], [11], especially if no baseline ECG is available for comparison [12], mainly due to confounding factors, such as cardiovascular comorbidities, medications or concurrent electrolyte imbalances, that mask or mimic the anticipated ECG alterations [9], [12]. The ambiguity of the emblematic ECG features profoundly contributes to the low ECG specificity, particularly when cardiovascular comorbidities are present [10]. Thus, exploring ECG-derived descriptors with higher specificity to serum electrolyte levels is crucial for noninvasive monitoring of electrolyte fluctuations.
A pioneering 12-lead ECG-based descriptor, T SA , was proposed for the quantification of serum potassium during HD [13]. Mayo Clinic researchers further enhanced the descriptor for use in a single-lead ECG, first precordial [14], [15], and later in lead-I acquired from a handheld device [16]. The descriptor was further compared to another descriptor, which evaluates the complete T-wave morphology [17], and studied under electrophysiological modeling [18]. Albeit with encouraging results, these studies investigated the descriptors' performance exclusively during HD procedures; thus, the feasibility of long-term ambulatory monitoring of potassium fluctuations remains unexplored. In interdialytic settings, serum electrolyte levels may fluctuate more gradually than during HD, where electrolyte levels usually are corrected in approximately 4 h. Rapid fluctuations of serum electrolyte levels induce cardiac instability [19], resulting in noticeable T-wave morphology changes [20], [21], as typically seen throughout HD. However, when electrolyte levels vary slowly, such changes are less apparent and may not be distinctively quantifiable, especially in HD patients who may develop compensatory mechanisms or manifest antagonist electrolyte levels that stabilize the cardiac membrane potential [19].
This study explores the feasibility of capturing potassium fluctuations over the long interdialytic interval using a single-lead ECG. The study aims to understand the current challenges of long-term noninvasive monitoring of such fluctuations during activities of daily living where: (i) potassium may fluctuate slowly, (ii) concomitant electrolyte imbalance may arise, and (iii) underlying cardiac diseases prevail. Considering that potassium fluctuations may affect the overall T-wave morphology and T SA relies on local T-wave features, we developed a model-based descriptor to account for global T-wave morphology. In contrast to other studies, we tracked T-wave morphology changes continuously between HD sessions in patients with several cardiac diseases as a realistic representation of the HD population. We investigate in detail patient-specific responses of T-wave morphology changes to gradual electrolyte fluctuations. In adition, we tested the performance of the descriptors in different signal quality periods. This paper is organized as follows. Firstly, we describe a model-based descriptor to monitor serum potassium fluctuations in a single-lead ECG. Secondly, we present results on a database recorded during the long interdialytic interval. The paper ends with considerations for future research, followed by conclusions. informed consent from all patients per the Declaration of Helsinki.
Hospitalized patients were not bedridden and were free to move in hospital facilities. Lead-I ECG was acquired during the long interdialytic interval (∼71 h for each patient, a total of ∼1078 h) using Bittium Faros (Bittium Corporation, Oulu, Finland) ambulatory recorder at a sampling rate of 500 Hz. Data acquisition started before the last HD of the week, either Friday or Saturday, and ended after the following HD on Monday or Tuesday (Fig. 1). From this point onwards, Friday HD refers to the last HD of the week, whereas Monday HD denotes the following HD.
Blood samples were drawn twice (start and end) during each HD procedure from hospitalized patients, and thrice (start, mid, and end) from ambulatory patients to assess serum potassium ([K + ]), magnesium ([Mg 2+ ]), calcium ([Ca]) and bicarbonate ([HCO − 3 ]) levels. At least one additional blood sample between HD sessions was collected from hospitalized patients at a predetermined time instant, decided by the physician on call. All patients were also asked to register the time of meal and medication intake.
Out of 17 patients, two were excluded from the analysis. One patient presented ventricular tachycardia episodes during the recording and was taken to the intensive care unit, while the other terminated recording just a few hours after Friday HD due to discomfort. Two hospitalized patients required urgent HD one day earlier. Patients were divided into two groups: Group I comprises patients with regular sinus rhythm and high signal quality over the whole recording period, whereas Group II includes patients whose recordings were noisy, with arrhythmias or affected by ingestion of potassium-lowering medication (Sorbisterit). Patients in both groups manifested concomitant electrolyte imbalances (calcium, bicarbonate, and magnesium). Table 1 provides patient and recording characteristics.

B. ECG PREPROCESSING
The recorded ECGs underwent preprocessing comprised of filtering, signal quality assessment, heart rate-based correction of T-wave duration, beat averaging, and T-wave rectification (Fig. 2).

1) FILTERING
For a reliable assessment of electrolyte fluctuations, it is crucial to avoid distortions in the ST-segment and T-wave. Thus, the ECGs were filtered using a combination of high-order finite impulse response filters. Baseline wandering was removed by using an 836 th order high-pass filter with a cut-off frequency of f c = 0.6 Hz, whereas high-frequency noise was suppressed using a 16 th order low-pass filter with f c = 40 Hz.

2) SIGNAL QUALITY ASSESSMENT
A 90-s sliding window with 10-s overlap was used to segment the ECGs, discarding heartbeats that did not fulfill the signal quality index (SQI) criteria proposed in [22]. Segments with more than 50% poor-quality beats were considered non-analyzable.
Each ECG was divided into three days: Day 0, covering the remaining hours of the same day after Friday HD (until 22:00), Day 1, and Day 2 as the ensuing and last days of the long interdialytic interval, respectively. Since lying positions can considerably alter the ECG morphology [23], Day 1 and Day 2 range from 07:00 till 22:00 as patients were usually awake within this period and the likelihood of encountering a lying position was reasonably low. ECG segments within episodes of arrhythmogenic events were excluded from the analysis.

3) HEART RATE CORRECTION
T-wave morphology is sensitive to heart rate changes, which must be rectified before evaluating the influence of serum electrolyte levels. Thus, the ST-T complex duration was resampled to fit the current RR interval, according to Fridercia's formula [24].

4) BEAT AVERAGING
The resampled heartbeats were aligned and averaged within each 90-s segment, resulting in a single representative heartbeat. QRS complex and T-wave onset were delineated using ecg-kit toolbox [25], whereas T-wave offset as described in [26]. Feature estimation was applied to the delineated T-waves of each averaged heartbeat.

5) T-WAVE RECTIFICATION
Each delineated T-wave, T (n), was preprocessed through a series of steps to transform different waveforms as closely as possible to a positive T-wave. Accordingly, negative T-waves were inverted, T (n) = −T (n). In waveforms with ST depression, the T-wave onset was amended to the local minimum amplitude point. Once the onset and offset were delineated, the T-wave baseline was corrected to begin and end at zero amplitude. A baseline was estimated by linear interpolation between T-wave onset and offset, and subtracted from T (n). Then, T (n) was standardized to counteract amplitude discrepancies caused by body position changes or pre-existent cardiac diseases: where T z (n) denotes the standardized T-wave,x and s are the mean and standard deviation of T (n), respectively.
From this point onwards, T z (n) denotes the standardized T-wave, whereas T (n) the baseline-removed T-wave.

C. T-WAVE PARAMETRIZATION
Model-based parametrization was employed to quantify electrolyte-induced changes in T-wave morphology. The T-wave, composed of two asymmetrical slopes-upward and downward-was modeled using a composite model of two functions to characterize each slope separately. The model, inspired by the one proposed in [27] and [28], and briefly described in [29], consisted of one Gaussian and one lognormal functions (Fig. 3). The Gaussian function construed the upward slope and is defined by: where n represents sample number, µ u and σ u are the location and scale parameters. The lognormal function, which depicted the downward slope, is defined by: where γ d , µ d and σ d stands for the location, scale, and shape parameters, respectively. The time-shifting parameter γ d ensures that T d (n) always fits the downward slope without modifying the shape and scale of the model. In this manner, we ensured an unambiguous reaction of µ d and σ d to morphological, but not temporal changes. T (n) can then be characterized by combining (2) and (3) as: The subscript c denotes the fitted composite model, whereas u and d imply that the parameters represent the upward and downward slopes. Both functions are weighted by parameters w u and w d , and balanced with an offset h. The parameters are merged into the vector which was estimated using the trust-region reflective least-squares algorithm with a set of empirically determined lower and upper boundaries to control the fitting process. Supplementary table 2 briefly presents such boundaries, along with values used to initialize φ. Before parameterization, T (n) was resampled to 1000 samples, normalized to unit amplitude, and mirrored in time, T (n) = T (−n). This step ensures that T (n) becomes right-skewed as a lognormal, increasing the coefficient of determination R 2 and improving goodness of fit. Fitting is considered acceptable when R 2 exceeds the empirically chosen fixed threshold of 0.8. Otherwise, waves were considered of poor quality and thereby discarded from the analysis. Flat T-waves were excluded from the analysis since parametrization of such waves is unavailing. Figure 4 depicts T-wave rectification and parametrization for several ECG morphologies encountered in the data. Appendix B presents pseudocodes for the T-wave rectification and parametrization algorithms. 1

D. T-WAVE FEATURE ESTIMATION
When serum [K + ] starts to rise above normal levels, the T-wave tends to become more peaked and decreases in duration [7], [9]. To quantify variations in T-wave peakedness, we estimated the angle θ between the upward and downward slopes ( Fig. 5a-b). Assuming that each slope is defined as a line with gradient S, θ was calculated by: where β and α are the angles between the temporal axis and the downward and upward slope, whereas S u and S d are the gradients of the correspondent slopes. S u and S d were estimated from T z (n) in a similar way as in [30]: two lines were computed in an 8 ms window centered at the maximum gradient between T-onset and T-peak, and at the minimum gradient between T-peak and T-offset (Fig. 5c). S u and S d are the yielded gradients of the fitted lines in a.u./s. As the duration of repolarization shortens, the T-wave becomes less elongated. Given that each function from the composite model depicts a slope, changes in T-wave elongation were characterized by a temporal displacement, δ, between the points of global maximum of T d (n) and T u (n) functions ( Fig. 5d-e). Considering that the point of global maximum of a probability distribution is its mode, δ was found by: where m d and m u are the modes of lognormal and Gaussian functions. The mode of a Gaussian function is given by µ u , whereas, for the three-parameter lognormal function, it was calculated as follows: Given that δ was estimated from the resampled T (n), δ was amended to the original time scale: where N is the number of samples in T (n). Conceptually, as serum [K + ] starts to rise slowly during the long interdialytic interval, the T-wave becomes narrower and more peaked, translating into lower values of δ (s) and θ ( • ). Since θ and δ vary concordantly with each other, both decreasing when [K + ] increases, we propose a new descriptor, θ δ , that amplifies their response to serum [K + ] fluctuations: The logarithm expands the dynamic range and ensures that θ δ is positively correlated with [K + ] levels.

E. PERFORMANCE EVALUATION
The performance of the proposed descriptor, θ δ , was compared to the descriptor introduced in [14]- [16], which was estimated as: . T-wave rectification and parametrization for various ECG morphologies encountered in the data. After delineating the T-waves for every valid averaged heartbeat, the T-wave was rectified, mirrored, resampled, normalized, and subjected to parametrization.
S d (in a.u./s) is the downward slope and T A is the peakto-peak amplitude between the T-wave peak and offset. S d and T A were computed from the non-mirrored T (n), normalized by the signal energy of its correspondent QRS-wave, as described in [15]. It should be noted that T SA is not applicable for negative T-waves [15]. Despite being often used by clinicians to identify potassium abnormalities, the emblematic T-wave amplitude was not included for comparison, since it shows inferior performance to that of T SA [14].
To examine the daily variation of θ δ and T SA relative to the [K + ] reference values of each individual, kernel density estimations were used to obtain distributions of θ δ − θ δ t0 and T SA − T SA t0 . The reference values were calculated at t 0 by finding the mean during the first 30 min following Friday HD termination. Within this 30 min period, [K + ] remains nearly unchanged as none of the patients had a meal, thus avoiding insulin spikes that drive serum [K + ] intracellularly [31].
The overlapping index η [32] was used to quantify similarities between the daily distributions of θ δ and T SA . The index η can take values between zero and one, where η = 1 indicates that the two distributions are identical. Intuitively, it is expected that higher [K + ] fluctuations will translate into smaller η values. The relationship between η and [K + ] was assessed using Pearson's correlation coefficient (r), where [K + ] is expected to be negatively correlated with η. η was calculated between the days with assessed [K + ], which, for the majority of patients, is solely between Day 0 and Day 2.
Since blood was collected at the start of Monday HD, Day 2 distribution includes 2 h preceding Monday HD as well. The subscript of η specifies the days between which η is evaluated, whereas [K + ] denotes the difference of [K + ] between two days.
To investigate noise robustness of θ δ and T SA in more detail, we compared the coefficient of variation, c v , of each descriptor within periods during which [K + ] levels remain nearly unchanged, but the signal quality was expected to vary. c v was estimated for each patient as follows: where s andx are the standard deviation and mean of either θ δ or T SA within a given period, respectively. Lower c v values within periods of low signal quality indicate higher descriptor stability and, therefore, more robustness to noise. Since ambulatory signals are recorded in an unsupervised fashion, c v was measured in two different periods: t 1 = [21:00-22:00] of Day 1 and t 2 = [00:00-01:00] of Day 2. During t 1 , the patients were still awake, and the ECGs were expected to have lower quality due to movement (e.g., walking around the house). Conversely, during t 2 , patients were asleep and physical activity was minimal, thereby increasing quality. We confirmed this through accelerometer signals recorded synchronously with the ECGs. The periods t 1 and t 2 were chosen for two reasons: (i) intra-and intercellular [K + ] changes are likely more stable during Day 1 and Day 2, unlike during the same day after HD [33]; (ii) the circadian variability of serum [K + ] in patients with impaired renal function indicates that [K + ] levels between 21:00 till 01:00 increase, on average, only 0.06 mmol/L [34], which is minimal. Although the circadian variability of serum [K + ] in HD patients has not been studied, we observed that θ δ responded similarly to the findings in [34] (see Fig. 9), thus implying that the circadian rhythm is maintained. Figure 6 depicts the variation of θ δ and T SA in patients of Group I. As expected, θ δ and T SA rise with the increase of [K + ]. Note the low trendline steepness for patient #6 which corresponds well with little change in [K + ]. Interestingly, T SA varies in the opposite direction in patient #4 who displayed positive and negative T-waves, and occasional ST depression. θ δ appears to better deal with alternating T-wave morphologies than T SA . Figure 7 shows the feature variation in patients of Group II of problematic recordings. Unsurprisingly, θ δ and T SA show trends discordant with [K + ] levels in patients with: atrial fibrillation (#8), premature atrial contractions (#9), and tachycardia (#9, #10, #14). Nevertheless, in periods of sinus rhythm, during which the T-wave morphology stabilizes, both descriptors varies agreeably with [K + ] levels.

III. RESULTS
Most of the time, flat or negative T-waves prevailed in patients #5 and #12, who manifested severe isolated hypocalcemia. T SA could only be computed during the short time intervals in which the T-wave was positive. Curiously, both patients displayed discrepantly high θ δ values despite the absence of hyperkalemia, likely due to T-wave narrowing during ST-T complex resampling used for correction of heart-rate induced T-wave changes.
In patients with hyperkalemia concomitant with metabolic acidosis (#10, #11, #13), T SA showed a more prominent trendline steepness, possibly due to the overlaying effects of both electrolytes on the T-wave downward slope.
The daily distributions of θ δ − θ δ t0 and T SA − T SA t0 are given in Fig. 8 Broader distributions are observed in patients #4, #5, #9, #12, and #15 who exhibited T-wave morphologies across the long interdialytic interval different from those used to estimate θ δ t0 and T SA t0 . A decrease of θ δ and T SA during Day 0 is visible in the majority of patients, possibly due to insulin spikes during meals which can drive [K + ] intracellularly. Figure 9 shows the mean of θ δ across all patients in non-overlapping 10 min intervals from 07:00 till 22:00. During Day 1 and Day 2, θ δ shows higher values in the morning, peaks around lunch time ([12:00-14:00]), and decreases across the afternoon until the evening. Also θ δ increases during the night as θ δ is higher at 07:00 of Day 2 compared to 22:00 of Day 1. Figure 10 shows the dispersion of c v for θ δ and T SA within the periods of low (t 1 ) and high (t 2 ) signal quality. As envisaged, both descriptors show higher c v values during t 1 . However, θ δ displays lower dispersion of c v during t 1 , suggesting greater stability in noisy conditions than T SA . While the median difference of T SA is minimal between t 1 and t 2 , T SA exhibits a large dispersion during t 2 . In contrast, θ δ seems to be more constant in less noisy conditions. Patients #8 and #12 were excluded from this analysis as #12 displayed T-wave inversion (for which T SA cannot be estimated) and #8 manifested atrial fibrillation during t 1 and t 2 .

A. DESCRIPTORS RESPONSIVENESS TO POTASSIUM FLUCTUATIONS
We quantified gradual electrolyte-induced T-wave changes using model-based parametrization. The yielded parameters of such models can act as surrogates of important physiological traits that cannot be straightforwardly determined (e.g., T-wave duration) [35]. Additionally, model-based parametrization enables a global evaluation of the T-wave morphology and may increase robustness to noise [36], which is frequent in ambulatory ECG recordings. We tracked T-wave morphology changes using two descriptors: θ δ , and T SA . The progression of θ δ and T SA during the long interdialytic interval is promising, both showing an appealing potential to become estimators of serum [K + ]. Even in a group of patients with various underlying cardiac diseases, θ δ and T SA are responsive to [K + ] fluctuations, indicating that long-term monitoring of such fluctuations is feasible. Furthermore, θ δ exhibited higher stability during noisy periods compared to T SA , which is advantageous for ambulatory monitoring.
Interestingly, the descriptors showed increased variability during Day 0 compared to Day 1 or Day 2. The presence of such variability is plausible since the effects of HD-induced hemodynamic stress could, presumably, still be felt for hours after HD, thus affecting T-wave morphology. The existence of such a transient period, during which the T-wave morphology can differ from the one manifested during the long interdialytic interval, may have substantial implications on [K + ] estimation. One approach for ECG-based estimation of [K + ] levels can be the use of a reference T-wave of each individual at a known [K + ] level. Indeed, previous studies have shown a decrease in the error of [K + ] estimation after patient-specific calibration [13], [15]. However, these VOLUME 8, 2020 studies focused on assessing [K + ] levels during HD exclusively, where the same T-wave morphology-similar to that used to estimate reference values-persists throughout HD.
Using T-waves acquired during or immediately after HD as a reference may result in [K + ] estimation errors when the morphology alters. Thus, days between HD sessions should preferably be used for reference T-wave assessment.
Another finding is the apparent circadian periodicity of θ δ , suggesting that [K + ] naturally fluctuates during the day in HD patients similarly to healthy subjects [34]. Although there is a lack of studies examining the circadian rhythm of serum [K + ] levels in HD patients, the existence of such circadian variability in these patients is still plausible. With little to no renal function left, as an attempt to maintain [K + ] homeostasis, HD patients heavily rely on aldosterone-regulated colonic [K + ] secretion [37], [38]. While the circadian rhythm of aldosterone is well understood in healthy subjects [39], it is unclear whether HD patients maintain such circadian rhythm.
Our study showed that θ δ and T SA started to decrease 2 h after the intake of potassium-lowering medication (Sorbisterit), which is compatible with its onset of action. The decrease of θ δ and T SA lasted about 10 h and is within the range of expected duration of the Sorbisterit effect. This observation needs to be taken into account to understand better how Sorbisterit, or other standard medications prescribed to HD patients, alters the T-wave morphology.

B. EVALUATION OF SERUM POTASSIUM WITH CONCURRENT CALCIUM IMBALANCE
Compared to T SA , the range of θ δ values is narrower and more consistent across the dataset, except for patients with isolated severe hypocalcemia (#5 and #12), both free from any pre-existent cardiac issues. Intriguingly, these patients exhibited high θ δ values without hyperkalemia. We found atypically low values of δ in these patients, which indicate T-wave narrowing as, conceptually, δ mostly depends on T-wave duration. Considering that the T-wave duration is not affected by calcium imbalance with normal [K + ] levels [9], δ should not have reacted in this manner. We suspect that resampling of the ST-T complex, distinctively prolonged in hypocalcemia [9], may have affected the T-wave duration.
While flattened or negative T-waves can be prominent in isolated calcium abnormalities [9], [40], particularly in severe levels, changes in ST-segment duration are the most discernible marker of [Ca] levels [9]. Although this study did not analyze in detail the effects of [Ca] on the ECG, we observed a prolonged ST-segment in three patients who displayed severe hypocalcemia. However, ambulatory estimation of the ST-segment duration is challenging, particularly in pathological conditions of ST-segment deviations, as frequently encountered in HD patients. For instance, in patient #10 with ST-elevation characteristic of left ventricular hypertrophy (LVH), the ST-elongation was not as blatant in lead-I as in patients #5 and #12, both without ST-deviations. Perhaps in cases of ST-segment deviations, relying on other ECG leads can mitigate this problem.
Recognizing abnormal calcium levels may improve the detection of dangerous serum [K + ] levels for twofold reasons. Firstly, isolated calcium imbalance can alter the T-wave morphology [9], thus interfering with the assessment of potassium-induced T-wave changes. Secondly, [Ca] and [K + ] have a complex relationship which affects the intra-and atrioventricular conduction within the heart [9], meaning that the harmfulness of [K + ] levels, either in hypo-or hyperkalemia, is tightly dependent on [Ca] levels [7]. For instance, hypercalcemia antagonizes, whereas hypocalcemia exacerbates the consequences of hyperkalemia [21]. Determining the presence of calcium imbalance can aid in ascertaining whether the measured [K + ] level is alarming or not.

C. EVALUATION OF SERUM POTASSIUM WITH CONCURRENT ACID-BASE IMBALANCE
Along with concurrent calcium imbalance, we also encountered difficulties in detecting [K + ] fluctuations in the presence of an acid-base disturbance (i.e., abnormal [HCO − 3 ] levels). When acidosis emerges, the electrophysiological effects of hyperkalemia are, expectedly, aggravated [21]. Consequently, one would anticipate θ δ and T SA to respond with higher values in such conditions, which was not entirely the case in patients with hyperkalemia and acidosis. Curiously, though rare, severe hyperkalemia with minimal T-wave changes has been reported in patients who manifested acidosis concurrently [41]. Although noisy recordings or LVH could reasonably justify such an unexpected variation of θ δ and T SA , the impact of acidosis in [K + ] estimation should not be neglected. Acidosis can instigate T-wave morphology changes resembling those of hyperkalemia [42]. Using solely T-wave-derived features to evaluate [K + ] levels when acidosis arises, may, therefore, either under-or overestimate [K + ] levels.
A compelling case to mention is patient #15, whose values of θ δ and T SA decreased during the long interdialytic interval. Besides being the patient with the most complicated medical history, including chronic heart failure, LVH, and ischemic heart disease, he was the only patient who experienced metabolic alkalosis. Even though alkalosis does not usually cause hypokalemia in HD patients [43], it is peculiar to see that θ δ and T SA decreased. Such behavior of θ δ and T SA is something we would expect in case of [K + ] depletion as in hypokalemia. Since alkalosis-related ECG changes resemble those of hypokalemia [44], one must pose the question of whether this unusual descriptor variation results, inherently, from the heart failure condition, or as a consequence of alkalosis.
While blood pH imbalance is seldom life-threatening in itself if not in severe levels [45], identifying acid-base disturbances may not only improve [K + ] monitoring but also aid in assessing the arrhythmogenic potential of [K + ]. In addition to being vastly prevalent in HD patients, acid-base disequilibrium can encourage the onset of arrhythmias by (i) impairing vascular and myocardial function [46], and (ii) influencing the levels of various electrolytes, including [K + ], [Na], and [Ca] [42], [45]. For instance, metabolic acidosis induces [K + ] shifts from the intracellular to the extracellular space, potentially leading to hyperkalemia [45].

D. CHALLENGES AND LIMITATIONS
Even with encouraging results, deriving θ δ and T SA in ambulatory conditions still poses some obstacles to be tackled, one of them being the inherent complexity of determining T-wave boundaries in noisy conditions. When tachycardia or an episode of premature atrial contractions (PACs) occur, the P-wave can partially hide within the preceding T-wave, resulting in either a disturbed T-wave morphology or a misguided delineation of the T-wave. We experienced difficulties in accurately locating T-waves during tachycardia or PAC episodes. Even though employing a SQI detector should have disregarded ECG segments with premature heartbeats, the SQI used in this work failed to identify PAC episodes, eliminating exclusively ventricular ectopic beats and noisy segments. Premature heartbeats, atrial or ventricular, must be detected not only to avoid erroneously locating the T-wave but also because alterations in serum [K + ] and [Mg 2+ ] can trigger ectopy and, consequently, arrhythmias [8]. The frequency of ectopy occurrence might, therefore, be an indicator of electrolyte fluctuations.
Alternating T-wave morphologies is another issue deserving further exploration. Independently of whether different physiological conditions instigate morphology variations, the disparity in observed T-wave morphologies, even in the same patient, further demonstrates the importance of dealing with various T-wave morphologies. With previous studies having used, exclusively, intradialytic T-waves to seed models for quantification of serum [K + ], the performance of such models is, arguably, fettered when encountering different interdialytic morphologies. While estimating [K + ] levels from T-waves identical to the patient-specific reference is ideal, it may not always be attainable to do so during activities of daily living. Availability of multiple ECG leads and lead-reduction techniques could ameliorate the problem of alternating T-wave morphologies [47]; however, 12-lead ECG recorders are often uncomfortable for wearing and hence unsuitable for long-term monitoring. Handling various ECG morphologies is, therefore, indispensable for noninvasive monitoring of electrolyte fluctuations. Indeed, in a highly susceptible group of HD patients, the discrepancy in T-wave morphologies can stem from many sources, either psychological stress [48], change in body position [23], physical activity [49], other electrolyte imbalances [9], or due to pre-existent cardiac comorbidities. Understanding the causes of morphology changes in HD patients is pivotal to avoid misclassification of other pathologies and electrolyte imbalance.
The small number of patients included in this study, albeit being a realistic representation of the HD population, certainly restricts the generalization of our findings, especially to other populations susceptible to [K + ] imbalance. Furthermore, the lack of patients with severe hypo-or hyperkalemia prevents us from evaluating the descriptor response in such extreme cases with distinct ECG morphology.
The exploration of additional electrolyte biomarkers is needed. Having biomarkers of serum [K + ], [Ca], and [HCO − 3 ] can facilitate routine electrolyte monitoring, aid in ascertaining the harmfulness of [K + ] levels, and possibly avert life-threatening conditions. Thus, our future studies will focus on developing descriptors of [Ca] and [HCO − 3 ] levels and optimize [K + ] estimation under concomitant electrolyte imbalance. Future studies should also strive to collect blood samples on days between HD sessions and extend to other patient populations susceptible to [K + ] imbalance (e.g., heart failure).
To the best of our knowledge, this is the first study to attempt to monitor gradual [K + ] fluctuations throughout the long interdialytic interval, thereby narrowing any possibility to compare our findings. Nevertheless, we reveal the central issues to be solved concerning the noninvasive monitoring of electrolyte fluctuations in HD patients.

V. CONCLUSION
This study demonstrates that long-term noninvasive monitoring of [K + ] fluctuations is feasible even in complicated Algorithm 3 Feature Estimation Input: Delineated T (n) Output: θ δ , T SA 1: T o (n) ← T (n) 2: T (n), T z (n), type ←TwaveRectificationT (n) 3: if type! = flat then 4: S u , S d ← Estimate T-wave slopes from T z (n) as in [30]. 5: θ δ ←EstimateThetaDelta(T (n), S u , S d ) 6: if type! = negative then 7: T SA ← Estimate T SA from T o (n) as described in [15]. N ←length(T (n)) 15: σ d , µ u , µ d , γ d , R 2 ←TwaveParametrization(T (n)) 16: if R 2 ≥ 0.8 then 17: θ ← arctan(S d ) − arctan(S u ) 18 θ δ ← − log 10 (θ · δ) 23: end if 24: return θ δ 25: end procedure were determined empirically and are dependent on T (n) and T (n). In the table, n p denotes the T-wave peak sample location of T (n), whereas b = N 1000 , where N is the number of samples in T (n). The initial values of φ can be modified as long as the initial template is similar to the one shown in Fig. 11. The composite T c (n) must be beneath T (n) peak. The location parameter µ u ensures that T u (n) always fits the upward slope, thus the lower and upper boundaries of µ u depend on the peak location. The boundaries guarantee T u (n) is centered within [25%-90%] of the upward portion of T (n) as shown in Fig 11. The scale parameter µ d evaluates how ''shrunk'' or ''stretched'' the T-wave is. Accordingly, ln b is used to better adapt the algorithm to different T-waves.

APPENDIX B PSEUCODE OF THE DEVELOPED ALGORITHM
T-wave rectification steps are described in Algorithm 1, T-wave parametrization in Algorithm 2. Algorithm 3 explains the procedure for feature estimation.