# Complex Systems, Emergence, and Multiscale Analysis: A Tutorial and Brief Survey
## 3 Adaptive Detrending, Denoising, Multiscale Decomposition, and Fractal Analysis
### Adaptive Detrending, Denoising, and Multiscale Decomposition
The adaptive filter discussed here is more effective than linear filters, the wavelet method, and chaos-based approaches in reducing noise [155; 156]. To see this, we have shown a comparison of these methods in Figure 25 for reducing measurement noise in the chaotic Lorenz system. The residual noise, characterized by the root-mean-square error (RMSE), is the smallest for the adaptive filter [154]. To better appreciate the above discussed properties of the filter, let us consider a power load time series measured at a power plant in Guilin during a long time period (from 1 January 2005 to 29 April 2010). Guilin is a very well-known tourism city, with the saying \"Guilin's landscape is the most uniquely beautiful in the world\". Power load time series may be equated to electricity consumption in a city. Interesting questions one can ask include whether electricity consumption may be correlated with climate variations. The raw load time series from Guilin is shown in Figure 26a as the blue curve. Here, the sampling time is 15 min. We observe that the data are very irregular and non-stationary, reflecting that the city's businesses and population must have been changing a lot during  
Figure 25: Denoising of the chaotic Lorenz signal: (**a**) phase diagrams constructed from the the clean and the noisy signal, which are marked as green and red, respectively; (**b**) the filtered signal obtained by a chaos-based approach; (**c**) the filtered signal obtained by the adaptive algorithm; and (**d**) the filtered signal obtained by a wavelet method. the period the data were collected. The trend signal for the raw data is shown in Figure 26a as the red curve; it is obtained by using a window size of 699 sample points. The order of the polynomial used for fitting is 2 (if the raw signal is very spiky, then higher-order polynomials are recommended). To facilitate further discussion, we denote the raw data by \(x(t)\), and the trend signal by \(\textit{trend}(t)\). Then we have  
\[x_{\textit{detrended}}=x(t)-\textit{trend}(t) \tag{97}\]  
In order to see the details of \(x_{\textit{detrended}}\), Figure 26b shows a small segment of it as the blue curve. We observe a diurnal cycle in the data. This is reasonable since electricity consumption in daytime and during night has to be quite different. The signal does not have a fixed amplitude though, as it is still quite noisy. This noise, which is high frequency, can also be removed by applying the adaptive filter again, with a small window size. The trend thus determined will better represent the diurnal cycle. It is a band-pass signal. An example of this signal is shown in Figure 26b as the red curve, where we used a window size of 9 and a polynomial of order 2. From this signal, we can construct a phase diagram with delayed coordinates. This is shown in Figure 26c. A limit cycle-like structure does emerge. We can further analyze the oscillatory feature of the trend signal by computing power-spectral density (PSD) from the data. The result is shown Figure 26d, where the blue, red, and green curves are for the raw, detrended, and the band-passed signals, respectively. The PSD curves show very sharp spectral peaks at frequency of 1 day\({}^{-1}\) and its harmonics. Note the blue curves are basically covered by the other two colors, except at the very low frequency (i.e., close to 0 Hz). This is due to the red trend signal shown in Figure 26a. Figure 26: Electricity consumption analysis: (**a**) raw data (blue) and the trend signal (red); (**b**) enlargement of the high-frequency load data showing the diurnal cycle (blue) and its filtered band-pass data (red); (**c**) 2D phase diagrams constructed from the data shown in (**b**); (**d**) PSD for the raw, detrended, and denoised data, which are marked by blue, red, and green, respectively.