struct mrpt::math::LowPassFilter_IIR1

1-order low-pass IIR filter.

Discrete time equation: y[k]=alpha*y[k-1]+(1-alpha)*x[k]. With: x[k] input, y[k] output, alpha a parameter in [0,1]

#include <mrpt/math/filters.h>

struct LowPassFilter_IIR1
{
    //
fields

    double alpha;

    // construction

    LowPassFilter_IIR1(
        double alpha = 0.5,
        double y_k_minus_1 = .0
        );

    //
methods

    double filter(double x);
    double getLastOutput() const;
};

Fields

double alpha

See equation in LowPassFilter_IIR1.

Methods

double filter(double x)

Processes one input sample, updates the filter state and return the filtered value.