Improving GPS Precision and Processing Time using Parallel and Reduced-Length Wiener Filters
JJOURNAL OF TELECOMMUNICATIONS, VOLUME 2, ISSUE 2, MAY 2010 91 © 2010 JOT http://sites.google.com/site/journaloftelecommunications/
Improving GPS Precision and Processing Time using Parallel and Reduced-Length Wiener Filters
Javier Garcia and Chi Zhou
Abstract — Increasing GPS precision at low cost has always been a challenge for the manufacturers of the GPS receivers. This paper proposes the use of a Wiener filter for increasing precision in substitution of traditional GPS/INS fusion systems, which require expensive inertial systems. In this paper, we first implement and compare three GPS signal processing schemes: a Kalman filter, a neural network and a Wiener filter and compare them in terms of precision and the processing time. To further reduce the processing time of Wiener filter, we propose parallel and reduced-length implementations. Finally, we calculate the sampling frequency that would be required in every Wiener scheme in order to obtain the same total processing time as the Kalman filter and the neural network.
Index Terms — GPS, precision, processing time, Wiener filter. —————————— (cid:1) ——————————
1 I
NTRODUCTION
GPS (Global Positioning System) is a global navigation satellite system that determines the position of any target by measuring the propagation delay of the signals from the satellites to the GPS receiver. Typically four or more satellites need to be tracked to calculate the position. GPS was developed by the US Department of Defense (DoD) in the 70s only for military purposes (positioning, naviga-tion and weapons aiming). In fact, DoD included a distor-tion in the GPS signal called Selective Availability (SA) so that other people would not obtain good precision. No-wadays, however, GPS is used worldwide for civilian applications (e.g. driving assistance, topography, atmos-phere study…) and that is why DoD decided to remove the SA. Part of the current research on GPS is focused on in-creasing precision and combating signal outages by means of external aids, such as INS (Inertial Navigation Systems). The main problem here is how to combine the GPS signal with these aids. The two main solutions are using a Kalman filter and neural networks. The Kalman filter is a recursive filter used to estimate the state (in our case position) of a dynamic system and was proposed in 1960 by Rudolf Kalman [1] as an improvement over the linear predictors of that time. On the other hand, neural networks consist of interconnecting programming struc-tures (neurons) that simulate the properties of the biolog-ical neural system. They adapt their response according to their training inputs so that they can be programmed for predicting the value of a signal considering different inputs (i.e. GPS and INS). Another branch of the current research focuses on in- creasing precision just by means of processing the GPS signal (without INS). As [2] and [3] show, very accurate results can be obtained without spending money on in-stalling inertial systems in every receiver. Again, the most frequently used mechanisms for this technique are Kal-man filter and neural networks (and their different confi-gurations: radial and fuzzy). In [2] Kalman filter and neural network performances are compared in a differen-tial GPS scenario. The result is that the former is slightly more accurate but much slower. Therefore, if we want to keep the Kalman filter precision but also a fast response, we need to find a way of reducing its processing time. In [4] the authors propose using a parallel structure so that the filtering process is done concurrently. Unfortunately, the results are not very promising: processing time is re-duced only by a 5.66% (from 6.36ms to 6ms). The main problem for implementing a parallel version of the Kal-man filter is that it is not a linear filter (i.e. it has no im-pulse response), so there are not systematic means for achieving the parallel scheme. Another possibility is using linear filters for prediction such as the Wiener filter. The Wiener filter was studied in [1] and proved to be a very accurate predictor filter. It is linear (so it has impulse response and, therefore, can be implemented in parallel) and optimum in terms of mini-mizing the MSE (mean squared error). At this point the Wiener filter seems very attractive but, why nobody has considered this filter for GPS? In fact, the Kalman filter was developed as an improvement over the Wiener filter [1]. Reference [5] also discusses the superiority of Kala-man filter over Wiener filter. The Wiener filter needs to accumulate past measurements in order to make a predic-tion, while the Kalman filter just needs the current mea-surement and the current state (updated in real time every sampling period); therefore, Kalman filter is usually preferred in real time applications [5]. ———————————————— • J. Garcia and C. Zhou are with the Electrical and Computer Engineering department, Illinois Institute of Technology, Chicago, IL. However, if the sampling rate was increased, the Wiener filter would accumulate the measurements so fast that users would feel that the prediction is performed in real time. The current GPS sampling rate is only 20Hz, which is understandable since GPS was developed in the 1970s. Therefore, if we increased the sampling rate, we would be able to apply other techniques (e.g. Wiener fil-ter) to improve GPS precision even more. Furthermore, we can adjust the length of the Wiener filter (i.e. how many previous measurements we consider) in order to reduce the processing time, although we will get worse precision. So, there is a trade-off between processing time and precision. The main goal of this work is two-fold. We first com-pare the Kalman filter, neural network and the Wiener filter in terms of the precision and prediction time for GPS applications. We then propose parallel and reduced-length implementations of the Wiener filter in order to improve the prediction time. The paper is organized as follows. Section 2 explains MATLAB implementations of three different schemes: Kalman filter, neural network and Wiener filter and also presents their accuracy and processing time. Section 3 describes the implementation of the parallel and reduced-length versions of the Wiener filter, which are used to reduce the processing time. Section 4 calculates which sampling frequency would be required in every Wiener scheme in order to obtain the same total processing time as the Kalman filter and the neural network. The simulations results show that the original Wiener filter is the most accurate but the slowest, while the neur-al network is the least accurate but the fastest; the Kalman filter is intermediate in both parameters. The improve-ment suggested in this work consists of either reducing the length of the Wiener filter or implementing it in paral-lel. Reducing the length of the filter decreases the preci-sion (not much) but reduces the processing time signifi-cantly while implementing the filter in parallel keeps the original precision and reduces the processing time at the cost of using more hardware. Finally, increasing the sam-pling rate up to 30 KHz (which is a reasonable value for a sampling frequency nowadays), allows us to use most of the suggested variations for the Wiener filter.
2 P
REDICTION F ILTERS FOR
GPS A PPLICATIONS
We use the “Constellation Toolbox for MATLAB” by Constell, INC to obtain position vectors for GPS and then use it to implement each of the prediction filters ex-plained in the sequel. The Constellation Toolbox is an integrated collection of MATLAB files that allows the us-er to model, simulate and analyze satellite constellations. It provides modeling capabilities for the GPS and GLO-NASS constellations for a great variety of navigation ap-plications. We will only focus on the position vectors of the GPS receiver. These position vectors are contained in ‘alamanac’ file in a matrix form where any row contains a position vector and the next row contains the position vector for 50 ms later (since the sampling frequency is equal to 20 Hz). These vectors have a length of 181 but in this work it has been limited to 180. In the following the ‘state’ of the filter corresponds to the position vector.
The Kalman filter solves the problem of estimating the state n x ∈ ℜ of a time controlled process directed by the linear stochastic difference equation: (1) k k x A x − = ⋅ A is an n times n matrix (where n is the number of state variables considered by the Kalman Filter) that relates the state at the previous time k-1 to the current state at time k . A may change at every time step. We employ the following notation: x k represents the process state vector at time k, represents the a priori state estimate (estimation of x k before updating with the current measurement z k ) and represents the a posteri-ori state estimate (estimation of x k after updating with the current measurement z k ). The a posteriori estimate is computed as a linear combination of the a priori estimate and a weighted difference between the current measurement z k and a measurement prediction H : ˆ ˆ ˆ( ) (2) k k k k x x K z Hx − − = + − where H is an mxn matrix (where m is the number of measurements that we take) that relates the state to the measurement z k ; which may change with each time step. The difference is called residual and it re-flects the discrepancy between the predicted measure-ment and the current measurement z k . K k is an nxm matrix called gain that aims to minimize a posteriori error covariance. It can be calculated as: ( ) (3) Tk k k
K P H HP H R − − − = ⋅ ⋅ + where R is the covariance of the error. Generally it is easy to determine because we also need to measure the process so we should be able to obtain some off-line sample mea-surements. As R decreases, the current measurement z k is trusted more in the second equation, while the predicted measurement is trusted less. P k- is the estimate of the error covariance matrix; it is calculated as: (4) Tk k
P A P A Q − − = ⋅ ⋅ + where Q is the noise covariance. The noise covariance is typically difficult to determine since we do not usually have the chance to directly observe the process we are estimating. If both Q and R are constant, both the estima-tion error covariance P k and the Kalman gain K k will con-verge quickly. The error covariance matrix P k is updated every time step by the following equation: (1 ) (5) k k k P K H P − = − ⋅ The filter goes making estimations periodically and then obtains feedback from the noisy measurements; therefore, the equations for the Kalman filter are classified into two groups: time update equations and measurement update equations. The former ones use the current state and the error covariance estimates to obtain the a priori estimates; the latter ones incorporate the new measure- ment into the a priori estimate to produce the a posteriori estimate. We have a summary of the structure of Kalman filter in Fig. 1. Fig. 1. The original Kalman filter equations. [5] The steps involved in implementing the Kalman filter for the z component of the GPS signal (called v_z) are as follows: • We set n = 2 because two state variables are consi-dered: position and velocity. • m = 1 because we will work with one measurement at each time step. • The estimation for the initial position is the mean of the two first samples, while the estimation for the in-itial velocity is the difference of the two first samples divided by the sampling period (50 ms). • The initial a priori estimate of the error covariance matrix P is equal to the noise covariance Q multip-lied by the identity matrix of order n =2. It is difficult to measure the value of Q , so the chosen value is Q = 30 as in [6]. • The measurement matrix chosen is H = [1, 0] because in GPS we only receive position measurements and not velocity ones. • The state update matrix A is: A = since the new measurement is the old one and the current velocity multiplied by the sampling period (50 ms). Below is a summary of equations: A neural network constitutes a mathematical model that implements a function f(x) , which is the result of-composing other functions g i (x) , which are themselves the result of composing other functions h i (x) . These functions are usually represented as a network structure with ar-rows showing the relations between variables. The most frequently used composed function is the so-called “non-linear weighted sum”, which is defined as: where K is some known function (e.g. the hyperbolic tan-gent). It is also usual to refer to a collection of functions g i as simply a vector g = (g , g , …, g n ) . The main improvement of the neural networks with respect to Kalman filters is that there are adaptive train-ing criterions in which neurons learn how to face new inputs. Learning consists of using a set of measurements to find a new function f’, so that we can derive a cost function C such that, there is no solution that has a cost less than the cost of the optimal solution f’. The cost func-tion C determines the discrepancy of the current solution from an optimal solution; learning implies searching through the solution space for a function that has the smallest possible cost. The neural network implemented in this paper is a multi-layer perceptron feedforward one, which has 2 in-puts, 3 hidden nodes and 1 output. A supervised learning algorithm called backpropagation [7] has been used for training the network; this algorithm does not require any feedback (so it is adequate for this feedforward network). In this algorithm we compute the gradient of the error with respect to the assigned weights; therefore errors propagate from the output nodes to the inner nodes. The computed gradient is employed to determine the weights that minimize the error. Backpropagation usually allows fast convergence on satisfactory local minima for error in the kind of networks to which it is suited. The Backpropagation algorithm has already been im-plemented in MATLAB by KashaniPour and Phil Brier-ley. It consists of the following steps: 1. Uses a certain training sample to the network. ( ) ( ) (8) i ii f x K g x ω = ⋅ ⋅ ∑ [ ] (1) (2)0 (2) (1)20
250 (7)1 0 1 0300 1 0 11 0 z zzz z z v vPositioinX Velocity v vmsP Q H − − + = = + = ⋅ = ⋅ = Compare the output obtained using this training sample to the desired output from that sample. 3.
Determine the error in each output neuron. 4.
Determine what output we should have obtained for each neuron, and also a scaling factor indicat-ing how much the output must be adjusted to match the desired output. This is known as the local error. 5.
Modify the weights of each neuron to reduce the local error of the last step. 6.
Modify the neurons at the previous levels that are responsible for the local, increasing the re-sponsibility to those neurons connected by stronger weights. We modify the above existing algorithm so that the first 90 samples of the received GPS vector v_z have been used for training the neural network and then the error is calculated for the last 90 samples.
This filter was developed in 1949 by Norbert Wiener in his book [8]. The objective of the Wiener filter is to re-move the noise that has corrupted a signal by means of a statistical approach. It is required to have information about the spectral or the statistical properties (power spectral density or auto-correlation and cross-correlation) of the original signal and the noise, so that we can design a LTI filter whose output is as similar as the original sig-nal as possible. The theory of Wiener filters is focused on those filters that are causal, that is, the ones that work only with the past and present of the time series. In this filter, the criterion selected for optimizing the filter im-pulse response is the minimization of the MSE. We will consider that the input of the Wiener filter is a signal s(t) corrupted by additive noise n(t) . The output ŝ(t) is calculated by filtering the input signal with the Wiener filter impulse response g(t). ˆ( ) ( ) ( ( ) ( )) (9) s t g t s t n t = ∗ +
After some calculations [8], we obtain the expression of the FIR filter coefficients: where: • M is the desired length of the filter • r xx (n) is the autocorrelation function of the noisy signal • r sx (n) is the crosscorrelation function between the signal and the noise. Simulation Results: The result achieved after applying Kalman Filter-ing is shown in Fig. 2. Fig. 2. Error after applying the Kalman filter. The errors after applying Kalman filter are calculated as the difference (in absolute value) between the out-put of the Kalman filter and the constant signal. Here we observe that the Kalman filter reduces the error considerably (mean = 3.0971 meters, variance = 9.7733 meters). However, when there is a sudden change in precision (e.g. sample 118 and sample 148) the Kalman filter increases the error, even if the sud-den change has reduced the error in the original sig-nal. The error obtained after applying the neural network can be seen in Figure 3. Fig. 3. Error after applying the neural network For the simulation result in Fig. 3, we trained the neural network using the first 90 samples, so we can only eva-luate its performance for the rest of the samples (from the 91 st to the 180 th ). We observe that the neural network also improves the original error significantly (mean = 4.7119, variance = 3.0141). The mean of the error is larger than the one for the Kalman filter, but the error is more con-stant (i.e. the variance is smaller); this is due to the main property of the backpropagation algorithm. Backpropaga-tion allows fast convergence on satisfactory local minima for error in the kind of networks to which it is suited; that (0) (1) ( 1) (0)(0)(1) (0) (1)(1) = (1)( 1) (0) ( 1)( 1)[ ] [ ] [ ] [ ] [ ] [ ] xx xx xx sxxx xx sxxxxx xx sxxx sx xx sx r r r M rhr r rhrr M r r Mh MR h r h R r − − ⋅ − −− ⇒ ⋅ = ⇒ = ⋅ LL MM M MM (10) is, the error in the neural network is quite constant as long as the original error does not vary too much, howev-er, when there is a peak in the original error, the error in the neural networks start to fluctuate. Also the error obtained after applying the Wiener filter can be seen in Fig. 4 Fig. 4. Error after applying the original Wiener filter We see that the Wiener filter achieves the smallest error in both mean and average (mean = 1.7938, variance = 1.7804). However, as we will analyze later, the Wiener filter is the slowest and also it needs to accumulate the 180 samples for calculating the coefficients of the filter. 2 Precision comparison: Table I shows the error (in absolute value) for each scheme. It is calculated as the difference between the real position vector and the output of each scheme. TABLE I: Precision comparison Original Kalman Neural Wiener Mean(m) 12.0916 3.0971 4.7119 1.7938 Variance 20.058 9.7733 3.0141 1.7804 It can be seen from the above table that the Kalman filter reduces the mean of the error enormously (from 12 me-ters to 3), but its variance is still quite large. The neural network is slightly worse, but its error is more constant since the Backpropagation algorithm allows fast conver-gence. Finally, the Wiener filter is the most precise in both mean and variance. Neural filter requires 80 samples and wiener filter requires 180 samples in the above table for calculating the coefficients of the filter. 3
Processing time comparison: Table II shows the processing time for each scheme. It does not include the acquisition time which has to be summed in the Wiener filter case. TABLE II: Processing time comparison Kalman Neural Wiener Processing time (ms) 20.3281 16.9648 25.2656 Table II indicates that the neural network is the fast-est scheme and the original Wiener filter is the slow-est one; that is why two methods for reducing the processing time are developed in this work: the pa-rallel implementation and the reduced length one.
3 P
ARALLEL AND R EDUCED - LENGTH A RCHITECTURES
Now that we have implemented the Wiener filter, we can try reducing the processing time. A reasonable way of doing this is performing the filtering process in parallel. The main inconvenient for this approach is that it requires incrementing the hardware, but we only need to add fil-ters, delayers and adders which are very cheap and will not make the GPS receiver much more expensive. Refer-ence [9] explains how to implement the 2-parallel and the 3-parallel structures in an efficient way. Figure 5 shows how to implement the 2-parallel scheme.
Fig. 5. The 2-parallel implementation [9]. The even and odd outputs are calculated as: Finally the total output is expressed as:
Fig. 6 shows the 3-parallel implementation. ( ) ( ) ( ) ( ) ( ) (11)( ) ( ) ( ) ( ) ( ) even even even odd oddodd odd even even odd
Y z H z X z z H z X zY z H z X z H z X z − = ⋅ + ⋅ ⋅ = ⋅ + ⋅ ( ) ( ) ( ) (12) even odd Y z Y z z Y z − = + ⋅ Fig. 6. The 3-parallel implementation [9]. Here: The partial outputs here are calculated as: Finally the total output is: ( ) ( ) ( ) ( ) (17)
Y z Y z z Y z z Y z − − = + ⋅ + ⋅
This is another approach for reducing the processing time: instead of waiting for receiving the 180 samples and then performing 180 samples-convolutions (as in the orig-inal simulation), we reduce the length of the Wiener filter to x , so that we have to wait for receiving only x samples and then perform x samples-convolutions. This approach has the advantage that it does not require more hardware. In Figs. 7 and 8, we will compare the 135-samples and the 90- samples versions via simulations. Fig. 7. Error after applying the 135 sample Wiener filter Fig. 8. Error after applying the 90 sample-Wiener filter Finally, we plot the last 90 samples of the Kalman fil-ter, the neural network and the original Wiener filter to-gether in Fig. 9. Fig. 9. Comparison between the three techniques
Here we compare the precision and processing time of the proposed parallel and reduced-length architectures for Wiener filter. We can see the results on Table III: TABLE III: Parallel and reduced-length architectures comparison for Wiener filter
Original //2 //3 L=135 L= 90
Mean(m) 1.7938 1.7938 1.7938 2.3545 3.102 Variance 1.7938 1.7938 1.7938 4.316 8.287 Processing 25.2656 20.234 15.1483 15.5938 { }{ }{ }
30 31 32 ( ) (0), 0, 0, (3), 0, 0, (6),( ) (1), 0, 0, (4), 0, 0, (7), (13)( ) (2), 0, 0, (5), 0, 0, (8),
H z h h hH z h h hH z h h h = = = KKK [( )( ) ] (14)
Y H X z H X z H H X X H X − − = − + + + −
31 0 1 0 1 1 1 0 0 2 2 [( )( ) ] [ ] (15)
Y H H X X H X H X z H X − = + + − − − [( )( )][( )( ) ] [( )( ) ] (16) Y H H H X X XH H X X H X H H X X H X = + + + + −+ + − − + + − processing time is reduced by a small amount. The re-duced length architecture improves the processing time substantially in exchange for some degradation of preci-sion.
4 S
AMPLING F REQUENCY R EUIREMENTS
In this section we compare the total prediction time. Since both the Kalman filter and the neural network are real-time mechanisms (i.e. they work with the current measurement so they do not need to accumulate sam-ples), the processing time is equal to the total time for them. The current sampling frequency in GPS (which has not changed since its beginning) is only 20 Hz, so its sam-pling period is 50 ms, which is already larger than any processing time; this way, accumulating 180 samples in a Wiener filter would take 9 seconds, which is incompatible with any real-time application. However, the value of 20 Hz for a sampling frequency is nowadays extremely small. Increasing this frequency to some KHz would al-low us to use the Wiener filter in real-time applications. Now we are going to calculate the required sampling fre-quency for getting the same processing time as the Kal-man filter and the neural network. The processing time of the original Wiener filter is al-ready larger than that of both the Kalman filter and the neural network, so there is no way to equalize their total times. The processing time of the 2-parallel Wiener filter is already larger than that of the neural network, but we can equalize the total time of the neural network. Let us calculate which sampling frequency we would need: / / 2 / / 2,/ / 2 ,/ / 2 / / 2
180 1 1 1912.86( ) / 180 kalman samplingsampling sampling kalman
T T samples Tf KHzT T T − = + ⋅ ⇒ = = =− This sampling frequency is too high, so we should switch to another configuration. The total time of the reduced length configurations is considerably smaller because, apart from having a smaller processing time, they have to accumulate fewer samples. We calculate the reuired sam-pling frequency for the 90-samples Wiener filter to equa-lize the total time of the neural network as:
90 9090 90 90
90 1 1 1 2.37( ) / 90 neural samplingsampling sam pling neural
T T sam p les Tf K H zT T T −− − = + ⋅ ⇒ = = =− This sampling frequency is much more reasonable. Ta-ble IV shows all the different combinations: TABLE IV: Sampling frequencies needed in KHz for pa-rallel and reduced-length architectures of Wiener filter
Original //2 //3 L= 135 L= 90 Kalman Impossible 1912.86 34.75 28.52 8.46 Neural Impossible Impossible 99.09 98.47 12.37
As we see in this table, 35 KHz is enough for most con-figurations to equalize the total time of the Kalman filter, and 100 KHz is enough for them to equalize the total time of the neural network.
4 C
ONCLUSION
In this paper we have studied three different tech-niques for improving precision at the GPS receiver with-out need for INS information. They are: Kalman filter, neural network and Wiener filter. The simulations show that the Wiener filter is the most accurate method. How-ever, the main disadvantage of the Wiener filter is that it requires additional time for accumulating measurements for determining the filter coefficients. Therefore we should increase the GPS sampling frequency for accumu-lating these measurements faster. This work shows that increasing the sampling frequency to 35 KHz lets us ob-tain similar total processing time to the Kalman filter (but better precision) in most of the proposed configurations; whereas 100 KHz is enough to equalize neural networks time. Two schemes are proposed for reducing the processing time of the Wiener filter: Implementing the filter in parallel and reducing its length. The former re-quires increasing the hardware (i.e. more filters, adders and delayers) and gets exactly the same accuracy as the original filter since they are analytically equivalent; the latter does not need any additional hardware and reduces the processing time significantly, but it makes precision slightly worse. A possible improvement to this work consists of combining the two proposed schemes: reducing the length of the filter and then parallelizing its implementa-tion. Using this improvement method, we should get the same accuracy as the reduced-length implementation, but a shorter processing time. Another possibility is imple-menting an IIR Wiener filter instead of a FIR one. The IIR is optimum in terms of minimizing the MSE, but we have to make sure that our implementation is stable and caus-al; otherwise it will not be applicable in GPS applications. R EFERENCES [1]
Rudolf E. Kalman, “A New Approach to Linear Filtering and Prediction Problems”, Transactions of the ASME–Journal of Ba-sic Engineering, vol. 82 (Series D), pp. 35-45, 1960. [2]
Mosavi M. R., “Comparing DGPS Corrections Prediction using Neural Network, Fuzzy Neural Network, and Kalman Filter”, Journal of GPS Solutions, vol.10, no. 2, pp.97-107, 2006 . [3] Mosavi M.R., “Frequency Domain Modeling of GP S Position-ing Errors”, The 8th International Conference on Signal Processing, vol. 4, pp. 16-20, 2006. [4]
Bo Tang, Pingyuan Cui and Yangzhou Chen, “A parallel processing Kalman filter for spacecraft vehicle parameters es-timation”, IEEE International Symposium on Communications and Information Technology, vol. 2, pp. 1476 – 1479, Oct. 2005. [5]
Greg Welch and Gary Bishop, “An Introduction to the Kalman Filter”, Survey by Department of Computer Science in the Uni-versity of North Carolina at Chapel Hill, TR 95-041, July 2006. [6]
M. H. Refan, M. R. Mosavi and K. Mohammadi, “Time Varying Kalman Filter Processing to Predict the Future Errors of a GPS Receiver”, Map India Conference, Jan. 2003. [7] David E. Rumelhart and James L. McClelland, “Parallel Distri-buted Processing: Explorations in the Microstructure of Cogni-tion”, MIT Press Book. ISBN: 0262181231, 1986. [8] Norbert Wiener, “Extrapolation, Interpolation, and Smoothing of Stationary Time Series”, Wiley Book, ISBN 0-262-73005-7. 1949. [9] M. Young,
The Techincal Writers Handbook.