a way of taking out very different value before calculating an average
Posted on 2006-03-24
i'm programming in j# which receives GPS data.
I noticed that sometimes the GPS give very 'bad' or 'wrong' data from time to time.
I designed a program that calculates something according to the data it receives
but since sometime i get some bad datas i decided to take the average data of every 3 datas
for example, if i'm using the bearing, i would get three bearings and get the average of the three and use them as the value.
but sometimes one of the three values would read very incorrect data.
i was wandering if there was an algorithm of some sort to take out that bad data or give less weight to it when doing the average.
bearing1 = 39
bearing2 = 43
bearing3 = 05
when i get this, i don't want to average the three but actually get soemthing in between 39 and 43