The final program for the #include AIR robot

Dependencies:   Biquad HIDScope QEI angleandposition controlandadjust mbed

Fork of includeair by BioRobotics

filtervalues.h

Committer:
Gerth
Date:
2015-11-02
Revision:
47:29ea2915b811
Parent:
39:ebcf0a60f58b

File content as of revision 47:29ea2915b811:

//////////////////////////////////////////////CONSTANTS
///////////////////Biquad #1
const double gain_f1 =    9.6508098634474382e-01;
const double A_f1[] = {  1.0000000000000000e+00 , -1.5685816307006708e+00  , 9.6424138386900704e-01};
const double B_f1[] = {   9.6508098634474382e-01  ,-1.5620271748674457e+00  , 9.6508103356874642e-01};

///////////////////Biquad #2
const double gain_f2 =   1.0000000000000000e+00;
const double A_f2[] = { 1.0000000000000000e+00 , -1.6110035772715345e+00  , 9.6592170561041857e-01};
const double B_f2[] = {  1.0000000000000000e+00  ,-1.6185451093340690e+00 ,  9.9999995106731920e-01};

///////////////////Biquad #3
const double gain_f3 =  9.6508098634473305e-01;
const double A_f3[] = {1.0000000000000000e+00,  -5.7396521780998500e-01 ,  9.6488297638274156e-01};
const double B_f3[] = { 9.6508098634473305e-01  ,-5.9664124427116272e-01 ,  9.6508097692557404e-01};

///////////////////Biquad #4
const double gain_f4 =  1.0000000000000000e+00;
const double A_f4[] = {   1.0000000000000000e+00  ,-6.4052826150899422e-01  , 9.6527942240059728e-01};
const double B_f4[] = {1.0000000000000000e+00,  -6.1822926625254149e-01 ,  1.0000000097599706e+00};
///////////////////Biquad #5
const double gain_f5 =    6.9977431651797473e-01;
const double A_f5[] = { 1.0000000000000000e+00  ,-1.3072850288493236e+00 ,  4.9181223722257517e-01};
const double B_f5[] = {  6.9977431651797473e-01,  -1.3995486330359495e+00 ,  6.9977431651797473e-01};

///////////////////Biquad #6
const double gain_f6 = 2.4136223124304745e-08;
const double A_f6[] = {1.0000000000000000e+00  ,-1.9540019616345168e+00  , 9.5461925134316061e-01};
const double B_f6[] = {  2.4136223124304745e-08 ,  4.8272447728835386e-08 ,  2.4136223466598214e-08};

///////////////////Biquad #7
const double gain_f7 =  1.0000000000000000e+00;
const double A_f7[] = {  1.0000000000000000e+00 , -1.9803238591642129e+00  , 9.8094946423345442e-01};
const double B_f7[] = {   1.0000000000000000e+00 ,  1.9999999386720257e+00  , 9.9999998581827421e-01};


////////////////////////////////////////////ARRAYS TO VARIABLES
/////////////////Biquad #1
const double a1_f1 = gain_f1*A_f1[1],
             a2_f1 = gain_f1*A_f1[2],
             b0_f1 = gain_f1*B_f1[0],
             b1_f1 = gain_f1*B_f1[1],
             b2_f1 = gain_f1*B_f1[2]; //filter coefficients filter 1
double v1_f1_emg1=0 ,
       v2_f1_emg1=0 ,
       v1_f1_emg2=0 ,
       v2_f1_emg2=0;//storage variables filter 1

/////////////////Biquad #2
const double a1_f2 = gain_f2*A_f2[1],
             a2_f2 = gain_f2*A_f2[2],
             b0_f2 = gain_f2*B_f2[0],
             b1_f2 = gain_f2*B_f2[1],
             b2_f2 = gain_f2*B_f2[2]; //filter coefficients filter 2
double v1_f2_emg1=0 ,
       v2_f2_emg1=0 ,
       v1_f2_emg2=0 ,
       v2_f2_emg2=0;//storage variables filter 2

/////////////////Biquad #3
const double a1_f3 = gain_f3*A_f3[1],
             a2_f3 = gain_f3*A_f3[2],
             b0_f3 = gain_f3*B_f3[0],
             b1_f3 = gain_f3*B_f3[1],
             b2_f3 = gain_f3*B_f3[2]; //filter coefficients filter 3
double v1_f3_emg1=0 ,
       v2_f3_emg1=0 ,
       v1_f3_emg2=0 ,
       v2_f3_emg2=0;//storage variables filter 3

/////////////////Biquad #4
const double a1_f4 = gain_f4*A_f4[1],
             a2_f4 = gain_f4*A_f4[2],
             b0_f4 = gain_f4*B_f4[0],
             b1_f4 = gain_f4*B_f4[1],
             b2_f4 = gain_f4*B_f4[2]; //filter coefficients filter 4
double v1_f4_emg1=0 ,
       v2_f4_emg1=0 ,
       v1_f4_emg2=0 ,
       v2_f4_emg2=0;//storage variables filter 4

/////////////////Biquad #5
const double a1_f5 = gain_f5*A_f5[1],
             a2_f5 = gain_f5*A_f5[2],
             b0_f5 = gain_f5*B_f5[0],
             b1_f5 = gain_f5*B_f5[1],
             b2_f5 = gain_f5*B_f5[2]; //filter coefficients filter 5
double v1_f5_emg1=0 ,
       v2_f5_emg1=0 ,
       v1_f5_emg2=0 ,
       v2_f5_emg2=0;//storage variables filter 5

/////////////////Biquad #6
const double a1_f6 = gain_f6*A_f6[1],
             a2_f6 = gain_f6*A_f6[2],
             b0_f6 = gain_f6*B_f6[0],
             b1_f6 = gain_f6*B_f6[1],
             b2_f6 = gain_f6*B_f6[2]; //filter coefficients filter 6
double v1_f6_emg1=0 ,
       v2_f6_emg1=0 ,
       v1_f6_emg2=0 ,
       v2_f6_emg2=0;//storage variables filter 6

/////////////////Biquad #7
const double a1_f7 = gain_f7*A_f7[1],
             a2_f7 = gain_f7*A_f7[2],
             b0_f7 = gain_f7*B_f7[0],
             b1_f7 = gain_f7*B_f7[1],
             b2_f7 = gain_f7*B_f7[2]; //filter coefficients filter 7
double v1_f7_emg1=0 ,
       v2_f7_emg1=0 ,
       v1_f7_emg2=0 ,
       v2_f7_emg2=0;//storage variables filter 7