{'fraction_non_alphanumeric': 0.03716630506555985, 'fraction_numerical': 0.011193912523975726, 'mean_word_length': 4.5659782989149456, 'pattern_counts': {'":': 0, '<': 8, '<?xml version=': 0, '>': 2, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 1, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
A Framework Based on Machine Learning for Analytics of Voltage Quality Disturbances

: This paper proposes a machine-learning-based framework for voltage quality analytics, where the space phasor model (SPM) of the three-phase voltages before, during, and after the event is applied as input data. The framework proceeds along with three main steps: (a) event extraction, (b) event characterization, and (c) additional information extraction. During the ﬁrst step, it utilizes a Gaussian-based anomaly detection (GAD) technique to extract the event data from the recording. Principal component analysis (PCA) is adopted during the second step, where it is shown that the principal components correspond to the semi-minor and semi-major axis of the ellipse formed by the SPM. During the third step, these characteristics are interpreted to extract additional information about the underlying cause of the event. The performance of the framework was veriﬁed through experiments conducted on datasets containing synthetic and measured power quality events. The results show that the combination of semi-major axis, semi-minor axis, and direction of the major axis forms a sufﬁcient base to characterize, classify, and eventually extract additional information from recorded event data.


Introduction
Among power quality (PQ) disturbances, three of the main voltage events are voltage dip, voltage swell, and (voltage or supply) interruption. Each of these events can result in undesired process or production interruptions or malfunctioning of sensitive loads such as PLC controllers, industrial installations, etc. [1]. Mitigation or compensation of these events results in a more reliable and high-quality electrical power supply.
Standard methods for PQ analytics are part of the RMS-voltage framework, where the RMS-voltage is used for detection, classification, and characterization, as prescribed in IEC 61000-4-30 [2] and IEEE 1564 [3]. The term "rms voltage variations", which is generally used in IEEE power-quality standards, is a clear reference to the existence of such an RMS-voltage-based framework. Within the IEC document, the one-cycle rms voltage is used to characterize dips, swells, and interruptions, A 10 or 12-cycle rms voltage is used to characterize slow variations in voltage magnitude. The RMS-based framework has resulted in the extensive use of power-quality monitoring to develop large volumes of statistical data and common benchmarks [3]. However, the standardization appears to have stopped further innovation and development, for example, to remove limitations regarding event characterization, the three-phase character of most of the measurements, and extending the methodology to voltage and current transients [4,5]. Event characterization aims to obtain single event characteristics (SECs) that can be used to interpret the corresponding voltage event and its impact on the grid and equipment connected to the grid [6][7][8][9]. The Most of the works on ML and DL applied synthetic data for the training and testing of their algorithms. Such synthetic data sets might not correspond to the same information as measurements. However, they provided the knowledge for enabling the extraction of additional information from a large amount of data. Such ML and DL methods can be used as input for automatic decision-making by smart grids. However, the existing set of single-event characteristics, based on the rms-model, is a limitation for developing machine-learning tools and such automatic decision-making. New frameworks should be developed to provide analytics of large power quality data sets.
This paper further extends the earlier works and proposes a complete framework that receives the SPM complex values as an input and then proceeds with three successive steps: (a) event data extraction and classification, (b) characterization, and (c) additional information extraction. These three steps are essential for the framework, but they can be filled in using different algorithms. In this paper, to illustrate the framework, the Gaussian anomaly detection (GAD) method is used in the first step to extract event data as anomalous data from the entire recording. The principal component analysis (PCA) method is applied in the second step to calculate the SECs from the extracted event data. The resulted SECs are transferred to the third step to extract additional information about the event, such as the location of the electrical fault that led to a voltage dip. The main contributions of the proposed framework are: 1.
The proposed SPM-based framework enables instantaneous event detection since it does not use any low-pass filter such as the RMS-based model. It also provides the same basic characteristics (semi-minor, semi-major axes, ellipse rotating angle) for dip, swell, and interruption events; 2.
The framework uses fully automatic machine learning (ML) methods (e.g., GAD, PCA) for voltage event analytics that do not need any human involvement during the entire process; 3.
The framework is applicable to all types of voltage events by just adjusting pre-defined setpoints for different event types; 4.
The framework is scalable to a large amount of data, which is important for modern power systems in which a huge amount of data is recorded continuously.
The proposed framework is applied to both measured and synthetic voltage events, and the results are compared with the results from existing methods. The remainder of this paper is organized as follows: Section 2 illustrates the proposed framework and its different modules (event detection, event characterization, and information extraction modules) and the applied ML method (GAD and PCA) in each module. Section 3 presents the results, and Section 4 the discussion. Section 5 concludes this paper.

Proposed Framework for Voltage Event Analytics
The proposed framework for voltage event analytics consists of three modules:

1.
Event data extraction and classification: the event data extraction distinguishes between normal data and deviated data. The flow diagram of the proposed framework is shown in Figure 1, indicating the main steps of this framework: even extraction, event characterization, and information extraction. The framework applies different machine learning methods for each step. The following subsections describe the applied measured data and corresponding pre-processing tasks, as well as developing machine-learning methods for voltage event analytics applied in the first and second steps.  3. Extracting additional information: this step aids in interpreting given SECs from the previous step to extract information about the event's origin, its impacts, etc.
The flow diagram of the proposed framework is shown in Figure 1, indicating the main steps of this framework: even extraction, event characterization, and information extraction. The framework applies different machine learning methods for each step. The following subsections describe the applied measured data and corresponding pre-processing tasks, as well as developing machine-learning methods for voltage event analytics applied in the first and second steps.

Measured Data
The PQ continuously monitors samples of the three-phase voltage streams among other electrical quantities (e.g., current and harmonics). The space phasor model of the sampled three-phase voltage signals is given by: Where , , and are three-phase voltage signals, = 1, ⋯ , denotes the number of samples, = 2 3 ⁄ , and ( × 1) is a row vector of complex values. Partitioning data vector into real and imaginary parts, the resulted data matrix is: (2) where contains the real part, and is the imaginary part of all SPM samples. During normal voltage conditions, the space phasor model, in the complex plane, is approximately in the shape of a circle where its radius (or modulus of the SPM) varies typically between 0.9 and 1.1 pu. During a voltage dip, the modulus drops below 0.9 pu (or another selected threshold), and for an unbalanced dip, it even varies with time. For a voltage swell, the modulus exceeds 1.1 pu (or another selected threshold). Once a modulus of the SPM drops crosses one of these thresholds, the event detection is triggered, and PQ monitors records during-event data as well as several pre-event and post-event cycles. Thereby, further precise voltage event analytics depends on how accurately the duringevent samples are extracted from pre-event and post-event samples. A typical recorded voltage event by a PQ monitor is shown in Figure 2. The waveform (upper left side), a modulus of an SPM as a function of time (lower left side), and the SPM (right side) of a typical voltage dip event. The pre-event and post-event segments are considered normal voltages since the corresponding modulus is within the thresholds. The during-event segment results in an ellipse inside the inner circle (dip threshold), where the modulus also drops below 0.9 pu. The SPM modules recover over 0.9 pu. Such a recovery occurs twice every cycle. Therefore, it would result in a method that detects a voltage dip every 10 ms. This way, to obtain the whole dip recording, the last recovery over the threshold is considered as dip end.

Measured Data
The PQ continuously monitors samples of the three-phase voltage streams among other electrical quantities (e.g., current and harmonics). The space phasor model of the sampled three-phase voltage signals is given by: where V a , V b , and V c are three-phase voltage signals, n = 1, · · · , N denotes the number of samples, α = e j2π/3 , and x (N × 1) is a row vector of complex values. Partitioning data vector x into real and imaginary parts, the resulted data matrix X is: where x R contains the real part, and x I is the imaginary part of all SPM samples. During normal voltage conditions, the space phasor model, in the complex plane, is approximately in the shape of a circle where its radius (or modulus of the SPM) varies typically between 0.9 and 1.1 pu. During a voltage dip, the modulus drops below 0.9 pu (or another selected threshold), and for an unbalanced dip, it even varies with time. For a voltage swell, the modulus exceeds 1.1 pu (or another selected threshold). Once a modulus of the SPM drops crosses one of these thresholds, the event detection is triggered, and PQ monitors records during-event data as well as several pre-event and post-event cycles. Thereby, further precise voltage event analytics depends on how accurately the during-event samples are extracted from pre-event and post-event samples. A typical recorded voltage event by a PQ monitor is shown in Figure 2. The waveform (upper left side), a modulus of an SPM as a function of time (lower left side), and the SPM (right side) of a typical voltage dip event. The pre-event and post-event segments are considered normal voltages since the corresponding modulus is within the thresholds. The during-event segment results in an ellipse inside the inner circle (dip threshold), where the modulus also drops below 0.9 pu. The SPM modules recover over 0.9 pu. Such a recovery occurs twice every cycle. Therefore, it would result in a method that detects a voltage dip every 10 ms. This way, to obtain the whole dip recording, the last recovery over the threshold is considered as dip end.

Extracting Voltage Event (Anomalous) Samples Using GAD Method
From a machine learning viewpoint, the anomaly detection technique is used to find observations that do not correspond to an expected pattern [45]. The proposed framework uses Gaussian-based anomaly detection to distinguish the voltage event samples from normal samples belonging to the pre-event and post-event segments. Given the measured data matrix = [ ] in (2), the assigned Gaussian distribution, for each dimension (i.e., column of the data matrix), is determined as follows: where = denotes the dimension of the data matrix. and 2 are the mean and standard variance of the -th dimension, given by the following equations: By the estimated Gaussian distribution for each test data sample ( ) , the corresponding -score is obtained as follow: A sample declared to be anomalous if: where is a total number of samples and the 2, −1 ⁄ is a threshold used to refer to a sample as anomalous. It is obtained from t-distribution at a confidence level of 2 [46]. The anomalous samples are saved in event data matrix denoted as = [ , ].

PCA Applications for Calculating the Single-Event Characteristics
Principal component analysis (PCA) finds a lower-dimensional representation of data. If the dimension of data is reduced into only two dimensions, the data is projected

Extracting Voltage Event (Anomalous) Samples Using GAD Method
From a machine learning viewpoint, the anomaly detection technique is used to find observations that do not correspond to an expected pattern [45]. The proposed framework uses Gaussian-based anomaly detection to distinguish the voltage event samples from normal samples belonging to the pre-event and post-event segments. Given the measured data matrix X = x R x I in (2), the assigned Gaussian distribution, for each dimension (i.e., column of the data matrix), is determined as follows: where j = R or I denotes the dimension of the data matrix. µ j and δ j 2 are the mean and standard variance of the j-th dimension, given by the following equations: By the estimated Gaussian distribution for each test data sample x (j) i , the corresponding z-score is obtained as follow: A sample declared to be anomalous if: where N is a total number of samples and the t γ/2,N−1 is a threshold used to refer to a sample as anomalous. It is obtained from t-distribution at a confidence level of γ 2N [46]. The anomalous samples are saved in event data matrix denoted as Y = [y R , y I ].

PCA Applications for Calculating the Single-Event Characteristics
Principal component analysis (PCA) finds a lower-dimensional representation of data. If the dimension of data is reduced into only two dimensions, the data is projected by the PCA into two data vectors u 1 and u 2 . The vector u 1 is the principal direction of variation of the data, and u 2 the secondary direction of the variation [47].
To develop a PCA technique, from the given event data matrix Y, the matrix where h is a unitary K × 1 column vector, and µ R and µ I are empirical means of y R and y I , respectively. Next, the covariance matrix C is calculated as follow: where stands for outer product, M T is a transpose of matrix M, and C is 2 × 2 symmetric matrix that results in two orthogonal eigenvectors (u 1 , u 2 ) [28]. By projecting the original data matrix Y into these eigenvectors, the projected data Y = [ y 1 , y 2 ] is in an ellipse shape, and y 1 , y 2 vectors tend to the ellipse semi-minor and major axis. Therefore, the magnitude of ellipse axes and the rotating angle is derived as follows: The semi-major axis A y , semi-minor axis (A x ), and rotating angle of the ellipse (ϕ) (the direction of the semi-major axis) are obtained as follows: Further, the duration of the event is determined by dividing the number of anomalous samples (k) by the sampling frequency ( f s ) as d = K f s .

Extracting Additional Information Using Single-Event Characteristics
This module extracts information about the voltage event, such as its type, underlying cause, etc., using the single-event characteristics.

Transient and Non-Transient Events
The "event duration" can be defined as the time between the first drop of the SPM modulus below the threshold and the last recovery above the threshold. By using this "event duration" characteristic, the voltage disturbances can be divided into "transient" and "non-transient" events. A transient event has a duration of less than one cycle. The discussion below is mainly for non-transient events; for transient events, a separate set of characteristics is needed. The SPM, as used in this paper, allows for a clear distinction between transient and non-transient events, something that was not possible with the rms-based approach.

Voltage Event Type
Based on the semi-minor and semi-major axes, a distinction can be made between a dip, swell, and interruption as follows: Voltage dip: δ interruption < A y < δ dip ; Voltage swell: A x > δ swell ; Voltage interruption: A y < δ interruption . The combination where A y > δ dip and A x < δ swell would be normal voltage and not lead to triggering as a voltage event. It is worth noting that these definitions largely but not completely correspond to the definitions according to IEC 61000-4-30 [2]. The IEC definitions are based on the deviation of the RMS voltage from its nominal value. Typical thresholds are 90% of the nominal voltage for voltage dips, 110% for voltage swells, and 10% for voltage interruption. The definitions based on ellipse parameters are different but not more arbitrary than the standard ones.

Unbalance Type
The unbalance type (UT) provides information about which phasor(s) are involved in voltage events. The UT characteristic is determined according to the direction of the semi-major axis. The rules in Table 1 show the relationship between the ellipse-rotating angle (i.e., the direction of the semi-major axis) and the UT characteristic. For instance, the first rule says once the rotating angle ϕ is in the range (0, 30], then the UT is I b , which means the event is taking place between phase "b" and neutral. For this case, the notation means that the angle ϕ is between 0 and 30 degrees, including 30 degrees; i.e., 0 < ϕ ≤ 30. Table 1. Relation between rotating angle (ϕ) and Unbalance Type (UT) characteristic.

Range of ϕ UT Main Unbalance Significant Drop or Swell in:
(0, 30] I b between phase "b" and neutral Phase "b" (30,60] I I c between phase "a" and "b" Phases "a" and "b" (60, 90] I a between phase "a" and neutral Phase "a" (90, 120] I I b between phase "a" and "c" Phases "a" and "c" (120, 150] I c between phase "c" and neutral Phases "c" (150, 180] I I a between phase "b" and "c" Phases "b" and "c"

Electrical Fault Type Detection and Localization
By the single-event characteristics, a dip or swell is assigned to one class of an extended ABC classification [8,14]. The recognition of the ABC class allows estimating the original type and location of a fault. The dip class is obtained as represented in Column 4 of Table 2 by UT, zero-sequence (z 0 ) and semi-major axis (A x ). The dip class is dependent on the type of fault and the winding connection between the fault and monitoring locations. It allows obtaining information on the type and location of the related fault, even when there is no information from the protection system. The relation between fault types and dip classes, which are also referred to as dip types [8,14], can be obtained as shown in Table 2. In Table 2, "<1" means that the length of the semi-major axis is somewhere between unity and the length of the semi-minor axis. The table only considers DY and YY-connected transformers, where the latter gives the same transformation as two DY transformers. Additional rules can be added for other transformer types [8]. The dip class alone cannot determine if the dip is at higher or lower voltage levels. However, faults at lower voltage levels result in shallow dips, whereas severe dips are either due to faults at the same or a higher voltage level.

Results
This section aims at verifying the performance of the proposed framework for analyzing the recorded voltage event data. Voltage dip measurements are used to illustrate the framework's effectiveness.

Measured Voltage Event Data
We applied about 200 different voltage dips measured at a distributed level to evaluate the performance of the proposed framework in terms of voltage event detection and characterization. However, due to lack of space, we show the results of only 10 examples. The three-phase voltage waveforms and the corresponding SPM of these 10 examples are shown in Figure 3. The SPM of the whole data is shown in blue, and the SPM of during-event data, extracted by GAD, is shown in red. The numerical results of event characterization, using the PCA method, are shown in Table 3. The zero-sequence parameter is zero for all the examples.

I/II
≠ 0 < 1 I Two-phase-to-ground at monitoring level in a highimpedance-earthed system I/II 0 ≈ < 1 A Three-phase fault at any level

Results
This section aims at verifying the performance of the proposed framework for analyzing the recorded voltage event data. Voltage dip measurements are used to illustrate the framework's effectiveness.

Measured Voltage Event Data
We applied about 200 different voltage dips measured at a distributed level to evaluate the performance of the proposed framework in terms of voltage event detection and characterization. However, due to lack of space, we show the results of only 10 examples. The three-phase voltage waveforms and the corresponding SPM of these 10 examples are shown in Figure 3. The SPM of the whole data is shown in blue, and the SPM of duringevent data, extracted by GAD, is shown in red. The numerical results of event characterization, using the PCA method, are shown in Table 3. The zero-sequence parameter is zero for all the examples. For instance, for the second event (Ev. 2), semi-major ( ) and semi-minor ( ) axes are equal to 0.77 pu and 0.11 pu, respectively. The rotating angle of the ellipse is 81.5°. This results in dip class with significant voltage drop in phase "a" and consequently unbalanced type . The event lasts for about 215 ms. The event is due to a two-phase-toground fault above a Dy transformer, at a higher voltage level (above 10 kV). The third event (Ev. 3) is a multi-stage dip that consists of two event segments. The first segment is an unbalanced short-duration dip that lasts for about three cycles (60 ms). The next segment is a balanced dip. The GAD method extracted both segments as one event. By using  For instance, for the second event (Ev. 2), semi-major (A x ) and semi-minor (A y ) axes are equal to 0.77 pu and 0.11 pu, respectively. The rotating angle of the ellipse is 81.5 • . This results in dip class F with significant voltage drop in phase "a" and consequently unbalanced type I a . The event lasts for about 215 ms. The event is due to a two-phase-toground fault above a Dy transformer, at a higher voltage level (above 10 kV). The third event (Ev. 3) is a multi-stage dip that consists of two event segments. The first segment is an unbalanced short-duration dip that lasts for about three cycles (60 ms). The next segment is a balanced dip. The GAD method extracted both segments as one event. By using PCA, the equivalent semi-major and semi-minor axes for the whole event are calculated as 0.66 pu and 0.56 pu, respectively.
The second segment lasts for about 11 cycles (220 ms), during which there is no big difference between semi-minor and major axes (0.1 pu). Alternatively, the PCA can be applied to each event segment separately, as in [4]. Ev. 6 is a heavy distorted shallow dip for which the SPM is a heavily distorted circle. The semi-minor and semi-major axes of the corresponding ellipse are 1.01 pu and 0.93 pu, respectively. The event lasts for 293 ms. The heavy distortion and the fact that this is only present during part of the cycle points to transformer energizing as the origin for this event.

Comparison with Symmetric-Component and Six-Phase Algorithms
In this sub-section, the proposed framework (in terms of Ay, A y , φ, and DT) is compared with two benchmarking methods (SCA and SPA) in terms of voltage dip characterization. Different synthetic dips, presented in [14] and shown in Table 4, are applied to all three methods. The synthetic dips are applied to these three methods, and the obtained characterization results are shown in Table 5. Events 1 through 4 are due to single-phase faults; they show the same voltage drop in phase "a", 50%, but with different PAJs. The results for the SCA are shown in Columns 2-4 of Table 5; the SPA results are shown in Columns 6-8. The results of the proposed framework are shown in Columns 8-11. All three methods result in the same dip type for three first events. The large PAJ (−40 • ) in Event 4 impacts the SPA algorithm and results in wrong unbalance type characteristics. Considering Event 1, the calculated CV characteristic by SCA and SPA methods and the calculated semi-minor axis by the proposed framework are all equal to 0.67 pu. Similarly, the values of the semi-major axis and PNF characteristics are the same and equal to 1 pu. Due to PAJ in Events 2-4, the semi-major axis increases, and the semi-minor axis decrease. The calculated PNF by the SCA remains 1 pu for all events, but the calculated PNF by the SPA for Event 4 increases to 1.04 pu. The CV and A y characteristics decrease with increasing PAJ.  Events 5-8 are due to phase-to-phase faults, including PAJ of 0, −17.8, −25.8, and −33.4 • , respectively. In this case, the PAJ has more impact on SPA, which results in the wrong unbalance type for Events 7 and 8.
Events 9-12 are synthesized voltage dips obtained by adding load effects on Events 5-8. The PNF and A x characteristics are no longer equal to 1 pu. The load effect makes that the SCA results in the incorrect unbalance type for Events 11 and 12. The same impact is seen for the SPA. The load effect impacts the semi-minor and major axes much more than the rotating angle of the SPM ellipse and shows that the rotating angle of the ellipse is a robust parameter for voltage dip classification. The results show that there is a strong correlation between CV and semi-minor axis as well as between PNF and semi-major axis.

Discussion
In general, the results presented in this paper show that the GAD method is a suitable method for extracting event data from recorded voltage waveforms in a three-phase system and that the PCA facilitates calculating efficient single value characteristics for the voltage event. Some of the advantages of the proposed SPM-based framework are: a.
The possibility of instantaneous event detection, since it does not use any low-pass filter such as the one-cycle rms voltage. This results in a higher time resolution for the event duration, which is especially important for short-duration events. It also becomes much more straightforward to obtain the point-on-wave for event start and event end; b.
The possibility to provide the same basic characteristics (semi-minor, semi-major axes, direction of semi-major axis) and triggering algorithm for dips, swells, and interruptions. The use of these three characteristics gives a better characterization of voltage events in a three-phase system than the rms-based method. The proposed characterization is also more robust than the benchmarking algorithms proposed earlier for the characterization of three-phase events (SCA, SPA); c.
The same triggering algorithm can be used for voltage transients. It becomes possible to use a unique distinction between transients and non-transient events; d.
The possibility of visualizing exact transitions segments as points between circles/ellipses corresponding to the pre-, post-, and during-event segments. The SPM-based method can also be used as a base for event segmentation; further work towards this is recommended; e.
The SPM is also a better reference for the performance of three-phase equipment, such as three-phase electrical motors, as the SPM is aligned with the rotating nature of such equipment. This can be either a physical rotation (in the case of three-phase electrical motors) or an emulated one in the control algorithm (in the case of three-phase power-electronic converters; f. In this paper, the method was applied to short-duration events, but a similar characterization can be applied to normal supply voltage variations. The existing method (as in IEC 61000-4-30) is to give (10/12-cycle, 120/150-cycle, and 10 minute) values of the three rms voltages and the voltage unbalance. Under the SPM-based method, this would be replaced by the semi-major axis, semi-minor axis, and direction of the semi-major axis; g.
The method uses machine-learning tools during the first two steps. Further machinelearning techniques can be applied during the second step, for example, for event segmentation. Machine-learning tools can also be used for the analysis of large amounts of events during step three; h.
The framework can unify a large amount of distinct event duration in a unified representation. The duration of events as voltage dips can be different for each waveform. Thus, the number of samples for each event can also be different; the number of stages can also imply a different number of samples. The framework keeps the original information in the SPM, which is not duration-dependent as RMS methods; i.
The SPM is the main contribution and the novelty presented in this framework. The steps for anomaly detection, event characterization, and information extraction can next be filled up with different ML methods. The choice of what is the best ML method is beyond the scope of this paper.
An obvious disadvantage of the proposed method is that it is not applicable to singlephase systems, installations, or equipment. The proposed method also does not allow for a characterization of the zero-sequence component. The latter is, however, equivalent to a single-phase system, and relatively simple methods are available or can be developed.

Conclusions
This paper proposes a machine learning-based framework that aims at handling large voltage event analytics in terms of event detection, event characterization, and information extraction, accepting a space phasor model (SPM) as input data. In the first step, the framework applies the Gaussian-based anomaly detection (GAD) to extract the duringevent segments from the recorded data. Then, the principal component analysis (PCA) is used to derive semi-minor and semi-major axis values and consequently single event characteristics (SECs). The SEC draws additional information about the corresponding event, which is useful for event mitigation and decision-making in the (smart) grid. The effectiveness of the framework was verified through the analysis of voltage dip datasets. The proposed framework was shown to be more robust under phase-angle jump and load effect than existing methods.
Some recommendations for further works are: a.
Although the analysis of this work is focused on voltage dips, it is recommended to apply the framework to other voltage variations. For instance, the framework can be applied to measurements of transients to obtain SECs without the need for filtering; b.
The framework can be extended to the pre-processing of waveforms to evaluate harmonic distortion; c.
The framework can be used as the pre-processing in supervised ML/DL. The labels can be related to the origin and impact of the disturbances. Additional information as waveforms of current can provide more features to such a task; d.
The SPM can also be employed in unsupervised DL. Since the framework can keep the original information of waveforms in a unified representation, it makes it easier to cluster a large number of events with different durations. The application of clustering algorithms could provide the most common patterns of events for a large amount of events waveforms; e.
Further works can employ different and evaluate the optimum choice for ML and DL methods in the steps of anomaly detection, event characterization, and information extraction. Funding: This research received external funding from the Swedish Energy Agency (project P39437-1 and P42979-1) as well as joint funding from Energiforsk and the Swedish Transport Administration (project 36267).

Conflicts of Interest:
The authors declare no conflict of interest.