![](/media/cache/img/default_profile.jpg.50x50_q85.jpg)
Non-variable (TESTEDandWORKING)
Fork of ELEC347_Coursework by
Diff: Filter.hpp
- Revision:
- 0:d39a06ca6bf1
- Child:
- 1:b088b771a591
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/Filter.hpp Thu Nov 23 10:41:18 2017 +0000 @@ -0,0 +1,59 @@ +//#define Fs 35000 //Frequency of Sample Rate in Hz +//#define N 5 //Number of Nodes N + +class FILTER +{ +private: + // calculate_equation();//calculated the value of the equation + + //Can be interrupt driven + int _Fs; + int _Fo; + int _Boost; + int _Q; + + float FilterOutput; + float _centreTap; //internal node of filter + float _b0; + float _b1; + float _b2; + float _b3; + float _b4; + + // A - Denominator coefficients + float _a0; + float _a1; + float _a2; + float _a3; + float _a4; + + float _G; + float _k; + float _Wo; + + float _xn; //this value is the input value + float _xnm1; + float _xnm2; + float _xnm3; + float _xnm4; + + float _yn; + float _ynm1; + float _ynm2; + float _ynm3; + float _ynm4; + + +public: + FILTER(int Fs, int Fo, int Boost, int Q); //Constuctor + ~FILTER(); //deConstuctor + + //setters + void setvalue(int RAW_input); //xn sample input + + //getters + float getvalue(void); //returns yn + +}; + +