Mercurial > hg > fxanalyse
changeset 162:1517a56163de
Cleanup
author | Daniele Nicolodi <daniele.nicolodi@obspm.fr> |
---|---|
date | Mon, 10 Feb 2014 14:44:41 +0100 |
parents | 6ee23cb3d6bb |
children | 4ff3e468ab5f |
files | FXAnalyse.c |
diffstat | 1 files changed, 15 insertions(+), 17 deletions(-) [+] |
line wrap: on
line diff
--- a/FXAnalyse.c Tue Feb 04 17:07:59 2014 +0100 +++ b/FXAnalyse.c Mon Feb 10 14:44:41 2014 +0100 @@ -186,19 +186,17 @@ int nobs = 0; int settling = 0; -double f0_DDS1 = 110000000.0, f0_DDS2, f0_DDS3; +double f0_DDS1 = 110000000.0, f0_DDS2, f0_DDS3, df_DDS3; -double N_1=0.0, N_2=0.0, N_3=0.0; double SlopeTime1=40.0, DeltaT_1=20.0, delta_f_lock_1=500.0; double SlopeTime2=40.0, DeltaT_2=20.0, delta_f_lock_2=500.0; double SlopeTime3=40.0, DeltaT_3=20.0, delta_f_lock_3=500.0; -double DeltaDDS3=0.0; - double t1, t2, t3; double f_rep_slope, f_beat_slope; double f_rep_plus, f_rep_minus; double f_beat_plus, f_beat_minus; +double N_measured; double Frequencystep1=10000.0, tbegin1=0.0, Frepbefore1=0.0, Frequency1=0.0; double Frequencystep2=10.0, tbegin2=0.0, Frepbefore2=0.0, Ch2before=0.0, Frequency2=0.0; @@ -791,8 +789,8 @@ // compute N1 double delta_f_rep = f_rep_minus - f_rep_plus; - N_1 = Sign1 * 2 * Ndiv * delta_f_lock_1 / delta_f_rep; - SetCtrlVal(CalcNPanel, CALCN_N, N_1); + N_measured = Sign1 * 2 * Ndiv * delta_f_lock_1 / delta_f_rep; + SetCtrlVal(CalcNPanel, CALCN_N, N_measured); // back to nominal frep DDS4xAD9912_RampFrequency(&DDS4xAD9912, 1, f0_DDS1, FREP_STEP_SIZE); @@ -848,7 +846,7 @@ // adjust DDS3 to keep beatnote within the bandpass filter. prediction double fDDS3 = f0_DDS3 + Sign1 * Sign2 * N2/N1 * Ndiv * delta_f_lock_2; - DeltaDDS3 = fDDS3 - DDS4xAD9912_GetFrequency(&DDS4xAD9912, 3); + df_DDS3 = fDDS3 - DDS4xAD9912_GetFrequency(&DDS4xAD9912, 3); DDS4xAD9912_SetFrequency(&DDS4xAD9912, 3, fDDS3); // allow counter to settle @@ -870,7 +868,7 @@ DDS4xAD9912_SetFrequency(&DDS4xAD9912, 2, fDDS2); double fDDS3 = DDS4xAD9912_GetFrequency(&DDS4xAD9912, 3) + 10000 - Ch2; - DeltaDDS3 = DeltaDDS3 + 10000 - Ch2; + df_DDS3 = df_DDS3 + 10000 - Ch2; DDS4xAD9912_SetFrequency(&DDS4xAD9912, 3, fDDS3); // allow counter to settle @@ -904,7 +902,7 @@ // adjust DDS3 to keep beatnote within the bandpass filter. prediction double fDDS3 = f0_DDS3 - Sign1 * Sign2 * N2/N1 * Ndiv * delta_f_lock_2; - DeltaDDS3 = fDDS3 - DDS4xAD9912_GetFrequency(&DDS4xAD9912, 3); + df_DDS3 = fDDS3 - DDS4xAD9912_GetFrequency(&DDS4xAD9912, 3); DDS4xAD9912_SetFrequency(&DDS4xAD9912, 3, fDDS3); // allow counter to settle @@ -940,8 +938,8 @@ logmsg("delta frep: measured=%e expected=%e difference=%e", delta_f_rep_m, delta_f_rep, delta_f_rep_m - delta_f_rep); - N_2 = -Sign2 * (DeltaDDS3 + f_beat_minus - f_beat_plus) / delta_f_rep; - SetCtrlVal(CalcNPanel, CALCN_N, N_2); + N_measured = -Sign2 * (df_DDS3 + f_beat_minus - f_beat_plus) / delta_f_rep; + SetCtrlVal(CalcNPanel, CALCN_N, N_measured); // back to nominal frequency DDS4xAD9912_RampFrequency(&DDS4xAD9912, 1, f0_DDS1, FREP_STEP_SIZE); @@ -1100,10 +1098,10 @@ logmsg("delta fbeat: measured=%e expected=%e difference=%e", delta_f_beat, delta_f_beat_expected, delta_f_beat - delta_f_beat_expected); - N_3 = delta_f_beat / delta_f_rep; - SetCtrlVal(CalcNPanel, CALCN_N, N_3); + N_measured = delta_f_beat / delta_f_rep; + SetCtrlVal(CalcNPanel, CALCN_N, N_measured); - logmsg("measured N3=%.3f", N_3); + logmsg("measured N3=%.3f", N_measured); // back to nominal frep DDS4xAD9912_RampFrequency(&DDS4xAD9912, 1, f0_DDS1, FREP_STEP_SIZE); @@ -1536,15 +1534,15 @@ GetPanelAttribute(panel, ATTR_CALLBACK_DATA, &measure); switch (measure) { case LO: - N1 = round(N_1); + N1 = round(N_measured); SetCtrlVal(MainPanel, PANEL_N1CHOICE, N1); break; case HG: - N2 = round(N_2); + N2 = round(N_measured); SetCtrlVal(MainPanel, PANEL_N2CHOICE, N2); break; case SR: - N3 = round(N_3); + N3 = round(N_measured); SetCtrlVal(MainPanel, PANEL_N3CHOICE, N3); break; }