double x; double y; double z; double temp1; double temp2; double Corrx; double Corry; double Corrz; void RFAMPD(double* datIn, int nIn, double* datOut, int nOut) { x=datIn[0]; //11MHz y=datIn[1]; //29MHz z=datIn[2]; //55MHz //Get to more sensibly scaled units (still Volts) x=-(x-2.16); y=-(y-2.16); z=-(z-2.16); //Correct the cross-talk (1st order only) // Correct 11MHz temp1=y-0.86; if( temp1 < 0 ) temp1=0; temp2=z-1.18; if( temp2 < 0 ) temp2=0; Corrx=x-temp1-temp2; // Correct 29MHz temp1=x-1.06; if( temp1 < 0 ) temp1=0; temp2=z-0.70; if( temp2 < 0 ) temp2=0; Corry=y-temp1-temp2; // Correct 55MHz temp1=x-1.26; if( temp1 < 0 ) temp1=0; temp2=z-0.84; if( temp2 < 0 ) temp2=0; Corrz=z-temp1-temp2; //Scale from Voltage to dBm (RF power) Corrx = (Corrx - 1.32) / 0.024; Corry = (Corry - 1.32) / 0.024; Corrz = (Corrz - 1.32) / 0.024; //Scale from dBm RF power to dBm optical power Corrx = Corrx - 69.5; Corry = Corry - 69.5; Corrz = Corrz - 69.5; datOut[0]=Corrx; datOut[1]=Corry; datOut[2]=Corrz; }