# Research on Leakage Location of Pipeline Based on Module Maximum Denoising
## 2 Materials and Method
### A Novel Denoising Method Based on Improved Module Maximum
#### 2.1.3 Signal Decomposition and Reconstruction Principle  
The Mallat algorithm convolves the vector (low frequency) to obtain low frequency information. The vectors are then also convolved to obtain high frequency information. The frequency of the signal changes with time, and this change can be divided into two parts: slow change and fast change. The slow change part corresponds to the low-frequency part of the signal, representing the main outline of the signal, while the fast change part corresponds to the high-frequency part of the signal, indicating the details of the signal.  
Let \(\phi(t)\) and \(\varphi(t)\) be the scale function and wavelet function of the function \(f(t)\) at \(2^{j-1}\)--resolution approximation, respectively, then its discrete approximation part \(A_{j}f(t)\) and detail part \(D_{j}f(t)\) can be expressed as:  
\[A_{j}f(t)=\sum\limits_{k=-\infty}^{\infty}C_{j,k}\phi_{j,k}(t) \tag{8}\]  
\[D_{j}f(t)=\sum\limits_{m=-\infty}^{\infty}D_{j,m}\psi_{j,m}(t) \tag{9}\]  
According to the decomposition idea of [PERSON]'s algorithm, \(A_{j}f(t)\) is decomposed into rough part \(A_{j+1}f(t)\) and the detailed part \(D_{j+1}f(t)\):  
\[A_{j}f(t)=A_{j+1}f(t)+D_{j+1}f(t) \tag{10}\]  
where \(A_{j+1}f(t)=\sum\limits_{m=-\infty}^{\infty}C_{j+1,m}\phi_{j+1,m}(t)\); \(D_{j+1}f(t)=\sum\limits_{m=-\infty}^{\infty}D_{j+1,m}\psi_{j+1,m}(t)\).  
\[\sum\limits_{m=-\infty}^{\infty}C_{j+1,m}\phi_{j+1,m}(t)+\sum\limits_{m=- \infty}^{\infty}D_{j+1,m}\psi_{j+1,m}(t)=\sum\limits_{k=-\infty}^{\infty}C_{ j,k}\phi_{j,k}(t) \tag{11}\]  
where, \(C_{j+1,m}\) and \(D_{j+1,m}\) are the expansion coefficients on the scale, and the former is the scale coefficient, and the latter is the wavelet coefficient.  
From a two-scale equation:  
\[\begin{cases}\phi=\sqrt{2}\sum\limits_{k=-\infty}^{\infty}h(t)\phi(2t-k)\\ \Psi=\sqrt{2}\sum\limits_{k=-\infty}^{\infty}g(k)\phi(2t-k)\end{cases}\text{ and orthogonality:}\]  
\[C_{j+1,m}=\sum\limits_{k=-\infty}^{\infty}h^{*}(k-2m)C_{j,k} \tag{12}\]  
\[D_{j+1,m}=\sum\limits_{k=-\infty}^{\infty}g^{*}(k-2m)C_{j,k} \tag{13}\]\[C_{j,k}=\sum_{k=-\infty}^{\infty}h(k-2m)D_{j+1,m}+\sum_{k=-\infty}^{\infty}g(k-2m)D _{j+1,m} \tag{14}\]  
So, we can perform fast wavelet decomposition and reconstruction of the signal according to the above formula.  
In summary, the denoising process of the algorithm proposed in this paper is as follows:  
Step 1: Perform a wavelet transformation on the noisy signal, and find the module maximum value of the transformation coefficient on each scale, and the maximum value of \(J\) is generally 4 to 6.  
Step 2: Starting from the largest scale, a threshold is determined according to the scale. The module maximum point greater than the threshold is retained on this maximum scale, and the modulo extreme point less than the threshold is removed to obtain a new module maximum sequence on the maximum scale.  
Step 3: On scale \(J-1\), set the threshold \(Thr=C*M^{2}/\log(J+1)\) to determine whether its module maximum point is greater than the threshold on its scale, and leave the maximum point greater than and in the search region corresponding to scale \(J\) otherwise zeroed. Soft threshold function processing can also be considered: soft threshold processing is performed on the module maximum sequence to obtain a new set of module maximum points on the maximum scale.  
Step 4: Repeat step 2 with \(J=J-1\) until \(J=2\).  
Step 5: On the extreme point position saved at \(J=2\), find the corresponding extreme point at \(J=1\), and remove it.  
Step 6: Use the modulus extremum points retained on multiple scales and reconstruct them by the interleaved projection method.  
Step 7: The denoising signal will be used for leak detection and location of water supply pipelines.