# Vehicle Trajectory Reconstruction Using Lagrange-Interpolation-Based Framework
## 4 Results  
DWT based on the Symlet8 wavelet framework was used to identify outliers with a judgment threshold. The judgment threshold is \([-8\text{ m/s}^{2},\text{ }5\text{ m/s}^{2}]\) in the limit value of human body bearing and vehicle dynamic performance. The outlier detection formula is defined by Equation (13). \[S_{j}^{z}=\mu_{j}\pm z\times\sigma_{j} \tag{13}\]  
where \(S_{j}^{z}\) is the limit of drift data; \(\mu_{j}\) is mean value; \(\sigma_{j}\) is standard deviation; \(z\) is the coefficient of standard deviation, and it is taken as 1.96 under the 95% confidence interval. The identification and re-estimation results of the proposed method are shown in Figure 5. The frequency spectrum deeply analyzes the characteristics of the data source system and determines whether there is noise in the vehicle trajectory data. Figure 5 shows that the wavelet transform based on Symlet8 has better performance in the recognition of outliers. Figure 5b shows that only 4.14% of the acceleration exceeded the limit of human body bearing and vehicle dynamic performance. The re-estimated trajectory data are more gentle than raw data. However, there are still data with frequencies greater than 2 Hz in Figure 5c. It is necessary to reduce the noise interference in the trajectory data. Figure 4: The process of the prediction and update of Kalman filter. The Kalman filter is used to reduce noise interference. The noise covariance is set to a constant. The initial value of estimation error covariance \(P(0)\) is 1. It can avoid the value of state estimation always being equal to the initial value. In order to determine the optimal filter parameters, this paper establishes the optimal filter parameter model. It is defined by Equations (14)-(16). \[[Q,R]=f\Big{(}R_{signalenergy},acceleration\Big{)} \tag{14}\]  
\[S.T. \begin{cases}\min(Rsignalenergy\geq 95\%)\\ \quad\quad\quad\quad\quad\quad\quad acceleration|\leq 5m/s^{2}\\ \quad\quad\quad\quad\quad\quad\quad\quad\quad\quad\quad\{Q,R\}\subseteq T\\ T=\{0.01,0.02,0.03,\cdots,1\}\end{cases}  \tag{15}\]  
\[R_{signalenergy}=\frac{\sum|x(t)|^{2}_{filtered}}{\sum|x(t)|^{2}_{original}} \times 100\% \tag{16}\]  
where \(R_{signalenergy}\) represents the signal energy ratio; \(x(t)_{original}\) and \(x(t)_{filtered}\) are the state values before and after filtering, respectively. The \(Q\) and \(R\) are in the interval [0, 1] and increase at intervals of 0.01. The values of \(Q\) and \(R\) are 0.05 and 0.15 by iterative calculation. The results of denoising are shown in Figure 6.  
Figure 6 shows that the speed of the trajectory data is smoother, and the acceleration value is within the limits. Figure 6c shows that the amplitude of data frequency is less than 1 Hz. The Kalman filter is a recursive filter used to estimate the state of a dynamic system, such as a traffic system or power system. It uses a series of measurements to produce an estimate that is closer to the true state than any individual measurement and can better adapt the geometric curve function input of the Lagrange interpolation polynomial in the processing of vehicle trajectory reconstruction. In order to demonstrate that the Kalman filter has better denoising results in vehicle trajectory reconstruction, the paper compares the denoising results among the different variants of filters, such as the Savitzky-Golay (S-G) filter, symmetric exponential moving average (SEMA) filter and extended Kalman filter (EKF). Figure 5: The outlier processing results. (**a**) shows the speed processing effects. (**b**) shows the acceleration processing effects. (**c**) shows the frequency spectrum of acceleration. Figure 7 shows that the Kalman filter is more sensitive to the observation noise and reduces the error of the re-estimation data in the trajectory data, compared with SEMA and EKF, such as the speed point at the 37 th second (see Figure 7a) and the acceleration at the 26 th second (see Figure 7b). The S-G filter can greatly remove the noise in the vehicle trajectory (see Figure 7c) but causes excessive denoising in some data.