# 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.2 Singularity Analysis and Threshold Processing of Signal and Noise  
When the noisy signal \(x\) is in the interval \([a,b]\), the wavelet transform \(f(x)\) satisfies:  
\[\left|W_{f}(s,x)\right|\leq ks^{\alpha} \tag{6}\]  
where, \(k\) is constant, and \(\alpha\) is the Lipschitz index. The Lipschitz index will be used to describe singularity. The larger the Lipschitz index, the higher the smoothness of the signal points, and vice versa. If a bounded function is continuous and differentiable at a point, or if it has a derivative at that point but the derivative is discontinuous, then the Lipschitz index is 1. By taking logarithm of both sides of the inequality (6), Lipschitz index of the signal \(f(x)\) has the following relation with the module maximum of the wavelet transform: if the singularity of the real signal \(x\) is greater than zero, the maximum modulus of the wavelet transform increases with the scale. If the singularity of the signal is negative, the opposite is true. In general, the Lipschitz index of the noise function is less than zero. The noise singularity is often large in the one-dimensional signal, and the Lipschitz index is less than \(-0.5\).  
The wavelet technique is used to decompose the original signal. With the increase of scale \(J\), the average amplitude and density of the module maximum point with noise component will decrease [17].  
Signal decomposition generally starts from the maximum decomposition scale \(J\), the threshold \(Thr=C*M/J\) is set on the scale \(J\), and the module maximum point that should be retained on the maximum scale is determined by adjusting variables. Where \(C\) is the threshold parameter, according to reference [18], its value can be taken as 0.8. \(M\) is the maximum value of all module maximum in scale \(J\)[18], and it is the maximum value obtained by comparing the absolute value of the modular maximum sequence with the threshold value. Points with values less than the threshold value become zero, and points with values greater than or equal to the threshold value remain unchanged, that is, the module maximum corresponding to the position of the mutation point is retained. Although the signal characteristics can be preserved by this method, the denoised signal has burrs and slight oscillations at the singularities. The main reason is that the wavelet transform value is discontinuous at the threshold after extracting the module maximum corresponding to the position of the mutation point. In order to overcome this shortcoming, soft threshold processing can be performed on the modular maximum sequence, and the soft threshold function is:  
\[\widetilde{w}_{jk}=\begin{cases}w_{jk}-\lambda&w_{jk}\geqslant\lambda\\ 0&\left|w_{jk}\right|<\lambda\\ w_{jk}+\lambda&w_{jk}\leqslant-\lambda\end{cases} \tag{7}\]  
In the formula, \(w_{jk}\) is the wavelet coefficient and \(\lambda\) is the threshold value. The wavelet coefficient is greatly affected by noise at small scales, resulting in many pseudo-extreme points, and often the location of the mutation point cannot be located by only one scale. At large scales, the signal is processed with a certain smooth soft threshold, and the extreme value points are relatively stable. When determining the singularity of the signal by the wavelet transform module maximum method, it is necessary to combine multi-scale comprehensive observation.