From 7d8a1caa0f286d29f58e9a0883a017bdf352a88d Mon Sep 17 00:00:00 2001 From: Vadim Yanitskiy Date: Sat, 19 Jan 2019 10:16:27 +0700 Subject: trx/radio_if.py: do not init both rx_freq and tx_freq Change-Id: I9f251958ec90141d144fdb027aff20182131a1d1 --- python/trx/radio_if.py | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/python/trx/radio_if.py b/python/trx/radio_if.py index 32b767a..93080c4 100644 --- a/python/trx/radio_if.py +++ b/python/trx/radio_if.py @@ -4,7 +4,7 @@ # GR-GSM based transceiver # Follow graph implementation # -# (C) 2016-2018 by Vadim Yanitskiy +# (C) 2016-2019 by Vadim Yanitskiy # (C) 2017 by Piotr Krysik # # All Rights Reserved @@ -43,8 +43,8 @@ from dict_toggle_sign import dict_toggle_sign class RadioInterface(gr.top_block): # PHY specific variables - rx_freq = 935e6 - tx_freq = 890e6 + rx_freq = None + tx_freq = None osr = 4 # Application state flags @@ -65,6 +65,10 @@ class RadioInterface(gr.top_block): # The current value is measured for USRP B2X0 at 26e6. delay_correction = (285.616 + 2 * GSM_SYM_PERIOD_uS) * 1e-6 + # Dummy freq. value that is used during initialization + # basically, the DL freq. of ARFCN 0 + DUMMY_FREQ = 935e6 + def __init__(self, phy_args, phy_sample_rate, phy_rx_gain, phy_tx_gain, phy_ppm, phy_rx_antenna, phy_tx_antenna, @@ -95,7 +99,6 @@ class RadioInterface(gr.top_block): channels=range(1))) self.phy_src.set_clock_rate(26e6, uhd.ALL_MBOARDS) - self.phy_src.set_center_freq(self.rx_freq, 0) self.phy_src.set_antenna(phy_rx_antenna, 0) self.phy_src.set_samp_rate(phy_sample_rate) self.phy_src.set_bandwidth(650e3, 0) @@ -103,8 +106,7 @@ class RadioInterface(gr.top_block): self.msg_to_tag_src = grgsm.msg_to_tag() - self.rotator_src = grgsm.controlled_rotator_cc( - self.calc_phase_inc(self.rx_freq)) + self.rotator_src = grgsm.controlled_rotator_cc(0.0) self.lpf = filter.fir_filter_ccf(1, firdes.low_pass( 1, phy_sample_rate, 125e3, 5e3, firdes.WIN_HAMMING, 6.76)) @@ -148,7 +150,6 @@ class RadioInterface(gr.top_block): self.phy_sink.set_clock_rate(26e6, uhd.ALL_MBOARDS) self.phy_sink.set_antenna(phy_tx_antenna, 0) self.phy_sink.set_samp_rate(phy_sample_rate) - self.phy_sink.set_center_freq(self.tx_freq, 0) self.phy_sink.set_gain(self.tx_gain) self.tx_time_setter = grgsm.txtime_setter( @@ -169,8 +170,7 @@ class RadioInterface(gr.top_block): self.msg_to_tag_sink = grgsm.msg_to_tag() - self.rotator_sink = grgsm.controlled_rotator_cc( - -self.calc_phase_inc(self.tx_freq)) + self.rotator_sink = grgsm.controlled_rotator_cc(0.0) # Connections self.msg_connect( @@ -225,8 +225,9 @@ class RadioInterface(gr.top_block): # AFC (Automatic Frequency Correction) + # NOTE: dummy frequency is used during init self.gsm_clck_ctrl = grgsm.clock_offset_control( - self.rx_freq, phy_sample_rate, osr = self.osr) + self.DUMMY_FREQ, phy_sample_rate, osr = self.osr) self.dict_toggle_sign = dict_toggle_sign() -- cgit v1.2.3