The cause is really not clear. The formual using 2*Pi to convert
from radians to frequency is perfectly correct.
However, measurements with various test equipment (including Racal 6103)
have shown our frequency error estimate is always off by a power of two...
#define AFC_NORM_FACTOR_DCS ((1<<15) / 1894)
/* we assume 4.9ppb per LSB, equals 0.0049 * 32768 == 160 */
-#define AFC_SLOPE 160
+//#define AFC_SLOPE 160
+#define AFC_SLOPE 320
//#define AFC_SLOPE 141
/* The DSP can measure the frequency error in the following ranges:
/* Convert an angle in fx1.15 notatinon into Hz */
#define BITFREQ_DIV_2PI 43104 /* 270kHz / 2 * pi */
+#define BITFREQ_DIV_PI 86208 /* 270kHz / pi */
#define ANG2FREQ_SCALING (2<<15) /* 2^15 scaling factor for fx1.15 */
-#define ANGLE_TO_FREQ(angle) ((int16_t)angle * BITFREQ_DIV_2PI / ANG2FREQ_SCALING)
+#define ANGLE_TO_FREQ(angle) ((int16_t)angle * BITFREQ_DIV_PI / ANG2FREQ_SCALING)
#define AFC_MAX_ANGLE 328 /* 0.01 radian in fx1.15 */
#define AFC_SNR_THRESHOLD 2560 /* 2.5 dB in fx6.10 */