# HG changeset patch # User Daniele Nicolodi # Date 1351518220 -3600 # Node ID 53dbce5f0745c1f30fd08e4bde99493f1a6c222e # Parent 37075b60408b0446cf16ea201892dc00478671a9 Further simplification diff -r 37075b60408b -r 53dbce5f0745 FXAnalyse.c --- a/FXAnalyse.c Thu Oct 18 12:24:31 2012 +0200 +++ b/FXAnalyse.c Mon Oct 29 14:43:40 2012 +0100 @@ -68,7 +68,7 @@ int Measuring_2 = FALSE; int Measuring_3 = FALSE; -double FrequDDS1=110000000.0, FrequDDS2=15300000.0, FrequDDS3=150400000.0, FrequDDS4=110000000.0; +double FrequDDS1=110000000.0, FrequDDS4=110000000.0; double Slope_1=0.0,Slope_2=0.0,Slope_3=0.0,Beatslope_2=0.0; double SlopeTime1=40.0, SlopeTime2=40.0; SlopeTime3=40.0; @@ -892,11 +892,13 @@ DDS4xAD9912_FrequencyRampe(&DDS4xAD9912,1, FrequDDS1, fDDS1, Step2/Ndiv); SetCtrlVal(MainPanel, PANEL_DDS1, fDDS1); DDS4xAD9912_SetFrequency(&DDS4xAD9912, 1, fDDS1); + // adjust DDS3 to keep beatnote within the bandpass filter. prediction - DeltaDDS3 = -DeltakHz_2*1000*(-Signe1/Signe2)*Ndiv*(Nu2)/(Nu1) - Beatslope_2*(utc-t1_2); + double fDDS3 = FrequencyDDS3Init - DeltakHz_2*1000*(-Signe1/Signe2)*Ndiv*(Nu2)/(Nu1) - Beatslope_2*(utc-t1_2); + DeltaDDS3 = fDDS3 - DDS4xAD9912.Frequency3; printf("deltaDDS3 = %g\n", DeltaDDS3); - SetCtrlVal(MainPanel, PANEL_DDS3, FrequencyDDS3Init + DeltaDDS3); - DDS4xAD9912_SetFrequency(&DDS4xAD9912, 3, FrequencyDDS3Init + DeltaDDS3); + SetCtrlVal(MainPanel, PANEL_DDS3, fDDS3); + DDS4xAD9912_SetFrequency(&DDS4xAD9912, 3, fDDS3); // allow counter to settle settling = 3; @@ -952,10 +954,13 @@ n_2 = 0; // negative frequency step - DDS4xAD9912_FrequencyRampe(&DDS4xAD9912,1, (FrequDDS1+DeltakHz_2*1000),(FrequDDS1-DeltakHz_2*1000), Step2/Ndiv); - SetCtrlVal(MainPanel, PANEL_DDS1, (FrequDDS1-DeltakHz_2*1000)); - DDS4xAD9912_SetFrequency(&DDS4xAD9912,1, (FrequDDS1-DeltakHz_2*1000)); - double fDDS3 = FrequencyDDS3Init+DeltakHz_2*1000*(-Signe1/Signe2)*Ndiv*(Nu2)/(Nu1); + double fDDS1 = FrequDDS1 - DeltakHz_2 * 1000; + DDS4xAD9912_FrequencyRampe(&DDS4xAD9912, 1, DDS4xAD9912.Frequency1, fDDS1, Step2/Ndiv); + SetCtrlVal(MainPanel, PANEL_DDS1, fDDS1); + DDS4xAD9912_SetFrequency(&DDS4xAD9912, 1, fDDS1); + + // adjust DDS3 to keep beatnote within the bandpass filter. prediction + double fDDS3 = FrequencyDDS3Init + DeltakHz_2*1000*(-Signe1/Signe2)*Ndiv*(Nu2)/(Nu1); DeltaDDS3 = fDDS3 - DDS4xAD9912.Frequency3; SetCtrlVal(MainPanel, PANEL_DDS3, fDDS3); DDS4xAD9912_SetFrequency(&DDS4xAD9912, 3, fDDS3); @@ -995,11 +1000,9 @@ // back to nominal frequency DDS4xAD9912_FrequencyRampe (&DDS4xAD9912, 1, FrequDDS1-DeltakHz_2*1000,FrequDDS1, Step2/Ndiv ); SetCtrlVal(MainPanel, PANEL_DDS1, FrequDDS1); - DDS4xAD9912_SetFrequency(&DDS4xAD9912,1,FrequDDS1); - Delay(0.1); + DDS4xAD9912_SetFrequency(&DDS4xAD9912, 1, FrequDDS1); SetCtrlVal(MainPanel, PANEL_DDS2, FrequencyDDSBesInit); DDS4xAD9912_SetFrequency (&DDS4xAD9912, 2, FrequencyDDSBesInit ); - Delay(0.1); SetCtrlVal(MainPanel, PANEL_DDS3, FrequencyDDS3Init-Beatslope_2*(utc-t1_2)); DDS4xAD9912_SetFrequency (&DDS4xAD9912, 3, FrequencyDDS3Init-Beatslope_2*(utc-t1_2) );