A digital filter system usually consists of an analog-to-digital
converter (ADC) to sample the input signal, followed by a microprocessor and
some peripheral components such as memory to store data and coefficients of the filter, etc.
Program Instructions (software) running on the
microprocessor implement the digital filter by performing the necessary
mathematical operations on the numbers received from the ADC.
Here is a simple digital filter that identifies and rejects transient response signals. It returns the average of the best two samples of
the last three. The third sample is discarded.
Algorithm:
1. Calculate the average of the last 3 samples
2. Identity the sample furthest from the mean value (which
is the outlier)
3. Discard the outlier and average the remaining two samples
4. Returns float value of the averaged data (y(i)).