Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependents: ActiveCaster_ ActiveCaster_2
Filter.h
- Committer:
- e5119053f6
- Date:
- 2022-01-28
- Revision:
- 2:f206311600ee
- Parent:
- 0:5e4f1e288e2a
File content as of revision 2:f206311600ee:
#ifndef FILTER_h
#define FILTER_h
#include "mbed.h"
class Filter
{
public:
double T_LPF;
double Om_n;
double sq_dt;
double sq_Om;
double omega;
double dzeta;
Filter(double);
void setLowPassPara(double T, double init_data);
double LowPassFilter(double input);
void setSecondOrderPara(double xOmega, double xDzeta, double init_data);
void initPrevData(double init_data);
double SecondOrderLag(double input);
void setNotchPara(double Omega, double init_data);
double NotchFilter(double input);
private:
double int_time;
double preOutput;
bool set_t;
double prev_output1, prev_output2;
bool set_secorder;
double n_preOutput[2];
double n_preInput[2];
};
#endif