aboutsummaryrefslogtreecommitdiffstats
path: root/python
diff options
context:
space:
mode:
authorVadim Yanitskiy <axilirator@gmail.com>2017-12-05 01:00:51 +0700
committerVadim Yanitskiy <axilirator@gmail.com>2017-12-06 00:42:40 +0700
commit9dded9b9f6e3a8a0412c2ab8f5b3e49b376d1b04 (patch)
tree67bf34926b6aac1ad958f74e4f32c37d66b0f7ed /python
parent7f121d6470d04242bebe4ada80bf14bd1b8c00f7 (diff)
trx/radio_if.py: clean up and explain GSM timings
Diffstat (limited to 'python')
-rw-r--r--python/trx/radio_if.py16
1 files changed, 12 insertions, 4 deletions
diff --git a/python/trx/radio_if.py b/python/trx/radio_if.py
index f84a710..e0678ab 100644
--- a/python/trx/radio_if.py
+++ b/python/trx/radio_if.py
@@ -66,9 +66,17 @@ class radio_if(gr.top_block):
# Application state flags
trx_started = False
- # GSM timings
- delay_correction = 285.616e-6
- ul_dl_shift = -(6.0/1625000*(156.25)*3)
+ # GSM timings (in microseconds [uS])
+ # One timeslot duration is 576.9 μs = 15/26 ms,
+ # or 156.25 symbol periods (a symbol period is 48/13 μs)
+ GSM_SYM_PERIOD_uS = 48.0 / 13.0
+ GSM_TS_PERIOD_uS = GSM_SYM_PERIOD_uS * 156.25
+ GSM_UL_DL_SHIFT_uS = -(GSM_TS_PERIOD_uS * 3)
+
+ # FIXME: shall be measured (automatically?) for
+ # particular device and particular clock rate.
+ # The current value is measured for USRP B2X0 at 26e6.
+ delay_correction = (285.616 + 2 * GSM_SYM_PERIOD_uS) * 1e-6
def __init__(self, phy_args, phy_sample_rate,
phy_rx_gain, phy_tx_gain, phy_ppm,
@@ -154,7 +162,7 @@ class radio_if(gr.top_block):
self.tx_time_setter = grgsm.txtime_setter(
0xffffffff, 0, 0, 0, 0, 0,
- self.delay_correction + self.ul_dl_shift)
+ self.delay_correction + self.GSM_UL_DL_SHIFT_uS * 1e-6)
self.tx_burst_proc = grgsm.preprocess_tx_burst()