An Adaptive Approach for Voltage Sag Automatic Segmentation

: Voltage sag characterization is essential for extracting information about a sag event’s origin and how sag events impact sensitive equipment. In response to such needs, more characteristics are required, such as the phase-angle jump, point-on-wave, unbalance, and sag type. However, the absence of an effective automatic segmentation method is a barrier to obtaining these characteristics. In this paper, an automatic segmentation method is proposed to improve this situation. Firstly, an extended voltage sag characterization method is described, in which segmentation plays an important role. Then, a multi-resolution singular value decomposition method is introduced to detect the boundaries of each segment. Further, the unsolved problem of how to set a threshold adaptively for different waveforms is addressed, in which the sag depth, the mean square error, and the entropy of the sag waveform are considered. Simulation data and ﬁeld measurements are utilized to validate the effectiveness and reliability of the proposed method. The results show that the accuracies of both boundary detection and segmentation obtained using the proposed method are higher than those obtained using existing methods. In general, the proposed method can be implemented into a power quality monitoring system as a preprocess to support related research activities.


Introduction
Nowadays, power customers and utilities consider voltage sag to be one of the most important power quality (PQ) problems. Voltage magnitude and sag duration are acknowledged to be basic characteristics of voltage sags [1][2][3]. In the past, only these two characteristics were involved in quantifying and benchmarking voltage sags [4]. With the increase in PQ monitors and new types of sensitive equipment in power systems, an effective data analysis of a sag event's origin and how sag events impact sensitive equipment is becoming more important for resolving voltage sag problems. Such developments have resulted in a need for a characterization method that can support several related research activities, as described below: 1.
The identification of the underlying causes of voltage sags. Short-circuit faults, energizing, and the connection of components may lead to sag events in a power system. For different causes, the characteristics in the recorded waveform are different. Since two single characteristic values lead to a significant loss of sag information, an improved characterization method may help to extract essential characteristics from the recorded waveform to identify the causes of a sag and recognize the status of the power supply system [5,6].
general, segmentation is a prerequisite process to obtain these characteristics that helps network operators and end-users to analyze sag events completely. For segmentation, the voltage magnitude and phase angle values during the transition segment are influenced by the calculation method and typically not realistic. Therefore, values in the transition segment should be excluded before calculation. As shown in Figure 2, the maximum voltage unbalance during a sag event is calculated as an example. If transition segments cannot be detected, it would result in the wrong result (more than 3% unbalance instead of 1%). The impacts of segmentation on other characteristics can be found in some published works, where segmentation is considered to be an unsolved problem [9,10]. In general, the inaccuracy of segmentation sometimes may result in an unacceptable error in the characteristics calculation. Another example can be found in the classification of a voltage sag event's origin [13], where the transition segment can be used to classify the origins of sag events. If the number of transition segments is inaccurate, the classification results are invalid. Overall, a further analysis of sag events and related conclusions would be affected by the segmentation method. It is noted that the pattern of transition segments and stationary segments is not common to all sag events. There might be no steady-state during the sags caused by starting a heavy motor and energizing a transformer. The cases in which the voltage changes continuously during the entire sag event are not considered in this paper. Since most sag events are caused by faults, which are more To improve the characterization method, the magnitude and phase variation with time, as well as the difference between each phase, are taken into consideration. Some characteristics, e.g., "single-event characteristics" and "single-segment characteristics", are introduced in [8][9][10]. Besides magnitude and duration, which are defined in standards [1][2][3][4], additional characteristics are required, e.g., the sag type [9], phase-angle jump [10], point-on-wave [15], unbalance [1,16], etc. In general, segmentation is a prerequisite process to obtain these characteristics that helps network operators and end-users to analyze sag events completely.
For segmentation, the voltage magnitude and phase angle values during the transition segment are influenced by the calculation method and typically not realistic. Therefore, values in the transition segment should be excluded before calculation. As shown in Figure 2, the maximum voltage unbalance during a sag event is calculated as an example. If transition segments cannot be detected, it would result in the wrong result (more than 3% unbalance instead of 1%). The impacts of segmentation on other characteristics can be found in some published works, where segmentation is considered to be an unsolved problem [9,10]. In general, the inaccuracy of segmentation sometimes may result in an unacceptable error in the characteristics calculation. Another example can be found in the classification of a voltage sag event's origin [13], where the transition segment can be used to classify the origins of sag events. If the number of transition segments is inaccurate, the classification results are invalid. Overall, a further analysis of sag events and related conclusions would be affected by the segmentation method.
Energies 2018, 11, x FOR PEER REVIEW  3 of 17 general, segmentation is a prerequisite process to obtain these characteristics that helps network operators and end-users to analyze sag events completely. For segmentation, the voltage magnitude and phase angle values during the transition segment are influenced by the calculation method and typically not realistic. Therefore, values in the transition segment should be excluded before calculation. As shown in Figure 2, the maximum voltage unbalance during a sag event is calculated as an example. If transition segments cannot be detected, it would result in the wrong result (more than 3% unbalance instead of 1%). The impacts of segmentation on other characteristics can be found in some published works, where segmentation is considered to be an unsolved problem [9,10]. In general, the inaccuracy of segmentation sometimes may result in an unacceptable error in the characteristics calculation. Another example can be found in the classification of a voltage sag event's origin [13], where the transition segment can be used to classify the origins of sag events. If the number of transition segments is inaccurate, the classification results are invalid. Overall, a further analysis of sag events and related conclusions would be affected by the segmentation method. It is noted that the pattern of transition segments and stationary segments is not common to all sag events. There might be no steady-state during the sags caused by starting a heavy motor and energizing a transformer. The cases in which the voltage changes continuously during the entire sag event are not considered in this paper. Since most sag events are caused by faults, which are more  It is noted that the pattern of transition segments and stationary segments is not common to all sag events. There might be no steady-state during the sags caused by starting a heavy motor and energizing a transformer. The cases in which the voltage changes continuously during the entire sag event are not considered in this paper. Since most sag events are caused by faults, which are more harmful to a power system's end-users, it is still necessary analyze these sag events. Besides, there are higher sub-and inter-harmonics caused by transformer energizing, arcing faults, intermediate faults, etc. Since all of the voltage values utilized in the proposed method are fundamental voltage values, harmonics would not affect the analysis's result. The question of how to obtain fundamental voltage values from sampling voltage values is the concern of the detection process, which is beyond the scope of this paper.

The Definition and Original Cause of Transition Segments
To separate a monitoring data sequence into several data blocks, segmentation has been implemented in many fields, including medicine and speech analysis [17][18][19]. Similar to the definition in other fields, a transition segment of a voltage sag waveform can be defined as a nonstationary segment from one stationary segment to another. The underlying reason is that it indicates the intermediate state during state changes of a power system. These changes result in abrupt changes in the three-phase voltage waveform. Therefore, the original cause of a transition segment is usually associated with fault initiation, a protection operation, etc. For instance, the actual event nearly happens close to the start of the transition segment, making segmentation more important [6]. Considering this property, the segmentation progress can be considered to be a special detection problem to locate abrupt changes in a sag waveform, that is, the boundaries of the transition segment. Once the boundaries of the transition segments have been determined, the voltage sag waveform can be divided into several segments.

The Multi-Resolution Singular Value Decomposition Method
To detect power quality disturbances, wavelet transformation (WT) and singular value decomposition (SVD) are generally used [5]. Since segmentation is actually detecting the boundaries of the transition segments of waveforms, these methods are still practical. To obtain a similar performance to the multi-scale analysis of WT, MRSVD has been applied to detect abrupt changes in waveforms, and to further locate the boundaries of transition segments. MRSVD has better performance than WT, especially in a strong noise environment, and does not require the choice of a mother wavelet as in WT [20][21][22].
Assuming a real-valued matrix A ∈ R m×n (m ≥ n), it is factored by SVD as follows.
The singular values λ i describe the significance of individual singular vectors. Although traditional SVD has optimal decorrelation and sub-rank approximation properties, to analyze signals in multi-resolution like WT, MRSVD is applied to extract important features at each of several levels of the resolution, and is described as follows. (1) Construct a Hankel matrix A 0 of an original signal x as: is the input data sequence. After SVD, only two singular values are obtained, i.e., S= diag[σ a , σ d ] (σ a > σ d ), and A 0 is decomposed as: where (2) Construct the approximation component A 1 and detail component D 1 as: where L a1 and L a2 can be constructed from Equations (12) and (13), respectively. Similarly, L d1 and L d2 are constructed from Equations (14) and (15).
L a2 = ( a 2 a 3 · · · a N−1 (13) (3) Repeating step (2) can obtain a series of detail components at each level, so multi-resolution decomposition is achieved. Finally, A 0 in Equation (4) is decomposed as The multi-scale decomposition of MRSVD is illustrated in Figure 3. Similar to the multi-resolution analysis of WT, the input signal is filtered separately by low-pass and high-pass filters, which are replaced with SVD. At each decomposition level, a detail signal is extracted and an approximation signal is used as the input signal of the next decomposition. By recursively repeating these steps, the original signal x is decomposed into multi-scale approximation and detail signals at different levels, and then the potential features of the original signal at different decomposition levels can be further analyzed.  In this paper, a differential waveform of the voltage magnitude, where a quarter-cycle overlapping calculation window is used, is taken as the input signal for the MRSVD method. For the case shown in Figure 1, results with three decomposition levels are shown in Figure 4. Figure 4a illustrates the voltage magnitude and Figure 4b is the approximation component after MRSVD. Figure 4c-e are the detail components at each decomposition level.
It is noted that some singular values are significantly larger than others in Figure 4b, and they relate to the abrupt changes in Figure 4a, that is, transition segments. In addition, the detail components at each decomposition level reach peaks at the same instant in Figure 4c-e. In conclusion, these peak values indicate the appearance of transition segments, which can be utilized to detect transition segments if the threshold value is selected. Therefore, the automatic segmentation process can be expressed as:

Stationary segment
Transition segment (17) where σ are singular values as shown in Figure 4b and τ is the threshold value.   In this paper, a differential waveform of the voltage magnitude, where a quarter-cycle overlapping calculation window is used, is taken as the input signal for the MRSVD method. For the case shown in Figure 1, results with three decomposition levels are shown in Figure 4. Figure 4a illustrates the voltage magnitude and Figure 4b is the approximation component after MRSVD.  In this paper, a differential waveform of the voltage magnitude, where a quarter-cycle overlapping calculation window is used, is taken as the input signal for the MRSVD method. For the case shown in Figure 1, results with three decomposition levels are shown in Figure 4. Figure 4a illustrates the voltage magnitude and Figure 4b is the approximation component after MRSVD. Figure 4c-e are the detail components at each decomposition level.
It is noted that some singular values are significantly larger than others in Figure 4b, and they relate to the abrupt changes in Figure 4a, that is, transition segments. In addition, the detail components at each decomposition level reach peaks at the same instant in Figure 4c-e. In conclusion, these peak values indicate the appearance of transition segments, which can be utilized to detect transition segments if the threshold value is selected. Therefore, the automatic segmentation process can be expressed as:

Stationary segment
Transition segment (17) where σ are singular values as shown in Figure 4b and τ is the threshold value.   It is noted that some singular values are significantly larger than others in Figure 4b, and they relate to the abrupt changes in Figure 4a, that is, transition segments. In addition, the detail components at each decomposition level reach peaks at the same instant in Figure 4c-e. In conclusion, these peak values indicate the appearance of transition segments, which can be utilized to detect transition segments if the threshold value is selected. Therefore, the automatic segmentation process can be expressed as: where σ are singular values as shown in Figure 4b and τ is the threshold value.

Impacts of a Constant Threshold Value on Segmentation
Since segmentation is a detection process, it can naturally be recognized as a binary hypothesis test, where the two hypotheses are as follows: H0: there is no transition segment, H1: there is a transition segment.
The probability density functions (PDFs) of these two hypotheses are shown in Figure 5, where the threshold plays an important role. To evaluate the its impact on segmentation, several definitions are introduced in Table 1.

Impacts of a Constant Threshold Value on Segmentation
Since segmentation is a detection process, it can naturally be recognized as a binary hypothesis test, where the two hypotheses are as follows: H0: there is no transition segment, H1: there is a transition segment.
The probability density functions (PDFs) of these two hypotheses are shown in Figure 5, where the threshold plays an important role. To evaluate the its impact on segmentation, several definitions are introduced in Table 1.  In the confusion matrix, TP and FN are the numbers of correctly detected cases, while FP and TN are the numbers of false alarm and miss alarm cases, respectively [23]. From Figure 5, with different threshold values, the area of the four kinds of cases is different. Theoretically, the area of the correctly detected cases should be as large as possible, i.e., the numbers of TP and FN should be as large as possible. However, if the threshold is too low, some fluctuations may lead to a false alarm; on the contrary, a miss alarm cannot be avoided. As a result, whatever threshold value is set, FP and TN cannot be eliminated at the same time. Therefore, the threshold value is usually set as a tradeoff between FP and TN in classical algorithms, to yield the minimum miss alarm rate with a given proper false alarm rate. However, it requires enormous waveforms, recorded at each monitoring site, to calculate the PDF in advance. For a large-scale monitoring system, this is sometimes not practical. To further validate the impact of threshold, singular values of two voltage sag waveforms, recorded at the same site in a distribution network, are illustrated in Figure 6.  In the confusion matrix, TP and FN are the numbers of correctly detected cases, while FP and TN are the numbers of false alarm and miss alarm cases, respectively [23]. From Figure 5, with different threshold values, the area of the four kinds of cases is different. Theoretically, the area of the correctly detected cases should be as large as possible, i.e., the numbers of TP and FN should be as large as possible. However, if the threshold is too low, some fluctuations may lead to a false alarm; on the contrary, a miss alarm cannot be avoided. As a result, whatever threshold value is set, FP and TN cannot be eliminated at the same time. Therefore, the threshold value is usually set as a tradeoff between FP and TN in classical algorithms, to yield the minimum miss alarm rate with a given proper false alarm rate. However, it requires enormous waveforms, recorded at each monitoring site, to calculate the PDF in advance. For a large-scale monitoring system, this is sometimes not practical. To further validate the impact of threshold, singular values of two voltage sag waveforms, recorded at the same site in a distribution network, are illustrated in Figure 6. Due to the stochasticity of voltage sags, the dynamic variation of magnitude has a significant impact on singular values. As the threshold value τ0 (dashed lines) shows in Figure 6, if τ0 in Figure  6a is less than seven, more transition segments would be detected (false alarm), while if it is larger than three for another waveform in Figure 6b, there would be only one segment or even zero (a miss alarm). Overall, the reasonable constant threshold for one recorded waveform may be unavailable to another one. From a practical standpoint, it is impossible to change the threshold value for different sag events at different monitoring sites in an artificial way. This is the primary reason for why there is no acceptable automatic segmentation method.

Construction Process of an Adaptive Threshold
To overcome the defect of a constant threshold, one feasible solution is to change the threshold value adaptively according to different waveform characteristics. Therefore, the adaptive threshold value is the key point of correct segmentation. To improve this situation, the adaptive threshold proposed in this paper is set as: S MSE (18) where Vdepth is the sag depth of the sag event, MSE is the mean square error of the waveform, and Smax is the maximum nominal entropy value. For different sag waveforms, the sag depth, MSE, and entropy can be calculated successively and the corresponding threshold determined. The construction of the adaptive threshold is explained as a three-step process as follows. How it works is verified with some field measurements in Section 5.2.

Sag Depth
Sag depth, one of the main characteristics, is the difference between the nominal voltage and the minimal voltage magnitude [4]. When the fundamental voltage is obtained, the sag depth can be obtained as: where VN and Vmin is the nominal voltage and the minimum voltage during sag, respectively. For example, if the minimum voltage during sag is 0.7, the sag depth is calculated as 0.3. Note that the Due to the stochasticity of voltage sags, the dynamic variation of magnitude has a significant impact on singular values. As the threshold value τ 0 (dashed lines) shows in Figure 6, if τ 0 in Figure 6a is less than seven, more transition segments would be detected (false alarm), while if it is larger than three for another waveform in Figure 6b, there would be only one segment or even zero (a miss alarm). Overall, the reasonable constant threshold for one recorded waveform may be unavailable to another one. From a practical standpoint, it is impossible to change the threshold value for different sag events at different monitoring sites in an artificial way. This is the primary reason for why there is no acceptable automatic segmentation method.

Construction Process of an Adaptive Threshold
To overcome the defect of a constant threshold, one feasible solution is to change the threshold value adaptively according to different waveform characteristics. Therefore, the adaptive threshold value is the key point of correct segmentation. To improve this situation, the adaptive threshold proposed in this paper is set as: where V depth is the sag depth of the sag event, MSE is the mean square error of the waveform, and S max is the maximum nominal entropy value. For different sag waveforms, the sag depth, MSE, and entropy can be calculated successively and the corresponding threshold determined. The construction of the adaptive threshold is explained as a three-step process as follows. How it works is verified with some field measurements in Section 5.2.

Sag Depth
Sag depth, one of the main characteristics, is the difference between the nominal voltage and the minimal voltage magnitude [4]. When the fundamental voltage is obtained, the sag depth can be obtained as: where V N and V min is the nominal voltage and the minimum voltage during sag, respectively. For example, if the minimum voltage during sag is 0.7, the sag depth is calculated as 0.3. Note that the proposed method is not a real-time method, which means that the sag depth is calculated after the entire sag waveform has been recorded and the fundamental voltage has been obtained. Since both voltage magnitude and singular values vary in different waveforms, the relationship between sag depth and the maximum singular value is analyzed. Field measurements recorded in different sites are applied to MRSVD and the result is illustrated in Figure 7, where each point represents one field measurement. In total, 98 points from 50 sag events in three-phase (excluding the phases without sag) are plotted in the figure. The X-axis and Y-axis represent the sag depth and the maximum singular value, respectively. proposed method is not a real-time method, which means that the sag depth is calculated after the entire sag waveform has been recorded and the fundamental voltage has been obtained. Since both voltage magnitude and singular values vary in different waveforms, the relationship between sag depth and the maximum singular value is analyzed. Field measurements recorded in different sites are applied to MRSVD and the result is illustrated in Figure 7, where each point represents one field measurement. In total, 98 points from 50 sag events in three-phase (excluding the phases without sag) are plotted in the figure. The X-axis and Y-axis represent the sag depth and the maximum singular value, respectively. In Figure 7, most points are close to the left side where the sag depth is between 0.1 and 0.2, because most sag events recorded in a distribution system have a slight voltage drop. In addition, it is noted that singular values are related to the sag depth (the first line). The reason is that the maximum singular value represents the largest rate of change (a differential waveform of voltage magnitude is taken as the input signal in MRSVD), which can be approximately considered as the proportion of sag depth. For the same sag depth, if the voltage decreases more quickly, the singular values are larger. Although different sag events may have different rates of voltage decrease (the ratio of Y-axis to X-axis of each point is different), most of them distribute in a small range (since the cases in which the voltage changes continuously during the entire sag event are not considered). To make sure that transition segments in different sag events can be detected, the threshold value should be below most points, but not too much to avoid false alarms. Therefore, the second line in Figure 7 indicates that the threshold should be nearly 0.5 times the sag depth. It is noted that this is just a rough value, and further steps are required to detect the outliers. In general, the sag depth helps us to first select a threshold in an approximate range.

Mean Square Error
Although the stationary segment is relatively stationary compared to the transition segment, the voltage rarely remains constant and the rough threshold identified in the first step may sometimes be invalid. On the basis of the rough threshold, and motivated by the image denoising method [24], the mean square error of the fundamental voltage is introduced as: where vi is the fundamental voltage sequence, v is the mean value of all voltage values in a window, and k is the window size. Due to the significant variety in a transition segment, the MSE in a transition segment is larger than the value in a stationary segment. Thus, the MSE is used as the denominator In Figure 7, most points are close to the left side where the sag depth is between 0.1 and 0.2, because most sag events recorded in a distribution system have a slight voltage drop. In addition, it is noted that singular values are related to the sag depth (the first line). The reason is that the maximum singular value represents the largest rate of change (a differential waveform of voltage magnitude is taken as the input signal in MRSVD), which can be approximately considered as the proportion of sag depth. For the same sag depth, if the voltage decreases more quickly, the singular values are larger. Although different sag events may have different rates of voltage decrease (the ratio of Y-axis to X-axis of each point is different), most of them distribute in a small range (since the cases in which the voltage changes continuously during the entire sag event are not considered). To make sure that transition segments in different sag events can be detected, the threshold value should be below most points, but not too much to avoid false alarms. Therefore, the second line in Figure 7 indicates that the threshold should be nearly 0.5 times the sag depth. It is noted that this is just a rough value, and further steps are required to detect the outliers. In general, the sag depth helps us to first select a threshold in an approximate range.

Mean Square Error
Although the stationary segment is relatively stationary compared to the transition segment, the voltage rarely remains constant and the rough threshold identified in the first step may sometimes be invalid. On the basis of the rough threshold, and motivated by the image denoising method [24], the mean square error of the fundamental voltage is introduced as: where v i is the fundamental voltage sequence, v is the mean value of all voltage values in a window, and k is the window size. Due to the significant variety in a transition segment, the MSE in a transition segment is larger than the value in a stationary segment. Thus, the MSE is used as the denominator in Equation (18), making the threshold lower for the transition segment to avoid miss alarms, and making the threshold higher for the stationary segment to avoid false alarms. With the introduction of the MSE, the miss alarm cases, for instance, the points below the dashed line in Figure 7, can still be detected. Additionally, the threshold helps to overcome the defect of a constant threshold in most cases, i.e., the false alarm and miss alarm cases can be eliminated at the same time.

Entropy
For a distribution system, there are a few cases in which the voltage drops in transition segments are very slight due to the monitoring sites being far away from the sag sources. In these cases, the MSE in Equation (18) would be less than 1 in a transition segment; correspondingly, an increased threshold value would result in a miss alarm. It will be difficult to distinguish transition segments from other disturbances in a stationary segment based on the time-domain features of the waveform. Therefore, considering the property of the multi-resolution analysis of MRSVD, entropy is introduced to correct the threshold value obtained in the second step in this work. Similar to the multi-resolution analysis with the wavelet transform, the entropy is used to evaluate the disorder and uncertainty of sag events in the time-frequency domain [25,26]. The entropy of singular values is calculated as: where P j is the energy ratio at the j th level, given by Equation (22): and E T is the total energy of the signal, as the sum of energy at each scale E j .
where d j is the detail coefficient at the j th decomposition level. Thus, entropy can be obtained based on the multi-resolution analysis results of MRSVD. To consider the efficiency, entropy is calculated once in each calculation window, which has the same window size k as the one used in the MSE calculation. The more complicated the sag waveform is, the more dispersed energy distributes. As a result, for the cases with a slight voltage drop, S max is less by the normalization operation. Then, τ is less than the threshold value obtained in the second step and the number of miss alarms caused by the MSE would be reduced. Note that, in the majority cases with obvious voltage drops in transition segments, the concentrated energy makes S max close to 1 and τ would be same as the threshold in the second step. In general, S max can be regarded as a correction factor that only impacts on a few cases.
The flow chart for the proposed algorithm is illustrated in Figure 8. Based on an existing detection algorithm, firstly, both the fundamental magnitude and the phase angle versus time can be obtained. Then, based on MRSVD, a differential waveform of fundamental magnitude is applied and the sag depth, mean square error, and entropy of the sag waveform can be calculated. Finally, the adaptive threshold is set in Equation (23) and the waveform is segmented.

Results and Discussion
In this section, the proposed method has been verified using both simulation data and field measurements. The simulation data originate from a power quality standard signal generator. The field measurements were recorded at different monitoring sites in a distribution system. The sampling frequencies of both simulated and measured data are 128 samples per cycle, and an entire event waveform, including several cycles before and after sag events, was recorded. The effectiveness of segmentation is affected by two factors: detection of a transition segment's boundaries and the selected threshold. Therefore, in what follows, the verification is composed of two parts.

Performance of MRSVD in Transition Segments Detection
To evaluate the performance of MRSVD in transition segments detection, the wavelet transform, which is widely used to detect fluctuations, is taken for comparison.

Transition Segment Detection
MRSVD and WT were utilized to decompose the same waveform shown in Figure 4a and the detail coefficients of each decomposition level are shown in Figure 9. In our experiments, the "Db 4" mother wavelet and five decomposition levels were used. The detail coefficients of each decomposition level shown in Figure 4c-e are plotted in one figure, so it is easier to compare the instants of peak values.

Results and Discussion
In this section, the proposed method has been verified using both simulation data and field measurements. The simulation data originate from a power quality standard signal generator. The field measurements were recorded at different monitoring sites in a distribution system. The sampling frequencies of both simulated and measured data are 128 samples per cycle, and an entire event waveform, including several cycles before and after sag events, was recorded. The effectiveness of segmentation is affected by two factors: detection of a transition segment's boundaries and the selected threshold. Therefore, in what follows, the verification is composed of two parts.

Performance of MRSVD in Transition Segments Detection
To evaluate the performance of MRSVD in transition segments detection, the wavelet transform, which is widely used to detect fluctuations, is taken for comparison.

Transition Segment Detection
MRSVD and WT were utilized to decompose the same waveform shown in Figure 4a and the detail coefficients of each decomposition level are shown in Figure 9. In our experiments, the "Db 4" mother wavelet and five decomposition levels were used. The detail coefficients of each decomposition level shown in Figure 4c-e are plotted in one figure, so it is easier to compare the instants of peak values. From Figure 9a, the peak values vary at each level in WT, i.e., the singular points would shift with an increase in decomposition levels. Actually, similar to the case of the detail coefficients, the singular points of the approximate coefficients at each decomposition level would also shift in WT. To limit the length of the paper, the approximate coefficients are not shown. The shifting singular point would change the boundaries of transition segments and, furthermore, the characteristics in each segment would be different. For MRSVD, the singular points in Figure 9b do not shift, which helps us to more easily detect singular points, i.e., the boundaries of transition segments.

Denoising Capability
Since WT is affected by noise, some complex denoising methods are necessary from a practical standpoint. However, MRSVD itself has a denoising ability. The phase-a voltage shown in Figure 4a within a 30 dB signal-to-noise ratio (SNR) is applied as an original signal for MRSVD. The approximation components of each decomposition level are shown in Figure 10. It is validated that MRSVD can effectively reduce the noise of the input signal with an increase in the decomposition level. The reason is that, in the Hankel matrix of Equation (4), the data of the 1st row correlates with the data of the 2nd row. Therefore, the energy is distributed mainly to the larger singular value. In contrast, the energy of the noise is distributed equably between the two From Figure 9a, the peak values vary at each level in WT, i.e., the singular points would shift with an increase in decomposition levels. Actually, similar to the case of the detail coefficients, the singular points of the approximate coefficients at each decomposition level would also shift in WT. To limit the length of the paper, the approximate coefficients are not shown. The shifting singular point would change the boundaries of transition segments and, furthermore, the characteristics in each segment would be different. For MRSVD, the singular points in Figure 9b do not shift, which helps us to more easily detect singular points, i.e., the boundaries of transition segments.

Denoising Capability
Since WT is affected by noise, some complex denoising methods are necessary from a practical standpoint. However, MRSVD itself has a denoising ability. The phase-a voltage shown in Figure 4a within a 30 dB signal-to-noise ratio (SNR) is applied as an original signal for MRSVD. The approximation components of each decomposition level are shown in Figure 10. From Figure 9a, the peak values vary at each level in WT, i.e., the singular points would shift with an increase in decomposition levels. Actually, similar to the case of the detail coefficients, the singular points of the approximate coefficients at each decomposition level would also shift in WT. To limit the length of the paper, the approximate coefficients are not shown. The shifting singular point would change the boundaries of transition segments and, furthermore, the characteristics in each segment would be different. For MRSVD, the singular points in Figure 9b do not shift, which helps us to more easily detect singular points, i.e., the boundaries of transition segments.

Denoising Capability
Since WT is affected by noise, some complex denoising methods are necessary from a practical standpoint. However, MRSVD itself has a denoising ability. The phase-a voltage shown in Figure 4a within a 30 dB signal-to-noise ratio (SNR) is applied as an original signal for MRSVD. The approximation components of each decomposition level are shown in Figure 10. It is validated that MRSVD can effectively reduce the noise of the input signal with an increase in the decomposition level. The reason is that, in the Hankel matrix of Equation (4), the data of the 1st row correlates with the data of the 2nd row. Therefore, the energy is distributed mainly to the larger singular value. In contrast, the energy of the noise is distributed equably between the two It is validated that MRSVD can effectively reduce the noise of the input signal with an increase in the decomposition level. The reason is that, in the Hankel matrix of Equation (4), the data of the 1st row correlates with the data of the 2nd row. Therefore, the energy is distributed mainly to the larger Energies 2018, 11, 3519 13 of 17 singular value. In contrast, the energy of the noise is distributed equably between the two singular values, that is, most of the noise energy is eliminated by decomposition. To further verify this property, the maximum detail singular values at each decomposition level are shown in Figure 11. It can be seen that energy of the noise is related to the detail coefficients. From Figure 11b, the decrease in singular values gradually slows down with the increase in decomposition level. This means that most of the noise energy is eliminated in each decomposition.
Energies 2018, 11, x FOR PEER REVIEW 13 of 17 singular values, that is, most of the noise energy is eliminated by decomposition. To further verify this property, the maximum detail singular values at each decomposition level are shown in Figure  11. It can be seen that energy of the noise is related to the detail coefficients. From Figure 11b, the decrease in singular values gradually slows down with the increase in decomposition level. This means that most of the noise energy is eliminated in each decomposition. In addition, the segmentation method would be implemented in a back-stage data center rather than in installed power quality monitors. Therefore, it is not a real-time calculation method. Since segmentation is utilized to enhance some further analyses that are done offline, the computational complexity of the proposed method is not a serious concern.

Validation of the Adaptive Threshold
To validate the effectiveness of an adaptive threshold in automatic segmentation, several field measurements were applied to the proposed method, and segmentation results with different thresholds are shown in Figures 12 and 13. In these figures, thresholds Th1, Th2, and Th3 represent 0.5 times the sag depth, the ratio of 0.5 times the sag depth to MSE, and τ in Equation (18), respectively. Figure 12a illustrates two field measurements. One is a typical voltage sag with an obvious voltage drop and recovery, while the other one has fluctuation in the during-event segment. From Figure 12b, the former one can be segmented correctly with threshold Th1, while the other one has a false alarm. In Figure 12c, the miss alarm can be eliminated with the introduction of MSE, and both waveforms can be segmented correctly with Th2. In Figure 13, the same sag waveform in Figure  12 is shown in Figure 13 for comparison. One sophisticated field measurement is illustrated (on the right side of Figure 13a). The voltage drop is very slight, and the instants at which the voltage drops in the three phases are different. From the right side of Figure 13b, it can be seen that the slight voltage drop makes the MSE increase, and Th2 is too high to detect the transition segment. With the correction factor Smax, the miss alarm cases can be eliminated, and the compared waveform on the left side would not be influenced due to the concentrated energy. In addition, the segmentation method would be implemented in a back-stage data center rather than in installed power quality monitors. Therefore, it is not a real-time calculation method. Since segmentation is utilized to enhance some further analyses that are done offline, the computational complexity of the proposed method is not a serious concern.

Validation of the Adaptive Threshold
To validate the effectiveness of an adaptive threshold in automatic segmentation, several field measurements were applied to the proposed method, and segmentation results with different thresholds are shown in Figures 12 and 13. In these figures, thresholds Th1, Th2, and Th3 represent 0.5 times the sag depth, the ratio of 0.5 times the sag depth to MSE, and τ in Equation (18), respectively. Figure 12a illustrates two field measurements. One is a typical voltage sag with an obvious voltage drop and recovery, while the other one has fluctuation in the during-event segment. From Figure 12b, the former one can be segmented correctly with threshold Th1, while the other one has a false alarm. In Figure 12c, the miss alarm can be eliminated with the introduction of MSE, and both waveforms can be segmented correctly with Th2. In Figure 13, the same sag waveform in Figure 12 is shown in Figure 13 for comparison. One sophisticated field measurement is illustrated (on the right side of Figure 13a). The voltage drop is very slight, and the instants at which the voltage drops in the three phases are different. From the right side of Figure 13b, it can be seen that the slight voltage drop makes the MSE increase, and Th2 is too high to detect the transition segment. With the correction factor S max , the miss alarm cases can be eliminated, and the compared waveform on the left side would not be influenced due to the concentrated energy.

The Effectiveness of the Proposed Method Compared to an Existing Method
Based on Table 1, two indices are introduced in Equations (24) and (25) to assess the accuracy of segmentation methods. Sensitivity is the proportion of correctly detected cases among all of the true cases, while specificity is the proportion of correctly undetected cases among all of the false cases. The closer to 100% the sensitivity and specificity are, the better the performance is.

The Effectiveness of the Proposed Method Compared to an Existing Method
Based on Table 1, two indices are introduced in Equations (24) and (25) to assess the accuracy of segmentation methods. Sensitivity is the proportion of correctly detected cases among all of the true cases, while specificity is the proportion of correctly undetected cases among all of the false cases. The closer to 100% the sensitivity and specificity are, the better the performance is.

The Effectiveness of the Proposed Method Compared to an Existing Method
Based on Table 1, two indices are introduced in Equations (24) and (25) to assess the accuracy of segmentation methods. Sensitivity is the proportion of correctly detected cases among all of the true cases, while specificity is the proportion of correctly undetected cases among all of the false cases. The closer to 100% the sensitivity and specificity are, the better the performance is. In this experiment, 45 simulated waveforms and 45 field measurements (different from the measurements utilized in Figure 7) were applied. The simulated waveforms were generated by Fluke 6100A, and the 45 waveforms were divided into nine groups during the simulation. Considering the uncertainty of sag events, the sag depth of each group was set to change from 10% to 90% (with an interval of 10%), and the duration of each waveform in the same group was set to change from 1 cycle to 9 cycles (with an interval of 2 cycles). To meet practical needs, all of the simulated waveforms have been added 3rd, 5th, and 7th order harmonics (10%) and noise (30 dB). The number of transition segments of field measurements have been recognized by inquiring into the short circuit faults and protection records in the system. An existing method, based on the Kalman filter with a constant threshold [11], was taken for comparison. The corresponding results of the two methods are shown in Table 2, where S1 and S2 denote sensitivity and specificity, respectively. From Table 2, with the increase in the constant threshold, S1 is decreasing while S2 is increasing. It is identical to the rule in Figure 5, i.e., false alarms and miss alarms cannot be eliminated for a constant threshold. Compared to the existing method, the proposed method adapts the threshold value for different waveforms. As a result, it has better performance, and both the sensitivity and specificity are improved at the same time.

Conclusions
The general objective of this paper is to propose a practical automatic segmentation method as a preprocess to support effective data analyses in a power quality monitoring system. The principle of the proposed method is to detect transition segments based on the multi-resolution singular value decomposition method. With the ability for multi-resolution analysis, the method has better performance in transition segments detection, especially in a strong noise environment. The method itself has the ability to denoise input signals. In addition, the sag depth, mean square error, and entropy of sag waveform are utilized to construct an adaptive threshold. The threshold value would change with different waveforms, and the defect of a constant threshold value in the existing segmentation method is addressed. Simulated data and field measurements are utilized to validate the proposed method, and the results show that the accuracy of segmentation is improved. Further research is required to study how to improve voltage sag characterization and related sag studies based on the proposed method.   Sum of energy at each decomposition level Sensitivity(S1) Proportion of correctly detected cases among all of true cases Specificity(S2) Proportion of correctly undetected cases among all of false cases