Skip to content

Commit

Permalink
apps/grgsm_trx: remove unnecessary checks of freq_offset
Browse files Browse the repository at this point in the history
Checking if freq_offset is None doesn't make sense currently
as it's always set to a float value by argparse (to 0 by default).

Change-Id: Ie8bae1ccde60d07fc25e0b874afa5aaaac04d8a7
  • Loading branch information
ptrkrysik committed Sep 13, 2018
1 parent 0631767 commit 0f3bceb
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 15 deletions.
4 changes: 0 additions & 4 deletions apps/grgsm_trx
Original file line number Diff line number Diff line change
Expand Up @@ -66,10 +66,6 @@ class Application:
self.phy_freq_offset_hz, self.bind_addr,
self.remote_addr, self.base_port)

# Optional frequency offset
if self.phy_freq_offset_hz is not None:
self.radio.freq_offset_hz = self.phy_freq_offset_hz

# Power measurement emulation
# Noise: -120 .. -105
# BTS: -75 .. -50
Expand Down
19 changes: 8 additions & 11 deletions python/trx/radio_if.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,6 @@ def change_sign(self, msg):

class radio_if(gr.top_block):
# PHY specific variables
freq_offset_hz = None
rx_freq = 935e6
tx_freq = 890e6
osr = 4
Expand Down Expand Up @@ -280,21 +279,19 @@ def calc_phase_inc(self, fc):
return self.ppm / 1.0e6 * 2 * pi * fc / self.sample_rate

def set_rx_freq(self, fc):
if self.freq_offset_hz is not None:
fc += self.freq_offset_hz
print("[#] Shifting RX freq. to %s (offset is %s)"
% (eng_notation.num_to_str(fc),
eng_notation.num_to_str(self.freq_offset_hz)))
fc += self.freq_offset_hz
print("[#] Shifting RX freq. to %s (offset is %s)"
% (eng_notation.num_to_str(fc),
eng_notation.num_to_str(self.freq_offset_hz)))
self.phy_src.set_center_freq(fc, 0)
self.rotator_src.set_phase_inc(self.calc_phase_inc(fc))
self.rx_freq = fc

def set_tx_freq(self, fc):
if self.freq_offset_hz is not None:
fc += self.freq_offset_hz
print("[#] Shifting TX freq. to %s (offset is %s)"
% (eng_notation.num_to_str(fc),
eng_notation.num_to_str(self.freq_offset_hz)))
fc += self.freq_offset_hz
print("[#] Shifting TX freq. to %s (offset is %s)"
% (eng_notation.num_to_str(fc),
eng_notation.num_to_str(self.freq_offset_hz)))
self.phy_sink.set_center_freq(fc, 0)
self.rotator_sink.set_phase_inc(-self.calc_phase_inc(fc))
self.tx_freq = fc
Expand Down

0 comments on commit 0f3bceb

Please sign in to comment.