comparison FXAnalyse.c @ 57:0e4e0d7b6a22

Do not suspend slope measurement for 5 cycles at each slope measurement interval
author Daniele Nicolodi <daniele.nicolodi@obspm.fr>
date Wed, 17 Oct 2012 15:54:41 +0200
parents 6e73fb3d94fa
children d0aa333e6451
comparison
equal deleted inserted replaced
56:6e73fb3d94fa 57:0e4e0d7b6a22
107 double SlopeMath2 = 0.0; // currently applied frequency dedrifiting slope 107 double SlopeMath2 = 0.0; // currently applied frequency dedrifiting slope
108 double TimetoSlope = 60.0; 108 double TimetoSlope = 60.0;
109 double SlopeMeasuringTimeBegin = 0.0; 109 double SlopeMeasuringTimeBegin = 0.0;
110 110
111 double Slope_Math2slope=0.0,Math2_slope=0.0,Moy_Math2slope=0.0; 111 double Slope_Math2slope=0.0,Math2_slope=0.0,Moy_Math2slope=0.0;
112 int N_Math2slope=0.0,nstabilisationSlopeMeasuring=0; 112 int N_Math2slope=0.0;
113 113
114 double LimitToDelock=5.0; 114 double LimitToDelock=5.0;
115 double limitotakoff=70.0; 115 double limitotakoff=70.0;
116 116
117 int ratio=10; //Recentre la frequence tous les ratios 117 int ratio=10; //Recentre la frequence tous les ratios
1237 SlopeMeasuring = FALSE; 1237 SlopeMeasuring = FALSE;
1238 SetCtrlVal(MainPanel, PANEL_MEASURE_SLOPE, 0); 1238 SetCtrlVal(MainPanel, PANEL_MEASURE_SLOPE, 0);
1239 } 1239 }
1240 1240
1241 // update slope measurement 1241 // update slope measurement
1242 if (nstabilisationSlopeMeasuring < 5) { 1242 N_Math2slope = N_Math2slope + 1;
1243 nstabilisationSlopeMeasuring += 1; 1243 Math2_slope = currentFreq;
1244 } else { 1244 Moy_Math2slope = ((N_Math2slope-1)*Moy_Math2slope + Math2_slope)/N_Math2slope;
1245 N_Math2slope = N_Math2slope + 1; 1245 Slope_Math2slope = (Slope_Math2slope*(N_Math2slope-2) + 6*(Math2_slope-Moy_Math2slope)/N_Math2slope)/(N_Math2slope+1);
1246 Math2_slope = currentFreq;
1247 Moy_Math2slope = ((N_Math2slope-1)*Moy_Math2slope + Math2_slope)/N_Math2slope;
1248 Slope_Math2slope = (Slope_Math2slope*(N_Math2slope-2) + 6*(Math2_slope-Moy_Math2slope)/N_Math2slope)/(N_Math2slope+1);
1249 }
1250 1246
1251 // update applied slope 1247 // update applied slope
1252 if ((utc - SlopeMeasuringTimeBegin) > TimetoSlope) { 1248 if ((utc - SlopeMeasuringTimeBegin) > TimetoSlope) {
1253 1249
1254 if (invertSlopeSign) 1250 if (invertSlopeSign)
1281 1277
1282 N_Math2slope = 0.0; 1278 N_Math2slope = 0.0;
1283 Math2_slope = 0.0; 1279 Math2_slope = 0.0;
1284 Moy_Math2slope = 0.0; 1280 Moy_Math2slope = 0.0;
1285 Slope_Math2slope = 0.0; 1281 Slope_Math2slope = 0.0;
1286 nstabilisationSlopeMeasuring = 0;
1287 SlopeMeasuringTimeBegin = utc; 1282 SlopeMeasuringTimeBegin = utc;
1288 } 1283 }
1289 } 1284 }
1290 1285
1291 // re-centering 1286 // re-centering
2244 Slope_Math2slope = 0.0; 2239 Slope_Math2slope = 0.0;
2245 MoyMath2 = 0.0; 2240 MoyMath2 = 0.0;
2246 Slope_Math2slope = 0.0; 2241 Slope_Math2slope = 0.0;
2247 CenterFrequencyCh2 = 0.0; 2242 CenterFrequencyCh2 = 0.0;
2248 Nratio = -1; 2243 Nratio = -1;
2249 nstabilisationSlopeMeasuring = 0;
2250
2251 } 2244 }
2252 break; 2245 break;
2253 } 2246 }
2254 return 0; 2247 return 0;
2255 } 2248 }