comparison rfcal/vcxo-manual/genparams.c @ 185:3eb53be9e667

fc-vcxo-param: use M_PI constant instead of acos(-1.0)
author Mychaela Falconia <falcon@freecalypso.org>
date Thu, 13 Apr 2017 05:13:45 +0000
parents b8599a1d5813
children
comparison
equal deleted inserted replaced
184:b8599a1d5813 185:3eb53be9e667
42 } 42 }
43 43
44 main(argc, argv) 44 main(argc, argv)
45 char **argv; 45 char **argv;
46 { 46 {
47 float pi;
48
49 if (argc < 2 || argc > 3) { 47 if (argc < 2 || argc > 3) {
50 fprintf(stderr, "usage: %s meas-file [outfile]\n", argv[0]); 48 fprintf(stderr, "usage: %s meas-file [outfile]\n", argv[0]);
51 exit(1); 49 exit(1);
52 } 50 }
53 read_meas_file(argv[1], meas, 4); 51 read_meas_file(argv[1], meas, 4);
66 dac_min = (-13500.0f - lin_b) / lin_a; 64 dac_min = (-13500.0f - lin_b) / lin_a;
67 dac_max = (13500.0f - lin_b) / lin_a; 65 dac_max = (13500.0f - lin_b) / lin_a;
68 dac_init = -lin_b2 / lin_a2; 66 dac_init = -lin_b2 / lin_a2;
69 67
70 /* Psi computations */ 68 /* Psi computations */
71 pi = acos(-1.0); 69 Psi_sta = 2.0f * (float)M_PI *
72 Psi_sta = 2.0f * pi * (float)(meas[1].freq_offset - meas[0].freq_offset) 70 (float)(meas[1].freq_offset - meas[0].freq_offset) /
73 / ((float)(meas[1].dac_value - meas[0].dac_value) * 270833.0f); 71 ((float)(meas[1].dac_value - meas[0].dac_value) * 270833.0f);
74 Psi_st = Psi_sta * 0.8f; 72 Psi_st = Psi_sta * 0.8f;
75 73
76 /* spit it all out */ 74 /* spit it all out */
77 write_output(argv[2]); 75 write_output(argv[2]);
78 exit(0); 76 exit(0);