复杂环境下高速铁路与城市轨道工程建养技术:第四届铁道工程关键技术国际学术会议论文集
上QQ阅读APP看书,第一时间看更新

COMPARISON OF FILTERING ALGORITHMS FOR RAIL PROFILE

Pengpeng WU,Junjun DING,Fu LI

School of Mechanical Engineering,Southwest Jiaotong University,Chengdu 610031

Abstract:The measured rail profile is of great significance for the rail wear and failure analysis,and it can be used to guide the rail grinding,repairing and exchanging.The measuring error has an important influence on the grinding and profile optimization of rails.In order to reduce the effect of the measuring error on the rail’s testing and analysis,there is a necessary to smooth the measured rail data.Four common methods that are,moving average filter,Gauss filter,Savitzky-Golay smoothing and median filtering are analyzed and compared in this paper.After the calculations of fitness(F),smoothness(S),run time(RT)and convergence of every method,the merits and demerits of each method is obtained,then there comes conclusion that the Savitzky-Golay method is relatively suitable for smoothing the measured rail profile.

Keywords:rail profile,moving average,Gaussian filter,Savitzky-Golay smoothing,median filter

Email:upeng1225@my.swjtu.edu.cn

1 Introduction

Problems of rail wear and rail injury affect the stability and safety of train operation seriously.In order to solve those problems,regular rail testing is a necessary procedure to obtain the rail wear results,detect rail problems in time and guide the process of rail grinding,repairing and exchanging.Due to the equipment’s deviations,unsuitable operations and other environment disturbances,inevitably,there exists measuring errors,and there is a great risk to generate serious measurement deviations from the real rail profile.In addition,there are still quite a number of cyclical or occasional glitches.Thus,there is a tremendous need to further smooth the measured rail data and eliminate outliers,for obtaining high quality rail profiles without deformations.Rail profile data is usually a plane curve made up of ordered points,the common smoothing and filtering methods are moving average filtering(M-A for short),Gaussian filter(G-F),Savitzky-Golay smoothing(S-G)and median filtering(M-F).

2 Principle Analysis on Smoothing Algorithms of Rail Profile

2.1 M-A filter

For an ordered point set Xi(i=1,n),the M-A method is to calculate the average value of M points(Xk-p-Xk+q)as the kth point’s smoothing result,so as to reduce the random error of measurement,which can be expressed as following:

where,m=p+q+1(usually,p=q),m is called the window size,which directly affects the smoothing effect;uiis the weight number,for simple method,ui=1.

2.2 G-F

G-F assumes that the measurement noises obey the Gaussian distribution,then Gaussian function can be used as the weight function to calculate the weighted average value of all points in the window,thus to eliminate the measurement error.It can be regarded as an advanced moving weighted average method.It can be expressed as the following two formulas:

As we know,the values of Gaussian function beyond the section [-3σ,3σ] are so small that can be omitted,thereby the formula of G-F can be changed into the weighted M-A formula as shown below:

where,{Ui/W} is the kernel or template function of G-F,σ can be calculated from the setting value of w.Then Gaussian smoothing is to calculate the convolutions of kernel function and the curve data.

2.3 S-G smoothing

2M+1 adjacent points of Xiare taken window by window to calculate the smoothing results of S-G method,according to the following formula:

where,A=hi/H is the convolution factor which can be calculated based on the theory of least squares polynomial fitting.The S-G method is to calculate the convolutions of the convolution factor A and the original data Xi.

The following N-rank polynomial can be used to fit a set of 2M+1 points:

The residual error of least square fitting ɛNis as follows:

S-G smoothing is aimed at minimizing the residual εN,by that means the convolution factor A can be obtained as below:

A=(BTB)-1BT  (10)

where,B={bnk},bnk=nk,n=-M-M,k=0,1,…,N.

2.4 M-F

M-F is a nonlinear smoothing method that uses the midpoint of all points in a neighborhood window as the smooth result.

Nothing will change if the points are strictly in order.Since the sorting time increases rapidly with the rising of window size,it is necessary to find a faster soring algorithm for median filter.

3 Evaluation Indicators of Filtering Algorithms

According to the criteria of Whittaker graduation and Vondrak filter,the following concepts can be introduced as the smoothing evaluation indicators:goodness-of-fit(or fitness)F and smoothness S.

where,

kxi=∆k−1xi+1−∆k−1xi  (14)

The smaller F is,the less the difference between the smoothing result and the original curve.The smaller S is,the smoother filtering result is.

What’s more,the aim of Vondrak smooth is to minimize the folowing formula:

Q=F+λ2S=min

If λ2is close to 0,Q ≈ F,the above formula is to make F closer to 0,then the result is more conform to original curve.In the other hand,ifλ2is quite large and close to infinity,Q ≈ S,then the result is even smoother,and closer to the parabola.

For the measured rail profile(two dimensional data){(xi,yi)| i=1-N},the average fitness Faand the average smoothness Saare used instead of F and S,so as to eliminate the effect of point density on the calculations,as shown in Formula(15)and(16):(Usually pi=1)

4 Analysis and Comparison of Each Method

According to the formulas above,a group of measured rail profiles are used to carry out the follwing calculations and analysis,where the window size is in the range of 3-31.

4.1 Relation between window size and filtering effects(Fitness F and Smoothness S)

As can be seen in Figure 1,with the increasing of window size,the filtering results of all the above algorithms are getting smoother,but the difference between the results and the original curve is growing larger.

Figure 1 Relation between window size and filtering evaluation factors F & S

4.2 Comparison of filtering evaluation factors of smoothness,fitness and run time

Figure 2 shows that the fitness F of M-A increases most rapidly in all,while the fitness of median filter is the smallest in those 4 methods.The fitness F of S-G is very close to that of G-F when the window size is small(<15);but with the increasing of window size,the fitness of S-G method is gradually getting smaller than that of G-F.

As can be seen in Figure 3,compared to the original smoothness,the change of median filter’s smoothness S is the smallest in 4methods,while the smoothness of the other three methods is gradually approaching to 0,with the rising of the window size.

Figure 2 Comparison of fitness

With regard to the run time RT,only the time of median filter is increasing rapidly with the rising of window size,as shown in Figure 4.Because of the differences in programming logics,computing algorithms as well as the running environment(hardware and software),the efficiency of each algorithm cannot be simply compared by the run time.

Figure 3 Comparison of smoothness

Figure 4 Comparison of average run time

4.3 Repeatability and convergence

The phenomenon of expansion,shrinkage or deformation may take place in the process of curve smoothing.By repeating curve smoothing many times,we can figure out whether these phenomena will occur.When the window size is 29,gradually increasing the times of smoothing and filtering,the smoothing results of each algorithm are as shown in Figure 5.

As shown in Figure 5(a)and Figure 5(b),both M-A and Gauss filter will cause shrinkage.Finally the result of M-A converges to a straight line,while the result of G-F converges to a point.What’s more,the convergence speed of G-F is faster.Due to the use of convolution,the two sides of G-F result are obviously deformed.

The S-G method is a kind of polynomial fitting,its deformation rate is veryslow,the deformation is still not quite obvious by repeating the smooth 2000 times,as shown in Figure 5(c).According to Vondrak’s theory,the smoothing result of S-G converges to a parabola when the smoothing times are quite large.

Median filter is a nonlinear smoothing method,it almost don’t cause stretching and distortion,as shown in Figure 5(d),but there is a strcit requirement for the orderliness of the curve.

Figure 5 Repeatability of each method

5 Filtering Examples

According to the calculation results above,there comes to the conclusion that the S-G method is more suitable for the rail profile’s smoothing.As shown in Figure 6,Figure 7 and Table 1,S-G method not only has a quite good smoothing effect,but also almost doesn’t change the appearance of the original curve,whether the noise is pulse or periodic.

Table 1 Results of filtering examples

Figure 6 Smoothing of rail profile with slight disturbance

Figure 6 shows the filtering results of rail profile with pulse noise.Most of the smoothing result is basically consistent with the original curve,and the pulse noise is filtered out at the same time.

Add normal noise(µ=0,σ=0.3)to the standard rail curve,then use S-G method to smooth the curve,the result is as shown in Figure 7,the noise has been filter out successfully.

Figure 7 Smoothing of rail profile with violent disturbance

6 Conclusions

(1)With the rising of window size,smoothing effect of each method in the paper is getting better.

(2)M-A method is quite simple,and it can be applied to the situation in which the requirements are not so high.

(3)Gauss filter can effectively filter out the periodic noises,but will produce shrinkage.

(4)Median filter can only filter out the pulse interference,but its smooth effect is very small.

(5)S-G smoothing is more suitable for filtering the rail profile.Compared to the other algorithms,the application of S-G method is wider,and its results are more stable.

Acknowledgement

This work was supported by the National Natural Science Foundation of China(No.51305359),the China Postdoctoral Science Foundation(No.2015T80988,No.2013M542291).

References

[1]Savitzky A.,Golay M.J.E.,1964.Smoothing and Differentiation of Data by Simplified Least Squares Procedure[J].Analytical Chemistry,36:1627-1639.

[2]Vondrak J.,1969.A Contribution to the Problem of Smoothing Observational Data[J].Bull.Astron.Inst.Czechoslov,20(6):349-355.

[3]Vondrak J.,1977.Problem of Smoothing Observational Data II[J].Bull.Astron.Inst.Czechoslov,28(2):84-89.

[4]London D.,1985.Graduation:the Revision of Estimates[M].Connecticut:Actex Publications.

[5]Alvarez-Ramirez J.,Rodriguez E.,Echeverria J.C.,2005.Detrending Flucluation Analysis Based on Moving Average Filtering[J].Physica A:Statistical Mechanics and its Applications,354(2):199-219.

[6]Li H.L.,Zhang Z.M.,Yi Z.Q.,2004.The Application of Median Filtering on Image Processing[J].Information Technology,28(7):26-27,52.

[7]Lei L.P.,2014.Curve Smooth Denoising Based on Savitzky-Golay Algorithm[J].Computer and Information Technology,22(5):30-31.

[8]Zhang Y.G.,Huang Y.L.,Zhao L.,2015.A General Framework Solution to Gaussian Filter with Multiple-step Randomly-Delayed Measurements[J].Acta Automatica Sinica,41(1):122-135.

ICRE2016-International Conference on Railway Engineering