Analyzing Electromagnetic Interferences in Power Applications by Using Time-Efficient Joint Analysis Based on DWT and WPT Trees

Decompositions relying on trees used to implement the Wavelet Package Transform (WPT) provide numerous advantages but require a significant runtime. When the parameters of relatively narrows ranges of harmonic orders change, only few vectors from the final nodes and the vectors hosted by the associated „parent nodes" from upper levels are affected. The counterpart decomposition relying on a tree which implements the Discrete Wavelet Transform (DWT) with the same number of levels requires a 20 times smaller runtime. An estimation of the energetic sensitivity of all DWT details vectors to harmonic orders from the interval [2,256] was made. Both types of trees were connected by means of harmonic orders affecting the levels in the DWT tree and terminal nodes in the WPT tree. Through an original labeling of the WPT nodes, 18 topologies of WPT subtrees were deduced. These subtrees correspond to individual levels or to pairs/triplets of adjacent levels from the DWT tree. Tests on synthetic and real signals validated the DWT/WPT trees based algorithm used to perform faster identification of harmonic orders whose magnitudes change from one period to another. Runtime savings varying from 90% to 10% were obtained.


I. INTRODUCTION
Over the years engineers and researchers realized that the conventional FFT was not suitable to process signals of complex, dynamic nature, often transient and non-stationary. [1]. Among other disadvantages, FFT lacks time localization and assumes that the 2-nd half period is symmetrical to the 1st one. To address this problem, time-frequency representations were sought and developed. Short-time Fourier Transform (STFT) was introduced as well as nonlinear distributions such as the Wigner-Ville distribution (WVD). STFT suffers from the fact that it provides constant resolution for all frequencies since it uses the same window for the analysis of the entire signal. WVD and Pseudo-WVD are bilinear in nature and artificial cross terms appear in the decomposition results rendering the feature interpretation problematic. Their greatest disadvantage though is that they are generally non-reversible transforms [1].
In this context the wavelet transforms (WT), which transform a function from the time domain to the time-scale domain (the scale being indirectly associated with frequency), became more and more popular. Furthermore, the WT is a reversible transform, which makes the recons- truction or evaluation of certain signal components possible, even though the inverse transform may not be orthogonal. WT is particularly useful for the transaction of 2 major tasks in signals of complex (transient and/or nonstationary) nature: de-noising and feature extraction [1].
Feature extraction provides usually -though not alwaysthe input to an expert system towards autonomic health degradation monitoring and data-driven prognostics ( Fig. 1 [1]). WTs were often combined with other methods in practical applications. Some examples are provided below. a) The wavelet packet decomposition (WPD) and empirical mode decomposition (EMD) were combined to extract fault feature frequency and neural network for rotating machinery early fault diagnosis. Acquisition signals with fault frequency feature were decomposed into a series of narrow bandwidth using WPD method for de-noising, then, the intrinsic mode functions which usually denoted the features of corresponding frequency bandwidth were obtained by applying the empirical mode decomposition (EMD) method [1], [2]. Similarly, a method relying on wavelet packets transform (WPT) and EMD to preprocess vibration signals and extract fault characteristic information from them was proposed in [3]. b) A fault detection method that combines Hilbert transform and WPT was proposed in [4]. c) A method which combines the capability of DWT to treat transient vibration signals with the ability of auto-associative neural networks for feature extraction is presented in [5]. d) An approach for differential protection of power transformers relies on DWT and an adaptive network-based This project has received funding from the European Union " Horizon 2020 research and innovation programme" under the Marie Sklodowska-Curie grant agreement No 812753. fuzzy inference system in order to discriminate internal faults from inrush currents [6].
On the other hand, the "classical" methods have not provided a solution to analyze the relation among multiple electromagnetic interference (EMI) signals, and the data clustering and mining were many times done manually [1]. To address this problem, [7] proposes a one-stop method based on WPD and a self-organized feature map aiming to provide a systematical and solution to extract and analyze multiple EMI signals.
In the same area of interest falls [8], which proposes a WPD -based technique to perform a feature extraction from the disturbance signal. The disturbance signal of the analyzed wiper motor was first decomposed into various frequency sub-band signals. A method of calculating the integrated energy and mutation parameters, using the WPD coefficient of the signal after decomposition was employed. The feature vector representing the EMI signal was developed in order to use the extracted parameters. A standard vector library for feature parameters was constructed with the multi-sample averaging method, in order to be exploited by a recognition algorithm with different frequency ranges and categories.
An important fact observed when using wavelet mothers (WM) from the Daubechies family, was the overlap between the frequencies bands (frequency aliasing) associated with the DWT decomposition of their signals [1].
When using a high-order Daubechies wavelet for signal decomposition, this effect is less intense than when using a low-order one. But longer filters mean more computational resources, the runtime becoming critical [9].
The authors obtained useful results relative to filtering properties of terminal nodes from a WPT tree with the following topology: 512 components in the root node, 7 levels and filters from the Daubechies family with 28 components (‚db14') [10]. Considering the significant runtime required by a full WPT decomposition relying on the tree mentioned above, a tree segmentation in WPT subtrees was conceived and implemented, relying on the WPT tree nodes' connection to the harmonic orders (HO) which affect their energies and also affect the energies of the vectors of details for various levels of a unbalanced DWT tree with a similar topology, built with the same WM. Details on WPT and DWT trees implementation are provided in [11].

A. Proving the magnitude and phase-shift invariance of harmonic energy weights versus levels for monoharmonic pollution
The selectivity property of the DWT vectors of details versus HOs energies was firstly studied on mono-harmonic synthetic signals containing 512 components equally spaced in time, covering a full period. A fundamental component magnitude of 800 and harmonic weights of 0.1 were considered, whilst the phase difference between the component of fundamental frequency and the harmonic component was varied such as to cover the range [-π,π] with the increment π /6. A total of 13 phase differences were used accordingly. For example, for a phase difference of -5 π/6, the i-th component of such test signal polluted by the 3-rd HO can be expressed as T(i)=T1(i)+T2(i), where: The distribution of each HO's energy across the DWT tree levels was studied. The DWT tree levels were indexed from 1 to 7 (considering the root node as level 0).
Figs. 2…4 depict the most significant harmonic "perlevel" energetic weights (computed as the ratio "energy induced by a certain HO h in the level l over the total energy induced by h in the tree") for 3 HOs: 2, 8 and 245. Different fundamental magnitudes , harmonic weights and phase differences yielded identical results.
Phase invariance was observed for all HOs with the following exceptions: -HOs multiple of 4, which affect two adjacent levels in a complementary way; -the HOs 3,5 and 11 (very small differences, of at most 0.0015 being noticed).
Another 2 significant observations must be mentioned: -low HOs affect only the energy of vectors of details (EVD) corresponding to high order levels whilst high HOs affect only the EVD of low order levels;   -a HO may have a significant influence (over 0.03) in at most 2 levels, always adjacent. If h influences only l and (h+1) influences both l and (l-1), the weight of energy produced by (h+1) in (l-1) is significantly smaller than those produced by (h+1) in l, a gradual crossing (higher HOs influencing lower levels) being observed.

B. Establishing the ranges of harmonic orders affecting each level in the DWT tree
Considering the invariance to phase-shift and magnitude, along with the exceptions exhibited by HOs multiple of 4, a diagram depicting the "harmonic energy weights" versus HOs, per level, was built (Fig. 5). The "spikes" appearing at all HOs multiple of 4 correspond to the maximum value that can be reached by the HO in the level. Therefore the HOs multiple of 4 appear in 2 level-plots. Only HOs with weights higher than 0.03 were represented in each figure.

III. RELATIONS BETWEEN THE WPT TERMINAL NODES AND HARMONIC ORDERS
The WPT tree which is going to be connected to the DWT tree studied in the previous section was intensively studied in [10], The main conclusion of that study was that the final nodes form clusters relative to restricted sets of harmonics, as follows [10]: -The odd harmonics determine clusters of 2 , 4 and 8 nodes affected only by sets of 2, 4 and 8 harmonic orders, accordingly. Of them, only one node has most of the harmonic weight and a single different node, hosting the most significant remaining weight, has to be considered too. The rest can be neglected without losing significant accuracy; -The even harmonics determine clusters of pairs of nodes, hosting weights in a complementary way from specific ranges of values. One even harmonic can determine clusters of 1...4 pairs of nodes. Of them, only one pair hosts most of the harmonic weight and a single different pair, hosting the most significant remaining weight, has to be considered too. The rest can be neglected without losing significant accuracy; -Each node can be associated to exactly 3 "most significant" harmonic orders, found in a sequence of consecutive numbers; -In the middle of this sequence there is always an odd harmonic order. Therefore there is a biunivoque association of type "node index <-> significant odd harmonic order". The other 2 significant harmonic orders affecting the node appear in both nodes which are part of the "most significant pair" associated to them; -The association between nodes and "most significant" harmonics" makes possible a more accurate localization of the frequency range responsible for a fault whilst preserving the time-related information.

A. The Bottom-up approach. Determining labels for all nodes in the WPT tree
In the previous sections was proved that the energy of each vector of details from the DWT tree is affected only by certain HOs and the same property was exhibited by the terminal nodes from a WPT tree. Therefore both trees can be connected through the HOs affecting them.
In this idea, at the beginning the terminal nodes from the WPT tree were labeled. The labels attached to terminal nodes can have 1...3 symbols (a symbol representing a number of level, from 1 to 7). Fig. 6 represents examples of such labels (e.g. the 2-nd node has the label "67" because the range of HOs affecting him is 3...6 , which also affect only  Once determined the terminal nodes' labels, the labels of WPT nodes from the upper levels were determined on a "pairing" basis. The label of a WPT node (Nj), belonging to a level i , is determined by the reunion (consisting in unique occurrences) relying on the labels of nodes generated by the Nj decomposition (N2j-1 and N2j), belonging to the level (i+1). The WPT indices within a level start from 1 toward right. An example is provided in Fig. 7 (labels in rectangles).
The labeling procedure continues toward the root node, which obviously has the label "1234567".

B. Determining the WPT subtrees
The next step consisted in determining the subtrees associated to single levels, respectively to pairs or triples of adjacent levels from the DWT tree. The main idea behind the building of these topologies is as follows: when only 1, 2 or 3 adjacent levels from the DWT tree are affected by harmonics, only the WPT nodes labeled with the associated number of levels have to be considered for the WPT decomposition. On this idea, a number of 18 subtrees were considered: 7 are associated to individual levels from the DWT tree, 6 are associated to 2 adjacent levels (combination like 12, 23, …, 67) and 5 are associated to 3 adjacent levels (e.g. 123, 234,…,567). Each possible combination generated on this basis using the DWT tree levels (CL) got an index, assigned in an intuitive manner (the subtrees for single nodes are associated to the combination 1…7, those for pairs of nodes (in the sequence 12, 23 etc.) got the indices from 8 to 13 and those for triples got the remaining indices (e.g. 123 has the index 14, 234 has the index 15 a.s.o.). 7 matrices of flags (one per each WPT tree level) were afterward built. All of them have 18 rows (one for each combination CL) and a number of columns equal to the number of nodes from the corresponding WPT tree level. For example, let us consider the component F5 (3,9). If it is 0, it means "when the 5-rd level in the DWT tree is affected by harmonics, the 9-th node from the 3-rd WPT tree level is not affected (the harmonics affecting him are not involved) and Fig. 7. Example of building labels from the labels of "child" nodes. therefore it does not belong to the subtree which has to be computed and this results into runtime savings".
In order to have a quantitative estimation of the efficiency associated to the use of matrices of flags which determine the WPT subtrees, Fig. 8 depicts the "per level" ratios Rl computed as "number of selected WPT nodes to be decomposed" over "total number of WPT nodes" for each level, for all CLs. As long as the total number of WPT nodes per level is equal to 2 l , where l represents the level index, the smaller Rl is, the higher runtime saving is obtained.
Considering that higher IDs of DWT tree levels are affected by narrower HOs ranges, bordered by lower HOs, Fig. 8 reflects correctly that the subtrees corresponding to the lowest HOs (e.g. those for the CLs 5…7 or 16…18) involve the smallest runtime , because fewer WPT nodes have to be computed.

A.
Tests on Randomly Polluted Multiharmonic Signals The algorithm was firstly tested on synthetic signals, randomly polluted with several harmonics, such as to have a high degree of generalization. The test procedure can be briefly described as follows: -2 periods from the test signal are generated; -the 2-nd period is modified , by changing the magnitude of one or several HOs affecting adjacent levels from the DWT tree; -the vectors of details from the DWT tree are computed for both periods and their energies are compared; -the highest percentage relative differences between the periods' counterpart vector details energies are used as criterion to decide the combination CL to be used when deciding which subtree will be used for decomposition; -the WPT decomposition , conducted by the corresponding subtree, is performed and a comparison between the periods' counterpart energies of the 7-th level selected nodes is made; -the indices of the "most significantly energetic affected nodes" are used to deduce the HOs whose magnitudes were changed, according to the clusters (Ids of nodes , HOs) specific to the WPT tree.
Fig 9 depicts a test signal used to test the algorithm when the 5-th harmonic weight is increased by a factor of 5. Fig.  10 depicts the vectors of details from the DWT for both periods and Fig. 11 depicts the energies of the above mentioned vectors, for both periods and the percentage relative differences between their energies respectively.    6-th and 7-th DWT levels, as determined by the algorithm.
The 5-th HO influences, along with the 3-rd HO, within a 2 x 2 cluster, the pair of nodes (2,4). It is dominant in the 4th node. Therefore the algorithm is validated. Only 6 out of 128 nodes were selected by the WPT subtree! Figs. 13…16 are dedicated to another example, where the weight of the 27-th HO was increased by a factor of 5. Here, the set of terminal nodes corresponding to the selected subtree includes the "most affected nodes" with the IDs 10, 12, 28, which are part of the 4 x 4 cluster of nodes affected by the 27-th harmonic. In this cluster the 12-th node carries most of this HO's energy and therefore is expected to be most affected, as correctly revealed by the algorithm. In this case, only 28 out of 128 terminal nodes were selected.

B.
Tests on real data Fig. 17 depicts 2 periods from real signals corresponding to the 1-st phase voltage and current acquired from the secondary main transformer of a plant producing electric vehicles. The 2-nd period was polluted (artificially) for a number of samples smaller than a period by a harmonic signal with HO=13 for voltage and HO=43 for current respectively. The most affected levels are those with indices 4 and 5 for voltage and those with indices 3 and 4 for current. The energies of nodes selected by the algorithm are represented in Fig. 18 -for voltage, and in Fig. 19 -for current. The clustering patterns (HOs)<->(indices of WPT nodes) prove the algorithm's validity.

CONCLUSIONS
Deviations in the harmonic spectra involving relatively narrow ranges of harmonic orders (e.g. EMI) can be correctly detected and identified by means of a time-efficient joint analysis, relying on DWT and WPT trees.
The appropriate properties relative to adjacent harmonic ranges exhibited by the energies of DWT vectors of details allow for the identification of (combination of) levels with energy deviations. Once the combination is known, the WPT decomposition is restricted to a specific subtree, which significantly reduces the number of nodes from the WPT tree which has to be computed, strictly to those which are affected by the harmonic spectrum change. Afterward the energy deviations of the selected final WPT nodes are computed in order to identify the deviations. To an end, the clustering properties of the terminal WPT nodes with individual harmonic orders are applied in order to evaluate the specific harmonic orders responsible for the modification of the harmonic spectrum.
The tests on both synthetic and real signals validated the algorithm and runtimes were estimated. Runtime savings varying from 10% to 90% were obtained. This joint analysis can be successfully applied both for faults detection and EMI detection and evaluation.