| Products & Services | Solutions | Academia | Support | User Community | Company |
| Download Product Updates | | | Get Pricing | | | Trial Software |
| Documentation → Wavelet Toolbox |
| Contents | Index |
Case Study: An Electrical Signal
The goal of this section is to provide a statistical description of an electrical load consumption using the wavelet decompositions as a multiscale analysis.
Two problems are addressed. They both deal with signal extraction from the load curve corrupted by noise:
The context of the study is the forecast of the electrical load. Currently, short-term forecasts are based on the data sampled over 30 minutes. After eliminating certain components linked to weather conditions, calendar effects, outliers and known external actions, a SARIMA parametric model is developed. The model delivers forecasts from 30 minutes to 2 days. The quality of the forecasts is very high at least for 90% of all days, but the method fails when working with the data sampled over 1 minute.
Data and the External Information
The data consist of measurement of a complex, highly aggregated plant: the electrical load consumption, sampled minute by minute, over a 5-week period. This time series of 50,400 points is partly plotted at the top of the second plot in the Analysis of the End of the Night Period.
External information is given by electrical engineers, and additional indications can be found in several papers. This information, used to define reference situations for the purpose of comparison, includes these points:
From a methodological point of view, the wavelet techniques provide a multiscale analysis of the signal as a sum of orthogonal signals corresponding to different time scales, allowing a kind of time-scale analysis.
Because of the absence of a model for the 1-minute data, the description strategy proceeds essentially by successive uses of various comparative methods applied to signals obtained by the wavelet decomposition.
Without modeling, it is impossible to define a signal or a noise effect. Nevertheless, we say that any repetitive pattern is due to signal and is meaningful.
Finally, it is known that two kinds of noise corrupt the signal: sensor errors and the state noise.
We shall not report here the complete analysis, which is included in the paper [MisMOP94] (see References). Instead, we illustrate the contribution of wavelet transforms to the local description of time series. We choose two small samples: one taken at midday, and the other at the end of the night.
In the first period, the signal structure is complex; in the second one, it is much simpler. The midday period has a complicated structure because the intensity of the electricity consumer activity is high and it presents very large changes. At the end of the night, the activity is low and it changes slowly.
For the local analysis, the decomposition is taken up to the level j = 5, because 25 = 32 is very close to 30 minutes. We are then able to study the components of the signal for which the period is less than 30 minutes.
The analyzing wavelet used here is db3.
The results are described similarly for the two periods.
Analysis of the Midday Period
This signal (see Example 14: A Real Electricity Consumption Signal) is also analyzed more crudely in Example 14: A Real Electricity Consumption Signal.
The shape is a middle mode between 12:30 p.m. and 1:00 p.m., preceded and followed by a hollow off-peak, and next a second smoother mode at 1:15 p.m. The approximation A5, corresponding to the time scale of 32 minutes, is a very crude approximation, particularly for the central mode: there is a peak time lag and an underestimation of the maximum value. So at this level, the most essential information is missing. We have to look at lower scales (4 for instance).
Let us examine the corresponding details.
The details D1 and D2 have small values and may be considered as local short-period discrepancies caused by the high-frequency components of sensor and state noises. In this bandpass, these noises are essentially due to measurement errors and fast variations of the signal induced by millions of state changes of personal electrical appliances.
The detail D3 exhibits high values at times corresponding to the start and the end of the original middle mode. It allows time localization of the local minima.
The detail D4 contains the main patterns: three successive modes. It is remarkably close to the shape of the curve. The ratio of the values of this level to the other levels is equal to 5. The detail D5 does not bear much information. So the contribution of the level 4 is the highest one, both in qualitative and quantitative aspects. It captures the shape of the curve in the concerned period.
In conclusion, with respect to the approximation A5, the detail D4 is the main additional correction: the components of a period of 8 to 16 minutes contain the crucial dynamics.
Analysis of the End of the Night Period
The shape of the curve during the end of the night is a slow descent, globally smooth, but locally highly irregular. One can hardly distinguish two successive local extrema in the vicinity of time t = 1600 and t = 1625. The approximation A5 is quite good except at these two modes.
The accuracy of the approximation can be explained by the fact that there remains only a low-frequency signal corrupted by noises. The massive and simultaneous changes of personal electrical appliances are absent.
The details D1, D2, and D3 show the kind of variation and have, roughly speaking, similar shape and mean value. They contain the local short period irregularities caused by noises, and the inspection of D2 and D3 allows you to detect the local minimum around t =1625.
The details D4 and D5 exhibit the slope changes of the regular part of the signal, and A4 and A5 are piecewise linear.
In conclusion, none of the time scales brings a significant contribution sufficiently different from the noise level, and no additional correction is needed. The retained approximation is A4 or A5.
All the figures in this paragraph are generated using the graphical user interface tools, but the user can also process the analysis using the command line mode. The following example corresponds to a command line equivalent for producing the figure below.
% Load the original 1-D signal, decompose, reconstruct details in % original time and plot. % Load the signal. load leleccum; s = leleccum; % Decompose the signal s at level 5 using the wavelet db3. w = 'db3'; [c,l] = wavedec(s,5,w); % Reconstruct the details using the decomposition structure. for i = 1:5 D(i,:) = wrcoef('d',c,l,w,i); end
| Note This loop replaces five separate wrcoef statements defining the details. The variable D contains the five details. |
% Avoid edge effects by suppressing edge values and plot. tt = 1+100:length(s)-100; subplot(6,1,1); plot(tt,s(tt),'r'); title('Electrical Signal and Details'); for i = 1:5, subplot(6,1,i+1); plot(tt,D(5-i+1,tt),'g'); end
Suggestions for Further Analysis
Let us now make some suggestions for possible further analysis starting from the details of the decomposition at level 5 of 3 days.
Identify the Sensor Failure
Focus on the wavelet decomposition and try to identify the sensor failure directly on the details D1, D2, and D3, and not the other ones. Try to identify the other part of the noise.
Suppress the Noise
Suppress measurement noise. Try by yourself and afterwards use the de-noising tools.
Indication: study the approximations and compare two successive days, the first without sensor failure and the second corrupted by failure (see figure below).
Identify Patterns in the Details
The idea here is to identify a pattern in the details typical of relay-switched water heaters.
Indication: the figure below gives an example of such a period. Focus on details D2, D3, and D4 around abscissa 1350, 1383, and 1415 to detect abrupt changes of the signal induced by automatic switches.
Locate and Suppress Outlying Values
Suppress the outliers by setting the corresponding values of the details to 0.
Indication: The figure below gives two examples of outliers around
and
. The effect produced on the details is clear when focusing on the low levels. As far as outliers are concerned, D1 and D2 are synchronized with s, while D3 shows a delayed effect.
Study Missing Data
Missing data have been crudely substituted (around observation 2870) by the estimation of 30 minutes of sampled data and spline smoothing for the intermediate time points. You can improve the interpolation by using an approximation and portions of the details taken elsewhere, thus implementing a sort of "graft."
Indication: see the figure below focusing around time 2870, and use the small variations part of D1 to detect the missing data.
| Provide feedback about this page |
![]() | Illustrated Examples | Using Wavelet Packets | ![]() |

Includes the most popular MATLAB recorded presentations with Q&A sessions led by MATLAB experts.
| © 1984-2009- The MathWorks, Inc. - Site Help - Patents - Trademarks - Privacy Policy - Preventing Piracy - RSS |