Test of pmic GPA with filter

Dependencies:   mbed

Fork of nucf446-cuboid-balance1_strong by RT2_Cuboid_demo

GPA.h

Committer:
pmic
Date:
2018-03-22
Revision:
8:d68e177e2571
Parent:
6:da0c9587ecae
Child:
22:715d351d0be7

File content as of revision 8:d68e177e2571:

class GPA
{
public:

    GPA(float fMin, float fMax, int NfexcDes, int NperMin, int NmeasMin, float Ts, float Aexc0, float Aexc1);

    float operator()(float inp, float out) {
        return update(inp, out);
    }

    virtual ~GPA();

    void     reset();
    float    update(float inp, float out);

    void     printGPAfexcDes();
    void     printGPAmeasPara();
    void     printGPAmeasTime();

private:

    int    NfexcDes;
    int    NperMin;
    int    NmeasMin;
    float  Ts;
    float *fexcDes;
    float  aAexcDes;
    float  bAexcDes;

    float  fnyq;
    float  pi2;
    float  pi2Ts;
    float  piDiv2;

    int    Nmeas;
    int    Nper;
    float  fexc;
    float  fexcPast;
    int    ii;
    int    jj;
    float  scaleG;
    float  cr;
    float  ci;
    float *sU;
    float *sY;
    float  sinarg;
    int    NmeasTotal;
    float  Aexc;
    float  pi2Tsfexc;

    void   fexcDesLogspace(float fMin, float fMax, int NfexcDes);
    void   calcGPAmeasPara(float fexcDes_i);
    void   printLine();

};