Enhanced Segmentation of Disturbance Records by Ad
Enhanced Segmentation of Disturbance Records by Ad
ADAPTIVE THRESHOLDING
Philipp Stachel1 Rastko Živanović Peter Schegner
TU Dresden University of Adelaide TU Dresden
Dresden, Germany Adelaide, Australia Dresden, Germany
[email protected] [email protected] [email protected]
Abstract - To analyse power system fault events scribed in section 3 and segmentation and validation
captured by disturbance recorders the sampled ana- algorithms are described in section 4. Finally we
logue waveforms (voltages and currents) have to be show the performance of the proposed methods on
segmented into system states (pre-fault, fault, . . . ). In a real disturbance example in section 5.
this paper a combination of wavelet transform (WT)
and linear prediction coding (LPC) is applied to the 2 Signal Analysis
symmetrical space phasor signals of the voltage and
The segmentation of the sampled analog data
current waveforms. The signals obtained contain im-
(currents i(n) and voltages u(n) with sample num-
pulses when the system state changes abruptly. A
ber n = 1 . . . N ) should be independent from the
threshold for segmentation is calculated using median
fault type. To achieve this and to reduce the necessary
filtering with adaptive window length. The segment
calculations first we calculate the time-varying sym-
borders are finally merged and validated.
metrical space phasor components ur (n) and u0 (n)
of the sampled phase voltage waveforms using [1]
Keywords - Digital signal processing, segmen-
tation, wavelet transform, linear prediction coding,
· ¸ · ¸ ua (n)
median filters, adaptive techniques ur (n) 2 1 a a2
= · ub (n) , (1)
u0 (n) 3 1 1 1
uc (n)
1 Introduction
D IGITAL relays and disturbance recorders col- where a = ej·2π/3 . The transformation (1) is applied
lect a lot of data when a fault occurs in the to the currents respectively.
power transmission (and/or distribution) network. 2.1 Wavelet transform
This data is usually transmitted via WAN, dial-up or
even manually to the network control centre. The Several methods are available to analyse a com-
analysis of the recorded data is usually done by plex signal x(n) (voltage or current time-varying
skilled persons but only when a serious fault occurs phasors obtained by (1)) in the time and frequency
in the network. To speed up this process, to get more domain . Short Time Fourier Transform (STFT), with
information out of this data and to support the person- a fixed window length, expresses the captured signal
nel (maintenance, fault analysis, dispatcher) an auto- as a sum of sinusoids. The obtained frequency com-
mated fault analysis of the disturbance data should be ponents over a specific time(span) are limited by the
utilised. length of the specific window. The Wavelet Trans-
An important step in the automated analysis of form (WT) overcomes this limitation as it inherently
fault events is a reliable segmentation of the current uses different window lengths. Sudden changes in a
and voltage waveforms. Each segment characterises signal x(n) are found in the low-scale wavelet co-
a new system state. Once it is clear where the pre- efficients and the signal fundamental frequencies are
fault, fault and post-fault segments occur, it is pos- found in high-scale coefficients.
sible to determine the fault type by using sampled The Discrete Wavelet Transform (DWT) of a sig-
voltage and/or current waveform. nal x(n) is [2] [3]
In section 2 we introduce wavelet transform and ∞
X
linear prediction coding. Both methods are used for X(m, n) = ∗
x(k) ψm,n (k), (2)
signal analysis. Several thresholding methods are de- k=−∞
1
TU Dresden, Institute of Electrical Power Systems and High Voltage Engineering
Mommsenstrasse 13, D - 01062 Dresden, Germany
phone: +49 351 463 35272, fax: +49 351 463 39061 / 37036
where ψm,n (k) = 2−m/2 ψ(2−m k − n). With the coefficients needs a lot of computation. In practice, it
scale m and the mother wavelet ψ(n). has been found that one set of estimated coefficients
In the case of continuous WT ψ(τ ) can be ex- over the whole signal x(n) produces good results.
pressed as a time dependent function. In the case of The prediction error signal ²(n) contains impulses,
discrete WT filter banks are used without calculating when the system state changes. The height of the im-
ψ(n). pulse depends on the smoothness of the transition or
DWT using cascaded filter banks discontinuity in the signal x(n).
The m-th scale of a discrete complex signal x(n) is A threshold value has to be defined to determine
calculated using the low-pass filter if an impulse in the wavelet coefficients or, in the case
X of LPC, in the error signal is a border between two
x(m, n) = h(k − 2n) x(m − 1, k), (3) segments. An impulse above this threshold indicates
k an abrupt change in signal parameters.
where x(0, n) ≈ x(n). The m-th detail-signal is ob-
tained by the high-pass filter 3 Threshold methods
X Both, detail-signal d(1, n) (WT) and error signal
d(m, n) = g(k − 2n) x(m − 1, k). (4)
²(n) (LPC), contain impulses when the voltage or
k
current changes abruptly and therefore can be used
To compress information the coefficients h(n) for segmentation. The following section does not
and g(n) should be orthogonal care about the origin of the analysed signal, so let’s
define:
g(n) = (−1)n h(M − 1 − n), (5) (
x(m − 1, n) = x(m, n) + d(m, n), (6) |d(1, n)| for WT
y(n) = (10)
²(n) for LPC
with the filter length M .
In this paper we used the Daubechies filter co- The threshold value ξ is determined based on
efficient for M = 8 [2]. The advantages of using statistical parameters (mean, standard deviation and
this db4-wavelet on disturbance records are sharp im- confidence interval) estimated locally for wavelet co-
pulses in the first detail-signal d(1, n) and a good efficients or error signal. The segmentation threshold
time resolution due to the small wavelet length. Its value is computed as the expected mean value y plus
performance in this application is also shown in other the standard deviation σy multiplied by a statistical
publications [4] [5]. threshold γ of the confidence interval:
2.2 Linear prediction coding
ξ(n) = y(n) + γ · σy (n), (11)
The idea of linear prediction coding is to express
the n-th sample of a complex signal x̂(n) as a sum of where the optimal γ can be obtained as in [6]. The
the past K known weighted samples x(n) [3]: expected mean value y (in the following called mean)
K can be estimated using arithmetic mean or median
X
x̂(n) = ak x(n − k). (7) calculation.
k=1 A constant global threshold is not very useful, as
the signal mean value changes over time. Therefore ξ
The prediction error ² can be expressed as follows
is calculated for a specific length of time (window).
²(n) = |x(n) − x̂(n)| . (8) 3.1 Comparison between threshold methods
The prediction coefficients ak (k = 1 . . . K) are cal- For comparison of different threshold methods
culated by solving a least square problem that min- we used the artificial signal y shown in figure 1. The
imises shape of that test signal contains most features seen
N
X −1
by analysing real disturbance records and therefore
²(n)2 . (9) represents practical signals. The specifications are:
n=0
The optimal prediction coefficients will change • t ∈ [0 . . . 0.1, 0.3 . . . 0.7]s: Constant signal
for each system state when analysing disturbance sig- mean value with normally distributed white
nals. Such continuous estimation of the prediction noise;
a) 10
Signal
mean+STD
8 med+MAD(global)
med+MAD(50ms)
6 med+ICI
y, ξ →
0
0 0.1 0.2 0.3 0.4 0.5 0.6 0.7
time in s →
window size →
b)
500
0
0 0.1 0.2 0.3 0.4 0.5 0.6 0.7
time in s →
Figure 1: Artificial test signal: a) Comparison of threshold methods; b) Window size for ICI
• t ∈ [0.1 . . . 0.2]s: Constant mean and higher the median estimate demonstrates a good resistance
noise level due to global LPC-model mismatch to the random impulses (outliers). The window size
at system changes; of the median filter in this application can be fixed or
varying.
• t ∈ [0.2 . . . 0.3]s: Non-constant signal mean Initially a fixed window length of t = 10ms is
value due to global LPC-model mismatch used for the calculation of the mean value y. The
at system changes with normally distributed signal standard deviation σy for the whole signal is
white noise; evaluated in a robust way using Median Absolute De-
• t ∈ {0.1, 0.2, 0.25}s: Impulses with different viation (MAD) estimator [7]:
height due to abrupt signal changes (segment median(|∆y 0 |)
borders). σy = √ , (12)
0.6745 2
3.2 Fixed Window Threshold Methods
where each entry of the vector ∆y 0 is calculated as
Method 1: Basic approach (mean+STD) the difference between two consecutive samples of
The signal mean value and the standard deviation are y 0 (n) = y(n) − y(n). The MAD estimator, in a sim-
calculated for a fixed window length of t = 100ms ilar way to the median filter, is not influenced by im-
(dotted line in figure 1). The impulses in y directly pulses in a signal, which is considered very important
influence the mean value and the standard deviation in this application.
and shift these to higher values. Some impulses lie The advantage of using the median for estimat-
under the threshold value which is too far away from ing the signal mean value can be seen in figure 1
the signal y. Therefore this approach is not reliable (thin black line). The noise level in y might change
for segmentation. with a new system state because the global prediction
Method 2: Median approach with global MAD model will not fit perfectly each signal segment. The
To overcome this unwanted effect and to estimate the calculated threshold value might be too close to the
mean value we propose a median filter. Suppose that analysed signal y (figure 1 0.1s < t < 0.2s). There-
the samples in y, for a specified window size, are fore the standard deviation should be estimated for a
ranked in ascending order. Then the median estimate moving window as for the mean value.
for this window size is the middle sample if there are Method 3: Median approach with local MAD
an odd number of samples in the window. It is well The signal mean value is calculated in the same way
known that the median filter with respect to the Gaus- as shown in the Method 2. The standard deviation
sian noise is nearly as good as the linear filter, while is estimated with MAD for a fixed window length of
several ten milliseconds. As seen in figure 1 (dashed for the optimal window length N ∗ determined by ICI.
line) the threshold tracks the new system state bet- The estimated adaptive threshold is shown in fig-
ter than the threshold with a global MAD. But if the ure 1 (bold line) as well as the used window size b).
mean value of the signal y does not change over time The window size is small if a change in y occurs and
the threshold t is still noisy and gets sometimes close is increased if y is constant. At the beginning and
to y (figure 1 t ≈ 0.35s and t ≈ 0.45s). It would end of the signal y the window size is reduced and t
be best to chose the window length adaptive to the gets too close to the signal. By using combinations of
signal parameters. left, symmetric and right windows this effect can be
overcome [6] [9] — here we use symmetric windows
3.3 Adaptive Threshold Method
only.
The varying window size can be used to adapt
median filter to statistical parameters of the signal 4 Segmentation algorithm
in a segment. If the parameters are varying but not
in abrupt way (that indicates switch to another seg- The obtained threshold ξ separates the signal
ment), the window size should be small to track this mean and noise from the impulses/outliers. To
changes. For constant parameters in a whole segment weight these impulses in the analysed signal y we
the window size should be maximal to achieve ef- define a ratio r:
ficient filtering of higher frequencies, Gaussian and
impulsive noise. 0
if y(n) < ξ(n)
r(n) = 1 if y(n)
ξ(n) > rmax , (16)
To find the optimal window one needs to apply
median filter for mean estimation using several pre- y(n) · 1 otherwise
ξ(n) rmax
specified window lengths. Then each candidate mean
estimate should be assessed to select the optimal one. where rmax is the maximum signal-to-threshold
The assessment is based on the Intersection of Confi- value.
dence Intervals method (ICI) [8]. In this method, af- The found segment borders r(n) > 0 obtained
ter calculating the median estimate y(N ) of a signal by analysing different signals y have finally to be
y for a central window of length N , the confidence merged. To do so we suggest the following method.
interval is estimated as follows: In the first step we merge the ratios ri , where i =
1 . . . M stands for every analysed signal (currents
and voltages), method (WT and LPC) and direction
D(N ) = [y(N ) − γ σ(N ), y(N ) + γ σ(N )] , (13) (forward and backward indices)
M
where the standard deviation is estimated using the 1 X
s(n) = ri (n). (17)
following expression [9]: M
i
r
π Ideally each applied method will find the segment
σ(N ) = σy (14)
2N border at the same indices n (corresponding to a spe-
cific time t = n/fs ). But in practice there will be
and γ is a threshold of the confidence interval. The
a small mismatch of a few samples. Therefore, as
standard deviation σy in the above formula is esti-
a second step we suggest a convolution of s with a
mated using equation (12).
rectangular window g for typically few milliseconds
For each specified window size N , the median
estimates y(N ), and the corresponding confidence X
f (m) = s(n) g(n − m) (18)
intervals D(N ) are calculated. The Intersection of n
Confidence Intervals (ICI) method, which determines
the optimal window size, can be summarised as fol- to group the closely located ratios. In the last step we
lows [10]: The optimal window length N ∗ is the one have to find indices of the local maxima of f greater
for which the set ∩N ≤N ∗ D(N ) is nonempty. The than a global threshold, e.g. 0.5. The quality q of a
asymptotic properties of the ICI method are provided segment border corresponds to the local maximum of
in [8]. For each sample y the segmentation threshold f.
value is calculated locally as Figure 2 shows the validation results with the ra-
tios ri (upper plot) and the result of the convolution
y(N ∗ ) + γ σ(N ∗ ) (15) f (lower plot). The related test signal (a two phase
fault) with segment borders and border qualities is gets very close to the signal y.
shown in figure 3. Figure 5 shows the validation results of the
found segment borders by different methods (WT
1 WT
0.8
LPC and LPC). To illustrate the robustness of the pro-
ratio ri →
0.6
borders obtained by LPC are more reliable in this par-
0.4
0.2
ticular case. The convoluted signal f still contains
0 these falsely segmented borders but now with a much
0 0.02 0.04 0.06 0.08 0.1 0.12 0.14 0.16 0.18 0.2
time in s → smaller quality below the global threshold (here 0.5).
Figure 2: Example of validation Figure 6 shows the correctly segmented voltages and
currents of the event with the quality identifiers of
72% 100% 96%
200 uL1
uL2
each border.
voltage in kV →
100 uL3
boarder
0
6 Conclusions
−100
5 iL2
iL3
0
boarder sented methods (wavelet transform and linear predic-
tion coding) can be used for analysing voltage and
−5
current waveforms. The signals obtained after trans-
0 0.02 0.04 0.06 0.08 0.1 0.12
time in s →
0.14 0.16 0.18 0.2 formations contain impulses if the parameters in the
analysed waveforms change abruptly.
Figure 3: Segmented voltages and currents of a 2-phase fault
It has been shown, that these impulses or outliers
influence the calculation of the signal mean and stan-
5 Performance of the proposed methods
dard deviation. We propose to use Median Filtering
The proposed adaptive thresholding method is to estimate the signal mean value and Median Ab-
implemented in an automated disturbance analysing solute Deviation to estimate the standard deviation.
software. Both methods use an adaptive window length cal-
In figures 4 the LPC error signal ² (grey line) of culated by using the Intersection of Confidence In-
a real disturbance record is shown. The error signal tervals method. Improvements in the estimates can
is obtained from the current space phasor ir of a sin- be made by using left, symmetrical and right win-
gle phase to ground fault with an unsuccessful auto- dows. The obtained threshold is not influenced by
reclosure event. Only the re-closure part is shown outliers. Two advantages of using adaptive window
in figures 4-6. For comparison all threshold methods length are fast tracking if the analysed signal changes
are shown in figure 4. and stronger filtering of noise if the signal does not
The advantage of using the adaptive method change much over time. The ratio of the impulse
(bold line) for segmentation can be seen at height to the threshold value is used for segmenta-
tion.
• t ∈ [1.14 . . . 1.2]s where the threshold calcu-
lated using fixed window length for mean and Finally the found segment borders are merged
MAD (dashed line) and and validated using convolution with a rectangular
window. The performance of the proposed methods
• t ∈ [1.3 . . . 1.44]s where the threshold ob- has been demonstrated using artificial and recorded
tained by global MAD (thin solid line) data.
a) 0.6
Signal
0.5 mean+STD
med+MAD(global)
0.4 med+MAD(50ms)
y, ξ →
med+ICI
0.3
0.2
0.1
0
1.1 1.15 1.2 1.25 1.3 1.35 1.4 1.45 1.5
time in s →
window size →
b)
500
0
1.1 1.15 1.2 1.25 1.3 1.35 1.4 1.45 1.5
time in s →
Figure 4: Real disturbance record: a) Comparison of threshold methods; b) Window size for ICI
a)
1
ratio ri →
WT
0.5
LPC
0
1.1 1.15 1.2 1.25 1.3 1.35 1.4 1.45 1.5
time in s →
b)
1
f →
0.5
0
1.1 1.15 1.2 1.25 1.3 1.35 1.4 1.45 1.5
time in s →
Figure 5: Validation of found segments: a) ratio impulse height to threshold; b) convoluted signal
200
uL2
uL3
boarder
0
−200
5 iL2
iL3
0 boarder
−5
[7] J. Fan and I. Gijbels, Local Polynomial Mod- Peter Schegner (M’99) received his Dipl.-Ing.
elling and Its Applications. London: Chapman degree in electrical power engineering from the
& Hall, February 1996. Darmstadt University of Technology, Germany, in
1982, and his Dr.-Ing. degree from Saarland Uni-
[8] A. Goldenshlunger and A. Nemirovski, “On versity, Germany, in 1989.
spatial adaptive estimation of nonparametric re- Currently, he is Professor at the Institute of Electri-
gression,” Mathematical Methods of Statistics, cal Power Systems and High Voltage Engineering,
vol. 6, no. 2, pp. 135–170, 1997. TU Dresden, Germany.