# 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 method is based on adaptive filtering [149; 155; 156; 186]. It works this way: first we partition a time series into many segments. Let the length of each segment be \(w=2n+1\) points, and neighboring segments overlap by \(n+1\) points. As we will see later, using segments with length containing odd number of sample points ensures symmetry. This operation also introduces a time scale \(\frac{w+1}{2}\tau=(n+1)\tau\), where \(\tau\) is the sampling time. For each segment, whose sample points represent a small portion of the curve we are studying, we assume the curve can be approximated by its Taylor series expansion very well. This suggests us to fit the segment by a polynomial of order \(M\). Minimizing the error, the obtained polynomial fitting becomes the best local fitting. Here, an important parameter is the polynomial order \(M\). When \(M=0\), the fitting is piece-wise constant. When \(M=1\), the fitting is locally linear (not necessarily also globally linear). Let \(y^{(i)}(l_{1})\), \(y^{(i+1)}(l_{2})\), \(l_{1},l_{2}=1,\cdots,2n+1\) be the fitted polynomial for the \(i\)-th and \((i+1)\)-th segments. The fitting for the overlapped part of the two adjacent segments can be obtained by properly combining these two polynomials:  
\[y^{(c)}(l)=w_{1}y^{(i)}(l+n)+w_{2}y^{(i+1)}(l),\quad l=1,2,\cdots,n+1 \tag{96}\]  
The two weights, \(w_{1}=\big{(}1-\frac{l-1}{n}\big{)},w_{2}=\frac{l-1}{n}\), can be written as \((1-d_{j}/n),j=1,2\), where \(d_{j}\) are the distances of the point from the centers of the two fitted polynomials. Therefore, the weights decrease linearly with the distance from the center of the segment. The weighting ensures symmetry. The scheme ensures that the overall fitted curve is continuous everywhere, has the right- or left-derivatives at the boundary, and is differentiable at non-boundary points. The adaptive filter can readily determine any kind of trend from the data. An example for determining the trend from the global annual sea surface temperature (SST) data is shown in Figure 24a, where the blue straight line is the global linear fit, the black curve is the global second-order polynomial fit, and the red curve is the adaptive trend with a window size about the half of the total data length. It is amazing that with such a large window size, not only the global warming trend but also the local brief cooling periods are clearly shown. In fact, the residual noise (i.e., the difference between the fitting and the original data) shown in Figure 24b with these fits is comparable to that obtained by empirical mode decomposition (EMD) [187]. Since EMD involves dyadic decomposition, while the window size used by the adaptive method is continuous, the adaptive filtering is more flexible and can be accurate. Figure 24: Analysis of the annual sea surface temperature (SST) data: (**a**) the original data and trend signals of different resolutions, (**b**) the residual signals. Note that whether the trend is considered noise or the desired signal depends on one's purpose. When the trend is considered noise, the approach is a high-pass filter. When the trend signal is considered the desired signal, then the approach is a low-pass filter. We can also take two window sizes and determine two trend signals. If we take the difference between them, then the approach becomes a band-pass filter. More generally, if we use a series of window sizes, \(w_{1}=2n_{1}+1<w_{2}=2n_{2}+1<w_{3}=2n_{3}+1<\cdots\) and get the corresponding trend signals. The difference between the two trend signals of window sizes \(w_{i}=2n_{i}+1\) and \(w_{j}=2n_{j}+1\) is called a band-limited signal, with cutoff frequencies \(1/(n_{i}\tau)\) and \(1/(n_{j}\tau)\), where \(\tau\) is the sampling time. These signals are called intrinsically band limited functions (IBFs) [154]. For an interesting application of the scheme (removing an ECG component from an EEG measurement for the study of apnea), we refer to [156].