Wavelet-Based Sparse Representation of Waveforms for Type-Testing of Static Electricity Meters

This article presents a strategy for the description of new test waveforms for static electricity meters to be included in international standards. The need of extending the existing standardization frame arises from several recent studies that have reported conducted electromagnetic interference problems of type-approved static electricity meters, resulting in significant errors in the measured electricity consumption. The proposed method is based on discrete wavelet transform and allows for a compact and parsimonious representation of test waveforms, suitable for inclusion in standards. Very few wavelet parameters are concentrating the relevant information to accurately reproduce all the characteristics that the meters need to be tested against. The same parsimonious description cannot be performed with the current practices based on Fourier transform methods since the new test signals need to be highly non-sinusoidal. The discrete wavelet transform is proposed as a more effective tool to sparsely describe the most relevant waveform features. The effect of different discrete wavelet transform decomposition settings on compactness and reconstruction accuracy is studied using suitable metrics. Finally, results from experimental validation with several different waveforms are presented to demonstrate that the error-inducing features can be preserved using only 0.1% of the original signal information.


I. INTRODUCTION
A CROSS the world, electricity networks are being transformed into smart grids through the deployment of intelligent monitoring devices. As part of this transformation, electromechanical electricity meters used for billing purposes are being replaced with static (electronic) meters with communication capabilities. These smart meters open up a range of possibilities, including reductions in electricity demand and customer bills, and supporting integration of variable renewable generation by enabling demand side response schemes [1], [2].
However, in recent years concerns have been raised about the accuracy of type-approved static electricity meters under non-sinusoidal conditions. One study by the University of Twente caused international headlines as it reported errors of more than 500% in static meter readings relative to an electromechanical meter for a combination of energy-efficient lamps controlled by a dimmer [3]. These results were subsequently verified by the Dutch Metrology Institute (VSL) using a wideband reference meter [4]. The experiment was also reproduced in other studies, resulting in lower but still significant static meter deviations of up to 30% [5], [6]. Other tests on a water pump used by a customer who was suspicious of high electricity bills revealed errors up to 2000% depending on the impedance of the power supply [7]. Common features of the current waveforms in all tests are impulsive shapes with high peaks and high slopes, which have shown a correlation to the size of the meter errors [8]. In order to maintain confidence in smart meter accuracy, existing standards for static electricity meters must be reviewed to ensure immunity under real grid conditions [9]- [11].
Type tests for static electricity meters currently specified in international standards are based on single swept sinusoidal tones but, while they reproduce some of the possible deviations from ideal sinusoidal waveforms, there is a lack of type tests that reflect realistic non-sinusoidal conditions that are occurring in low voltage networks due to increasingly non-linear loads. Work is in progress to develop the foundations for an extended standardization framework [12], [13], including nonsinusoidal test waveforms containing high levels of distortion associated with errors in static electricity meters [14]. A simple and compact description for these new test waveforms is needed, which can be easily formulated in a standard for reproduction by test laboratories. In this article, a non-parametric representation in the frequency domain is proposed with the flexibility to adapt to different underlying waveform shapes. The objective is to provide a representation of measured waveforms in terms of only a small number of frequencydomain coefficients, so that they can be easily included in standards. From this compact description, test laboratories can reconstruct impulsive error-inducing waveforms to test the immunity of static electricity meters in an easy yet highly accurate fashion. This work is licensed under a Creative Commons Attribution 4.0 License. For more information, see https://creativecommons.org/licenses/by/4.0/ The remaining of the article is structured as follows. Section II presents the motivation of the study in the framework of the existing techniques used in standards and currently available algorithms. Section III provides the theoretical background of the proposed method, based on the discrete wavelet transform (DWT), while in Section IV it is shown how the proposed approach outperforms the existing strategy based on discrete Fourier transform (DFT) in terms of sparsity. Building on this insight, Section V outlines the algorithm to obtain a compact waveform specification, the performance metrics to assess reconstructed waveforms, and the analysis of sensitivity to different parameters. Finally, in Section VI the proposed method is validated with a real meter that was found to be prone to errors. The conclusions are then presented in Section VII.

II. BACKGROUND AND MOTIVATION
As discussed in Section I, there is the need to extend the current standardization framework to include more realistic type-testing waveforms for static electricity meters [15]. Such waveforms must be representative of the real-world highlyimpulsive disturbances that have been found to potentially cause significant errors in static electricity meters [3], [4], [7], [8]. Their non-sinusoidal character, however, makes the strategy currently adopted for their representation in international standards unsuitable.
Requirements and type tests for static electricity meters are specified in international standards IEC 62053-21 [16] and IEC 62053-22 [17]. European Norm 50470-3 [18] has a similar structure, with modifications to comply with the Measuring Instruments Directive (MID) [19], the relevant legislation for static meter type-approval. These standards include tests to verify meter immunity to harmonic voltages and currents, in particular odd harmonics in the form of a 90 • phase-fired waveform with a rise time of 0.2 ms and even harmonics in the form of a half-wave rectified waveform. Furthermore, immunity to conducted currents in the 2-150 kHz range must be verified with continuous wave pulses and rectangularly modulated pulses of sinusoidal signals according to IEC 61000-4-19 [20].
Such signals are efficiently and accurately described in terms of their harmonic content using Fourier transform methods. For example, a signal composed of a pure nth harmonic can be simply described using the DFT providing amplitude, phase, and order of the harmonic. With this compact information, any test laboratory can reconstruct the corresponding time-domain waveform with high accuracy. However, realistic error-inducing waveforms are highly non-sinusoidal, with very fast-rising slopes and rich Fourier spectra [3], [4], [7], [8]. These features make a DFT description inaccurate and inefficient, with too many coefficients to be suitable for standard inclusion, as it will be demonstrated in Section IV. A simple and compact representation of such signals is therefore needed to go beyond the DFT methods used in international standards and provide compactly described type-testing waveforms based on real-world signals.
At the moment, no other strategy has been suggested to provide a compact representation of new type-testing signals for static electricity meters. Within the EMPIR MeterEMI project, of which this work is part, a time-domain parametric model has been developed to characterize and represent potential test waveforms [21]. One strength of this model is the possibility to adjust parameters such as slope, peak amplitude, and crest factor, to control the static meter errors. However, the parametric time-domain model is limited to generating artificial waveforms based on two generic trapezoidal pulse types. In this article, a complementary approach based on a frequency-domain method is proposed, with the purpose of providing an accurate description of real waveforms with the flexibility to represent the measured waveforms of any shape with high fidelity and few coefficients.
Many frequency-domain and hybrid time-frequency-domain techniques have been used in the literature to analyze power systems signals, including short-time Fourier transform (STFT), S-transform, and wavelet packet transform (WPT) [22]- [24]. The purpose of the present application, however, is to identify a few parameters that carry most of the information so that they can be handled in an easy and compact fashion, rather than to provide a useful analysis or insight on the signals.
The problem statement is similar to that of data compression applications, where the purpose is to reduce the data storage requirements while maintaining high fidelity. For this reason, all the methods that provide redundant information (even if useful for analysis purposes) are not suitable.
The work in [25] presents a comprehensive review of the state of the art of compression techniques for electric signals. One clear trend is that electric signals are mainly composed of a steady-state sinusoidal part and transient impulses (or high-frequency oscillations). The former are well described by DFT-based methods, while the latter are not. The great suitability of wavelet transforms for compressing transients and pulses is well recognized, thanks to their good localization in frequency and time, and to the capability of concentrating a great share of the signal information in very few coefficients [25]- [28], while most of the other techniques are hybrid techniques that attempt at representing the steady-state sinusoidal part as well as the impulsive part of the signals. Since the immunity of meters to sinusoidal distortion is already sufficiently addressed by the existing standards and the focus of the article is solely on impulsive disturbances, following up on the study performed in [29] the DWT is chosen for the present application, proving to be effective and efficient for the task.

III. THEORETICAL BACKGROUND
This section introduces the mathematical tools that will be used for frequency analysis and representation of errorinducing waveforms.

A. Discrete Fourier Transform
Given a sampled time-domain signal x n , n = 0, 1, 2, . . . , N − 1, the DFT is given by where F k , k = 0, 1, 2, . . . , N − 1 represent sinusoidal frequency components with constant amplitude and phase angle over the duration of the original signal. The frequency resolution is fixed across the spectrum, according to the sampling frequency and signal length.

B. Discrete Wavelet Transform
Given a sampled time-domain signal x n , n = 0, 1, 2, . . . , N−1, the continuous wavelet transform (CWT) is given in [30] as where * denotes the complex conjugate, υ(n) is the basis function (mother wavelet), which is scaled and shifted according to parameters s and τ , respectively, The choice of what mother wavelet to employ determines the characteristics of the transform. Over the years, several wavelet families have emerged and become popular thanks to their properties. These well-known mother wavelets will be tested in Section V-C to identify the most suitable mother wavelet for the present application. The coefficients W (s, τ ) form a 2-D grid describing the frequency content of signal x(n) at different time instants. The time-frequency resolution is variable such that slow signal features described by low scales have low time resolution, while fast-changing signal features described by high scales have high time resolution.
The CWT gives a highly redundant and computationally intensive decomposition. The sparser DWT is obtained by defining a dyadic grid by setting s = 2 −m and τ = ks where m = 1, 2, . . . and k = 1, 2, . . . . For sampled input signals, the DWT is computed efficiently by a recursive digital filter bank [31]. On each iteration, the input signal is convoluted with low-and high-pass filters h(n) and g(n), respectively, and each filter output is downsampled by a factor of 2. The filters are halfband filters and, therefore, each filtering operation halves the frequency content of the signal, recursively, as it can be seen in Fig. 1. As the frequency content is halved at each stage, the downsampling operation removes the redundant information improving the efficiency of the algorithm. After the first iteration, the high-frequency output are detail coefficients D 1 , and the low-frequency output are approximation coefficients A 1 , which become the input to the second iteration. This multilevel decomposition principle is shown schematically in Fig. 1 for three levels. After decomposition to level l, the coefficients can be concatenated into a single vector C = [A l , D l , D l−1 , . . . , D 2 , D 1 ]. If an orthonormal wavelet basis is chosen, the original waveform can be perfectly reconstructed from the coefficient vector through an inverse DWT, which is implemented by reversing the steps of the Fig. 1. Schematic overview of a DWT decomposition into three levels by a recursive filter bank. At each level, the input signal x n is convoluted with lowand high-pass filters h(n) and g(n), respectively, and then downsampled to obtain approximation and detail coefficients. They are identified by the letters A x and D x , where the subscript x indicates the number of decomposition level. Below each node, the bandwidth is indicated in terms of the original sampling frequency F s . recursive filter bank. Starting from the highest decomposition level l, the approximation and detail coefficients A l and D l are upsampled, convoluted with inverse filters, and summed to give the approximation coefficients A l−1 for the previous level. This sequence is repeated to reconstruct A l−2 , A l−1 , . . . , A 1 and finally the original signal samples x n .

C. Signal Representation
Both the DFT and the DWT represent digital signals by a set of coefficients in the frequency domain and allow for perfect reconstruction through their inverse transforms. If the frequency domain representation is sparse, i.e., if few coefficients capture most of the signal energy, then the signal can be reconstructed with those coefficients with enough accuracy, since the rest of the coefficients contributes with negligible energy. Thus, the non-parametric frequency domain models can be used to extract the main signal features and to achieve a parsimonious signal representation. The sparsity, i.e., the distribution of signal energy over the coefficient set, depends on the similarity of the relevant signals to the basis functions of the transform. The next section considers the suitability of the DFT and the DWT to provide sparse representations of typical waveforms that have been found to cause errors in static electricity meters.

IV. WAVEFORM ANALYSIS
As reported in the literature, the majority of errors in static electricity meters are produced under highly non-sinusoidal conditions, which is a very common situation in power systems. In particular, the studies performed in [3], [4], [7], and [8] showed that the most problematic cases are observed when the current waveforms show highly impulsive features, with high peaks characterized by fast-rising edges. A similar effect emerges from the results of [6], where the largest errors are produced by the signals with impulsive features. As an example, Fig. 2 shows one power cycle of errorinducing supply voltage and current waveforms of a water pump powered by an ideal power supply via a line impedance stabilization network (LISN) to provide a stable impedance, as described in [7]. The current waveform is unipolar and has a sharp peak, localized in time, close to the zero crossing of the voltage waveform. From the detail of the current peak, shown in the inset of Fig. 2, it can be observed that the current rises very quickly, reaching approximately 8 A in 0.01 ms, followed by a further increase, but with a less steep slope.
The waveform provides a good example to assess the sparsity of the DFT and the DWT decomposition for errorinducing waveforms. As described in Section III-A, the DFT allows to represent a signal as a sum of sinusoids, assuming constant frequency content over the power cycle. The signal presented in Fig. 2 as well as most of the error-inducing signals so far identified, however, do not fulfill the assumptions of the DFT analysis, since the signals are impulsive, with short duration relative to the power cycle. In order to represent a localized pulse as a sum of sinusoids spanning the waveform duration, a very large number of harmonic components are necessary. For this reason, the DFT produces a very broad spectrum, with many frequency components having significant non-zero amplitude. As an example, the 250 largest DFT coefficients of the current waveform presented in Fig. 2 are shown in Fig. 3, in order of decreasing amplitude.
In contrast to the DFT, the basis functions of the DWT are short-duration impulsive waves (wavelets), which are scaled and shifted to decompose the input signal as described in Section III-B, thereby allowing for temporal resolution within the power cycle. In order to provide a comparison with the sparsity provided by the DFT, Fig. 3 also shows the 250 largest DWT coefficients. It can be observed that the maximum normalized amplitude is higher for the DWT than for the DFT coefficients, and that the coefficient amplitude decreases at a faster rate. In fact, the four highest coefficients of the DWT represent 92% of the total energy, while the 4 highest coefficients of the DFT only represent 54% of the total energy. It is possible to observe that the DWT description is much more compact, or sparse, i.e. most of the information of the original waveform is contained in a few coefficients of high amplitude. As a result, although often employed to efficiently define electromagnetic compatibility (EMC) test waveforms [18], [20], harmonic components are not suitable to provide an efficient representation of impulsive waveforms such as those that have been found to induce errors in static electricity meters. The high number of frequency coefficients required to accurately represent type-testing waveforms would be unpractical for specification in international standards. Similar differences in sparsity have been found for other errorinducing waveforms. For these reasons, the DWT has been selected as the basis for a parsimonious signal representation, which will be described in Section V.

A. Algorithm Description
As described in Section IV, analysis of error-inducing waveforms has shown that their impulsive characteristics can be represented sparsely using DWT coefficients. Therefore, it is expected that the waveforms can be reconstructed to a good accuracy even if most of the coefficients with smaller magnitudes are discarded and assumed to be zero in the reconstruction. This principle has been used previously to achieve compression of power system disturbance data [26], [32]. In this article, it is proposed that previously identified waveforms that cause errors in static electricity meters can be specified with sufficient accuracy using only a small number of wavelet coefficients compared to the original sample data. The approximate waveform specification is obtained through the following steps.
1) Compute the DWT decomposition to level l of the original waveform x n consisting of N samples using low-and high-pass wavelet decomposition filters, h(n) and g(n), respectively, as described in Section III-B.  3) Select the P ≤ M largest coefficients and their corresponding vector indices to obtain a reduced waveform representation C approx = [q i , c i ], i = 1, 2, . . . , P, and discard the remaining coefficients and indices. The approximation of the original waveform is fully defined by the retained indices and coefficients C approx , the number of coefficients per level S c , the length of the original waveform N, and the inverse filters of h(n) and g(n). Given these parameters, the waveform approximation can be reconstructed as follows.
1) Create a coefficient vector C rec of length M (sum of the elements of S c ). For the elements in C rec whose indices exist in C approx , set the value to the corresponding coefficient value. Set all other elements of C rec to zero. 2) Split C rec into approximation and detail coefficient vectors per level according to the sizes in S c . 3) Reconstruct the N samples of the approximate waveform x n,rec by the inverse DWT, which is computed by recursively upsampling, filtering, and summing the approximation and detail coefficients. A simple diagram of the described method is presented in Fig. 4. The compact waveform representation described in the previous paragraphs is general in terms of the number of retained coefficients, decomposition level, and mother wavelet, which determines the high-and low-pass filter coefficients. These parameters will be chosen to minimize the number of retained coefficients needed to achieve a waveform representation with sufficient accuracy.

B. Metrics
In order to quantify the compactness of the wavelet-based waveform representation, define the compression ratio where M is the number of coefficients of the decomposition and P is the number of coefficients taken into account. The compression ratio is always greater or equal than one, and indicates the factor by which the original number of coefficients has been reduced. The accuracy of the reconstructed waveform with respect to the original will be measured using the maximum of the residual as a percentage of the maximum waveform amplitude, defined as where x n and x n,rec are the samples of the original and reconstructed waveforms, respectively. This metric has been chosen to evaluate the closeness of the reconstructed waveform at the highest amplitudes of the waveform, which occur at the impulsive step changes known to cause meter errors. The objective of the wavelet-based waveform representation is to achieve compactness as well as high accuracy, balancing the tradeoff between increasing residual and higher compression ratios.

C. Choice of Wavelet Parameters
The method described in Section V-A requires the selection of the mother wavelet and the number of decomposition levels of the DWT. As for most wavelet applications, there is no universal rule to be followed in the choice of the configuration and the parameters must be tailored to the specific application. In the case presented in this article, the objective is to achieve an accurate reconstruction of the original waveform using a low number of coefficients and this shall therefore guide the choice of the parameters. The metrics introduced in Section V-B will be used to identify the most suitable parameters. The metric r max quantifies how accurate the reconstruction is, while the compression ratio R is an indication of the sparsity of the representation.
In order to select a suitable configuration of the mother wavelet and number of decomposition levels, an extensive study has been carried out, considering the reconstruction performance of several wavelet configurations. The following commonly employed wavelet families have been considered: Daubechies (db), Discrete Meyer (dmey), Symlet (sym), Coiflet (coif ), Fejér-Korovkin (fk), Biorthogonal (bior), and Reverse Biorthogonal (rbio). The wavelet families have been selected based on wavelets that proved to be successful in power system applications in previous research [25], [27], [28], [33], [34]. This is complemented by the use of additional families that are implemented in common programming tools, e.g., MATLAB or Python, in order to provide a representation that is easily implementable by a wide range of users.
Within each family, the wavelets differ by their number of vanishing moments, which determines the polynomial order that the wavelet can represent efficiently. The number of vanishing moments is specified in the acronym after the mother wavelet part, e.g., db2 identifies the Daubechies wavelet with two vanishing moments. Different vanishing moments have been tested across the wavelet families, generating therefore 64 possible mother wavelets. For each mother wavelet, five Fig. 5. For each configuration of mother wavelet and decomposition level, the mean valueP min and the standard deviation σ P,min of DWT coefficients needed to achieve a residual value r max ≤ 5% are shown. For each mother wavelet indicated in the figure, results from decomposition levels 5 to 9 are shown from left to right, grouped into color bars. Decomposition levels are identified via different colors and markers.
possible decomposition levels have been tested, ranging from 5 to 9. The total number of tested configurations therefore sums up to 320. Their performances have been tested on a set of 59 current signals with similar characteristics as the waveform described in Section IV. These waveforms were captured in different laboratory measurement campaigns within the EMPIR project MeterEMI [4], [7], [14], and have been found to induce errors in some static electricity meters, to a different extent depending on the waveform.
For each of the 59 signals, nine power cycles were available, giving a total of 9 × 59 = 531 individual test waveforms. In order to assess the reconstruction performance of a single configuration of mother wavelet and the number of decomposition levels, all 531 waveforms were decomposed and reconstructed repeatedly as described in Section V-A using the configuration under test. On each repeat, the number of retained coefficients in C approx is reduced, starting from the total number of coefficients M (perfect reconstruction) until a target accuracy of r max = 5% is met. The obtained value P min represents the minimum number of coefficients required to achieve the target reconstruction accuracy. From the resulting 531 values of P min per configuration, the mean valueP min and the standard deviation σ P,min have been calculated. Fig. 5 shows results ofP min and σ P,min for each tested mother wavelet.
Since all the waveforms were sampled at the same sampling rate of 1 MS/s, the denominator of the compression ratio defined in (5) is equal for all waveforms such that the number of coefficients suffices to comparatively assess the compression performance of different configurations. The lower the number of coefficients, the better the performance. The number of coefficients varies in a range from 38 to 100, depending on the mother wavelet and on the number of decomposition levels. Given the original number of samples is N = 20 000 per waveform, the compression ratio ranges from 526 to 200, representing a very efficient compression. Moreover, it is possible to identify a pattern: regardless of the mother wavelet, the optimal number of decomposition levels is either 6 or 7 in most of the cases. Specifically, it is six levels in 47% of the cases, and seven levels in 42% of the cases. Fig. 6 shows the detail of the 25 best cases, selected from the initial 320 configuration results. It can be seen that different types of mother wavelets provide very similar performance, with small differences between them. Moreover, it is confirmed that the best results are achieved with either 6 or 7 levels of decomposition. These 25 configurations (mother wavelet and decomposition levels) can be considered equally suitable and effective for the application described in this article. Considering the results of the analysis described above, the db2 mother wavelet with seven levels of decomposition is selected. The db2 mother wavelet has been explored before with impulsive waveforms causing errors in static electricity meters [33], proving that its low-complexity and compact definition, with only two vanishing moments, is suitable to Fig. 6. Mean valueP min and standard deviation σ P,min of DWT coefficients needed to achieve r max = 5% for the 25 best configurations of mother wavelet and decomposition level. represent these types of impulsive waveforms. In the next section, it will be shown that this configuration is very effective in providing a sparse representation of the current waveforms while maintaining the error-inducing features.

VI. EXPERIMENTAL VALIDATION
This section presents the validation of the proposed waveletbased representation method. This is done by verifying that the reconstructed waveforms can effectively reproduce the same level of static meter error as the original ones, i.e., they preserve the error-inducing features. The validation is not performed with a DFT-based representation since, as proved in Section IV, the DFT is unsuitable for inclusion in standards due to the excessively high number of coefficients required. In order to compare the level of errors, the static meter testbed first presented in [35] and developed within the EMPIR MeterEMI project is employed. This electricity meter testbed is a flexible and highly accurate metrology platform for testing the accuracy of electricity meters. It generates synchronized voltage and current waveforms using an arbitrary waveform generator in combination with voltage and current amplifiers. The generated waveforms are supplied to the meter under test and, simultaneously, they are measured with metrology grade voltage and current sensors. Van den Brom et al. [15] provides a detailed description of the latest version of the employed static meter testbed and the schematics of the measurement setup. The measurement performed by the testbed (reference) is then compared to the measurement done by the meter under test, assessing therefore the accuracy of the meter and the extent of any possible error. According to [15], the meter error is defined as where E MUT is the measurement done by the meter under test and E ref is the measurement performed by the testbed. For this validation, six test waveforms have been selected from the experimental measurements described in [4], [7] and [14], representing the most challenging scenarios for the meters. Waveforms 1-4 are taken from [7], and have been  recorded from a water pump connected to the mains via a controlled impedance. Four different impedance levels have been used: a stable standardized impedance (waveform 1), a stable low impedance (waveform 2), a stable high impedance (waveform 3), and the mains impedance (waveform 4). Waveforms 5 and 6 are taken from [4], [14] and were recorded, respectively, from a different water pump connected directly to the mains and operated remotely, and from a combination of light emitting diodess (LEDss) and compact fluorescent lampss (CFLss) operated using a dimmer. For each test waveform, four wavelet-based representations have been used in the validation in order to test the sensitivity of the meter error to different compression ratios resulting from reconstruction using 100, 50, 20, and 10 coefficients. Fig. 7 shows all tested current waveforms, with an inset showing the detail of the fast rising current slopes responsible for the erroneous readings. In Fig. 8, the detail of the current peak of waveform 1 is shown, together with the four different   Table I, where it is possible to see that r max increases as the number of employed coefficients P decreases.
From Fig. 8 it can be seen that the maximum value of the residuals occurs when the current waveform experiences a rapid change with a sharp rise and a high current slope. This confirms that this part of the waveform is the most difficult to represent but also the most relevant in terms of inducing errors in the meters, making it very important for the representation, as shown in [8].
An electricity meter known to be not immune to errors has been used for the validation in order to provide a constant benchmark. The results are presented in Fig. 9, which shows the errors produced by the selected meter. The blue solid lines indicate the errors obtained with the original waveforms, i.e. as they have been recorded from the respective load appliances. The scatter points represent the errors obtained with the different reconstructed waveforms. The corresponding numerical values are reported in Table II. It can be observed that the waveforms reconstructed using only ten coefficients are not always sufficiently accurate to preserve the error-inducing features. This is the case for waveform 3, where the error reduces from 259% to −6% when only ten coefficients are used in the reconstruction. A similar effect has been observed with waveform 6. However, all the performed tests indicate that a reconstruction with 20 coefficients (i.e., 0.1% of the total number of coefficients) can produce waveforms that reproduce the error-inducing features with sufficient accuracy. The following observations can be made for the reconstructions performed with 20 coefficients. Waveforms 2, 3, and 5 can be reconstructed with 20 coefficients and reproduce error values with only few hundreds of percent difference compared to the original, which is sufficiently accurate, considering that they originally produced errors in the range of thousands of percent. Waveforms 1 and 3, which originally caused errors in the order of hundreds of percent, can be reconstructed with 20 coefficients and reproduce errors with only few tens of percent difference compared to the original. Finally, the 20-coefficient reconstruction of waveform 6 produces an error of 81%, very similar to the original 76% error. Considering the introduced metrics, the results indicate that a value of r max of approximately 20% can be sufficient to preserve the error-inducing features in waveform reconstruction when a wavelet-based approach is employed, as it can clearly be appreciated in Fig. 9.

VII. CONCLUSION
As discussed in Section I, recent studies have found some specific cases in which static electricity meters perform poorly when subjected to conducted electromagnetic interference. Additionally, new types of loads in the grid are creating new types of electromagnetic disturbances. While research is underway to understand the full extent of the problem and what types of meters are more or less immune to this interference, there is the urgent need to review the current standardization framework. This requires the definition of new type-testing waveforms, based on those that have been found to produce errors in static electricity meters. Considering their impulsive features, however, the traditional description based on Fourier analysis, as seen in this article, is not effective nor practical for inclusion in international standards and more suitable techniques are needed.
In this article, a wavelet-based technique has been presented to parsimoniously describe waveforms that produce errors in static electricity meters. The impulsive character, with high slopes and fast-rising edges, of such waveforms would require an excessively large number of coefficients to be accurately represented with the DFT. The DWT, instead, is very effective in representing these types of waveforms, being able to provide a sparse representation, i.e., very few coefficients are sufficient to produce an accurate description of these potentially harmful waveforms. Extensive analysis has been presented, considering hundreds of possible configurations, discarding unsuitable mother wavelets, and identifying the optimal number of decomposition levels that maximizes the compression ratio. As a result, the method has proven to be effective in parsimoniously representing error-inducing waveforms with very few coefficients. A laboratory experiment using a real meter has validated the technique, showing that a reduction from thousands of coefficients to only few tens is sufficient to reproduce the error levels observed in static electricity meters in good accordance with the errors produced by the original error-inducing waveforms. Although these values are waveform-specific, the order of magnitude is very satisfactory. Moreover, the mother wavelet optimization strategy described in the article can be easily tailored to any specific application or even to any specific test waveforms to further reduce the number of coefficients, should it be required.
As a conclusion, the DWT-based technique presented in this article represents a highly accurate method to provide a parsimonious description of type-testing waveforms, suitable to support the revision of European and international standards for EMC, helping to ensure immunity of static electricity meters from harmful disturbances existing in the grid.
In terms of future work, the present research opens the possibility to a more unified approach. While the proposed DWT method is very suitable for the description of the highly impulsive features above described, the DFT is still an effective method to represent the steady-state sinusoidal distortion, as currently done in the standards. The possibility of exploring a frequency-domain method that employs a hybrid decomposition base (or dictionary) that includes both wavelets and sinusoids could provide a method to describe both parts of electric signals (steady-state and transients) with the same method. This could potentially be used to specify type tests for static electricity meters with the same methodology, provided it retains the relevant error-inducing features.