Software > Software

Filtering bogus readings

<< < (2/2)

hazzer123:
Heres a sorting function you probably could use.

http://www.devx.com/tips/Tip/12940

Brandon121233:
I don't think I can import the necessary library into Arduino, if someone who has used the Arduino program could tell me how to be able to import and use the sort() function that would be spectacular.

nanob0t:
Is there a summation function?  Represented by the weird Eish symbol.

Brandon121233:
I think I can use some of this code http://www.tigoe.net/pcomp/code/archives/arduino/000711.shtml and then from there I know how to do the rest

Admin:
(apologies for late reply, finishing up the last of the messages I missed resulting from my trip)

Firstly, you should figure out why your sonar is getting these weird values. I think your sonar is picking up echoes from a previous chirp. To correct for this, you would need to reduce your sonar frequency. 22Hz is pretty fast for sonar. Id recommend closer to 5Hz.

But if this isnt the problem, there are other methods to removing strange values than just averaging. The method is to compare your newest value to the average of previous values. If the new value is really whack, throw it away and use the average of the last few values. Dont average it in, just dump it out.

Navigation

[0] Message Index

[*] Previous page

Go to full version