The signal trend term can seriously affect the accuracy of signal anomaly detection methods.Therefore,it is very important to eliminate the trend term in the process of signal preprocessing.High-pass filtering has been proved to be a simple and efficient trend term elimination method.In this work,the positive and negative interval statistical distribution of the signal is first obtained.Then,a judgment criterion for the trend item is proposed.On this basis,a real-time optimal selection method of the cut-off frequency of a high-pass filter is designed to realize the adaptive elimination of the signal trend,and the factors influencing the efficacy of the proposed method are ana-lyzed.The algorithm was then improved to give the high convergence speed and reduced calculation amount required for practical application.Finally,the proposed method was employed using the pressure signal data in a pipeline leakage monitoring problem.The experimental results show that this method can realize real-time optimal selection of the cut-off frequency,and the calculation quantity of the algorithm is small.