摘要 |
A digital filter for filtering a stream of input data and producing a corresponding stream of output data receives a series of input data samples, each having a respective value, and for each input data sample, sets the value of a corresponding output data sample according to a comparison between an accumulated value of previous input samples and a predetermined threshold. If the difference between the value of the present input sample and the current accumulated value is less than the predetermined threshold, then the accumulated value is updated by summing the present input sample with values corresponding to one or more previous input samples. If the difference between the value of the input sample and the current accumulated value is greater than the predetermined threshold, the accumulated value is updated by setting the accumulated value equal to the value of the present input sample. The accumulated value may be an average. The filter responds quickly to large changes in input but removes the influence of small variations e.g. noise. |