![]() |
Re: Sensor "de-noising"
Quote:
|
Re: Sensor "de-noising"
While Kevin's approach is far more elegant, this might work for you in a pinch:
Code:
...ugly but it could work Eric |
Re: Sensor "de-noising"
Here's a simple IIR filter which does essentially the same thing with 2 lines of code, no loops, and no conditional logic: Code:
ave = 0.5*(input+ave);input and output are 0 or 1. |
Re: Sensor "de-noising"
Last year we created a class to handle averaging out our noise. we were using this for sensors that gave us analog data, but you could send in 1.0 and 0.0 on the output side for a digital signal.
What ended up being nice about this class last year was that we could very easily change how many samples were being included in the average. As we started to speed things up throughout the season, we needed the average to be more responsive (fewer samples) Here's the Java code: https://gist.github.com/jcorcoran/5097376 |
Re: Sensor "de-noising"
Quote:
|
Re: Sensor "de-noising"
Quote:
Mind you, it's probably a perfectly cromulent and simple solution to the OP's actual problem, it just seems different than actual debouncing. |
Re: Sensor "de-noising"
Quote:
If you want to debounce in both directions, change the second line to Code:
|
Re: Sensor "de-noising"
Quote:
|
Re: Sensor "de-noising"
Quote:
|
| All times are GMT -5. The time now is 04:48. |
Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi