Kalman filter for beginners
25 views (last 30 days)
Show older comments
Hi,
I have never used matlab before and unfortunately don't have time to learn it in-depth so was wondering if someone could help guide me through my problem.
I have an excel spread sheet with over 50,000+ GPS fixes taken each second of decimal degree latitude and longitude locations. (a birds movement) and I am looking to kalman filter this. Is anyone able to guide me in importing this excel data and then applying a kalman filer? I would be incredibly greatful.
This is how my data looks:
Date Time Latitude Longitude
6/12/2017 12:25:00 50.774715 -3.932923
6/12/2017 12:25:01 50.774742 -3.932912
6/12/2017 12:25:02 50.774773 -3.932896
0 Comments
Answers (3)
James Tursa
on 24 Jun 2017
Edited: James Tursa
on 24 Jun 2017
You need to have a good dynamics model of the system you are trying to estimate in order for a Kalman filter to make sense for the application. E.g., for an airplane you've got physics of flight associated with that particular airplane along with accelerometer & gyro & baro altimeter etc inputs as well. This dynamics model is needed in order to develop a meaningful Kalman filter for estimating system properties (like position and velocity). The dynamics model would be able to propagate the airplane position and velocity etc in the absence of GPS updates. The GPS updates would be used by the Kalman filter to augment and correct the estimated position and velocity.
You don't have any such dynamics model for your bird. The only thing you apparently have are the GPS measurements themselves. You have nothing that can be used to propagate the bird position and velocity in any meaningful way in the absence of the GPS measurements, so trying to develop a Kalman filter that somehow incorporates those GPS measurements makes no sense.
If you somehow thought for some reason that the GPS measurements were too erratic and needed smoothing in some fashion, or you are trying to develop some type of curve fitting or interpolation scheme for those in between points, that's a different issue.
1 Comment
Somto Dibiaezue
on 15 Feb 2018
Hi,
Following on from your statement:
"If you somehow thought for some reason that the GPS measurements were too erratic and needed smoothing in some fashion, or you are trying to develop some type of curve fitting or interpolation scheme for those in between points, that's a different issue."
I'm looking to smoothen out my data sets, are there particular filters that can achieve this without the necessary need for a model? Thanks.
Cam Salzberger
on 23 Jun 2017
Hello Jessica,
Getting the data into MATLAB is really simple. There is an "Import Data" button in the ribbon that will help you through graphically importing the data. Yours is clean enough that you could probably just do:
T = readtable('datfile.txt');
One important part of Kalman filtering is the "prediction" step. Generally absolutely-positioning sensor data like GPS will be used during the "update" step. Traditionally, the movement commands to the object being localized will be used during the prediction step, but I've seen odometry and IMU data being used for that instead. So unless you are expecting your object to be sitting absolutely still, you'll want some kind of data for what it was supposed to be doing, before you look to the GPS to see what it was actually doing.
Once you have that, you can check out a couple of good resources (if you have the Control System Toolbox). There's a built-in function called kalman that will help you set up the problem. There's also a convenient documentation page that walks you through the whole process.
Good luck!
-Cam
1 Comment
Cam Salzberger
on 27 Jun 2017
Ah, I didn't see that it was a bird's movement earlier. In that case, I have to agree with Roger and James on this one.
Roger Labbe
on 24 Jun 2017
Are you sure you want to apply a Kalman filter to this? I ask because GPS already applies a Kalman filter to the pseudorange measurements that it processes, hence the result is already mathematically optimal. Reapplying a KF is just going to straighten out the data - if you iteratively applied a KF you'd eventually end up with a straight line.
Now, if you recorded the pseudorange distances, and then had other information (either other measurements or a good process model (model of how a bird flies) you might do better than the GPS, but you'd have to be very skilled in this domain.
0 Comments
See Also
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!