Comparative study of wavelet based techniques for elec- tromagnetic noise evaluation and removal

Signals acquired from an industrial environment with many sources of electromagnetic interferences may be polluted by white noise. Polluted data segments with many steady consecutive periods can be used (sometimes unsuccessful) for the estimation of a denoised period from the steady acquired data by using the mean signal method. For data segments with at least 4 periods, when only certain segments (shorter than a period) can be considered steady, hybrid algorithms can be used to automatically evaluate the power of noise and afterward to perform the noise removal by using wavelet thrashing trees. This paper deals with 2 additional denoising techniques. The 1-st one is based on the Wavelet Package Transform and allows for the separation of the noise components which pollute a data segment of at least one period. The second approached denoising technique is also addressing one period data segments and estimates firstly the power of noise by using the energies of the vectors of details from the first 2 levels of a tree used by decompositions with the Stationary Wavelet Transform. The estimated power of noise is afterward used to establish the number of levels in the wavelet thrashing trees. In this last stage, two wavelet mothers were used. Simulated and real test signals were used and performance comparisons were performed.


Introduction
Electric signals are affected by many factors, random events, and corrupted with noise, making them nonlinear and non-stationary in nature [1]. The application of signal processing tools for noise removal and power quality monitoring has been studied extensively [1], [2]. A correct denoising allows for a more accurate evaluation of power quality indices and detection of faults by using wavelet based decompositions [3]. When the analyzed data have a quasi-stationary nature and are polluted by white noise, a special technique (relying on average signals) can be applied [4]... [7]. According to it, repetitive additions of noisy signals tend to emphasize their systematic characteristics and to cancel out any zero-mean random noise. An average of the analyzed sequence of periods therefore would provide a good approximation of the denoised signal [8]. When the polluted signal does not exhibit stationarity across a long sequence of consecutive periods, the above mentioned method cannot be applied in its original form. The Wavelet threshold denoising method represents a reliable tool for cases like this [9]... [11]. The number of levels used by the wavelet thresholding tree and respectively the selection of the wavelet mother are key factors for the results accuracy [9], [12]. Previous studies of authors [8], [9] helped in establishing the parameters of the wavelet tree based threshold method used in this paper, implemented in Matlab with the function wden [13] (which assumes that the polluting signal is a Gaussian white noise, the soft thresholding being selected), the type of noise estimation within the wavelet tree (set to be done in a per level manner) and respectively possible wavelet mothers used by the denoising procedure. Still the automated determination of the thrashing tree number of levels represents a challenge. One of the major criteria used for this aim consists in the estimation of the noise level.

Hybrid algorithms for denoising electrical waveforms containing steady segments
An original adaptation of the average signal technique was conceived by the authors and presented in [7]. It allows for the determination of the signals quasi-stationary segments and evaluation of the noise polluting them. Sets of three-phase currents as those from Fig. 1 were analyzed [7]. The waveforms were acquired with a sampling rate of 700 samples per period. The studied waveforms were unsteady, but exhibiting a sort of local stationarity property (quasi-stationarity along intervals usually as long as 1/6 from a period). Fig. 2 [7] represents 4 overlapped periods from one of the analyzed signal.  Some of the most visible unsteady segments are pointed by arrows. Average one-period signals (AS) were built, as mean across all 4 periods from a data segment. For a period from a steady signal, the noise can be estimated as difference (polluted-AS). Fig. 3 represents the signals obtained as difference (polluted minus ASs), called estimated noises for a signal analyzed in [7]. The rectangle was used to emphasize a subinterval exhibiting a normal behavior of noise. The non-uniformities recorded in most of the subintervals belonging to the signals from Fig. 3 reveal the unsteady nature of the analyzed currents.
A denoising technique relying on average signal was conceived, such as to take advantage of the presence of segments (observed to be as long as 1/6 from a period length) exhibiting acceptable stationarity features.
Each per period estimated noise was divided into 6 equal subintervals. 3 metrics were computed for all subintervals: (a) noises powers; (b) averages of noises (AVS mean noises); (c) standard deviations (SD) of the absolute values of local peaks exhibited by the estimated noises. SD-s were computed considering the formula [7]: where lp i represents the absolute value of the i-th local peak andl p represents the average of all absolute values of the noises local peaks associated to the subrange s. White noises have almost zero mean value and small SD, therefore the accomplishment of these two conditions were considered as usable to identify a quasi-stationary subinterval.  Figs. 4 and 5 depict two opposite cases. The 1-st one is related to a quasi-stationary subinterval whilst the 2-nd one is related to a unsteady one. An analysis of shapes and metrics considering all subintervals let us conclude that the smallest estimated noise powers are usually associated to quasi-stationary subintervals. Therefore the estimated power of noise (P) for a certain set of data was computed as minimum across all powers of estimated noises evaluated for that set.
In its 2-nd stage, the algorithm performs a denoising of the polluted signals by using a wavelet based thrashing tree. The number of trees levels is varied within the range 1...4 and the powers associated to the different yielded noises are compared to P. The algorithm stops when the best match between P and the power of the yielded noise is reached, the number of levels being determined by this condition.
The denoising based on the mean signal method or the hybrid algorithm presented above are applicable in certain conditions of partial or total stationarity and requires the availability of more than one period. In order to denoise singular periods from electrical signals, we conceived another 2 methods relying on the special properties of the frequency bands separation exhibited by wavelet transforms.

Using Wavelet Packet Trees for Denoising Electrical Signals
A. Test signals 20 sets of sinusoidal signals with magnitude of 800 were generated, considering 700 samples per period. They were afterward polluted with harmonics up to the 29-th order in a random manner, such as to be similar to those available in practice. The initial signals were polluted by a Gaussian Noise signal, generated by Matlab using the wgn function. The generated noise power is correlated to the polluted signals power as follows: where: NP = noise power; S P = signal power; NS = set index, varying from 1 to 20.

B. Denoising operating principle
The topology used for the Wavelet Packet Decomposition tree can be described as follows [13]: 512 components in the root, 7 levels, wavelet mother (db14) of type Daubechies with a filter of length 28. This tree exhibited interesting (harmonics-nodes) separation properties on mono-harmonic test signals (Fig. 6) [13]). The horizontal lines (corresponding to the harmonic orders 40, 50,,80) provide a visual representation of the ranges of nodes from the 7-th level (referred from this point on as final nodes) holding energies provided by harmonic orders lower than a certain threshold. For example the nodes from the ranges [17,24], [29,30] and [32,128] are not affected by harmonic orders lower than 40 [14]. It means that WPT can be used to remove the harmonic components whose orders are higher than a certain harmonic order (Hs) in 3 steps: (a) Perform the WPT decomposition and obtain the vectors from the final nodes which are affected by harmonic orders at most equal to Hs; (b) Recompose the signal considering the vectors from step (a) and zero for all the other vectors.
The signal yielded by decomposition represents, with a certain approximation the denoised signal.

C. Tests results
Figs. 7 and 8 depict results yielded by the WPT based denoising algorithm, for minimum and maximum generated noises respectively. From top to bottom, left to right, the pictures represent: the generated noise, the noise computed by algorithm, the original (non-polluted) synthetic signal, superposed with the polluted version and with the signal denoised and the difference (original-denoised). Fig. 9 depicts the powers of simulated and computed noises powers (left) and the signal to noise ratios (right) for the 1-st dataset. The powers of computed noises are always smaller than those of simulated noises, but acceptably close to them. As for the non-strict ascending order of the generated noises powers with increasing set indices, this comes from the random technique used by Matlab to generate noises whose powers are suggested (but not imposed) as input parameter.

Using Stationary Wavelet Decomposition and Wavelet Thrashing Trees for Denoising
The second denoising technique implemented by us consisted in evaluating the noise power by using the energies of vectors of details from the first 2 levels of the Stationary Wavelet Transform (SWT) decomposition tree. The main steps of the algorithm used by this technique are: a) Perform the SWT decomposition for the first 2 levels, relying on db14; Figure 11. Results yielded by the SWT based denoising algorithm, for maximum noise, 1-st set.   (c) Similar to the technique described in Section II, perform the denoising by using a wavelet based thrashing tree. The number of trees levels is varied within the range 1...4 and the powers associated to the different yielded noises are compared to P. The algorithm stops when the best match between P and the power of the yielded noise is reached.
The selectivity properties of db14 forces us to use it when estimating the power of noise, but the much shorter runtime required by the wavelet mother from the symlet family with a 8 components filter (sym4) was also considered during tests, along with db14, for the denoising.
Figs. 10 and 11 depict results yielded by the SWT based denoising algorithm, for minimum and maximum generated noises polluting the same test signal used in Figs. 7 and 8, when using sym4. Fig.12 depicts the simulated and computed noises powers considering the SWT based technique with both wavelet mother functions. Both SWT and denoising techniques provided smaller but close estimations for the noise powers.  . From top to bottom: relative maxim absolute deviations; relative percentage differences (with db14 as reference) for relative maxim absolute deviations ; mean square relative deviations; relative percentage differences (with db14 as reference) for mean square relative deviations, 2-nd dataset.

A. Tests on symmetrical periods
Statistics such as maximum absolute relative error and relative root mean square deviation (referred from this point on as MSD) were considered for comparison. Both indices are relative to the absolute maximum of the polluted signal. Fig. 13 presents a first representation of these statistics. One can see that for the 1-st analyzed set, usually the errors are increasing with the test index and db14 provides the best estimation in most cases. Therefore the values provided by db14 were used for comparison WPT versus SWT with db14 and SWT with sym4 versus SWT with db14 respectively.
The comparisons were relative to the values provided by db14. Fig. 14 represents histograms with the metrics and comparative indices.
One can see that usually for low power noises WPT and the SWT technique with db14 provide similar accuracy with respect to the maximum absolute deviations. Usually the highest estimation errors are provided by SWT with sym4. Figure 17. From top to bottom: relative maxim absolute deviations; relative percentage differences (with db14 as reference) for relative maxim absolute deviations ; mean square relative deviations; relative percentage differences (with db14 as reference) for mean square relative deviations. 3-rd dataset. Fig. 15 depicts a test signal in which the signal is decreased by 30% starting with its 3-rd quarter, for a segment as long as 50 samples. The start/end limits of fault are marked by strong deviations in the reconstruction error waveform, because WPT is implemented by means of DWT.

B. Tests on non-symmetrical periods
Similarly, a 3-rd dataset consider an increase by 30% within the same limits. Fig. 16 presents the histograms associated to the 2-nd set whilst Fig. 17 is dedicated to the 3-rd set.
One can see that, for the 2-nd and 3-rd sets of data, the method relying on WPT performs the best in most of the cases relative to the maximum deviations (overcoming the method relying on SWT with db14) and has significantly improved performances relative to MSD.

Tests on real data
The waveforms analyzed in the 2-nd Section were used now to make comparative tests between the newly tested techniques. In a first approach, data were denoised by using all methods. Fig. 18 presents the analyzed signals and noises extracted with WPT, along with the differences between noises, considering as reference the noise generated by the SWT based technique with db14.
A very good convergence of methods was proved by the tests on real data. The WPT based technique yielded almost identical results with the SWT based technique relying on db14. On the other hand, sym4 had also yielded satisfactory results, requiring only around one third of the computations resources associated to the use of db14.

Conclusion
A hybrid algorithm can be used to perform the denoising of non-steady electric waveforms, characterized by short steady segments and polluted by white noise. The subintervals exhibiting quasi-stationarity are identified firstly. Afterwards, the minimum noise power (P) across all quasi-stationary subintervals is estimated. Then denoising by using a wavelet based thrashing tree can be performed. The number of levels in the tree is established using P.
WPT can also provide a reliable modality for denoising. It relies on terminal nodes (NZ) which are not affected by harmonic orders exceeding a certain limit. A decomposition followed by a re-composition in which NZ are set to 0 provides a denoised version of the analyzed signal.
SWT provides a modality to estimate the noise, through the energy of its vectors of details from the first 2 levels. The estimated level of noise is used to determine the number of levels in the thrashing tree.
For signals with symmetric half-periods, usually the technique relying on SWT with db14 provided best results, followed by the WPT based technique. But often WPT was the best technique for signals with non-symmetric half-periods.
All presented methods provided almost identical results when applied to the same real data used for analysis in the Section II, validating each other.
When the time is critical, the use of SWT based on sym4 is a reliable option, because the accuracy increase does not worth the computational resources wasting.