ya kno it

filter.h

Committer:
Thijs12va
Date:
2017-10-27
Revision:
1:db5970567c4d
Parent:
0:09ae59836ddc

File content as of revision 1:db5970567c4d:

#ifndef FILTERJWZ
#define FILTERJWZ

#include "mbed.h"
//#include <math.h>

class LowPass{
    public:
    float yprev;
    float a;
    
    float filter(float x);
};

class HighPass{
    public:
    float xprev[2];           // to remember the 2 previous input values
    float yprev;              // to remember the previous output value
    float a;                  /*RC / (RC + dt)*/
    
    float filter(float x);
};

class Notch{
    public:
    float xprev[3];
    float yprev[2];
    float lambda;
    float b;
    
    float filter(float x);
};

class ButterLow{
    public:
    float xprev[3];
    float yprev[2];
    float w; //wc: cutoff frequency
    
    float filter(float x);
};

#endif