There are many times where you would like to “stabilize” an input signal so that you don’t see the input value “jumping” so much. This is specially true on the MilliVolt Signal range, where nearby noise present can disturb the original signal. In this case, you always have the option of buying some kind of signal conditioner, which handles the filtering function of the raw signal. However, there are many times where the noise problem presents itself after the system is built, in which case a simple software solution is preferable to mitigate the problem.
Here is a simple example of what one might encounter:
(A) is the original raw signal, which in this case should be 10 Millivolts.
(B) show various waveforms, each with a different amplitude and frequency. When we add these waveforms together, we end up with ©.
(D) is some random static noise, which might be present in the line. When we add this static noise to the original signal, we get (E).
With some simple software filter, we can stabilize the signal back to the original value:
(F) is our noisy signal again. G1 –G4 are the output of our software filter, each having a different filter coefficient.
Out Software Filter formula is simply:
where:
y = filter output (state variable)
x = raw signal input (independent variable)
C = filter coefficient
Does the above formula look familiar? It has the same basic principle as another formula describing exponential growth, for example, of a capacitor charge:
So, what do the different filter coefficients represent? in order to answer this question, let’s perform a step test of our input signal and analyze the results of our filters:
(H) is our step test signal, where we step the input from 5 to 10. This causes the filters to react. As shown above, the lower the filter coefficient, the more time it takes for the filtered output to reach the new steady state of 10. We can also notice the exponential growth curve. This curve is not very noticeable on filter picture (I1), but it is evident on (I2), (I3) and (I4).
Looking at Filter 3 (Coef = 0.01) closely, we have:
In the picture (Filter 3) above, we can see that it takes approximately 10 Milli Seconds for the output to go to about 63% of the final steady state, which is equivalent to 1/C, where C is our filter coefficient.
The filter formula is, in fact, an application of an exponential delay (or exponential leak), where the state of the system will adjust to a given input only after a certain amount of time. The optimum filter coefficient for your application will depend on specific circumstances such as maximum predicted input fluctuation, data acquisition scan time, desired frequency response, etc.
In part 2 of Simple Software Filter, we take a better look at the simple software filter formula, the filter coefficient and how it all came to be.
Calculations and Graphics Powered By
© 2012, gilbertojunqueira.com. All rights reserved.
Related posts:








[…] Software Filter — [Link] Tags: filter, noise Filed in Miscellaneous | 2 views No Comments […]