annotate L1/include/l1_ctl.h @ 33:6a2b09d3b1b4

disable L1_DYN_DSP_DWNLD and AMR by default
author Mychaela Falconia <falcon@freecalypso.org>
date Sat, 15 Oct 2016 04:23:58 +0000
parents f93dab57b032
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
0
75a11d740a02 initial import of gsm-fw from freecalypso-sw rev 1033:5ab737ac3ad7
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1 /************* Revision Controle System Header *************
3
f93dab57b032 L1/include: TCS211-based version restored
Mychaela Falconia <falcon@freecalypso.org>
parents: 0
diff changeset
2 * GSM Layer 1 software
0
75a11d740a02 initial import of gsm-fw from freecalypso-sw rev 1033:5ab737ac3ad7
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
3 * L1_CTL.H
75a11d740a02 initial import of gsm-fw from freecalypso-sw rev 1033:5ab737ac3ad7
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
4 *
75a11d740a02 initial import of gsm-fw from freecalypso-sw rev 1033:5ab737ac3ad7
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
5 * Filename l1_ctl.h
3
f93dab57b032 L1/include: TCS211-based version restored
Mychaela Falconia <falcon@freecalypso.org>
parents: 0
diff changeset
6 * Copyright 2003 (C) Texas Instruments
0
75a11d740a02 initial import of gsm-fw from freecalypso-sw rev 1033:5ab737ac3ad7
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
7 *
75a11d740a02 initial import of gsm-fw from freecalypso-sw rev 1033:5ab737ac3ad7
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
8 ************* Revision Controle System Header *************/
75a11d740a02 initial import of gsm-fw from freecalypso-sw rev 1033:5ab737ac3ad7
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
9
75a11d740a02 initial import of gsm-fw from freecalypso-sw rev 1033:5ab737ac3ad7
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
10 /************************************/
75a11d740a02 initial import of gsm-fw from freecalypso-sw rev 1033:5ab737ac3ad7
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
11 /* Automatic timing control (TOA) */
75a11d740a02 initial import of gsm-fw from freecalypso-sw rev 1033:5ab737ac3ad7
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
12 /************************************/
3
f93dab57b032 L1/include: TCS211-based version restored
Mychaela Falconia <falcon@freecalypso.org>
parents: 0
diff changeset
13 #define C_RED 1 // Factor used to reduce the maximum accumulated values.
f93dab57b032 L1/include: TCS211-based version restored
Mychaela Falconia <falcon@freecalypso.org>
parents: 0
diff changeset
14 // Default : 1/2
f93dab57b032 L1/include: TCS211-based version restored
Mychaela Falconia <falcon@freecalypso.org>
parents: 0
diff changeset
15 #define C_GEW 1 // Weighting factor. Default : 1/2
0
75a11d740a02 initial import of gsm-fw from freecalypso-sw rev 1033:5ab737ac3ad7
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
16
75a11d740a02 initial import of gsm-fw from freecalypso-sw rev 1033:5ab737ac3ad7
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
17 #define C_SNRGR 2560 // 2.5 F6.10
75a11d740a02 initial import of gsm-fw from freecalypso-sw rev 1033:5ab737ac3ad7
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
18 #define C_SNR_THR 8192 // 8 F6.10
3
f93dab57b032 L1/include: TCS211-based version restored
Mychaela Falconia <falcon@freecalypso.org>
parents: 0
diff changeset
19 #define TOA_HISTO_LEN 11 // Histogram length
0
75a11d740a02 initial import of gsm-fw from freecalypso-sw rev 1033:5ab737ac3ad7
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
20
3
f93dab57b032 L1/include: TCS211-based version restored
Mychaela Falconia <falcon@freecalypso.org>
parents: 0
diff changeset
21 /*
f93dab57b032 L1/include: TCS211-based version restored
Mychaela Falconia <falcon@freecalypso.org>
parents: 0
diff changeset
22 * FreeCalypso Frankenstein: the following definition has been added
f93dab57b032 L1/include: TCS211-based version restored
Mychaela Falconia <falcon@freecalypso.org>
parents: 0
diff changeset
23 * from LoCosto version of this file, as it is used by l1_cmplx.c
f93dab57b032 L1/include: TCS211-based version restored
Mychaela Falconia <falcon@freecalypso.org>
parents: 0
diff changeset
24 * fairly extensively.
f93dab57b032 L1/include: TCS211-based version restored
Mychaela Falconia <falcon@freecalypso.org>
parents: 0
diff changeset
25 *
f93dab57b032 L1/include: TCS211-based version restored
Mychaela Falconia <falcon@freecalypso.org>
parents: 0
diff changeset
26 * Disassembly-matching reconstruction has revealed that the constant
f93dab57b032 L1/include: TCS211-based version restored
Mychaela Falconia <falcon@freecalypso.org>
parents: 0
diff changeset
27 * in question was originally 210 in the TCS211 version, and then
f93dab57b032 L1/include: TCS211-based version restored
Mychaela Falconia <falcon@freecalypso.org>
parents: 0
diff changeset
28 * increased to 220 in the LoCosto source. We currently seek to match
f93dab57b032 L1/include: TCS211-based version restored
Mychaela Falconia <falcon@freecalypso.org>
parents: 0
diff changeset
29 * TCS211 without any changes, hence we are setting it back to 210.
f93dab57b032 L1/include: TCS211-based version restored
Mychaela Falconia <falcon@freecalypso.org>
parents: 0
diff changeset
30 */
f93dab57b032 L1/include: TCS211-based version restored
Mychaela Falconia <falcon@freecalypso.org>
parents: 0
diff changeset
31 #define IL_FOR_RXLEV_SNR 210 // RX POWER LEVEL
0
75a11d740a02 initial import of gsm-fw from freecalypso-sw rev 1033:5ab737ac3ad7
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
32
75a11d740a02 initial import of gsm-fw from freecalypso-sw rev 1033:5ab737ac3ad7
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
33 /************************************/
75a11d740a02 initial import of gsm-fw from freecalypso-sw rev 1033:5ab737ac3ad7
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
34 /* Automatic Gain Control (AGC) */
75a11d740a02 initial import of gsm-fw from freecalypso-sw rev 1033:5ab737ac3ad7
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
35 /************************************/
75a11d740a02 initial import of gsm-fw from freecalypso-sw rev 1033:5ab737ac3ad7
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
36
75a11d740a02 initial import of gsm-fw from freecalypso-sw rev 1033:5ab737ac3ad7
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
37 #define INDEX_MIN 0
75a11d740a02 initial import of gsm-fw from freecalypso-sw rev 1033:5ab737ac3ad7
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
38 #define INDEX_MAX 240 // 120
75a11d740a02 initial import of gsm-fw from freecalypso-sw rev 1033:5ab737ac3ad7
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
39
75a11d740a02 initial import of gsm-fw from freecalypso-sw rev 1033:5ab737ac3ad7
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
40 /************************************/
75a11d740a02 initial import of gsm-fw from freecalypso-sw rev 1033:5ab737ac3ad7
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
41 /* Automatic frequency compensation */
75a11d740a02 initial import of gsm-fw from freecalypso-sw rev 1033:5ab737ac3ad7
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
42 /************************************/
3
f93dab57b032 L1/include: TCS211-based version restored
Mychaela Falconia <falcon@freecalypso.org>
parents: 0
diff changeset
43 #define C_thr_snr 2560 // 1/0.4 * 2**10
f93dab57b032 L1/include: TCS211-based version restored
Mychaela Falconia <falcon@freecalypso.org>
parents: 0
diff changeset
44 #define C_thr_P 524288L // 0.5 * 2**20
f93dab57b032 L1/include: TCS211-based version restored
Mychaela Falconia <falcon@freecalypso.org>
parents: 0
diff changeset
45 #define C_cov_start 838861L // 0.8 * 2**20
f93dab57b032 L1/include: TCS211-based version restored
Mychaela Falconia <falcon@freecalypso.org>
parents: 0
diff changeset
46 #define C_a0_kalman 10486L // 0.01 * 2**20
f93dab57b032 L1/include: TCS211-based version restored
Mychaela Falconia <falcon@freecalypso.org>
parents: 0
diff changeset
47 #define C_g_kalman 53687091L// 0.05 * 2**30
0
75a11d740a02 initial import of gsm-fw from freecalypso-sw rev 1033:5ab737ac3ad7
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
48 #define C_N_del 2 // delay of frequency control loop
3
f93dab57b032 L1/include: TCS211-based version restored
Mychaela Falconia <falcon@freecalypso.org>
parents: 0
diff changeset
49 // due to C W R pipeline
f93dab57b032 L1/include: TCS211-based version restored
Mychaela Falconia <falcon@freecalypso.org>
parents: 0
diff changeset
50 #define C_Q 3L // 0.000003 * 2**20
f93dab57b032 L1/include: TCS211-based version restored
Mychaela Falconia <falcon@freecalypso.org>
parents: 0
diff changeset
51 #define C_thr_K 209715L // 0.2 * 2**20
0
75a11d740a02 initial import of gsm-fw from freecalypso-sw rev 1033:5ab737ac3ad7
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
52 #define C_thr_phi 328 // 0.01 * 2**15
75a11d740a02 initial import of gsm-fw from freecalypso-sw rev 1033:5ab737ac3ad7
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
53
75a11d740a02 initial import of gsm-fw from freecalypso-sw rev 1033:5ab737ac3ad7
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
54 #if (VCXO_ALGO == 1)
75a11d740a02 initial import of gsm-fw from freecalypso-sw rev 1033:5ab737ac3ad7
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
55 #define C_WIN_AVG_SIZE_M 64 // average size M
75a11d740a02 initial import of gsm-fw from freecalypso-sw rev 1033:5ab737ac3ad7
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
56 #define C_PSI_AVG_SIZE_D 32 // distance size D
75a11d740a02 initial import of gsm-fw from freecalypso-sw rev 1033:5ab737ac3ad7
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
57 #define C_MSIZE (C_WIN_AVG_SIZE_M * C_PSI_AVG_SIZE_D) // Data history for predictor
3
f93dab57b032 L1/include: TCS211-based version restored
Mychaela Falconia <falcon@freecalypso.org>
parents: 0
diff changeset
58 #define C_RGAP_BAD_SNR_COUNT_B 32 // bad SNR count B
0
75a11d740a02 initial import of gsm-fw from freecalypso-sw rev 1033:5ab737ac3ad7
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
59 #define ALGO_AFC_RXGAP 1 // reception gap algo
75a11d740a02 initial import of gsm-fw from freecalypso-sw rev 1033:5ab737ac3ad7
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
60 #define ALGO_AFC_KALMAN 1 // Kalman filter
75a11d740a02 initial import of gsm-fw from freecalypso-sw rev 1033:5ab737ac3ad7
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
61 #define ALGO_AFC_LQG_PREDICTOR 2 // LQG filter + rgap predictor
75a11d740a02 initial import of gsm-fw from freecalypso-sw rev 1033:5ab737ac3ad7
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
62 #define ALGO_AFC_KALMAN_PREDICTOR 3 // Kalman filter + rgap predictor
75a11d740a02 initial import of gsm-fw from freecalypso-sw rev 1033:5ab737ac3ad7
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
63 #endif
75a11d740a02 initial import of gsm-fw from freecalypso-sw rev 1033:5ab737ac3ad7
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
64
3
f93dab57b032 L1/include: TCS211-based version restored
Mychaela Falconia <falcon@freecalypso.org>
parents: 0
diff changeset
65 #if ((ANALOG == 1) || (ANALOG == 2) || (ANALOG == 3))
0
75a11d740a02 initial import of gsm-fw from freecalypso-sw rev 1033:5ab737ac3ad7
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
66 // clipping related to AFC DAC linearity range
3
f93dab57b032 L1/include: TCS211-based version restored
Mychaela Falconia <falcon@freecalypso.org>
parents: 0
diff changeset
67 #define C_max_step 32000 // 4000 * 2**3
f93dab57b032 L1/include: TCS211-based version restored
Mychaela Falconia <falcon@freecalypso.org>
parents: 0
diff changeset
68 #define C_min_step -32000 // -4000 * 2**3
0
75a11d740a02 initial import of gsm-fw from freecalypso-sw rev 1033:5ab737ac3ad7
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
69 #endif