Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

What is this

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.

Name: Anonymous 2012-10-30 14:13

C++ code
stopped reading

Name: Anonymous 2012-10-30 14:18

Pig disgusting

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List