{'fraction_non_alphanumeric': 0.026070867907602602, 'fraction_numerical': 0.0067840322942363755, 'mean_word_length': 4.9023825281270685, 'pattern_counts': {'":': 0, '<': 4, '<?xml version=': 0, '>': 1, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
An Improved Adaptive Time Difference Estimation Method Based on Median Filter in Impulse Environment

Boiler tube burst is the main reason for the unplanned shutdown of thermal power plants. The time difference can be estimated and analyzed by the acoustic signal generated when the boiler tube leaks, and the time difference can be converted into a distance difference to locate the leakage point. The accuracy of positioning depends on the accuracy of the time difference estimation, and the various background noises produced by the complex production environment of the boiler and the impulse noise generated by the uncertain factors in the signal acquisition circuit have a non-negligible effect on the accuracy of the time difference estimation. Aiming at the problem that the signal does not have obvious second-order statistics in the environment of impulse noise, a Wiener weighted adaptive time difference estimation method based on median filtering is proposed. First, the median filter is used to remove the impulse points in the noise to make it obey the normal distribution and have second-order statistics; Next, select the generalized correlation method based on the Wiener weighting function of linear minimum mean square error to eliminate the influence of noise; Finally, according to the characteristics of the generalized correlation method that relies on the prior knowledge of the signal but the ability to suppress noise and the characteristics of the adaptive method that the ability to suppress noise is weak but does not rely on the prior knowledge of the signal, the two methods are combined to form a Wiener-weighted generalized correlation and its adaptive method. Simulation experiments prove that the Wiener weighted adaptive time difference estimation method based on median filtering has better estimation performance under impulsive noise than the adaptive minimum average p-norm method based on fractional low-order statistics.


Introduction
At present, most signal processing models follow a normal distribution, so the signal processing methods used are mostly based on second-order moments or second-order [1] statistics, such as the mean, variance, and correlation function of random signals. And power spectral density analysis. Among the time delay estimation methods, the correlation method is the most widely studied. It is a typical time difference estimation method based on second-order statistics [2]. Aiming at the impact of environmental noise, the concept of weighting function is introduced, namely the generalized weighted correlation method [3], which can compare the correlation function the peaks in play the role of sharpening, reducing the impact of noise on time estimation. However, the noise here refers to Gaussian noise, which obeys a normal distribution. The noise should have second-order statistics such as variance and correlation function. This is the premise of using the weighted generalized correlation method.
Although signal processing methods based on Gaussian assumptions and second-order statistics [4] have been widely used, in actual situations, such as underwater sound, signal transmission in the circuit, etc., may not obey the normal distribution and do not have second-order statistics, correlation methods based on second-order statistics will fail. The literature [5] proposes a series of estimation methods based on fractional low-order statistics, such as covariation method, adaptive minimum average P-norm, etc. These methods can solve the signal of non-Gaussian model well and introduce the concept of alpha stable distribution. Since the correlation method is based on second-order statistics, its moment order is a fixed constant of 2. The method based on fractional low-order statistics has a moment order of p and is limited to (0, α), so the value of p The determination of depends on the prior knowledge or estimation of the random variable α [6].
In order to avoid the estimation of the p value, and for the impulse noise, that is, the noise that does not obey the Gaussian distribution, a median filtering method [7] is proposed. The impulse points are removed to make the noise obey the Gaussian distribution. Then the current mature generalized correlation method is selected, and according to the generalized correlation method The characteristics of relying on the prior knowledge of the signal but the ability to suppress noise [8] and the characteristics of the adaptive method that the ability to suppress noise is weak but not relying on the prior knowledge [9] of the signal combine the two methods. Through simulation, the generalized weighted adaptive correlation method based on median filter and the time difference method based on fractional low-order statistics are compared in the impulse environment with different signal-to-noise ratios. The results prove that the generalized weighted adaptive correlation method based on median filtering has good toughness under this noise condition.

Generalized Adaptive Correlation
Method Based on Median Filter

Alpha Stable Distribution Model
The alpha stable distribution [10] is a generalized normal distribution, or the normal distribution is a special distribution of the alpha stable distribution. Compared with the normal distribution, the alpha stable distribution is characterized by impulsive noise, which is expressed in the time domain of noise. It has a spike, which is expressed as an extreme point of a set of data in mathematics. Equation (1) is used as a characteristic function to describe this distribution process: (1) Where: and .

Weighted Median Filtering with Double Threshold
Median filtering refers to non-linear filtering to obtain the median of a set of data. It has a good ability to suppress impulsive noise, but the effect of median filtering is easily affected by the size of the filtering window. If the window size is too small, the impulse noise suppression effect is not good and cannot meet the requirements of signal processing; if the window size is too large, although the impulse noise is suppressed, the original signal details are also lost a lot, making the signal distortion. Therefore, it is necessary to select an appropriate filter window from the filtered signal-to-noise ratio and the root mean square error at the same time.
In response to these contradictions, many scholars have successively proposed different median filtering methods [11]. The more common ones are multiple median filtering, switching median filtering, weighted median filtering and so on. The median filtering method used in this article is based on the improvement of weighted median filtering, mainly for the improvement of the weighted median filtering to determine the signal noise points and signal points. Since the impulse points are mainly some extreme points, the double Threshold to determine whether the signal point is a noise point. The specific method is: suppose the filter window is M, and the data sample is x 1 , x 2 …x n . Use the average difference between each sample point and the maximum and minimum values as the first-level threshold of median filtering, T 1 as shown in formula (4): The specific steps of improvement are mainly divided into two steps: the first step is to find the maximum and minimum values in the sample, and compare them with the current sample value, if max-T<x<max or min<x<min+T, then this point is a possible impulse point, go to step 2. Calculate the average gray value ave of all pixels in the filter window. If |x-ave|-T 1 >0, the point is confirmed as an impulse point, it will be weighted so that it is arranged at both ends of the sample, and the median output is performed. The flowchart is shown in Figure 1: Median Filter in Impulse Environment

WP Weighted Correlation Method and Its Adaptive Realization
The principle of Wiener weighting is to use the Wiener filter [12] to make an optimal estimation of the processed signal under the criterion of minimum mean square error, and then calculate the correlation function for the noisy signal. Figure 2 is a schematic diagram of Wiener weighting. Where s(n) is the signal to be processed, v1(n) and v2(n) are noise, H1(f) and H2(f) are the weighting functions of the Wiener filter, and its function is to combine x1(n) and The source signal s(n) in x2(n) is separated, that is, the influence of noise is suppressed, thereby improving the signal-to-noise ratio and improving the accuracy of time difference estimation. The specific process is: The estimated value of x1(n) is , and the estimated value of x2(n) is . The minimum mean square criterion can be expressed as: Where: Among them, * represents the convolution operation, and h1(n) and h2(n) respectively represent the time-domain form of Wiener filtering. So the weighting function of Wiener filtering can be expressed as: Among them , , , and are the self-power spectra of the source signal s(n), the noise signal v1(n) and v2(n), respectively. And , therefore, formula (11) and formula (12) can be further simplified as: So we can finally deduce the weighting function of Wiener as: (13) The process of realizing self-adaptation is actually the process of decomposing the Wiener weighting function into two Roth weighting functions, and then using the relationship between the Roth [13] function and the adaptive filter to realize the self-adaptation of the weighting function. The specific process is as follows: Write the Wiener weighting function represented by formula (14) as: (14) Then decompose formula (15) into two Roth functions as: According to the previous statement, the Roth function is equal to the weight vector of the adaptive filter, so Among them, represents the estimation of the weighting function at time n. And can be expressed as two adaptive filters of Roth weighting function respectively. Figure 3 is a block diagram of the Wiener weighted correlation method and its adaptive implementation. In Figure 3, the right side is the basic block diagram of the LMS adaptive time difference estimation method [14], the left x1(n) and x2(n) are input to two Wiener adaptive filters, and the output y1(n) and y2(n), and then input to the LMS adaptive time difference estimation on the right and estimate it.

Adaptive Minimum Average p-norm Estimation Method
The noise model studied in this chapter obeys the alpha stable distribution, and it does not have second-order statistics. Therefore, if the generalized correlation method and the adaptive time difference estimation method (LMSTDE) are directly used without processing, the algorithm will not converge or get an incorrect estimate. result. Section 2.2 of this chapter is to first process the median filtering of the noise to restore it to a normal distribution, and then use a combination of generalized correlation method and adaptive filter; if the median filter is not used, only score-based Time difference estimation method based on low-level statistics. The self-adaptive minimum average P-norm time difference estimation method [16] is an improvement on the LMSTDE for the noise characteristics of the fractional low-order statistics [15].
LMSTDE is based on the minimum mean square error criterion, and its cost function is the mean square error function, as shown in formula (18) In an impulsive environment, due to the existence of abnormal data such as extreme values in the sample, the square error is very sensitive to these abnormal data, which may cause the algorithm to fail to converge. Therefore, the improvement of LMPTDE over LMSTDE is mainly to replace the cost function based on the least mean square with the average P-norm function, as shown in equation (21): It can be seen from equation (21) that the error functions of LMPTDE and LMSTDE are the same, but the order of the moments are different. The second-order moment in LMSTDE and the fractional lower-order moment in LMPTDE. The order p of the moment in LMPTDE is usually limited within the range of, so the determination of p value depends on the understanding and estimation of the prior knowledge of the value of random variable, so the choice of p value will still affect the final estimation result.
Both LMPTDE and LMSTDE use the steepest descent method to find the minimum value of the cost function, and the iterative formula is generally:

Simulation Experiment
Through simulation experiments, the WP generalized adaptive correlation method based on median filtering proposed in this paper and the LMP algorithm are compared in the impulse noise environment with different signal-to-noise ratios. Construct two received signals according to the signal and noise model. The noise-free signal s(n) is generated by a 6th-order Butterworth low-pass filter with a bandwidth of 0.1, and s(nD) is shifted to the right by the sequence of s(n) by D-One point is generated, the length of the signal is 10000 points, the sampling frequency is 10MHZ, S2(n) is 1000 sampling points later than s1(n), and the instant difference is 100us. Experiment 1, perform median filtering on signals containing impulse noise. Figure 4 is the comparison of the input signal before and after adding noise. The upper part is the signal before noise is added, and the lower part is the signal after noise is added. After the noise is added, it is obviously impulsive and no longer obey the normal distribution. Through the median filtering method introduced in section 2.2, the input signal is processed by median filtering. The processed signal is shown in Figure 5.  It can be observed from Figures 4 and 5 that the pulse points of the signal are well eliminated. In order to judge whether it obeys the normal distribution, use the QQ chart in the SPSS statistical tool to analyze, as shown in Figure 6, the signal points are Basically all fall on the diagonal line, indicating that it approximately obeys the normal distribution. Experiment 2, the WP weighted correlation method and its adaptive minimum average p-norm to compare the estimation performance of the time delay after its adaptation.
The minimum average p-norm algorithm is directly aimed at the environment with impulsive noise, and does not need to be processed with median filtering; while the generalized correlation adaptive time delay estimation method has been explained in the previous section, first, the impulsive noise is done. The processing of value filtering makes the processed noise obey the normal distribution, and then uses the generalized correlation adaptive method to process. This experiment compares the estimation performance of these two methods in a noise environment with a signal-to-noise ratio of 10db and 0db. Figures 7 and 8 are respectively the simulation diagrams of the estimation effect of LMS-WP and LMP algorithms when the signal-to-noise ratio is 10db. The abscissa of the weight vector distribution curve is the delay point, and the ordinate is the normalized weight vector., The maximum value of the weight vector corresponds to the point of time delay; the convergence curve represents the number of algorithm iterations in the entire estimation process. From Figures 7 and  8, it can be observed that when the signal-to-noise ratio is high, the two algorithms have higher estimation accuracy and good convergence, but the estimation effect of LMS-WP is better. a) Weight vector distribution curve   Figures 9 and 10 are respectively the simulation diagrams of the estimation effect of LMS-WP and LMP algorithm under the environment of 0db SNR. It can be observed that even if LMS-WP is under the environment of low SNR, its estimation The effect is not much different from the effect estimated in the 10db environment, and still has high estimation accuracy and good convergence; while the weight vector distribution curve of the LMP algorithm has been unable to observe the point corresponding to the maximum value of the weight vector, in the convergence curve Even if the maximum number of iterations is reached, it cannot converge to an accurate peak, indicating that the LMP algorithm has lost its estimation performance in 0db environment.    As shown in Table 1, the data of the mean, variance, and number of iterations estimated by the LMS-WP and LMP algorithms are given. In the environment of high SNR and low SNR, the variance of LMS-WP is smaller than that of LMP, Which shows that the estimation accuracy and estimation results of the LMS-WP algorithm are more stable; and the number of iterations of the LMS-WP algorithm is also one order of magnitude smaller than that of the LMP algorithm. Therefore, it can be observed from the data in Experiment 3 and Table 1 that the LMS-WP based on the median filter has better performance than the LMP algorithm, no matter in the high signal-to-noise ratio or the low signal-to-noise ratio impulsive noise environment. Better estimation performance.

Conclusion
Although the estimation method based on fractional low-order statistics (such as LMP) has a good estimation effect on impulse noise, the parameter p of its fractional low-order moment is an uncertain value, and poor selection will reduce the estimation effect; and this article The proposed generalized correlation method based on median filtering can filter impulse noise first, and then use correlation method, which can avoid the selection of p-value. Secondly, in view of the generalized method has good ability to suppress noise but requires prior knowledge of the signal, while the adaptive method does not require prior knowledge of the signal but is susceptible to noise interference, this paper adopts the weighted generalized correlation method and adaptive filter. The combination (such as LMS-WP) can complement each other. Therefore, the LMS-WP is less affected by noise in the experiment, and the estimated result