From fe538eba62623cb4462bd4a2085ab754b5121ffd Mon Sep 17 00:00:00 2001 From: Piotr Krysik Date: Mon, 18 Jul 2016 18:14:49 +0200 Subject: Changes to apps after frequency offset correction major change --- apps/grgsm_livemon | 24 ++++++++++++++------ apps/grgsm_livemon.grc | 51 +++++++++++++++++++++++++++++++++++++++++-- apps/grgsm_scanner | 2 +- apps/helpers/grgsm_capture.py | 2 +- 4 files changed, 68 insertions(+), 11 deletions(-) (limited to 'apps') diff --git a/apps/grgsm_livemon b/apps/grgsm_livemon index cb5b55c..d4376e4 100755 --- a/apps/grgsm_livemon +++ b/apps/grgsm_livemon @@ -5,7 +5,7 @@ # Title: Gr-gsm Livemon # Author: Piotr Krysik # Description: Interactive monitor of a single C0 channel with analysis performed by Wireshark (command to run wireshark: sudo wireshark -k -f udp -Y gsmtap -i lo) -# Generated: Fri Jul 15 13:18:50 2016 +# Generated: Mon Jul 18 18:08:34 2016 ################################################## if __name__ == '__main__': @@ -38,7 +38,7 @@ import time class grgsm_livemon(gr.top_block, Qt.QWidget): - def __init__(self, args="", fc=939.4e6, gain=30, ppm=0, samp_rate=2000000.052982, shiftoff=400e3): + def __init__(self, args="", fc=939.4e6, gain=30, ppm=0, samp_rate=2000000.052982, shiftoff=400e3, osr=4): gr.top_block.__init__(self, "Gr-gsm Livemon") Qt.QWidget.__init__(self) self.setWindowTitle("Gr-gsm Livemon") @@ -70,6 +70,7 @@ class grgsm_livemon(gr.top_block, Qt.QWidget): self.ppm = ppm self.samp_rate = samp_rate self.shiftoff = shiftoff + self.osr = osr ################################################## # Variables @@ -159,7 +160,7 @@ class grgsm_livemon(gr.top_block, Qt.QWidget): self.gsm_decryption_0 = grgsm.decryption(([]), 1) self.gsm_control_channels_decoder_0_0 = grgsm.control_channels_decoder() self.gsm_control_channels_decoder_0 = grgsm.control_channels_decoder() - self.gsm_clock_offset_control_0 = grgsm.clock_offset_control(fc-shiftoff, samp_rate) + self.gsm_clock_offset_control_0 = grgsm.clock_offset_control(fc-shiftoff, samp_rate, osr) self.gsm_bcch_ccch_demapper_0 = grgsm.gsm_bcch_ccch_demapper( timeslot_nr=0, ) @@ -225,19 +226,25 @@ class grgsm_livemon(gr.top_block, Qt.QWidget): def set_samp_rate(self, samp_rate): self.samp_rate = samp_rate - self.blocks_rotator_cc_0.set_phase_inc(-2*pi*self.shiftoff/self.samp_rate) + self.gsm_input_0.set_samp_rate_in(self.samp_rate) self.qtgui_freq_sink_x_0.set_frequency_range(self.fc_slider, self.samp_rate) self.rtlsdr_source_0.set_sample_rate(self.samp_rate) - self.gsm_input_0.set_samp_rate_in(self.samp_rate) + self.blocks_rotator_cc_0.set_phase_inc(-2*pi*self.shiftoff/self.samp_rate) def get_shiftoff(self): return self.shiftoff def set_shiftoff(self, shiftoff): self.shiftoff = shiftoff - self.blocks_rotator_cc_0.set_phase_inc(-2*pi*self.shiftoff/self.samp_rate) self.rtlsdr_source_0.set_center_freq(self.fc_slider-self.shiftoff, 0) self.rtlsdr_source_0.set_bandwidth(250e3+abs(self.shiftoff), 0) + self.blocks_rotator_cc_0.set_phase_inc(-2*pi*self.shiftoff/self.samp_rate) + + def get_osr(self): + return self.osr + + def set_osr(self, osr): + self.osr = osr def get_ppm_slider(self): return self.ppm_slider @@ -282,6 +289,9 @@ def argument_parser(): parser.add_option( "-o", "--shiftoff", dest="shiftoff", type="eng_float", default=eng_notation.num_to_str(400e3), help="Set shiftoff [default=%default]") + parser.add_option( + "", "--osr", dest="osr", type="intx", default=4, + help="Set OSR [default=%default]") return parser @@ -295,7 +305,7 @@ def main(top_block_cls=grgsm_livemon, options=None): Qt.QApplication.setGraphicsSystem(style) qapp = Qt.QApplication(sys.argv) - tb = top_block_cls(args=options.args, fc=options.fc, gain=options.gain, ppm=options.ppm, samp_rate=options.samp_rate, shiftoff=options.shiftoff) + tb = top_block_cls(args=options.args, fc=options.fc, gain=options.gain, ppm=options.ppm, samp_rate=options.samp_rate, shiftoff=options.shiftoff, osr=options.osr) tb.start() tb.show() diff --git a/apps/grgsm_livemon.grc b/apps/grgsm_livemon.grc index 9c3945d..6394924 100644 --- a/apps/grgsm_livemon.grc +++ b/apps/grgsm_livemon.grc @@ -333,7 +333,7 @@ _coordinate - (256, 299) + (256, 300) _rotation @@ -641,6 +641,10 @@ minoutbuf 0 + + osr + osr + fc fc-shiftoff @@ -1006,6 +1010,49 @@ from math import pi + + parameter + + alias + + + + comment + + + + _enabled + True + + + _coordinate + (1088, 7) + + + _rotation + 0 + + + id + osr + + + label + OSR + + + short_id + + + + type + intx + + + value + 4 + + parameter @@ -2640,7 +2687,7 @@ _coordinate - (16, 227) + (8, 237) _rotation diff --git a/apps/grgsm_scanner b/apps/grgsm_scanner index bbda35d..169a9e5 100755 --- a/apps/grgsm_scanner +++ b/apps/grgsm_scanner @@ -76,7 +76,7 @@ class receiver_with_decoder(grgsm.hier_block): samp_rate_in=samp_rate, ) self.gsm_control_channels_decoder_0 = grgsm.control_channels_decoder() - self.gsm_clock_offset_control_0 = grgsm.clock_offset_control(fc, samp_rate) + self.gsm_clock_offset_control_0 = grgsm.clock_offset_control(fc, samp_rate, osr=4) self.gsm_bcch_ccch_demapper_0 = grgsm.gsm_bcch_ccch_demapper(0) ################################################## diff --git a/apps/helpers/grgsm_capture.py b/apps/helpers/grgsm_capture.py index 22dec52..aa3a15c 100755 --- a/apps/helpers/grgsm_capture.py +++ b/apps/helpers/grgsm_capture.py @@ -86,7 +86,7 @@ class grgsm_capture(gr.top_block): fc=fc, samp_rate_in=samp_rate, ) - self.gsm_clock_offset_control = grgsm.clock_offset_control(fc-shiftoff, osr=4) + self.gsm_clock_offset_control = grgsm.clock_offset_control(fc-shiftoff, sample_rate, osr=4) if self.burst_file: self.gsm_burst_file_sink = grgsm.burst_file_sink(self.burst_file) -- cgit v1.2.3