Library for control puposes
Fork of Cntrl_Lib by
GPA.h@12:c8ec698c53ed, 2019-02-07 (annotated)
- Committer:
- pmic
- Date:
- Thu Feb 07 09:08:47 2019 +0000
- Revision:
- 12:c8ec698c53ed
- Parent:
- 7:7715f92c5182
Add new default istantiate option for GPA
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
altb | 0:e2a7d7f91e49 | 1 | class GPA |
altb | 0:e2a7d7f91e49 | 2 | { |
altb | 0:e2a7d7f91e49 | 3 | public: |
pmic | 12:c8ec698c53ed | 4 | |
pmic | 12:c8ec698c53ed | 5 | GPA(float fMin, float fMax, int NfexcDes, float Aexc0, float Aexc1, float Ts); |
pmic | 7:7715f92c5182 | 6 | GPA(float fMin, float fMax, int NfexcDes, int NperMin, int NmeasMin, float Ts, float Aexc0, float Aexc1, int NstartMin, int NsweepMin); |
pmic | 7:7715f92c5182 | 7 | GPA(float f0, float f1, float *fexcDes, int NfexcDes, int NperMin, int NmeasMin, float Ts, float Aexc0, float Aexc1, int NstartMin, int NsweepMin); |
pmic | 7:7715f92c5182 | 8 | GPA(float *fexcDes, int NfexcDes, int NperMin, int NmeasMin, float Ts, float Aexc0, float Aexc1, int NstartMin, int NsweepMin); |
altb | 0:e2a7d7f91e49 | 9 | |
altb | 0:e2a7d7f91e49 | 10 | float operator()(float inp, float out) { |
altb | 0:e2a7d7f91e49 | 11 | return update((double)inp, (double)out); |
altb | 0:e2a7d7f91e49 | 12 | } |
altb | 0:e2a7d7f91e49 | 13 | |
altb | 0:e2a7d7f91e49 | 14 | virtual ~GPA(); |
altb | 0:e2a7d7f91e49 | 15 | |
altb | 0:e2a7d7f91e49 | 16 | void reset(); |
altb | 0:e2a7d7f91e49 | 17 | float update(double inp, double out); |
altb | 0:e2a7d7f91e49 | 18 | |
altb | 0:e2a7d7f91e49 | 19 | void printGPAfexcDes(); |
altb | 0:e2a7d7f91e49 | 20 | void printGPAmeasPara(); |
pmic | 7:7715f92c5182 | 21 | void printFullGPAmeasPara(); |
altb | 0:e2a7d7f91e49 | 22 | void printGPAmeasTime(); |
altb | 0:e2a7d7f91e49 | 23 | void printNfexcDes(); |
altb | 0:e2a7d7f91e49 | 24 | |
altb | 0:e2a7d7f91e49 | 25 | private: |
altb | 0:e2a7d7f91e49 | 26 | |
altb | 0:e2a7d7f91e49 | 27 | int NfexcDes; |
altb | 0:e2a7d7f91e49 | 28 | int NperMin; |
altb | 0:e2a7d7f91e49 | 29 | int NmeasMin; |
altb | 0:e2a7d7f91e49 | 30 | double Ts; |
altb | 0:e2a7d7f91e49 | 31 | double *fexcDes; |
altb | 0:e2a7d7f91e49 | 32 | double aAexcDes; |
altb | 0:e2a7d7f91e49 | 33 | double bAexcDes; |
altb | 0:e2a7d7f91e49 | 34 | |
altb | 0:e2a7d7f91e49 | 35 | double fnyq; |
altb | 0:e2a7d7f91e49 | 36 | double pi2; |
altb | 0:e2a7d7f91e49 | 37 | double pi2Ts; |
altb | 0:e2a7d7f91e49 | 38 | double piDiv2; |
pmic | 7:7715f92c5182 | 39 | float rad2deg; |
altb | 0:e2a7d7f91e49 | 40 | |
altb | 0:e2a7d7f91e49 | 41 | int Nmeas; |
altb | 0:e2a7d7f91e49 | 42 | int Nper; |
pmic | 7:7715f92c5182 | 43 | double dfexc; |
altb | 0:e2a7d7f91e49 | 44 | double fexc; |
altb | 0:e2a7d7f91e49 | 45 | double fexcPast; |
pmic | 7:7715f92c5182 | 46 | int i; |
pmic | 7:7715f92c5182 | 47 | int j; |
altb | 0:e2a7d7f91e49 | 48 | double scaleG; |
altb | 0:e2a7d7f91e49 | 49 | double cr; |
altb | 0:e2a7d7f91e49 | 50 | double ci; |
altb | 0:e2a7d7f91e49 | 51 | double *sU; |
altb | 0:e2a7d7f91e49 | 52 | double *sY; |
altb | 0:e2a7d7f91e49 | 53 | double sinarg; |
altb | 0:e2a7d7f91e49 | 54 | int NmeasTotal; |
altb | 0:e2a7d7f91e49 | 55 | double Aexc; |
pmic | 7:7715f92c5182 | 56 | double AexcPast; |
altb | 0:e2a7d7f91e49 | 57 | double pi2Tsfexc; |
pmic | 7:7715f92c5182 | 58 | int NstartMin; |
pmic | 7:7715f92c5182 | 59 | int NsweepMin; |
pmic | 7:7715f92c5182 | 60 | int Nsweep; |
pmic | 7:7715f92c5182 | 61 | double bfexc; |
pmic | 7:7715f92c5182 | 62 | double afexc; |
pmic | 7:7715f92c5182 | 63 | double aAexc; |
pmic | 7:7715f92c5182 | 64 | double bAexc; |
pmic | 7:7715f92c5182 | 65 | double AexcOut; |
pmic | 7:7715f92c5182 | 66 | |
pmic | 7:7715f92c5182 | 67 | void assignParameters(int NfexcDes, int NperMin, int NmeasMin, double Ts, int NstartMin, int NsweepMin); |
pmic | 7:7715f92c5182 | 68 | void calculateDecreasingAmplitudeCoefficients(double Aexc0, double Aexc1); |
pmic | 7:7715f92c5182 | 69 | void initializeConstants(double Ts); |
pmic | 7:7715f92c5182 | 70 | void assignFilterStorage(); |
altb | 0:e2a7d7f91e49 | 71 | void fexcDesLogspace(double fMin, double fMax, int NfexcDes); |
altb | 0:e2a7d7f91e49 | 72 | void calcGPAmeasPara(double fexcDes_i); |
pmic | 7:7715f92c5182 | 73 | void calcGPAsweepPara(); |
pmic | 7:7715f92c5182 | 74 | double wrapAngle(double angle); |
pmic | 7:7715f92c5182 | 75 | void printLongLine(); |
altb | 0:e2a7d7f91e49 | 76 | void printLine(); |
altb | 0:e2a7d7f91e49 | 77 | |
altb | 0:e2a7d7f91e49 | 78 | }; |