Comparison of commercial and original methods for de-noising electrical waveforms with constant or linearly variable magnitudes

. Acquired electrical waveforms can be a ff ected by white noise. The 1-st part of the paper analysis deals with the denoising of multi-period steady signals by using 3 methods: mean signal method, an original method relying on wavelet packet trees and the method implemented by the wavelet-based Matlab function wden. The signal length influence over the mean signal method’s accuracy is studied. The results yielded by the other 2 methods are also analyzed considering signals with 7 periods. Afterward the wavelet-based methods are used to denoise segments of 7 periods with linearly variable magnitudes (ascending or descending) for 3 di ff erent slopes. Artificial test signals, with rich harmonic content, were used. They were polluted by sets of 10 white noises with di ff erent powers. Maximum absolute deviations and mean square root deviations were computed considering the original signals, before pollution, versus the corresponding denoised signal. The metrics were computed relative to the maximum absolute value of the noise and allowed to determine the most accurate method.


Introduction
Electric signals are affected by many factors, random events, and corrupted with noise, making them nonlinear and non-stationary in nature [1], [2].
The "mean signal method" (MSM) relies on the following principle ( [1]... [3]): 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. Yet one has to determine the minimum length for the analyzed sequence such as to get results with an acceptable accuracy. This topic will be addressed in this paper.
When MSM cannot be used (e.g. unacceptable deviations of certain periods from the average, non-steady signals or highly variable power of noise), other denoising methods should be considered. Usually the denoising methods can be divided into: (a) the modulus maxima denoising method; (b) the correlation denoising method and (c) the wavelet threshold denoising method [4]. Method (a) involves a huge amount of calculation [4], [5], whilst the calculation procedure corresponding to (b) is complex [4], [6]. The Wavelet threshold denoising method is simple to implement and the noise can be suppressed to a large extent [4]. Singular information of the original signal can be preserved well, so it is a simple and effective method [4].
The authors also conceived an original denoising method relying on Wavelet Packet Transform (WPT) [7.. .9]. WPT can be used to remove the harmonic components whose orders are higher than a certain harmonic order (Hs) in 2 steps [7]: (a) Perform the WPT decomposition and obtain the vectors from the final nodes which are affected only by harmonic orders (HO) at most equal to Hs-1; (b) Recompose the signal considering as non-zero only the vectors from step (a) and zero for all the other nodes.
The signal yielded by recomposition represents, with a certain approximation, the denoised signal.
For this study, Hs equals 43, because this was the lowest cut-off frequency allowed by the algorithm which belongs to the white noise harmonic range. The parameters used by algorithm were also revised because the old ones were used for signals with one period. In that case, the vectors from the final nodes of the WPT tree hosted vectors of 4 components. The new topology of 7 level WPT tree used in this paper hosts 3584 (=512 x 7) samples in the root node (corresponding to 7 periods) and 28 samples in each of the terminal nodes, such as to match the lenght of the filters for the wavelet mother (‚db14').
A denoising technique available in Matlab by means of the function wden can also be used [10], [11]. Previous studies of authors [8], [9] helped in establishing the values of the parameters of this function used in the approached operational context (artificial test signals with rich harmonic content and notches, acquired signals with 700 samples per period). These values are: soft trasholding technique, per-level reevaluation of the noise level in the wavelet tree and a Daubechy wavelet mother with a filter of length 28 (‚db14'). The number of levels is imposed by the power of noise.

Test Signals and Methodology
A. Test signals Fig. 1 depicts a period from the artificial test signals with constant magnitude used in this paper (512 samples per period). Fig. 2 depicts one period from a white noise signal generated with the function wgn [12]. The RMS value of the fundamental component is 1000. Sets of 10 tests were made. In each of them, 10 noises were considered , with the powers: The 7 periods test signals with linearly variable magnitudes based on constant ascending/ descending slopes were built considering 3 different slopes, characterized by the parameter M which can be 0.2, 0.4 and 0.6. The relation between the maximum values of the fundamental sinusoids from the 1-st period (Max1) and respectively from the last period (Max7) is:

B. Methodology
White noises were added to the test signals (TS) and afterward denoising was performed through various techniques, obtaining different versions of denoised signals (DS). For steady signals one used the MSM method along with WPT and wden, whilst for signals with linearly variable magnitude only the wavelet-based methods could be used. Two metrics were used to evaluate the performances of different methods: relative maximum absolute deviation (MAD) and relative root mean square deviation (RMSD). Denoting by D the difference between TS and DS and by N the noise used to pollute TS, we get:

Denoising Steady Signals
A. Denoising with the Mean Signal Method Synthetic steady signals with variable lengths (7, 25 and 50 periods) were built based on the one-period signal from Fig. 1. They were polluted with sets of 10 artificial noises as explained in Section 2. The MSM method was applied in order to obtain the mean "one-period" signal which should represent, with a certain accuracy (obviously directly proportional to the signal length) , one period from the denoised signal . The algorithm efficiency was evaluated by using the metrics MAD and RMSD.
Figs. 3 and 4 depict the 1-st period from TSs of 7 and 50 periods respectively, considering the 10-th (most significant) noise. As expected, the difference D is significantly smaller for the longest signal.       Fig. 1. The same steps were made: polluting with noise, denoising (now with WPT), computing the difference D and the associated metrics respectively. Fig. 5 is dedicated to the denoising with WPT for the case with the most significant noise. Fig. 6 represents the corresponding MAD and RMSD for all 10 cases. In order to prevent the affecting of accuracy by the "edge effect", a second set of statistics (which disregards the 1-st 3 components nearby both edges) were also computed. C. Denoising with wden Figs. 7 and 8 are dedicated to the denoising with wden for the steady signals, the case with the most significant noise. Fig. 9 is dedicated to the metrics associated to this type of denoising.

A. Denoising Signals with Positive Slope
Mean signal method cannot be applied for signals whose periods are not identical or at least very similar. An almost constant power of noise is also required. Therefore the analysis made in this section , which addresses signals with linearly variable magnitude, is performed only with WPT and wden. Sets of artificial signals of 7 periods were analyzed. They had either ascending or descending constant slope, are characterized by the values of the parameter M and were built as explained in Section 2. The analysis was made considering the same steps as those presented in Section 3. Figs. 10 and 11 are dedicated to the denoising with WPT for the case with the most significant noise and M=0.06.

B. Denoising Signals with negative slope
Signals with negative slopes ("in mirror" relative to those from the previous subsection) were also submitted to artificial pollution with noise, denoising and analysis.
The counterpart of Fig. 10 (now corresponding to a descending slope) is represented by Fig. 15, whilst Fig. 16 is dedicated to the metrics for all tests made for the descending slope, M=0.06. The function wden was also applied to descending slope and Figs. 17 and 18 are dedicated to the results for M=0.06 and most significant noise.

C. Comparative Analysis
The extreme and mean metrics computed for all wavelet-based denoising techniques are gathered by Tables II...IV. WPT-based denoising provides the best results as compared to wden and therefore we tried to find some explanations for the differences "TSs vs DSs" yielded by this method:   • the cut-off frequency provided by the algorithm when noise removal is intended is 43 x 50 instead of the 40 x 50, which is considered as low-limit for Gaussian noise ; • imperfect segregation of the final nodes of the WPT tree (the algorithm cannot provide the ideal 2 sets of nodes: N1 -nodes to host vectors whose energies are affected only by HOs higher than 43 and respectively N2 -nodes to host vectors whose energies are affected only by HOs strictly lower than 43). Nodes from N1 (those to be zeroed) might contain small weights from the components with HOs lower than 43 and viceversa, such as it becomes possible have "leakages" between the component without noise and the one consisting only of noise; • the possibility of appearance, in certain circumstances, of the "edge-effect" [13], as long as the WPT decomposition relies on individual nodes decompositions with the Discrete    Wavelet Transform considering the parameter "periodization" (it is clearly visible in Fig. 5), but this may affect only a very small number of samples. In Figs. 19 and 20 bar graph representations were used for a better overview of method comparison. Fig. 19 depicts comparison of all slopes used for WPT method of denoising, with and without edges. Fig. 20 depicts comparison of all three methods used in this paper (mean signal, WPT and wden), where for mean signal method only result for 7 periods signal was used because both WPT and wden method were tested on signal of 7 periods. Also, for both WPT and wden method only result with no slope were considered because mean signal method is inapplicable in other cases.

Conclusion
In this paper, effects of number of periods of polluted synthetic signals are analyzed using three methods of denoising: mean signal method, WPT method and wden method. Authors concluded that using 7 periods instead of one will be suitable because the terminal nodes  of the WPT tree will contain 28 components instead of 4, which suits the filter length of wavelet mother ‚db14'. Then, using mean signal method, polluted signals of 7, 25 and 50 periods were synthesized and analyzed. For these stationary signals interesting conclusions were made: • Mean signal method shows better results (smaller deviations) as the number of period increases.
• Method wden exhibits unusualy high deviations in notches of the original signal.
• Both WPT and wden show a trend of relative MAD and RMSD decreasing as the power of noise increases.
• Method wden shows higher difference between original and denoised signal compared to the WPT method.
On the other hand, methods WPT and wden were used on nonstationary signals with varying positive and negative slopes and conclusions were: • Problem with high deviations in notches of the original signal using method wden doesn't exist.
• Both WPT and wden show a trend of MAD and RMSD decreasing as the power of noise increases.
• Method wden yields higher difference between original and denoised signal compared to the WPT method.
• For a positive slope, both WPT and wden methods show a decrease in relative MAD and relative RMSD as parameter M increases, whilst for negative slope both methods show a slight increase in relative MAD and relative RMSD as the absolute value of the parameter M increases.
Mean signal method yielded better results compared to the other two methods analyzed in this paper when computing higher number of periods. But it requires severe restrictions relative to usability, requiring long steady sequences and invariable level of noise.
WPT again proved to be a better solution than wden function.