analog input filtering

Masia Jean-Baptiste 6 years ago in IQANdesign updated by Gustav Widén (System support) 6 years ago 4

In my system, I have an angular sensor.
That value varies continuously (example: 2.56 --- 2.65 --- 2.48 ---2.65...).
How can you filter signals to avoid having oscillatory values and have a fixed value?

Best regard

Satisfaction mark by Masia Jean-Baptiste 6 years ago
Under review
What filter to choose and how to tune it will depend on how quickly you need the filtered signal to respond to an actual change.
Two filter types to try in this case would be the SFC-Moving average, and the SFC-BWL.

The moving average is good to use where there are spikes in the measurement that you want to filter out. It will also filter out these low amptitude oscialltions that you describe. 

If you need to filter out the small amplitude fluctuations, but still react quickly to a step change, then the BWL could be a good choice.

Below is an attempt to illustrate the differences between the filters.There is not much oscillation on the input signal to start with here, but both the moving average and the BWL does a pretty good job in filtering these out. 
The main noticable difference is how they respond to a quick change in the input signal.

Thank you
I used another solution.
I sampled every 10ms and I memorized the value of my sensor outside a range (0.5°)

That is also an interesting alternative, it looks like a hysteresis functon.