Name: Anonymous 2012-10-30 13:36
class some_kind_of_simple_filter
{
public:
some_kind_of_simple_filter(float coefficient_) : coefficient(coefficient_), value(0.0f) {}
void sample(float f)
{
value = coefficient * value + (1.0f - coefficient) * f;
}
float get()
{
return value;
}
protected:
float coefficient;
float value;
};/prog/, what is this kind of filter called? I've been using it forever, and it is really nice for smoothing out sampled data. I've just never known what it's called.