comparison FXAnalyse.c @ 62:53dbce5f0745

Further simplification
author Daniele Nicolodi <daniele.nicolodi@obspm.fr>
date Mon, 29 Oct 2012 14:43:40 +0100
parents 37075b60408b
children d6efe6fe6eb3
comparison
equal deleted inserted replaced
61:37075b60408b 62:53dbce5f0745
66 66
67 int Measuring_1 = FALSE; 67 int Measuring_1 = FALSE;
68 int Measuring_2 = FALSE; 68 int Measuring_2 = FALSE;
69 int Measuring_3 = FALSE; 69 int Measuring_3 = FALSE;
70 70
71 double FrequDDS1=110000000.0, FrequDDS2=15300000.0, FrequDDS3=150400000.0, FrequDDS4=110000000.0; 71 double FrequDDS1=110000000.0, FrequDDS4=110000000.0;
72 double Slope_1=0.0,Slope_2=0.0,Slope_3=0.0,Beatslope_2=0.0; 72 double Slope_1=0.0,Slope_2=0.0,Slope_3=0.0,Beatslope_2=0.0;
73 double SlopeTime1=40.0, SlopeTime2=40.0; SlopeTime3=40.0; 73 double SlopeTime1=40.0, SlopeTime2=40.0; SlopeTime3=40.0;
74 74
75 double N_1=0.0, N_2=0.0, N_3=0.0; 75 double N_1=0.0, N_2=0.0, N_3=0.0;
76 double DeltaT_1=20.0, DeltakHz_1=500.0, t1_1=0.0, t2_1=0.0, t3_1=0.0, Frepplus_1=0.0, Frepminus_1=0.0; 76 double DeltaT_1=20.0, DeltakHz_1=500.0, t1_1=0.0, t2_1=0.0, t3_1=0.0, Frepplus_1=0.0, Frepminus_1=0.0;
890 double fDDS1 = FrequDDS1 + DeltakHz_2 * 1000; 890 double fDDS1 = FrequDDS1 + DeltakHz_2 * 1000;
891 printf("fDDS1 = %g\n", fDDS1); 891 printf("fDDS1 = %g\n", fDDS1);
892 DDS4xAD9912_FrequencyRampe(&DDS4xAD9912,1, FrequDDS1, fDDS1, Step2/Ndiv); 892 DDS4xAD9912_FrequencyRampe(&DDS4xAD9912,1, FrequDDS1, fDDS1, Step2/Ndiv);
893 SetCtrlVal(MainPanel, PANEL_DDS1, fDDS1); 893 SetCtrlVal(MainPanel, PANEL_DDS1, fDDS1);
894 DDS4xAD9912_SetFrequency(&DDS4xAD9912, 1, fDDS1); 894 DDS4xAD9912_SetFrequency(&DDS4xAD9912, 1, fDDS1);
895
895 // adjust DDS3 to keep beatnote within the bandpass filter. prediction 896 // adjust DDS3 to keep beatnote within the bandpass filter. prediction
896 DeltaDDS3 = -DeltakHz_2*1000*(-Signe1/Signe2)*Ndiv*(Nu2)/(Nu1) - Beatslope_2*(utc-t1_2); 897 double fDDS3 = FrequencyDDS3Init - DeltakHz_2*1000*(-Signe1/Signe2)*Ndiv*(Nu2)/(Nu1) - Beatslope_2*(utc-t1_2);
898 DeltaDDS3 = fDDS3 - DDS4xAD9912.Frequency3;
897 printf("deltaDDS3 = %g\n", DeltaDDS3); 899 printf("deltaDDS3 = %g\n", DeltaDDS3);
898 SetCtrlVal(MainPanel, PANEL_DDS3, FrequencyDDS3Init + DeltaDDS3); 900 SetCtrlVal(MainPanel, PANEL_DDS3, fDDS3);
899 DDS4xAD9912_SetFrequency(&DDS4xAD9912, 3, FrequencyDDS3Init + DeltaDDS3); 901 DDS4xAD9912_SetFrequency(&DDS4xAD9912, 3, fDDS3);
900 902
901 // allow counter to settle 903 // allow counter to settle
902 settling = 3; 904 settling = 3;
903 905
904 // next step 906 // next step
950 Frepplus_2 = Frepplus_2 / n_2; 952 Frepplus_2 = Frepplus_2 / n_2;
951 Delta10K_Plus = Delta10K_Plus / n_2; 953 Delta10K_Plus = Delta10K_Plus / n_2;
952 n_2 = 0; 954 n_2 = 0;
953 955
954 // negative frequency step 956 // negative frequency step
955 DDS4xAD9912_FrequencyRampe(&DDS4xAD9912,1, (FrequDDS1+DeltakHz_2*1000),(FrequDDS1-DeltakHz_2*1000), Step2/Ndiv); 957 double fDDS1 = FrequDDS1 - DeltakHz_2 * 1000;
956 SetCtrlVal(MainPanel, PANEL_DDS1, (FrequDDS1-DeltakHz_2*1000)); 958 DDS4xAD9912_FrequencyRampe(&DDS4xAD9912, 1, DDS4xAD9912.Frequency1, fDDS1, Step2/Ndiv);
957 DDS4xAD9912_SetFrequency(&DDS4xAD9912,1, (FrequDDS1-DeltakHz_2*1000)); 959 SetCtrlVal(MainPanel, PANEL_DDS1, fDDS1);
958 double fDDS3 = FrequencyDDS3Init+DeltakHz_2*1000*(-Signe1/Signe2)*Ndiv*(Nu2)/(Nu1); 960 DDS4xAD9912_SetFrequency(&DDS4xAD9912, 1, fDDS1);
961
962 // adjust DDS3 to keep beatnote within the bandpass filter. prediction
963 double fDDS3 = FrequencyDDS3Init + DeltakHz_2*1000*(-Signe1/Signe2)*Ndiv*(Nu2)/(Nu1);
959 DeltaDDS3 = fDDS3 - DDS4xAD9912.Frequency3; 964 DeltaDDS3 = fDDS3 - DDS4xAD9912.Frequency3;
960 SetCtrlVal(MainPanel, PANEL_DDS3, fDDS3); 965 SetCtrlVal(MainPanel, PANEL_DDS3, fDDS3);
961 DDS4xAD9912_SetFrequency(&DDS4xAD9912, 3, fDDS3); 966 DDS4xAD9912_SetFrequency(&DDS4xAD9912, 3, fDDS3);
962 967
963 // allow counter to settle 968 // allow counter to settle
993 SetCtrlVal(CalcN2Panel, CALCN2_N, N_2); 998 SetCtrlVal(CalcN2Panel, CALCN2_N, N_2);
994 999
995 // back to nominal frequency 1000 // back to nominal frequency
996 DDS4xAD9912_FrequencyRampe (&DDS4xAD9912, 1, FrequDDS1-DeltakHz_2*1000,FrequDDS1, Step2/Ndiv ); 1001 DDS4xAD9912_FrequencyRampe (&DDS4xAD9912, 1, FrequDDS1-DeltakHz_2*1000,FrequDDS1, Step2/Ndiv );
997 SetCtrlVal(MainPanel, PANEL_DDS1, FrequDDS1); 1002 SetCtrlVal(MainPanel, PANEL_DDS1, FrequDDS1);
998 DDS4xAD9912_SetFrequency(&DDS4xAD9912,1,FrequDDS1); 1003 DDS4xAD9912_SetFrequency(&DDS4xAD9912, 1, FrequDDS1);
999 Delay(0.1);
1000 SetCtrlVal(MainPanel, PANEL_DDS2, FrequencyDDSBesInit); 1004 SetCtrlVal(MainPanel, PANEL_DDS2, FrequencyDDSBesInit);
1001 DDS4xAD9912_SetFrequency (&DDS4xAD9912, 2, FrequencyDDSBesInit ); 1005 DDS4xAD9912_SetFrequency (&DDS4xAD9912, 2, FrequencyDDSBesInit );
1002 Delay(0.1);
1003 SetCtrlVal(MainPanel, PANEL_DDS3, FrequencyDDS3Init-Beatslope_2*(utc-t1_2)); 1006 SetCtrlVal(MainPanel, PANEL_DDS3, FrequencyDDS3Init-Beatslope_2*(utc-t1_2));
1004 DDS4xAD9912_SetFrequency (&DDS4xAD9912, 3, FrequencyDDS3Init-Beatslope_2*(utc-t1_2) ); 1007 DDS4xAD9912_SetFrequency (&DDS4xAD9912, 3, FrequencyDDS3Init-Beatslope_2*(utc-t1_2) );
1005 1008
1006 t1_2 = 0.0; 1009 t1_2 = 0.0;
1007 t2_2 = 0.0; 1010 t2_2 = 0.0;