Hi Henrik,
Don't know if this will help or not, but one of our members, Tom Igoe, has a routine that's supposedly "based" on a kalman filter.
http://www.tigoe.net/pcomp/code/arch...o/000710.shtml
Versions in C and picbasic.
Don't know enough about it to know if it's what you're looking for.
HTH,
Bookmarks