*4.1. Test Waveforms*

The 13 employed waveforms are presented in Table 2. It was decided to employ all the waveforms of the NPL library coming from direct measurements in the grid (11), together with two synthetic waveforms, to further test the method. The synthetic waveforms were a square wave, allowing testing harmonic contents up to the 49th order, and a waveform whose harmonic content was created using IEC 61000-3-2:2000 limits for harmonic voltage emissions [28]. In each case, the power frequency was 50 Hz, so the duration of the test waveform was 200 ms, as prescribed in IEC 61000-4-7, while the RMS amplitude of the fundamental components was 230 V. Table 2 also shows the THD factors calculated from the nominal harmonic content values reported in [28]. For the study of the non-stationary case, the following modulation patterns were applied to the test waveforms:


The last two modulations were considered to provide a more reliable validation, since they could be realistically found in the grid, in the case of the connection of large loads or in the case of flicker [29]. More information about the modulation patterns is given in Section 4.3.


**Table 2.** Validation test waveforms, taken from [28], showing the total number of harmonic components included *n*, the most intense harmonic order *H*, and the calculated THD.

### *4.2. Validation for Stationary Conditions*

In this section, an extensive analysis is presented for the case of Waveform 1, in steady state conditions. Figure 3 shows the obtained results for Waveform 1, along with the calculated errors.

**Figure 3.** Analysis of the IEC 61000-3-2 limits waveform under stationary conditions. The comparison is made between the IEC, the grouped IEC, and the proposed WPD methods. The upper graph shows the spectrum of the RMS content of each IEC frequency band for the three methods, compared to the real content. The middle graph shows the errors for each frequency band. The difference between the errors is shown in the bottom graph.

The harmonic content was significantly more complex than single frequency signals, and it is possible to see that the results of the FFT slightly deviated from the expected values. The same happened with the grouped FFT and the proposed WPD method. In all of the cases, however, the errors were very low, always lower than 0.2%. Depending on the harmonic order and on the frequency content, the WPD errors were higher or lower than FFT. The bottom graph of Figure 3 shows a plot of the difference between the error of the WPD results and the error of the results of the grouped FFT (which resulted in being more accurate than standard FFT). This value indicated how worse WPD

was performing with respect to the grouped FFT. Negative values mean that WPD was performing better. It is possible to see from Figure 3 that the error of the proposed WPD method was always lower than the IEC method, except for the orders four and 39 where, however, the difference was negligible (less than 0.005%). In any case, all the errors presented were extremely low, and all the methods were perfectly suitable for stationary harmonics.

The other 12 waveforms were assayed with the same methodology, and a summary of the obtained results is presented. Figure 4 shows that, among all the assayed waveforms, the maximum difference between the errors of the two methods was less than 0.35%, which represented the worst case. This means that in the case of stationary signals, the presented method was almost never worse than the FFT or the grouped FFT, and when it was, the deviation was negligible.

**Figure 4.** Maximum positive difference between the error of the WPD and grouped IEC methods.

### *4.3. Validation for Non-Stationary Conditions*

In this section, the performance of the proposed method in the case of non-stationary realistic waveforms is assessed. The results were compared to the strategy proposed by IEC 61000-4-7, i.e., grouped FFT. Among the scenarios discussed so far, this was the most relevant one, since it was the closest to reality, where voltage and current waveforms are often, if not always, non-stationary. As stated in Section 4.1, three different fluctuation patterns were applied to the 13 waveforms previously identified. In this regard, Figure 5 illustrates the three types of modulations that were used.

**Figure 5.** Schematic illustration of the employed modulation patterns. From left to right: constant modulation, linear modulation, and flicker-type modulation.

Figure 6 shows the results obtained for Waveform 1 with constant modulation. It can be easily seen how the proposed WPD method was significantly more accurate than the grouped FFT, which produced large errors. When the measured RMS content was less than 1%, the percentage of error was

calculated with respect to the nominal voltage, according to the IEC 61000-4-7 standard [5]. The results of the conventional FFT produced even larger errors and, for the sake of clarity, are not presented. Depending on the harmonic order, the deviation of the proposed WPD method from the real content of the signal could vary, but it was always more accurate than the grouped IEC method. This is confirmed by the bottom graph of Figure 6, which shows the difference between the errors made by the two methods. As can be seen, all the values were negative, meaning that WPD always gave more accurate results than grouped FFT, and in some cases with a large difference. It can also be seen that, in both methods, the largest errors were usually produced when no harmonic content was expected. In this case, the appearance of non-zero values was due to the so-called energy leakage, i.e., part of the harmonic content of nearby bands leaked to a band where no content should be present. This affected both methods, but it was evident that WPD was significantly superior in dealing with this issue, providing a far better overall accuracy.

**Figure 6.** Analysis of the IEC 61000-3-2 limits waveform under non-stationary conditions (constant modulation). The upper graph shows the spectrum of the RMS content of each IEC frequency band for the three methods, compared to the real content. The middle graph shows the errors for each frequency band. The difference between the errors is shown in the bottom graph.

The other 12 waveforms were assayed with the same methodology, and a summary of the obtained results is presented. In this case, to quantify and compare the overall accuracy of the two methods, the Root Mean Squared Error (RMSE) can be employed:

$$RMSE = \sqrt{\frac{\sum\_{h=1}^{N} \varepsilon\_{h}^{2}}{N}} \tag{5}$$

where *ε*h is the error produced for order *h*, and *N* is the total number of bands, 50 in this case. This quantity is typically used in statistics to measure how well a distribution fits experimental data. However, in this case, it was used to aggregate the errors of each tested method over all harmonic orders into a single measure and have an estimation of the overall accuracy. The higher the RMSE, the lower the overall accuracy. Figure 7 shows the RMSE obtained with both methods, for all the considered waveforms (see Table 2). The constant modulation was employed (the same proposed by IEC 61000-4-7 for fluctuating harmonics). In order to better appreciate the large differences, results are plotted in logarithmic scale. The significantly lower RMSE for the proposed WPD method means a

higher overall accuracy of the proposed method. Figures 8 and 9 present the same analysis, but using the linear modulation and the flicker-type modulation, respectively.

**Figure 7.** RMSE for each assessed waveform under fluctuating conditions, for grouped IEC and WPD, in the case of constant modulation.

**Figure 8.** RMSE for each assessed waveform under fluctuating conditions, for grouped IEC and WPD, in the case of linear modulation (motor-start type).

**Figure 9.** RMSE for each assessed waveform under fluctuating conditions, for grouped IEC and WPD, in the case of flicker-type rectangular modulation.

It can be seen that the overall accuracy of the WPD method was always significantly superior to the grouped FFT, for all the tested waveforms and types of modulations. The only case where the overall accuracy of WPD was comparable with the grouped FFT was the case of Waveform 11 (square wave) with the linear modulation. However, even in this extremely non-realistic case, WPD showed a better performance. Table A1, reported in Appendix A, provides a summary of the maximum errors obtained in the calculation of individual harmonic components, for all the assayed waveforms, in the four validation scenarios (stationary and fluctuating). It can be seen that the maximum error never exceeded 1%, with the maximum obtained error being 0.678%. Although this was far from being a mathematical formulation of the error, it could be considered as an indication of the accuracy of the proposed method.
