At 08:56 AM 9/16/2004, Wouter van Ooijen wrote: >> I am not sure the conversion helps. If the resulting Cartesian >coordinates >> tends to be zero, then the variability of the polar angle increases >> dramatically. > >That is not an artifact of the calculation method, it is inherent in the >problem statement. What is the average direction of two compass >readings, one North and one South ? In my case, I was getting bearings from a doppler DF unit (actually another section of software, and some fun hardware). It would be quite reasonable for me to get bearing data that looks like this: 90,90,87,270,93,91... Just the nature of the beast. The math average is wrong no matter how you do it, because it can't handle the wrap. What I ended up doing, was five layers of 16 bearings. When I got the first 16 raw bearings, that made one "level two" bearing. When I accumulated 16 level two bearings,that made a level three. and so on. When the signal went away, I would take the best data I had and output it. In the end, IIRC, I could average up about 4 seconds of 7200 bearings/sec this way, in much less ram than you'd otherwise expect. With the pol-rect-pol method, I also got the length of the vector, which directly expressed how much "noise" was in the data. A short vector indicates that the bearing is too noisy to use, probably because of multipath reflections. I never implemented it that way, but I could have tossed the shortest vector in each level before averaging, to clean it up, but I'm not sure that's entirely valid. _______________________________________________ http://www.piclist.com View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist