#include "filter.h"

PT1Filter::PT1Filter(double tau, double dt) : output(0.0) {
    filterFactor = dt / (tau + dt);
}

double PT1Filter::update(double input) {
    output += filterFactor * (input - output);
    return output;
}

double PT1Filter::step(double input) {
    output += filterFactor * (input - output);
    return output;
};


void PT1Filter::reset() {
    output = 0.0;
}