From c8d86cefb02ce2e40c6875b7fdb1d67d46bbd203 Mon Sep 17 00:00:00 2001 From: Chris Poore Date: Sun, 18 Sep 2022 22:05:57 -0400 Subject: [PATCH] USRP2, USRP N2xx support --- .../archive_replay_usrp2.grc | 604 ++++++++++++ .../archive_replay_usrp2.py | 132 +++ .../archive_replay_usrp_n2xx.grc | 604 ++++++++++++ .../archive_replay_usrp_n2xx.py | 132 +++ .../iq_playback_single_usrp2.grc | 604 ++++++++++++ .../iq_playback_single_usrp2.py | 132 +++ .../iq_playback_single_usrp_n2xx.grc | 604 ++++++++++++ .../iq_playback_single_usrp_n2xx.py | 132 +++ .../IQ Flow Graphs/iq_playback_usrp2.grc | 604 ++++++++++++ .../IQ Flow Graphs/iq_playback_usrp2.py | 132 +++ .../IQ Flow Graphs/iq_playback_usrp_n2xx.grc | 604 ++++++++++++ .../IQ Flow Graphs/iq_playback_usrp_n2xx.py | 132 +++ .../IQ Flow Graphs/iq_recorder_usrp2.grc | 842 +++++++++++++++++ .../IQ Flow Graphs/iq_recorder_usrp2.py | 150 +++ .../IQ Flow Graphs/iq_recorder_usrp_n2xx.grc | 842 +++++++++++++++++ .../IQ Flow Graphs/iq_recorder_usrp_n2xx.py | 150 +++ .../instantaneous_frequency_usrp2.grc | 696 ++++++++++++++ .../instantaneous_frequency_usrp2.py | 331 +++++++ .../instantaneous_frequency_usrp_n2xx.grc | 696 ++++++++++++++ .../instantaneous_frequency_usrp_n2xx.py | 331 +++++++ .../signal_envelope_usrp2.grc | 697 ++++++++++++++ .../signal_envelope_usrp2.py | 330 +++++++ .../signal_envelope_usrp_n2xx.grc | 697 ++++++++++++++ .../signal_envelope_usrp_n2xx.py | 330 +++++++ .../time_sink_1_10_100_usrp2.grc | 866 ++++++++++++++++++ .../time_sink_1_10_100_usrp2.py | 417 +++++++++ .../time_sink_1_10_100_usrp_n2xx.grc | 866 ++++++++++++++++++ .../time_sink_1_10_100_usrp_n2xx.py | 417 +++++++++ .../time_sink_usrp2.grc | 761 +++++++++++++++ .../Inspection Flow Graphs/time_sink_usrp2.py | 379 ++++++++ .../time_sink_usrp_n2xx.grc | 761 +++++++++++++++ .../time_sink_usrp_n2xx.py | 379 ++++++++ .../waterfall_usrp2.grc | 596 ++++++++++++ .../Inspection Flow Graphs/waterfall_usrp2.py | 282 ++++++ .../waterfall_usrp_n2xx.grc | 596 ++++++++++++ .../waterfall_usrp_n2xx.py | 282 ++++++ .../TSI Flow Graphs/wideband_usrp2.grc | 815 ++++++++++++++++ .../TSI Flow Graphs/wideband_usrp2.py | 173 ++++ .../TSI Flow Graphs/wideband_usrp_n2xx.grc | 815 ++++++++++++++++ .../TSI Flow Graphs/wideband_usrp_n2xx.py | 173 ++++ Icons/USRP2.png | Bin 0 -> 26044 bytes Icons/USRP_N2xx.png | Bin 0 -> 32678 bytes Installer/installer | 3 +- Logs/event.log | 130 +-- UI/dashboard.ui | 42 + UI/hardware_select.ui | 121 ++- YAML/fissure_config.yaml | 30 +- YAML/library.yaml | 12 + dashboard.py | 810 +++++++++++++++- protocol_discovery.py | 2 +- tsi_component.py | 6 +- 51 files changed, 20113 insertions(+), 129 deletions(-) create mode 100644 Flow Graph Library/Archive Flow Graphs/archive_replay_usrp2.grc create mode 100755 Flow Graph Library/Archive Flow Graphs/archive_replay_usrp2.py create mode 100644 Flow Graph Library/Archive Flow Graphs/archive_replay_usrp_n2xx.grc create mode 100755 Flow Graph Library/Archive Flow Graphs/archive_replay_usrp_n2xx.py create mode 100644 Flow Graph Library/IQ Flow Graphs/iq_playback_single_usrp2.grc create mode 100755 Flow Graph Library/IQ Flow Graphs/iq_playback_single_usrp2.py create mode 100644 Flow Graph Library/IQ Flow Graphs/iq_playback_single_usrp_n2xx.grc create mode 100755 Flow Graph Library/IQ Flow Graphs/iq_playback_single_usrp_n2xx.py create mode 100644 Flow Graph Library/IQ Flow Graphs/iq_playback_usrp2.grc create mode 100755 Flow Graph Library/IQ Flow Graphs/iq_playback_usrp2.py create mode 100644 Flow Graph Library/IQ Flow Graphs/iq_playback_usrp_n2xx.grc create mode 100755 Flow Graph Library/IQ Flow Graphs/iq_playback_usrp_n2xx.py create mode 100644 Flow Graph Library/IQ Flow Graphs/iq_recorder_usrp2.grc create mode 100755 Flow Graph Library/IQ Flow Graphs/iq_recorder_usrp2.py create mode 100644 Flow Graph Library/IQ Flow Graphs/iq_recorder_usrp_n2xx.grc create mode 100755 Flow Graph Library/IQ Flow Graphs/iq_recorder_usrp_n2xx.py create mode 100644 Flow Graph Library/Inspection Flow Graphs/instantaneous_frequency_usrp2.grc create mode 100755 Flow Graph Library/Inspection Flow Graphs/instantaneous_frequency_usrp2.py create mode 100644 Flow Graph Library/Inspection Flow Graphs/instantaneous_frequency_usrp_n2xx.grc create mode 100755 Flow Graph Library/Inspection Flow Graphs/instantaneous_frequency_usrp_n2xx.py create mode 100644 Flow Graph Library/Inspection Flow Graphs/signal_envelope_usrp2.grc create mode 100755 Flow Graph Library/Inspection Flow Graphs/signal_envelope_usrp2.py create mode 100644 Flow Graph Library/Inspection Flow Graphs/signal_envelope_usrp_n2xx.grc create mode 100755 Flow Graph Library/Inspection Flow Graphs/signal_envelope_usrp_n2xx.py create mode 100644 Flow Graph Library/Inspection Flow Graphs/time_sink_1_10_100_usrp2.grc create mode 100755 Flow Graph Library/Inspection Flow Graphs/time_sink_1_10_100_usrp2.py create mode 100644 Flow Graph Library/Inspection Flow Graphs/time_sink_1_10_100_usrp_n2xx.grc create mode 100755 Flow Graph Library/Inspection Flow Graphs/time_sink_1_10_100_usrp_n2xx.py create mode 100644 Flow Graph Library/Inspection Flow Graphs/time_sink_usrp2.grc create mode 100755 Flow Graph Library/Inspection Flow Graphs/time_sink_usrp2.py create mode 100644 Flow Graph Library/Inspection Flow Graphs/time_sink_usrp_n2xx.grc create mode 100755 Flow Graph Library/Inspection Flow Graphs/time_sink_usrp_n2xx.py create mode 100644 Flow Graph Library/Inspection Flow Graphs/waterfall_usrp2.grc create mode 100755 Flow Graph Library/Inspection Flow Graphs/waterfall_usrp2.py create mode 100644 Flow Graph Library/Inspection Flow Graphs/waterfall_usrp_n2xx.grc create mode 100755 Flow Graph Library/Inspection Flow Graphs/waterfall_usrp_n2xx.py create mode 100644 Flow Graph Library/TSI Flow Graphs/wideband_usrp2.grc create mode 100755 Flow Graph Library/TSI Flow Graphs/wideband_usrp2.py create mode 100644 Flow Graph Library/TSI Flow Graphs/wideband_usrp_n2xx.grc create mode 100755 Flow Graph Library/TSI Flow Graphs/wideband_usrp_n2xx.py create mode 100644 Icons/USRP2.png create mode 100644 Icons/USRP_N2xx.png diff --git a/Flow Graph Library/Archive Flow Graphs/archive_replay_usrp2.grc b/Flow Graph Library/Archive Flow Graphs/archive_replay_usrp2.grc new file mode 100644 index 00000000..944671de --- /dev/null +++ b/Flow Graph Library/Archive Flow Graphs/archive_replay_usrp2.grc @@ -0,0 +1,604 @@ +options: + parameters: + author: '' + category: Custom + cmake_opt: '' + comment: '' + copyright: '' + description: '' + gen_cmake: 'On' + gen_linking: dynamic + generate_options: no_gui + hier_block_src_path: '.:' + id: archive_replay_usrp2 + max_nouts: '0' + output_language: python + placement: (0,0) + qt_qss_theme: '' + realtime_scheduling: '' + run: 'True' + run_command: '{python} -u {filename}' + run_options: run + sizing_mode: fixed + thread_safe_setters: '' + title: '' + window_size: 1280, 1024 + states: + bus_sink: false + bus_source: false + bus_structure: null + coordinate: [10, 10] + rotation: 0 + state: enabled + +blocks: +- name: filepath + id: variable + parameters: + comment: '' + value: '""' + states: + bus_sink: false + bus_source: false + bus_structure: null + coordinate: [8, 164] + rotation: 0 + state: enabled +- name: ip_address + id: variable + parameters: + comment: '' + value: '"192.168.10.2"' + states: + bus_sink: false + bus_source: false + bus_structure: null + coordinate: [8, 100] + rotation: 0 + state: enabled +- name: sample_rate + id: variable + parameters: + comment: '' + value: 4e6 + states: + bus_sink: false + bus_source: false + bus_structure: null + coordinate: [8, 356] + rotation: 0 + state: enabled +- name: tx_channel + id: variable + parameters: + comment: '' + value: '"A:0"' + states: + bus_sink: false + bus_source: false + bus_structure: null + coordinate: [8, 228] + rotation: 0 + state: enabled +- name: tx_frequency + id: variable + parameters: + comment: '' + value: 2425.715e6 + states: + bus_sink: false + bus_source: false + bus_structure: null + coordinate: [8, 292] + rotation: 0 + state: enabled +- name: tx_gain + id: variable + parameters: + comment: '' + value: '30' + states: + bus_sink: false + bus_source: false + bus_structure: null + coordinate: [8, 420] + rotation: 0 + state: enabled +- name: blocks_file_source_0 + id: blocks_file_source + parameters: + affinity: '' + alias: '' + begin_tag: pmt.PMT_NIL + comment: '' + file: filepath + length: '0' + maxoutbuf: '0' + minoutbuf: '0' + offset: '0' + repeat: 'True' + type: complex + vlen: '1' + states: + bus_sink: false + bus_source: false + bus_structure: null + coordinate: [304, 125] + rotation: 0 + state: enabled +- name: qtgui_time_sink_x_0 + id: qtgui_time_sink_x + parameters: + affinity: '' + alias: '' + alpha1: '1.0' + alpha10: '1.0' + alpha2: '1.0' + alpha3: '1.0' + alpha4: '1.0' + alpha5: '1.0' + alpha6: '1.0' + alpha7: '1.0' + alpha8: '1.0' + alpha9: '1.0' + autoscale: 'True' + axislabels: 'True' + color1: blue + color10: dark blue + color2: red + color3: green + color4: black + color5: cyan + color6: magenta + color7: yellow + color8: dark red + color9: dark green + comment: '' + ctrlpanel: 'False' + entags: 'True' + grid: 'False' + gui_hint: '' + label1: '' + label10: '' + label2: '' + label3: '' + label4: '' + label5: '' + label6: '' + label7: '' + label8: '' + label9: '' + legend: 'True' + marker1: '-1' + marker10: '-1' + marker2: '-1' + marker3: '-1' + marker4: '-1' + marker5: '-1' + marker6: '-1' + marker7: '-1' + marker8: '-1' + marker9: '-1' + name: '""' + nconnections: '1' + size: '1024' + srate: sample_rate + stemplot: 'False' + style1: '1' + style10: '1' + style2: '1' + style3: '1' + style4: '1' + style5: '1' + style6: '1' + style7: '1' + style8: '1' + style9: '1' + tr_chan: '0' + tr_delay: '0' + tr_level: '0.0' + tr_mode: qtgui.TRIG_MODE_FREE + tr_slope: qtgui.TRIG_SLOPE_POS + tr_tag: '""' + type: complex + update_time: '0.10' + width1: '1' + width10: '1' + width2: '1' + width3: '1' + width4: '1' + width5: '1' + width6: '1' + width7: '1' + width8: '1' + width9: '1' + ylabel: Amplitude + ymax: '1' + ymin: '-1' + yunit: '""' + states: + bus_sink: false + bus_source: false + bus_structure: null + coordinate: [712, 459] + rotation: 0 + state: disabled +- name: qtgui_time_sink_x_0_0 + id: qtgui_time_sink_x + parameters: + affinity: '' + alias: '' + alpha1: '1.0' + alpha10: '1.0' + alpha2: '1.0' + alpha3: '1.0' + alpha4: '1.0' + alpha5: '1.0' + alpha6: '1.0' + alpha7: '1.0' + alpha8: '1.0' + alpha9: '1.0' + autoscale: 'True' + axislabels: 'True' + color1: blue + color10: dark blue + color2: red + color3: green + color4: black + color5: cyan + color6: magenta + color7: yellow + color8: dark red + color9: dark green + comment: '' + ctrlpanel: 'False' + entags: 'True' + grid: 'False' + gui_hint: '' + label1: '' + label10: '' + label2: '' + label3: '' + label4: '' + label5: '' + label6: '' + label7: '' + label8: '' + label9: '' + legend: 'True' + marker1: '-1' + marker10: '-1' + marker2: '-1' + marker3: '-1' + marker4: '-1' + marker5: '-1' + marker6: '-1' + marker7: '-1' + marker8: '-1' + marker9: '-1' + name: '""' + nconnections: '1' + size: '1024' + srate: sample_rate + stemplot: 'False' + style1: '1' + style10: '1' + style2: '1' + style3: '1' + style4: '1' + style5: '1' + style6: '1' + style7: '1' + style8: '1' + style9: '1' + tr_chan: '0' + tr_delay: '0' + tr_level: '0.0' + tr_mode: qtgui.TRIG_MODE_FREE + tr_slope: qtgui.TRIG_SLOPE_POS + tr_tag: '""' + type: complex + update_time: '0.10' + width1: '1' + width10: '1' + width2: '1' + width3: '1' + width4: '1' + width5: '1' + width6: '1' + width7: '1' + width8: '1' + width9: '1' + ylabel: Amplitude + ymax: '1' + ymin: '-1' + yunit: '""' + states: + bus_sink: false + bus_source: false + bus_structure: null + coordinate: [1000, 387] + rotation: 0 + state: disabled +- name: uhd_usrp_sink_0 + id: uhd_usrp_sink + parameters: + affinity: '' + alias: '' + ant0: TX/RX + ant1: '' + ant10: '' + ant11: '' + ant12: '' + ant13: '' + ant14: '' + ant15: '' + ant16: '' + ant17: '' + ant18: '' + ant19: '' + ant2: '' + ant20: '' + ant21: '' + ant22: '' + ant23: '' + ant24: '' + ant25: '' + ant26: '' + ant27: '' + ant28: '' + ant29: '' + ant3: '' + ant30: '' + ant31: '' + ant4: '' + ant5: '' + ant6: '' + ant7: '' + ant8: '' + ant9: '' + bw0: '0' + bw1: '0' + bw10: '0' + bw11: '0' + bw12: '0' + bw13: '0' + bw14: '0' + bw15: '0' + bw16: '0' + bw17: '0' + bw18: '0' + bw19: '0' + bw2: '0' + bw20: '0' + bw21: '0' + bw22: '0' + bw23: '0' + bw24: '0' + bw25: '0' + bw26: '0' + bw27: '0' + bw28: '0' + bw29: '0' + bw3: '0' + bw30: '0' + bw31: '0' + bw4: '0' + bw5: '0' + bw6: '0' + bw7: '0' + bw8: '0' + bw9: '0' + center_freq0: float(tx_frequency) + center_freq1: '0' + center_freq10: '0' + center_freq11: '0' + center_freq12: '0' + center_freq13: '0' + center_freq14: '0' + center_freq15: '0' + center_freq16: '0' + center_freq17: '0' + center_freq18: '0' + center_freq19: '0' + center_freq2: '0' + center_freq20: '0' + center_freq21: '0' + center_freq22: '0' + center_freq23: '0' + center_freq24: '0' + center_freq25: '0' + center_freq26: '0' + center_freq27: '0' + center_freq28: '0' + center_freq29: '0' + center_freq3: '0' + center_freq30: '0' + center_freq31: '0' + center_freq4: '0' + center_freq5: '0' + center_freq6: '0' + center_freq7: '0' + center_freq8: '0' + center_freq9: '0' + clock_rate: '0.0' + clock_source0: '' + clock_source1: '' + clock_source2: '' + clock_source3: '' + clock_source4: '' + clock_source5: '' + clock_source6: '' + clock_source7: '' + comment: '' + dev_addr: '"ip_addr="+ip_address' + dev_args: '""' + gain0: float(tx_gain) + gain1: '0' + gain10: '0' + gain11: '0' + gain12: '0' + gain13: '0' + gain14: '0' + gain15: '0' + gain16: '0' + gain17: '0' + gain18: '0' + gain19: '0' + gain2: '0' + gain20: '0' + gain21: '0' + gain22: '0' + gain23: '0' + gain24: '0' + gain25: '0' + gain26: '0' + gain27: '0' + gain28: '0' + gain29: '0' + gain3: '0' + gain30: '0' + gain31: '0' + gain4: '0' + gain5: '0' + gain6: '0' + gain7: '0' + gain8: '0' + gain9: '0' + len_tag_name: '' + lo_export0: 'False' + lo_export1: 'False' + lo_export10: 'False' + lo_export11: 'False' + lo_export12: 'False' + lo_export13: 'False' + lo_export14: 'False' + lo_export15: 'False' + lo_export16: 'False' + lo_export17: 'False' + lo_export18: 'False' + lo_export19: 'False' + lo_export2: 'False' + lo_export20: 'False' + lo_export21: 'False' + lo_export22: 'False' + lo_export23: 'False' + lo_export24: 'False' + lo_export25: 'False' + lo_export26: 'False' + lo_export27: 'False' + lo_export28: 'False' + lo_export29: 'False' + lo_export3: 'False' + lo_export30: 'False' + lo_export31: 'False' + lo_export4: 'False' + lo_export5: 'False' + lo_export6: 'False' + lo_export7: 'False' + lo_export8: 'False' + lo_export9: 'False' + lo_source0: internal + lo_source1: internal + lo_source10: internal + lo_source11: internal + lo_source12: internal + lo_source13: internal + lo_source14: internal + lo_source15: internal + lo_source16: internal + lo_source17: internal + lo_source18: internal + lo_source19: internal + lo_source2: internal + lo_source20: internal + lo_source21: internal + lo_source22: internal + lo_source23: internal + lo_source24: internal + lo_source25: internal + lo_source26: internal + lo_source27: internal + lo_source28: internal + lo_source29: internal + lo_source3: internal + lo_source30: internal + lo_source31: internal + lo_source4: internal + lo_source5: internal + lo_source6: internal + lo_source7: internal + lo_source8: internal + lo_source9: internal + maxoutbuf: '0' + minoutbuf: '0' + nchan: '1' + norm_gain0: 'False' + norm_gain1: 'False' + norm_gain10: 'False' + norm_gain11: 'False' + norm_gain12: 'False' + norm_gain13: 'False' + norm_gain14: 'False' + norm_gain15: 'False' + norm_gain16: 'False' + norm_gain17: 'False' + norm_gain18: 'False' + norm_gain19: 'False' + norm_gain2: 'False' + norm_gain20: 'False' + norm_gain21: 'False' + norm_gain22: 'False' + norm_gain23: 'False' + norm_gain24: 'False' + norm_gain25: 'False' + norm_gain26: 'False' + norm_gain27: 'False' + norm_gain28: 'False' + norm_gain29: 'False' + norm_gain3: 'False' + norm_gain30: 'False' + norm_gain31: 'False' + norm_gain4: 'False' + norm_gain5: 'False' + norm_gain6: 'False' + norm_gain7: 'False' + norm_gain8: 'False' + norm_gain9: 'False' + num_mboards: '1' + otw: '' + samp_rate: float(sample_rate) + sd_spec0: tx_channel + sd_spec1: '' + sd_spec2: '' + sd_spec3: '' + sd_spec4: '' + sd_spec5: '' + sd_spec6: '' + sd_spec7: '' + show_lo_controls: 'False' + stream_args: '' + stream_chans: '[]' + sync: sync + time_source0: '' + time_source1: '' + time_source2: '' + time_source3: '' + time_source4: '' + time_source5: '' + time_source6: '' + time_source7: '' + type: fc32 + states: + bus_sink: false + bus_source: false + bus_structure: null + coordinate: [864, 74] + rotation: 0 + state: enabled + +connections: +- [blocks_file_source_0, '0', uhd_usrp_sink_0, '0'] + +metadata: + file_format: 1 diff --git a/Flow Graph Library/Archive Flow Graphs/archive_replay_usrp2.py b/Flow Graph Library/Archive Flow Graphs/archive_replay_usrp2.py new file mode 100755 index 00000000..ea1e2fbc --- /dev/null +++ b/Flow Graph Library/Archive Flow Graphs/archive_replay_usrp2.py @@ -0,0 +1,132 @@ +#!/usr/bin/env python3 +# -*- coding: utf-8 -*- + +# +# SPDX-License-Identifier: GPL-3.0 +# +# GNU Radio Python Flow Graph +# Title: Archive Replay Usrp2 +# GNU Radio version: 3.10.1.1 + +from gnuradio import blocks +import pmt +from gnuradio import gr +from gnuradio.filter import firdes +from gnuradio.fft import window +import sys +import signal +from argparse import ArgumentParser +from gnuradio.eng_arg import eng_float, intx +from gnuradio import eng_notation +from gnuradio import uhd +import time + + + + +class archive_replay_usrp2(gr.top_block): + + def __init__(self): + gr.top_block.__init__(self, "Archive Replay Usrp2", catch_exceptions=True) + + ################################################## + # Variables + ################################################## + self.tx_gain = tx_gain = 30 + self.tx_frequency = tx_frequency = 2425.715e6 + self.tx_channel = tx_channel = "A:0" + self.sample_rate = sample_rate = 4e6 + self.ip_address = ip_address = "192.168.10.2" + self.filepath = filepath = "" + + ################################################## + # Blocks + ################################################## + self.uhd_usrp_sink_0 = uhd.usrp_sink( + ",".join(("ip_addr="+ip_address, "")), + uhd.stream_args( + cpu_format="fc32", + args='', + channels=list(range(0,1)), + ), + '', + ) + self.uhd_usrp_sink_0.set_subdev_spec(tx_channel, 0) + self.uhd_usrp_sink_0.set_samp_rate(float(sample_rate)) + self.uhd_usrp_sink_0.set_time_unknown_pps(uhd.time_spec(0)) + + self.uhd_usrp_sink_0.set_center_freq(float(tx_frequency), 0) + self.uhd_usrp_sink_0.set_antenna('TX/RX', 0) + self.uhd_usrp_sink_0.set_gain(float(tx_gain), 0) + self.blocks_file_source_0 = blocks.file_source(gr.sizeof_gr_complex*1, filepath, True, 0, 0) + self.blocks_file_source_0.set_begin_tag(pmt.PMT_NIL) + + + ################################################## + # Connections + ################################################## + self.connect((self.blocks_file_source_0, 0), (self.uhd_usrp_sink_0, 0)) + + + def get_tx_gain(self): + return self.tx_gain + + def set_tx_gain(self, tx_gain): + self.tx_gain = tx_gain + self.uhd_usrp_sink_0.set_gain(float(self.tx_gain), 0) + + def get_tx_frequency(self): + return self.tx_frequency + + def set_tx_frequency(self, tx_frequency): + self.tx_frequency = tx_frequency + self.uhd_usrp_sink_0.set_center_freq(float(self.tx_frequency), 0) + + def get_tx_channel(self): + return self.tx_channel + + def set_tx_channel(self, tx_channel): + self.tx_channel = tx_channel + + def get_sample_rate(self): + return self.sample_rate + + def set_sample_rate(self, sample_rate): + self.sample_rate = sample_rate + self.uhd_usrp_sink_0.set_samp_rate(float(self.sample_rate)) + + def get_ip_address(self): + return self.ip_address + + def set_ip_address(self, ip_address): + self.ip_address = ip_address + + def get_filepath(self): + return self.filepath + + def set_filepath(self, filepath): + self.filepath = filepath + self.blocks_file_source_0.open(self.filepath, True) + + + + +def main(top_block_cls=archive_replay_usrp2, options=None): + tb = top_block_cls() + + def sig_handler(sig=None, frame=None): + tb.stop() + tb.wait() + + sys.exit(0) + + signal.signal(signal.SIGINT, sig_handler) + signal.signal(signal.SIGTERM, sig_handler) + + tb.start() + + tb.wait() + + +if __name__ == '__main__': + main() diff --git a/Flow Graph Library/Archive Flow Graphs/archive_replay_usrp_n2xx.grc b/Flow Graph Library/Archive Flow Graphs/archive_replay_usrp_n2xx.grc new file mode 100644 index 00000000..f4104683 --- /dev/null +++ b/Flow Graph Library/Archive Flow Graphs/archive_replay_usrp_n2xx.grc @@ -0,0 +1,604 @@ +options: + parameters: + author: '' + category: Custom + cmake_opt: '' + comment: '' + copyright: '' + description: '' + gen_cmake: 'On' + gen_linking: dynamic + generate_options: no_gui + hier_block_src_path: '.:' + id: archive_replay_usrp_n2xx + max_nouts: '0' + output_language: python + placement: (0,0) + qt_qss_theme: '' + realtime_scheduling: '' + run: 'True' + run_command: '{python} -u {filename}' + run_options: run + sizing_mode: fixed + thread_safe_setters: '' + title: '' + window_size: 1280, 1024 + states: + bus_sink: false + bus_source: false + bus_structure: null + coordinate: [10, 10] + rotation: 0 + state: enabled + +blocks: +- name: filepath + id: variable + parameters: + comment: '' + value: '""' + states: + bus_sink: false + bus_source: false + bus_structure: null + coordinate: [8, 164] + rotation: 0 + state: enabled +- name: ip_address + id: variable + parameters: + comment: '' + value: '"192.168.10.2"' + states: + bus_sink: false + bus_source: false + bus_structure: null + coordinate: [8, 100] + rotation: 0 + state: enabled +- name: sample_rate + id: variable + parameters: + comment: '' + value: 4e6 + states: + bus_sink: false + bus_source: false + bus_structure: null + coordinate: [8, 356] + rotation: 0 + state: enabled +- name: tx_channel + id: variable + parameters: + comment: '' + value: '"A:0"' + states: + bus_sink: false + bus_source: false + bus_structure: null + coordinate: [8, 228] + rotation: 0 + state: enabled +- name: tx_frequency + id: variable + parameters: + comment: '' + value: 2425.715e6 + states: + bus_sink: false + bus_source: false + bus_structure: null + coordinate: [8, 292] + rotation: 0 + state: enabled +- name: tx_gain + id: variable + parameters: + comment: '' + value: '30' + states: + bus_sink: false + bus_source: false + bus_structure: null + coordinate: [8, 420] + rotation: 0 + state: enabled +- name: blocks_file_source_0 + id: blocks_file_source + parameters: + affinity: '' + alias: '' + begin_tag: pmt.PMT_NIL + comment: '' + file: filepath + length: '0' + maxoutbuf: '0' + minoutbuf: '0' + offset: '0' + repeat: 'True' + type: complex + vlen: '1' + states: + bus_sink: false + bus_source: false + bus_structure: null + coordinate: [304, 125] + rotation: 0 + state: enabled +- name: qtgui_time_sink_x_0 + id: qtgui_time_sink_x + parameters: + affinity: '' + alias: '' + alpha1: '1.0' + alpha10: '1.0' + alpha2: '1.0' + alpha3: '1.0' + alpha4: '1.0' + alpha5: '1.0' + alpha6: '1.0' + alpha7: '1.0' + alpha8: '1.0' + alpha9: '1.0' + autoscale: 'True' + axislabels: 'True' + color1: blue + color10: dark blue + color2: red + color3: green + color4: black + color5: cyan + color6: magenta + color7: yellow + color8: dark red + color9: dark green + comment: '' + ctrlpanel: 'False' + entags: 'True' + grid: 'False' + gui_hint: '' + label1: '' + label10: '' + label2: '' + label3: '' + label4: '' + label5: '' + label6: '' + label7: '' + label8: '' + label9: '' + legend: 'True' + marker1: '-1' + marker10: '-1' + marker2: '-1' + marker3: '-1' + marker4: '-1' + marker5: '-1' + marker6: '-1' + marker7: '-1' + marker8: '-1' + marker9: '-1' + name: '""' + nconnections: '1' + size: '1024' + srate: sample_rate + stemplot: 'False' + style1: '1' + style10: '1' + style2: '1' + style3: '1' + style4: '1' + style5: '1' + style6: '1' + style7: '1' + style8: '1' + style9: '1' + tr_chan: '0' + tr_delay: '0' + tr_level: '0.0' + tr_mode: qtgui.TRIG_MODE_FREE + tr_slope: qtgui.TRIG_SLOPE_POS + tr_tag: '""' + type: complex + update_time: '0.10' + width1: '1' + width10: '1' + width2: '1' + width3: '1' + width4: '1' + width5: '1' + width6: '1' + width7: '1' + width8: '1' + width9: '1' + ylabel: Amplitude + ymax: '1' + ymin: '-1' + yunit: '""' + states: + bus_sink: false + bus_source: false + bus_structure: null + coordinate: [712, 459] + rotation: 0 + state: disabled +- name: qtgui_time_sink_x_0_0 + id: qtgui_time_sink_x + parameters: + affinity: '' + alias: '' + alpha1: '1.0' + alpha10: '1.0' + alpha2: '1.0' + alpha3: '1.0' + alpha4: '1.0' + alpha5: '1.0' + alpha6: '1.0' + alpha7: '1.0' + alpha8: '1.0' + alpha9: '1.0' + autoscale: 'True' + axislabels: 'True' + color1: blue + color10: dark blue + color2: red + color3: green + color4: black + color5: cyan + color6: magenta + color7: yellow + color8: dark red + color9: dark green + comment: '' + ctrlpanel: 'False' + entags: 'True' + grid: 'False' + gui_hint: '' + label1: '' + label10: '' + label2: '' + label3: '' + label4: '' + label5: '' + label6: '' + label7: '' + label8: '' + label9: '' + legend: 'True' + marker1: '-1' + marker10: '-1' + marker2: '-1' + marker3: '-1' + marker4: '-1' + marker5: '-1' + marker6: '-1' + marker7: '-1' + marker8: '-1' + marker9: '-1' + name: '""' + nconnections: '1' + size: '1024' + srate: sample_rate + stemplot: 'False' + style1: '1' + style10: '1' + style2: '1' + style3: '1' + style4: '1' + style5: '1' + style6: '1' + style7: '1' + style8: '1' + style9: '1' + tr_chan: '0' + tr_delay: '0' + tr_level: '0.0' + tr_mode: qtgui.TRIG_MODE_FREE + tr_slope: qtgui.TRIG_SLOPE_POS + tr_tag: '""' + type: complex + update_time: '0.10' + width1: '1' + width10: '1' + width2: '1' + width3: '1' + width4: '1' + width5: '1' + width6: '1' + width7: '1' + width8: '1' + width9: '1' + ylabel: Amplitude + ymax: '1' + ymin: '-1' + yunit: '""' + states: + bus_sink: false + bus_source: false + bus_structure: null + coordinate: [1000, 387] + rotation: 0 + state: disabled +- name: uhd_usrp_sink_0 + id: uhd_usrp_sink + parameters: + affinity: '' + alias: '' + ant0: TX/RX + ant1: '' + ant10: '' + ant11: '' + ant12: '' + ant13: '' + ant14: '' + ant15: '' + ant16: '' + ant17: '' + ant18: '' + ant19: '' + ant2: '' + ant20: '' + ant21: '' + ant22: '' + ant23: '' + ant24: '' + ant25: '' + ant26: '' + ant27: '' + ant28: '' + ant29: '' + ant3: '' + ant30: '' + ant31: '' + ant4: '' + ant5: '' + ant6: '' + ant7: '' + ant8: '' + ant9: '' + bw0: '0' + bw1: '0' + bw10: '0' + bw11: '0' + bw12: '0' + bw13: '0' + bw14: '0' + bw15: '0' + bw16: '0' + bw17: '0' + bw18: '0' + bw19: '0' + bw2: '0' + bw20: '0' + bw21: '0' + bw22: '0' + bw23: '0' + bw24: '0' + bw25: '0' + bw26: '0' + bw27: '0' + bw28: '0' + bw29: '0' + bw3: '0' + bw30: '0' + bw31: '0' + bw4: '0' + bw5: '0' + bw6: '0' + bw7: '0' + bw8: '0' + bw9: '0' + center_freq0: float(tx_frequency) + center_freq1: '0' + center_freq10: '0' + center_freq11: '0' + center_freq12: '0' + center_freq13: '0' + center_freq14: '0' + center_freq15: '0' + center_freq16: '0' + center_freq17: '0' + center_freq18: '0' + center_freq19: '0' + center_freq2: '0' + center_freq20: '0' + center_freq21: '0' + center_freq22: '0' + center_freq23: '0' + center_freq24: '0' + center_freq25: '0' + center_freq26: '0' + center_freq27: '0' + center_freq28: '0' + center_freq29: '0' + center_freq3: '0' + center_freq30: '0' + center_freq31: '0' + center_freq4: '0' + center_freq5: '0' + center_freq6: '0' + center_freq7: '0' + center_freq8: '0' + center_freq9: '0' + clock_rate: '0.0' + clock_source0: '' + clock_source1: '' + clock_source2: '' + clock_source3: '' + clock_source4: '' + clock_source5: '' + clock_source6: '' + clock_source7: '' + comment: '' + dev_addr: '"ip_addr="+ip_address' + dev_args: '""' + gain0: float(tx_gain) + gain1: '0' + gain10: '0' + gain11: '0' + gain12: '0' + gain13: '0' + gain14: '0' + gain15: '0' + gain16: '0' + gain17: '0' + gain18: '0' + gain19: '0' + gain2: '0' + gain20: '0' + gain21: '0' + gain22: '0' + gain23: '0' + gain24: '0' + gain25: '0' + gain26: '0' + gain27: '0' + gain28: '0' + gain29: '0' + gain3: '0' + gain30: '0' + gain31: '0' + gain4: '0' + gain5: '0' + gain6: '0' + gain7: '0' + gain8: '0' + gain9: '0' + len_tag_name: '' + lo_export0: 'False' + lo_export1: 'False' + lo_export10: 'False' + lo_export11: 'False' + lo_export12: 'False' + lo_export13: 'False' + lo_export14: 'False' + lo_export15: 'False' + lo_export16: 'False' + lo_export17: 'False' + lo_export18: 'False' + lo_export19: 'False' + lo_export2: 'False' + lo_export20: 'False' + lo_export21: 'False' + lo_export22: 'False' + lo_export23: 'False' + lo_export24: 'False' + lo_export25: 'False' + lo_export26: 'False' + lo_export27: 'False' + lo_export28: 'False' + lo_export29: 'False' + lo_export3: 'False' + lo_export30: 'False' + lo_export31: 'False' + lo_export4: 'False' + lo_export5: 'False' + lo_export6: 'False' + lo_export7: 'False' + lo_export8: 'False' + lo_export9: 'False' + lo_source0: internal + lo_source1: internal + lo_source10: internal + lo_source11: internal + lo_source12: internal + lo_source13: internal + lo_source14: internal + lo_source15: internal + lo_source16: internal + lo_source17: internal + lo_source18: internal + lo_source19: internal + lo_source2: internal + lo_source20: internal + lo_source21: internal + lo_source22: internal + lo_source23: internal + lo_source24: internal + lo_source25: internal + lo_source26: internal + lo_source27: internal + lo_source28: internal + lo_source29: internal + lo_source3: internal + lo_source30: internal + lo_source31: internal + lo_source4: internal + lo_source5: internal + lo_source6: internal + lo_source7: internal + lo_source8: internal + lo_source9: internal + maxoutbuf: '0' + minoutbuf: '0' + nchan: '1' + norm_gain0: 'False' + norm_gain1: 'False' + norm_gain10: 'False' + norm_gain11: 'False' + norm_gain12: 'False' + norm_gain13: 'False' + norm_gain14: 'False' + norm_gain15: 'False' + norm_gain16: 'False' + norm_gain17: 'False' + norm_gain18: 'False' + norm_gain19: 'False' + norm_gain2: 'False' + norm_gain20: 'False' + norm_gain21: 'False' + norm_gain22: 'False' + norm_gain23: 'False' + norm_gain24: 'False' + norm_gain25: 'False' + norm_gain26: 'False' + norm_gain27: 'False' + norm_gain28: 'False' + norm_gain29: 'False' + norm_gain3: 'False' + norm_gain30: 'False' + norm_gain31: 'False' + norm_gain4: 'False' + norm_gain5: 'False' + norm_gain6: 'False' + norm_gain7: 'False' + norm_gain8: 'False' + norm_gain9: 'False' + num_mboards: '1' + otw: '' + samp_rate: float(sample_rate) + sd_spec0: tx_channel + sd_spec1: '' + sd_spec2: '' + sd_spec3: '' + sd_spec4: '' + sd_spec5: '' + sd_spec6: '' + sd_spec7: '' + show_lo_controls: 'False' + stream_args: '' + stream_chans: '[]' + sync: sync + time_source0: '' + time_source1: '' + time_source2: '' + time_source3: '' + time_source4: '' + time_source5: '' + time_source6: '' + time_source7: '' + type: fc32 + states: + bus_sink: false + bus_source: false + bus_structure: null + coordinate: [864, 74] + rotation: 0 + state: enabled + +connections: +- [blocks_file_source_0, '0', uhd_usrp_sink_0, '0'] + +metadata: + file_format: 1 diff --git a/Flow Graph Library/Archive Flow Graphs/archive_replay_usrp_n2xx.py b/Flow Graph Library/Archive Flow Graphs/archive_replay_usrp_n2xx.py new file mode 100755 index 00000000..ad6406a6 --- /dev/null +++ b/Flow Graph Library/Archive Flow Graphs/archive_replay_usrp_n2xx.py @@ -0,0 +1,132 @@ +#!/usr/bin/env python3 +# -*- coding: utf-8 -*- + +# +# SPDX-License-Identifier: GPL-3.0 +# +# GNU Radio Python Flow Graph +# Title: Archive Replay Usrp N2Xx +# GNU Radio version: 3.10.1.1 + +from gnuradio import blocks +import pmt +from gnuradio import gr +from gnuradio.filter import firdes +from gnuradio.fft import window +import sys +import signal +from argparse import ArgumentParser +from gnuradio.eng_arg import eng_float, intx +from gnuradio import eng_notation +from gnuradio import uhd +import time + + + + +class archive_replay_usrp_n2xx(gr.top_block): + + def __init__(self): + gr.top_block.__init__(self, "Archive Replay Usrp N2Xx", catch_exceptions=True) + + ################################################## + # Variables + ################################################## + self.tx_gain = tx_gain = 30 + self.tx_frequency = tx_frequency = 2425.715e6 + self.tx_channel = tx_channel = "A:0" + self.sample_rate = sample_rate = 4e6 + self.ip_address = ip_address = "192.168.10.2" + self.filepath = filepath = "" + + ################################################## + # Blocks + ################################################## + self.uhd_usrp_sink_0 = uhd.usrp_sink( + ",".join(("ip_addr="+ip_address, "")), + uhd.stream_args( + cpu_format="fc32", + args='', + channels=list(range(0,1)), + ), + '', + ) + self.uhd_usrp_sink_0.set_subdev_spec(tx_channel, 0) + self.uhd_usrp_sink_0.set_samp_rate(float(sample_rate)) + self.uhd_usrp_sink_0.set_time_unknown_pps(uhd.time_spec(0)) + + self.uhd_usrp_sink_0.set_center_freq(float(tx_frequency), 0) + self.uhd_usrp_sink_0.set_antenna('TX/RX', 0) + self.uhd_usrp_sink_0.set_gain(float(tx_gain), 0) + self.blocks_file_source_0 = blocks.file_source(gr.sizeof_gr_complex*1, filepath, True, 0, 0) + self.blocks_file_source_0.set_begin_tag(pmt.PMT_NIL) + + + ################################################## + # Connections + ################################################## + self.connect((self.blocks_file_source_0, 0), (self.uhd_usrp_sink_0, 0)) + + + def get_tx_gain(self): + return self.tx_gain + + def set_tx_gain(self, tx_gain): + self.tx_gain = tx_gain + self.uhd_usrp_sink_0.set_gain(float(self.tx_gain), 0) + + def get_tx_frequency(self): + return self.tx_frequency + + def set_tx_frequency(self, tx_frequency): + self.tx_frequency = tx_frequency + self.uhd_usrp_sink_0.set_center_freq(float(self.tx_frequency), 0) + + def get_tx_channel(self): + return self.tx_channel + + def set_tx_channel(self, tx_channel): + self.tx_channel = tx_channel + + def get_sample_rate(self): + return self.sample_rate + + def set_sample_rate(self, sample_rate): + self.sample_rate = sample_rate + self.uhd_usrp_sink_0.set_samp_rate(float(self.sample_rate)) + + def get_ip_address(self): + return self.ip_address + + def set_ip_address(self, ip_address): + self.ip_address = ip_address + + def get_filepath(self): + return self.filepath + + def set_filepath(self, filepath): + self.filepath = filepath + self.blocks_file_source_0.open(self.filepath, True) + + + + +def main(top_block_cls=archive_replay_usrp_n2xx, options=None): + tb = top_block_cls() + + def sig_handler(sig=None, frame=None): + tb.stop() + tb.wait() + + sys.exit(0) + + signal.signal(signal.SIGINT, sig_handler) + signal.signal(signal.SIGTERM, sig_handler) + + tb.start() + + tb.wait() + + +if __name__ == '__main__': + main() diff --git a/Flow Graph Library/IQ Flow Graphs/iq_playback_single_usrp2.grc b/Flow Graph Library/IQ Flow Graphs/iq_playback_single_usrp2.grc new file mode 100644 index 00000000..69819cd0 --- /dev/null +++ b/Flow Graph Library/IQ Flow Graphs/iq_playback_single_usrp2.grc @@ -0,0 +1,604 @@ +options: + parameters: + author: '' + category: Custom + cmake_opt: '' + comment: '' + copyright: '' + description: '' + gen_cmake: 'On' + gen_linking: dynamic + generate_options: no_gui + hier_block_src_path: '.:' + id: iq_playback_single_usrp2 + max_nouts: '0' + output_language: python + placement: (0,0) + qt_qss_theme: '' + realtime_scheduling: '' + run: 'True' + run_command: '{python} -u {filename}' + run_options: run + sizing_mode: fixed + thread_safe_setters: '' + title: '' + window_size: 1280, 1024 + states: + bus_sink: false + bus_source: false + bus_structure: null + coordinate: [10, 10] + rotation: 0 + state: enabled + +blocks: +- name: filepath + id: variable + parameters: + comment: '' + value: '""' + states: + bus_sink: false + bus_source: false + bus_structure: null + coordinate: [8, 164] + rotation: 0 + state: enabled +- name: ip_address + id: variable + parameters: + comment: '' + value: '"192.168.10.2"' + states: + bus_sink: false + bus_source: false + bus_structure: null + coordinate: [8, 100] + rotation: 0 + state: enabled +- name: sample_rate + id: variable + parameters: + comment: '' + value: '4' + states: + bus_sink: false + bus_source: false + bus_structure: null + coordinate: [8, 356] + rotation: 0 + state: enabled +- name: tx_channel + id: variable + parameters: + comment: '' + value: '"A:0"' + states: + bus_sink: false + bus_source: false + bus_structure: null + coordinate: [8, 228] + rotation: 0 + state: enabled +- name: tx_frequency + id: variable + parameters: + comment: '' + value: '2425.715' + states: + bus_sink: false + bus_source: false + bus_structure: null + coordinate: [8, 292] + rotation: 0 + state: enabled +- name: tx_gain + id: variable + parameters: + comment: '' + value: '30' + states: + bus_sink: false + bus_source: false + bus_structure: null + coordinate: [8, 420] + rotation: 0 + state: enabled +- name: blocks_file_source_0 + id: blocks_file_source + parameters: + affinity: '' + alias: '' + begin_tag: pmt.PMT_NIL + comment: '' + file: filepath + length: '0' + maxoutbuf: '0' + minoutbuf: '0' + offset: '0' + repeat: 'False' + type: complex + vlen: '1' + states: + bus_sink: false + bus_source: false + bus_structure: null + coordinate: [304, 125] + rotation: 0 + state: enabled +- name: qtgui_time_sink_x_0 + id: qtgui_time_sink_x + parameters: + affinity: '' + alias: '' + alpha1: '1.0' + alpha10: '1.0' + alpha2: '1.0' + alpha3: '1.0' + alpha4: '1.0' + alpha5: '1.0' + alpha6: '1.0' + alpha7: '1.0' + alpha8: '1.0' + alpha9: '1.0' + autoscale: 'True' + axislabels: 'True' + color1: blue + color10: dark blue + color2: red + color3: green + color4: black + color5: cyan + color6: magenta + color7: yellow + color8: dark red + color9: dark green + comment: '' + ctrlpanel: 'False' + entags: 'True' + grid: 'False' + gui_hint: '' + label1: '' + label10: '' + label2: '' + label3: '' + label4: '' + label5: '' + label6: '' + label7: '' + label8: '' + label9: '' + legend: 'True' + marker1: '-1' + marker10: '-1' + marker2: '-1' + marker3: '-1' + marker4: '-1' + marker5: '-1' + marker6: '-1' + marker7: '-1' + marker8: '-1' + marker9: '-1' + name: '""' + nconnections: '1' + size: '1024' + srate: sample_rate + stemplot: 'False' + style1: '1' + style10: '1' + style2: '1' + style3: '1' + style4: '1' + style5: '1' + style6: '1' + style7: '1' + style8: '1' + style9: '1' + tr_chan: '0' + tr_delay: '0' + tr_level: '0.0' + tr_mode: qtgui.TRIG_MODE_FREE + tr_slope: qtgui.TRIG_SLOPE_POS + tr_tag: '""' + type: complex + update_time: '0.10' + width1: '1' + width10: '1' + width2: '1' + width3: '1' + width4: '1' + width5: '1' + width6: '1' + width7: '1' + width8: '1' + width9: '1' + ylabel: Amplitude + ymax: '1' + ymin: '-1' + yunit: '""' + states: + bus_sink: false + bus_source: false + bus_structure: null + coordinate: [712, 459] + rotation: 0 + state: disabled +- name: qtgui_time_sink_x_0_0 + id: qtgui_time_sink_x + parameters: + affinity: '' + alias: '' + alpha1: '1.0' + alpha10: '1.0' + alpha2: '1.0' + alpha3: '1.0' + alpha4: '1.0' + alpha5: '1.0' + alpha6: '1.0' + alpha7: '1.0' + alpha8: '1.0' + alpha9: '1.0' + autoscale: 'True' + axislabels: 'True' + color1: blue + color10: dark blue + color2: red + color3: green + color4: black + color5: cyan + color6: magenta + color7: yellow + color8: dark red + color9: dark green + comment: '' + ctrlpanel: 'False' + entags: 'True' + grid: 'False' + gui_hint: '' + label1: '' + label10: '' + label2: '' + label3: '' + label4: '' + label5: '' + label6: '' + label7: '' + label8: '' + label9: '' + legend: 'True' + marker1: '-1' + marker10: '-1' + marker2: '-1' + marker3: '-1' + marker4: '-1' + marker5: '-1' + marker6: '-1' + marker7: '-1' + marker8: '-1' + marker9: '-1' + name: '""' + nconnections: '1' + size: '1024' + srate: sample_rate + stemplot: 'False' + style1: '1' + style10: '1' + style2: '1' + style3: '1' + style4: '1' + style5: '1' + style6: '1' + style7: '1' + style8: '1' + style9: '1' + tr_chan: '0' + tr_delay: '0' + tr_level: '0.0' + tr_mode: qtgui.TRIG_MODE_FREE + tr_slope: qtgui.TRIG_SLOPE_POS + tr_tag: '""' + type: complex + update_time: '0.10' + width1: '1' + width10: '1' + width2: '1' + width3: '1' + width4: '1' + width5: '1' + width6: '1' + width7: '1' + width8: '1' + width9: '1' + ylabel: Amplitude + ymax: '1' + ymin: '-1' + yunit: '""' + states: + bus_sink: false + bus_source: false + bus_structure: null + coordinate: [1000, 387] + rotation: 0 + state: disabled +- name: uhd_usrp_sink_0 + id: uhd_usrp_sink + parameters: + affinity: '' + alias: '' + ant0: TX/RX + ant1: '' + ant10: '' + ant11: '' + ant12: '' + ant13: '' + ant14: '' + ant15: '' + ant16: '' + ant17: '' + ant18: '' + ant19: '' + ant2: '' + ant20: '' + ant21: '' + ant22: '' + ant23: '' + ant24: '' + ant25: '' + ant26: '' + ant27: '' + ant28: '' + ant29: '' + ant3: '' + ant30: '' + ant31: '' + ant4: '' + ant5: '' + ant6: '' + ant7: '' + ant8: '' + ant9: '' + bw0: '0' + bw1: '0' + bw10: '0' + bw11: '0' + bw12: '0' + bw13: '0' + bw14: '0' + bw15: '0' + bw16: '0' + bw17: '0' + bw18: '0' + bw19: '0' + bw2: '0' + bw20: '0' + bw21: '0' + bw22: '0' + bw23: '0' + bw24: '0' + bw25: '0' + bw26: '0' + bw27: '0' + bw28: '0' + bw29: '0' + bw3: '0' + bw30: '0' + bw31: '0' + bw4: '0' + bw5: '0' + bw6: '0' + bw7: '0' + bw8: '0' + bw9: '0' + center_freq0: float(tx_frequency)*1e6 + center_freq1: '0' + center_freq10: '0' + center_freq11: '0' + center_freq12: '0' + center_freq13: '0' + center_freq14: '0' + center_freq15: '0' + center_freq16: '0' + center_freq17: '0' + center_freq18: '0' + center_freq19: '0' + center_freq2: '0' + center_freq20: '0' + center_freq21: '0' + center_freq22: '0' + center_freq23: '0' + center_freq24: '0' + center_freq25: '0' + center_freq26: '0' + center_freq27: '0' + center_freq28: '0' + center_freq29: '0' + center_freq3: '0' + center_freq30: '0' + center_freq31: '0' + center_freq4: '0' + center_freq5: '0' + center_freq6: '0' + center_freq7: '0' + center_freq8: '0' + center_freq9: '0' + clock_rate: '0.0' + clock_source0: '' + clock_source1: '' + clock_source2: '' + clock_source3: '' + clock_source4: '' + clock_source5: '' + clock_source6: '' + clock_source7: '' + comment: '' + dev_addr: '"ip_addr="+ip_address' + dev_args: '""' + gain0: float(tx_gain) + gain1: '0' + gain10: '0' + gain11: '0' + gain12: '0' + gain13: '0' + gain14: '0' + gain15: '0' + gain16: '0' + gain17: '0' + gain18: '0' + gain19: '0' + gain2: '0' + gain20: '0' + gain21: '0' + gain22: '0' + gain23: '0' + gain24: '0' + gain25: '0' + gain26: '0' + gain27: '0' + gain28: '0' + gain29: '0' + gain3: '0' + gain30: '0' + gain31: '0' + gain4: '0' + gain5: '0' + gain6: '0' + gain7: '0' + gain8: '0' + gain9: '0' + len_tag_name: '' + lo_export0: 'False' + lo_export1: 'False' + lo_export10: 'False' + lo_export11: 'False' + lo_export12: 'False' + lo_export13: 'False' + lo_export14: 'False' + lo_export15: 'False' + lo_export16: 'False' + lo_export17: 'False' + lo_export18: 'False' + lo_export19: 'False' + lo_export2: 'False' + lo_export20: 'False' + lo_export21: 'False' + lo_export22: 'False' + lo_export23: 'False' + lo_export24: 'False' + lo_export25: 'False' + lo_export26: 'False' + lo_export27: 'False' + lo_export28: 'False' + lo_export29: 'False' + lo_export3: 'False' + lo_export30: 'False' + lo_export31: 'False' + lo_export4: 'False' + lo_export5: 'False' + lo_export6: 'False' + lo_export7: 'False' + lo_export8: 'False' + lo_export9: 'False' + lo_source0: internal + lo_source1: internal + lo_source10: internal + lo_source11: internal + lo_source12: internal + lo_source13: internal + lo_source14: internal + lo_source15: internal + lo_source16: internal + lo_source17: internal + lo_source18: internal + lo_source19: internal + lo_source2: internal + lo_source20: internal + lo_source21: internal + lo_source22: internal + lo_source23: internal + lo_source24: internal + lo_source25: internal + lo_source26: internal + lo_source27: internal + lo_source28: internal + lo_source29: internal + lo_source3: internal + lo_source30: internal + lo_source31: internal + lo_source4: internal + lo_source5: internal + lo_source6: internal + lo_source7: internal + lo_source8: internal + lo_source9: internal + maxoutbuf: '0' + minoutbuf: '0' + nchan: '1' + norm_gain0: 'False' + norm_gain1: 'False' + norm_gain10: 'False' + norm_gain11: 'False' + norm_gain12: 'False' + norm_gain13: 'False' + norm_gain14: 'False' + norm_gain15: 'False' + norm_gain16: 'False' + norm_gain17: 'False' + norm_gain18: 'False' + norm_gain19: 'False' + norm_gain2: 'False' + norm_gain20: 'False' + norm_gain21: 'False' + norm_gain22: 'False' + norm_gain23: 'False' + norm_gain24: 'False' + norm_gain25: 'False' + norm_gain26: 'False' + norm_gain27: 'False' + norm_gain28: 'False' + norm_gain29: 'False' + norm_gain3: 'False' + norm_gain30: 'False' + norm_gain31: 'False' + norm_gain4: 'False' + norm_gain5: 'False' + norm_gain6: 'False' + norm_gain7: 'False' + norm_gain8: 'False' + norm_gain9: 'False' + num_mboards: '1' + otw: '' + samp_rate: float(sample_rate)*1e6 + sd_spec0: tx_channel + sd_spec1: '' + sd_spec2: '' + sd_spec3: '' + sd_spec4: '' + sd_spec5: '' + sd_spec6: '' + sd_spec7: '' + show_lo_controls: 'False' + stream_args: '' + stream_chans: '[]' + sync: sync + time_source0: '' + time_source1: '' + time_source2: '' + time_source3: '' + time_source4: '' + time_source5: '' + time_source6: '' + time_source7: '' + type: fc32 + states: + bus_sink: false + bus_source: false + bus_structure: null + coordinate: [864, 74] + rotation: 0 + state: enabled + +connections: +- [blocks_file_source_0, '0', uhd_usrp_sink_0, '0'] + +metadata: + file_format: 1 diff --git a/Flow Graph Library/IQ Flow Graphs/iq_playback_single_usrp2.py b/Flow Graph Library/IQ Flow Graphs/iq_playback_single_usrp2.py new file mode 100755 index 00000000..7b994ed7 --- /dev/null +++ b/Flow Graph Library/IQ Flow Graphs/iq_playback_single_usrp2.py @@ -0,0 +1,132 @@ +#!/usr/bin/env python3 +# -*- coding: utf-8 -*- + +# +# SPDX-License-Identifier: GPL-3.0 +# +# GNU Radio Python Flow Graph +# Title: Iq Playback Single Usrp2 +# GNU Radio version: 3.10.1.1 + +from gnuradio import blocks +import pmt +from gnuradio import gr +from gnuradio.filter import firdes +from gnuradio.fft import window +import sys +import signal +from argparse import ArgumentParser +from gnuradio.eng_arg import eng_float, intx +from gnuradio import eng_notation +from gnuradio import uhd +import time + + + + +class iq_playback_single_usrp2(gr.top_block): + + def __init__(self): + gr.top_block.__init__(self, "Iq Playback Single Usrp2", catch_exceptions=True) + + ################################################## + # Variables + ################################################## + self.tx_gain = tx_gain = 30 + self.tx_frequency = tx_frequency = 2425.715 + self.tx_channel = tx_channel = "A:0" + self.sample_rate = sample_rate = 4 + self.ip_address = ip_address = "192.168.10.2" + self.filepath = filepath = "" + + ################################################## + # Blocks + ################################################## + self.uhd_usrp_sink_0 = uhd.usrp_sink( + ",".join(("ip_addr="+ip_address, "")), + uhd.stream_args( + cpu_format="fc32", + args='', + channels=list(range(0,1)), + ), + '', + ) + self.uhd_usrp_sink_0.set_subdev_spec(tx_channel, 0) + self.uhd_usrp_sink_0.set_samp_rate(float(sample_rate)*1e6) + self.uhd_usrp_sink_0.set_time_unknown_pps(uhd.time_spec(0)) + + self.uhd_usrp_sink_0.set_center_freq(float(tx_frequency)*1e6, 0) + self.uhd_usrp_sink_0.set_antenna('TX/RX', 0) + self.uhd_usrp_sink_0.set_gain(float(tx_gain), 0) + self.blocks_file_source_0 = blocks.file_source(gr.sizeof_gr_complex*1, filepath, False, 0, 0) + self.blocks_file_source_0.set_begin_tag(pmt.PMT_NIL) + + + ################################################## + # Connections + ################################################## + self.connect((self.blocks_file_source_0, 0), (self.uhd_usrp_sink_0, 0)) + + + def get_tx_gain(self): + return self.tx_gain + + def set_tx_gain(self, tx_gain): + self.tx_gain = tx_gain + self.uhd_usrp_sink_0.set_gain(float(self.tx_gain), 0) + + def get_tx_frequency(self): + return self.tx_frequency + + def set_tx_frequency(self, tx_frequency): + self.tx_frequency = tx_frequency + self.uhd_usrp_sink_0.set_center_freq(float(self.tx_frequency)*1e6, 0) + + def get_tx_channel(self): + return self.tx_channel + + def set_tx_channel(self, tx_channel): + self.tx_channel = tx_channel + + def get_sample_rate(self): + return self.sample_rate + + def set_sample_rate(self, sample_rate): + self.sample_rate = sample_rate + self.uhd_usrp_sink_0.set_samp_rate(float(self.sample_rate)*1e6) + + def get_ip_address(self): + return self.ip_address + + def set_ip_address(self, ip_address): + self.ip_address = ip_address + + def get_filepath(self): + return self.filepath + + def set_filepath(self, filepath): + self.filepath = filepath + self.blocks_file_source_0.open(self.filepath, False) + + + + +def main(top_block_cls=iq_playback_single_usrp2, options=None): + tb = top_block_cls() + + def sig_handler(sig=None, frame=None): + tb.stop() + tb.wait() + + sys.exit(0) + + signal.signal(signal.SIGINT, sig_handler) + signal.signal(signal.SIGTERM, sig_handler) + + tb.start() + + tb.wait() + + +if __name__ == '__main__': + main() diff --git a/Flow Graph Library/IQ Flow Graphs/iq_playback_single_usrp_n2xx.grc b/Flow Graph Library/IQ Flow Graphs/iq_playback_single_usrp_n2xx.grc new file mode 100644 index 00000000..9b47e9db --- /dev/null +++ b/Flow Graph Library/IQ Flow Graphs/iq_playback_single_usrp_n2xx.grc @@ -0,0 +1,604 @@ +options: + parameters: + author: '' + category: Custom + cmake_opt: '' + comment: '' + copyright: '' + description: '' + gen_cmake: 'On' + gen_linking: dynamic + generate_options: no_gui + hier_block_src_path: '.:' + id: iq_playback_single_usrp_n2xx + max_nouts: '0' + output_language: python + placement: (0,0) + qt_qss_theme: '' + realtime_scheduling: '' + run: 'True' + run_command: '{python} -u {filename}' + run_options: run + sizing_mode: fixed + thread_safe_setters: '' + title: '' + window_size: 1280, 1024 + states: + bus_sink: false + bus_source: false + bus_structure: null + coordinate: [10, 10] + rotation: 0 + state: enabled + +blocks: +- name: filepath + id: variable + parameters: + comment: '' + value: '""' + states: + bus_sink: false + bus_source: false + bus_structure: null + coordinate: [8, 164] + rotation: 0 + state: enabled +- name: ip_address + id: variable + parameters: + comment: '' + value: '"192.168.10.2"' + states: + bus_sink: false + bus_source: false + bus_structure: null + coordinate: [8, 100] + rotation: 0 + state: enabled +- name: sample_rate + id: variable + parameters: + comment: '' + value: '4' + states: + bus_sink: false + bus_source: false + bus_structure: null + coordinate: [8, 356] + rotation: 0 + state: enabled +- name: tx_channel + id: variable + parameters: + comment: '' + value: '"A:0"' + states: + bus_sink: false + bus_source: false + bus_structure: null + coordinate: [8, 228] + rotation: 0 + state: enabled +- name: tx_frequency + id: variable + parameters: + comment: '' + value: '2425.715' + states: + bus_sink: false + bus_source: false + bus_structure: null + coordinate: [8, 292] + rotation: 0 + state: enabled +- name: tx_gain + id: variable + parameters: + comment: '' + value: '30' + states: + bus_sink: false + bus_source: false + bus_structure: null + coordinate: [8, 420] + rotation: 0 + state: enabled +- name: blocks_file_source_0 + id: blocks_file_source + parameters: + affinity: '' + alias: '' + begin_tag: pmt.PMT_NIL + comment: '' + file: filepath + length: '0' + maxoutbuf: '0' + minoutbuf: '0' + offset: '0' + repeat: 'False' + type: complex + vlen: '1' + states: + bus_sink: false + bus_source: false + bus_structure: null + coordinate: [304, 125] + rotation: 0 + state: enabled +- name: qtgui_time_sink_x_0 + id: qtgui_time_sink_x + parameters: + affinity: '' + alias: '' + alpha1: '1.0' + alpha10: '1.0' + alpha2: '1.0' + alpha3: '1.0' + alpha4: '1.0' + alpha5: '1.0' + alpha6: '1.0' + alpha7: '1.0' + alpha8: '1.0' + alpha9: '1.0' + autoscale: 'True' + axislabels: 'True' + color1: blue + color10: dark blue + color2: red + color3: green + color4: black + color5: cyan + color6: magenta + color7: yellow + color8: dark red + color9: dark green + comment: '' + ctrlpanel: 'False' + entags: 'True' + grid: 'False' + gui_hint: '' + label1: '' + label10: '' + label2: '' + label3: '' + label4: '' + label5: '' + label6: '' + label7: '' + label8: '' + label9: '' + legend: 'True' + marker1: '-1' + marker10: '-1' + marker2: '-1' + marker3: '-1' + marker4: '-1' + marker5: '-1' + marker6: '-1' + marker7: '-1' + marker8: '-1' + marker9: '-1' + name: '""' + nconnections: '1' + size: '1024' + srate: sample_rate + stemplot: 'False' + style1: '1' + style10: '1' + style2: '1' + style3: '1' + style4: '1' + style5: '1' + style6: '1' + style7: '1' + style8: '1' + style9: '1' + tr_chan: '0' + tr_delay: '0' + tr_level: '0.0' + tr_mode: qtgui.TRIG_MODE_FREE + tr_slope: qtgui.TRIG_SLOPE_POS + tr_tag: '""' + type: complex + update_time: '0.10' + width1: '1' + width10: '1' + width2: '1' + width3: '1' + width4: '1' + width5: '1' + width6: '1' + width7: '1' + width8: '1' + width9: '1' + ylabel: Amplitude + ymax: '1' + ymin: '-1' + yunit: '""' + states: + bus_sink: false + bus_source: false + bus_structure: null + coordinate: [712, 459] + rotation: 0 + state: disabled +- name: qtgui_time_sink_x_0_0 + id: qtgui_time_sink_x + parameters: + affinity: '' + alias: '' + alpha1: '1.0' + alpha10: '1.0' + alpha2: '1.0' + alpha3: '1.0' + alpha4: '1.0' + alpha5: '1.0' + alpha6: '1.0' + alpha7: '1.0' + alpha8: '1.0' + alpha9: '1.0' + autoscale: 'True' + axislabels: 'True' + color1: blue + color10: dark blue + color2: red + color3: green + color4: black + color5: cyan + color6: magenta + color7: yellow + color8: dark red + color9: dark green + comment: '' + ctrlpanel: 'False' + entags: 'True' + grid: 'False' + gui_hint: '' + label1: '' + label10: '' + label2: '' + label3: '' + label4: '' + label5: '' + label6: '' + label7: '' + label8: '' + label9: '' + legend: 'True' + marker1: '-1' + marker10: '-1' + marker2: '-1' + marker3: '-1' + marker4: '-1' + marker5: '-1' + marker6: '-1' + marker7: '-1' + marker8: '-1' + marker9: '-1' + name: '""' + nconnections: '1' + size: '1024' + srate: sample_rate + stemplot: 'False' + style1: '1' + style10: '1' + style2: '1' + style3: '1' + style4: '1' + style5: '1' + style6: '1' + style7: '1' + style8: '1' + style9: '1' + tr_chan: '0' + tr_delay: '0' + tr_level: '0.0' + tr_mode: qtgui.TRIG_MODE_FREE + tr_slope: qtgui.TRIG_SLOPE_POS + tr_tag: '""' + type: complex + update_time: '0.10' + width1: '1' + width10: '1' + width2: '1' + width3: '1' + width4: '1' + width5: '1' + width6: '1' + width7: '1' + width8: '1' + width9: '1' + ylabel: Amplitude + ymax: '1' + ymin: '-1' + yunit: '""' + states: + bus_sink: false + bus_source: false + bus_structure: null + coordinate: [1000, 387] + rotation: 0 + state: disabled +- name: uhd_usrp_sink_0 + id: uhd_usrp_sink + parameters: + affinity: '' + alias: '' + ant0: TX/RX + ant1: '' + ant10: '' + ant11: '' + ant12: '' + ant13: '' + ant14: '' + ant15: '' + ant16: '' + ant17: '' + ant18: '' + ant19: '' + ant2: '' + ant20: '' + ant21: '' + ant22: '' + ant23: '' + ant24: '' + ant25: '' + ant26: '' + ant27: '' + ant28: '' + ant29: '' + ant3: '' + ant30: '' + ant31: '' + ant4: '' + ant5: '' + ant6: '' + ant7: '' + ant8: '' + ant9: '' + bw0: '0' + bw1: '0' + bw10: '0' + bw11: '0' + bw12: '0' + bw13: '0' + bw14: '0' + bw15: '0' + bw16: '0' + bw17: '0' + bw18: '0' + bw19: '0' + bw2: '0' + bw20: '0' + bw21: '0' + bw22: '0' + bw23: '0' + bw24: '0' + bw25: '0' + bw26: '0' + bw27: '0' + bw28: '0' + bw29: '0' + bw3: '0' + bw30: '0' + bw31: '0' + bw4: '0' + bw5: '0' + bw6: '0' + bw7: '0' + bw8: '0' + bw9: '0' + center_freq0: float(tx_frequency)*1e6 + center_freq1: '0' + center_freq10: '0' + center_freq11: '0' + center_freq12: '0' + center_freq13: '0' + center_freq14: '0' + center_freq15: '0' + center_freq16: '0' + center_freq17: '0' + center_freq18: '0' + center_freq19: '0' + center_freq2: '0' + center_freq20: '0' + center_freq21: '0' + center_freq22: '0' + center_freq23: '0' + center_freq24: '0' + center_freq25: '0' + center_freq26: '0' + center_freq27: '0' + center_freq28: '0' + center_freq29: '0' + center_freq3: '0' + center_freq30: '0' + center_freq31: '0' + center_freq4: '0' + center_freq5: '0' + center_freq6: '0' + center_freq7: '0' + center_freq8: '0' + center_freq9: '0' + clock_rate: '0.0' + clock_source0: '' + clock_source1: '' + clock_source2: '' + clock_source3: '' + clock_source4: '' + clock_source5: '' + clock_source6: '' + clock_source7: '' + comment: '' + dev_addr: '"ip_addr="+ip_address' + dev_args: '""' + gain0: float(tx_gain) + gain1: '0' + gain10: '0' + gain11: '0' + gain12: '0' + gain13: '0' + gain14: '0' + gain15: '0' + gain16: '0' + gain17: '0' + gain18: '0' + gain19: '0' + gain2: '0' + gain20: '0' + gain21: '0' + gain22: '0' + gain23: '0' + gain24: '0' + gain25: '0' + gain26: '0' + gain27: '0' + gain28: '0' + gain29: '0' + gain3: '0' + gain30: '0' + gain31: '0' + gain4: '0' + gain5: '0' + gain6: '0' + gain7: '0' + gain8: '0' + gain9: '0' + len_tag_name: '' + lo_export0: 'False' + lo_export1: 'False' + lo_export10: 'False' + lo_export11: 'False' + lo_export12: 'False' + lo_export13: 'False' + lo_export14: 'False' + lo_export15: 'False' + lo_export16: 'False' + lo_export17: 'False' + lo_export18: 'False' + lo_export19: 'False' + lo_export2: 'False' + lo_export20: 'False' + lo_export21: 'False' + lo_export22: 'False' + lo_export23: 'False' + lo_export24: 'False' + lo_export25: 'False' + lo_export26: 'False' + lo_export27: 'False' + lo_export28: 'False' + lo_export29: 'False' + lo_export3: 'False' + lo_export30: 'False' + lo_export31: 'False' + lo_export4: 'False' + lo_export5: 'False' + lo_export6: 'False' + lo_export7: 'False' + lo_export8: 'False' + lo_export9: 'False' + lo_source0: internal + lo_source1: internal + lo_source10: internal + lo_source11: internal + lo_source12: internal + lo_source13: internal + lo_source14: internal + lo_source15: internal + lo_source16: internal + lo_source17: internal + lo_source18: internal + lo_source19: internal + lo_source2: internal + lo_source20: internal + lo_source21: internal + lo_source22: internal + lo_source23: internal + lo_source24: internal + lo_source25: internal + lo_source26: internal + lo_source27: internal + lo_source28: internal + lo_source29: internal + lo_source3: internal + lo_source30: internal + lo_source31: internal + lo_source4: internal + lo_source5: internal + lo_source6: internal + lo_source7: internal + lo_source8: internal + lo_source9: internal + maxoutbuf: '0' + minoutbuf: '0' + nchan: '1' + norm_gain0: 'False' + norm_gain1: 'False' + norm_gain10: 'False' + norm_gain11: 'False' + norm_gain12: 'False' + norm_gain13: 'False' + norm_gain14: 'False' + norm_gain15: 'False' + norm_gain16: 'False' + norm_gain17: 'False' + norm_gain18: 'False' + norm_gain19: 'False' + norm_gain2: 'False' + norm_gain20: 'False' + norm_gain21: 'False' + norm_gain22: 'False' + norm_gain23: 'False' + norm_gain24: 'False' + norm_gain25: 'False' + norm_gain26: 'False' + norm_gain27: 'False' + norm_gain28: 'False' + norm_gain29: 'False' + norm_gain3: 'False' + norm_gain30: 'False' + norm_gain31: 'False' + norm_gain4: 'False' + norm_gain5: 'False' + norm_gain6: 'False' + norm_gain7: 'False' + norm_gain8: 'False' + norm_gain9: 'False' + num_mboards: '1' + otw: '' + samp_rate: float(sample_rate)*1e6 + sd_spec0: tx_channel + sd_spec1: '' + sd_spec2: '' + sd_spec3: '' + sd_spec4: '' + sd_spec5: '' + sd_spec6: '' + sd_spec7: '' + show_lo_controls: 'False' + stream_args: '' + stream_chans: '[]' + sync: sync + time_source0: '' + time_source1: '' + time_source2: '' + time_source3: '' + time_source4: '' + time_source5: '' + time_source6: '' + time_source7: '' + type: fc32 + states: + bus_sink: false + bus_source: false + bus_structure: null + coordinate: [864, 74] + rotation: 0 + state: enabled + +connections: +- [blocks_file_source_0, '0', uhd_usrp_sink_0, '0'] + +metadata: + file_format: 1 diff --git a/Flow Graph Library/IQ Flow Graphs/iq_playback_single_usrp_n2xx.py b/Flow Graph Library/IQ Flow Graphs/iq_playback_single_usrp_n2xx.py new file mode 100755 index 00000000..36d521f9 --- /dev/null +++ b/Flow Graph Library/IQ Flow Graphs/iq_playback_single_usrp_n2xx.py @@ -0,0 +1,132 @@ +#!/usr/bin/env python3 +# -*- coding: utf-8 -*- + +# +# SPDX-License-Identifier: GPL-3.0 +# +# GNU Radio Python Flow Graph +# Title: Iq Playback Single Usrp N2Xx +# GNU Radio version: 3.10.1.1 + +from gnuradio import blocks +import pmt +from gnuradio import gr +from gnuradio.filter import firdes +from gnuradio.fft import window +import sys +import signal +from argparse import ArgumentParser +from gnuradio.eng_arg import eng_float, intx +from gnuradio import eng_notation +from gnuradio import uhd +import time + + + + +class iq_playback_single_usrp_n2xx(gr.top_block): + + def __init__(self): + gr.top_block.__init__(self, "Iq Playback Single Usrp N2Xx", catch_exceptions=True) + + ################################################## + # Variables + ################################################## + self.tx_gain = tx_gain = 30 + self.tx_frequency = tx_frequency = 2425.715 + self.tx_channel = tx_channel = "A:0" + self.sample_rate = sample_rate = 4 + self.ip_address = ip_address = "192.168.10.2" + self.filepath = filepath = "" + + ################################################## + # Blocks + ################################################## + self.uhd_usrp_sink_0 = uhd.usrp_sink( + ",".join(("ip_addr="+ip_address, "")), + uhd.stream_args( + cpu_format="fc32", + args='', + channels=list(range(0,1)), + ), + '', + ) + self.uhd_usrp_sink_0.set_subdev_spec(tx_channel, 0) + self.uhd_usrp_sink_0.set_samp_rate(float(sample_rate)*1e6) + self.uhd_usrp_sink_0.set_time_unknown_pps(uhd.time_spec(0)) + + self.uhd_usrp_sink_0.set_center_freq(float(tx_frequency)*1e6, 0) + self.uhd_usrp_sink_0.set_antenna('TX/RX', 0) + self.uhd_usrp_sink_0.set_gain(float(tx_gain), 0) + self.blocks_file_source_0 = blocks.file_source(gr.sizeof_gr_complex*1, filepath, False, 0, 0) + self.blocks_file_source_0.set_begin_tag(pmt.PMT_NIL) + + + ################################################## + # Connections + ################################################## + self.connect((self.blocks_file_source_0, 0), (self.uhd_usrp_sink_0, 0)) + + + def get_tx_gain(self): + return self.tx_gain + + def set_tx_gain(self, tx_gain): + self.tx_gain = tx_gain + self.uhd_usrp_sink_0.set_gain(float(self.tx_gain), 0) + + def get_tx_frequency(self): + return self.tx_frequency + + def set_tx_frequency(self, tx_frequency): + self.tx_frequency = tx_frequency + self.uhd_usrp_sink_0.set_center_freq(float(self.tx_frequency)*1e6, 0) + + def get_tx_channel(self): + return self.tx_channel + + def set_tx_channel(self, tx_channel): + self.tx_channel = tx_channel + + def get_sample_rate(self): + return self.sample_rate + + def set_sample_rate(self, sample_rate): + self.sample_rate = sample_rate + self.uhd_usrp_sink_0.set_samp_rate(float(self.sample_rate)*1e6) + + def get_ip_address(self): + return self.ip_address + + def set_ip_address(self, ip_address): + self.ip_address = ip_address + + def get_filepath(self): + return self.filepath + + def set_filepath(self, filepath): + self.filepath = filepath + self.blocks_file_source_0.open(self.filepath, False) + + + + +def main(top_block_cls=iq_playback_single_usrp_n2xx, options=None): + tb = top_block_cls() + + def sig_handler(sig=None, frame=None): + tb.stop() + tb.wait() + + sys.exit(0) + + signal.signal(signal.SIGINT, sig_handler) + signal.signal(signal.SIGTERM, sig_handler) + + tb.start() + + tb.wait() + + +if __name__ == '__main__': + main() diff --git a/Flow Graph Library/IQ Flow Graphs/iq_playback_usrp2.grc b/Flow Graph Library/IQ Flow Graphs/iq_playback_usrp2.grc new file mode 100644 index 00000000..e931aaa7 --- /dev/null +++ b/Flow Graph Library/IQ Flow Graphs/iq_playback_usrp2.grc @@ -0,0 +1,604 @@ +options: + parameters: + author: '' + category: Custom + cmake_opt: '' + comment: '' + copyright: '' + description: '' + gen_cmake: 'On' + gen_linking: dynamic + generate_options: no_gui + hier_block_src_path: '.:' + id: iq_playback_usrp2 + max_nouts: '0' + output_language: python + placement: (0,0) + qt_qss_theme: '' + realtime_scheduling: '' + run: 'True' + run_command: '{python} -u {filename}' + run_options: run + sizing_mode: fixed + thread_safe_setters: '' + title: '' + window_size: 1280, 1024 + states: + bus_sink: false + bus_source: false + bus_structure: null + coordinate: [10, 10] + rotation: 0 + state: enabled + +blocks: +- name: filepath + id: variable + parameters: + comment: '' + value: '""' + states: + bus_sink: false + bus_source: false + bus_structure: null + coordinate: [8, 164] + rotation: 0 + state: enabled +- name: ip_address + id: variable + parameters: + comment: '' + value: '"192.168.10.2"' + states: + bus_sink: false + bus_source: false + bus_structure: null + coordinate: [8, 100] + rotation: 0 + state: enabled +- name: sample_rate + id: variable + parameters: + comment: '' + value: '4' + states: + bus_sink: false + bus_source: false + bus_structure: null + coordinate: [8, 356] + rotation: 0 + state: enabled +- name: tx_channel + id: variable + parameters: + comment: '' + value: '"A:0"' + states: + bus_sink: false + bus_source: false + bus_structure: null + coordinate: [8, 228] + rotation: 0 + state: enabled +- name: tx_frequency + id: variable + parameters: + comment: '' + value: '2425.715' + states: + bus_sink: false + bus_source: false + bus_structure: null + coordinate: [8, 292] + rotation: 0 + state: enabled +- name: tx_gain + id: variable + parameters: + comment: '' + value: '30' + states: + bus_sink: false + bus_source: false + bus_structure: null + coordinate: [8, 420] + rotation: 0 + state: enabled +- name: blocks_file_source_0 + id: blocks_file_source + parameters: + affinity: '' + alias: '' + begin_tag: pmt.PMT_NIL + comment: '' + file: filepath + length: '0' + maxoutbuf: '0' + minoutbuf: '0' + offset: '0' + repeat: 'True' + type: complex + vlen: '1' + states: + bus_sink: false + bus_source: false + bus_structure: null + coordinate: [304, 125] + rotation: 0 + state: enabled +- name: qtgui_time_sink_x_0 + id: qtgui_time_sink_x + parameters: + affinity: '' + alias: '' + alpha1: '1.0' + alpha10: '1.0' + alpha2: '1.0' + alpha3: '1.0' + alpha4: '1.0' + alpha5: '1.0' + alpha6: '1.0' + alpha7: '1.0' + alpha8: '1.0' + alpha9: '1.0' + autoscale: 'True' + axislabels: 'True' + color1: blue + color10: dark blue + color2: red + color3: green + color4: black + color5: cyan + color6: magenta + color7: yellow + color8: dark red + color9: dark green + comment: '' + ctrlpanel: 'False' + entags: 'True' + grid: 'False' + gui_hint: '' + label1: '' + label10: '' + label2: '' + label3: '' + label4: '' + label5: '' + label6: '' + label7: '' + label8: '' + label9: '' + legend: 'True' + marker1: '-1' + marker10: '-1' + marker2: '-1' + marker3: '-1' + marker4: '-1' + marker5: '-1' + marker6: '-1' + marker7: '-1' + marker8: '-1' + marker9: '-1' + name: '""' + nconnections: '1' + size: '1024' + srate: sample_rate + stemplot: 'False' + style1: '1' + style10: '1' + style2: '1' + style3: '1' + style4: '1' + style5: '1' + style6: '1' + style7: '1' + style8: '1' + style9: '1' + tr_chan: '0' + tr_delay: '0' + tr_level: '0.0' + tr_mode: qtgui.TRIG_MODE_FREE + tr_slope: qtgui.TRIG_SLOPE_POS + tr_tag: '""' + type: complex + update_time: '0.10' + width1: '1' + width10: '1' + width2: '1' + width3: '1' + width4: '1' + width5: '1' + width6: '1' + width7: '1' + width8: '1' + width9: '1' + ylabel: Amplitude + ymax: '1' + ymin: '-1' + yunit: '""' + states: + bus_sink: false + bus_source: false + bus_structure: null + coordinate: [712, 459] + rotation: 0 + state: disabled +- name: qtgui_time_sink_x_0_0 + id: qtgui_time_sink_x + parameters: + affinity: '' + alias: '' + alpha1: '1.0' + alpha10: '1.0' + alpha2: '1.0' + alpha3: '1.0' + alpha4: '1.0' + alpha5: '1.0' + alpha6: '1.0' + alpha7: '1.0' + alpha8: '1.0' + alpha9: '1.0' + autoscale: 'True' + axislabels: 'True' + color1: blue + color10: dark blue + color2: red + color3: green + color4: black + color5: cyan + color6: magenta + color7: yellow + color8: dark red + color9: dark green + comment: '' + ctrlpanel: 'False' + entags: 'True' + grid: 'False' + gui_hint: '' + label1: '' + label10: '' + label2: '' + label3: '' + label4: '' + label5: '' + label6: '' + label7: '' + label8: '' + label9: '' + legend: 'True' + marker1: '-1' + marker10: '-1' + marker2: '-1' + marker3: '-1' + marker4: '-1' + marker5: '-1' + marker6: '-1' + marker7: '-1' + marker8: '-1' + marker9: '-1' + name: '""' + nconnections: '1' + size: '1024' + srate: sample_rate + stemplot: 'False' + style1: '1' + style10: '1' + style2: '1' + style3: '1' + style4: '1' + style5: '1' + style6: '1' + style7: '1' + style8: '1' + style9: '1' + tr_chan: '0' + tr_delay: '0' + tr_level: '0.0' + tr_mode: qtgui.TRIG_MODE_FREE + tr_slope: qtgui.TRIG_SLOPE_POS + tr_tag: '""' + type: complex + update_time: '0.10' + width1: '1' + width10: '1' + width2: '1' + width3: '1' + width4: '1' + width5: '1' + width6: '1' + width7: '1' + width8: '1' + width9: '1' + ylabel: Amplitude + ymax: '1' + ymin: '-1' + yunit: '""' + states: + bus_sink: false + bus_source: false + bus_structure: null + coordinate: [1000, 387] + rotation: 0 + state: disabled +- name: uhd_usrp_sink_0 + id: uhd_usrp_sink + parameters: + affinity: '' + alias: '' + ant0: TX/RX + ant1: '' + ant10: '' + ant11: '' + ant12: '' + ant13: '' + ant14: '' + ant15: '' + ant16: '' + ant17: '' + ant18: '' + ant19: '' + ant2: '' + ant20: '' + ant21: '' + ant22: '' + ant23: '' + ant24: '' + ant25: '' + ant26: '' + ant27: '' + ant28: '' + ant29: '' + ant3: '' + ant30: '' + ant31: '' + ant4: '' + ant5: '' + ant6: '' + ant7: '' + ant8: '' + ant9: '' + bw0: '0' + bw1: '0' + bw10: '0' + bw11: '0' + bw12: '0' + bw13: '0' + bw14: '0' + bw15: '0' + bw16: '0' + bw17: '0' + bw18: '0' + bw19: '0' + bw2: '0' + bw20: '0' + bw21: '0' + bw22: '0' + bw23: '0' + bw24: '0' + bw25: '0' + bw26: '0' + bw27: '0' + bw28: '0' + bw29: '0' + bw3: '0' + bw30: '0' + bw31: '0' + bw4: '0' + bw5: '0' + bw6: '0' + bw7: '0' + bw8: '0' + bw9: '0' + center_freq0: float(tx_frequency)*1e6 + center_freq1: '0' + center_freq10: '0' + center_freq11: '0' + center_freq12: '0' + center_freq13: '0' + center_freq14: '0' + center_freq15: '0' + center_freq16: '0' + center_freq17: '0' + center_freq18: '0' + center_freq19: '0' + center_freq2: '0' + center_freq20: '0' + center_freq21: '0' + center_freq22: '0' + center_freq23: '0' + center_freq24: '0' + center_freq25: '0' + center_freq26: '0' + center_freq27: '0' + center_freq28: '0' + center_freq29: '0' + center_freq3: '0' + center_freq30: '0' + center_freq31: '0' + center_freq4: '0' + center_freq5: '0' + center_freq6: '0' + center_freq7: '0' + center_freq8: '0' + center_freq9: '0' + clock_rate: '0.0' + clock_source0: '' + clock_source1: '' + clock_source2: '' + clock_source3: '' + clock_source4: '' + clock_source5: '' + clock_source6: '' + clock_source7: '' + comment: '' + dev_addr: '"ip_addr="+ip_address' + dev_args: '""' + gain0: float(tx_gain) + gain1: '0' + gain10: '0' + gain11: '0' + gain12: '0' + gain13: '0' + gain14: '0' + gain15: '0' + gain16: '0' + gain17: '0' + gain18: '0' + gain19: '0' + gain2: '0' + gain20: '0' + gain21: '0' + gain22: '0' + gain23: '0' + gain24: '0' + gain25: '0' + gain26: '0' + gain27: '0' + gain28: '0' + gain29: '0' + gain3: '0' + gain30: '0' + gain31: '0' + gain4: '0' + gain5: '0' + gain6: '0' + gain7: '0' + gain8: '0' + gain9: '0' + len_tag_name: '' + lo_export0: 'False' + lo_export1: 'False' + lo_export10: 'False' + lo_export11: 'False' + lo_export12: 'False' + lo_export13: 'False' + lo_export14: 'False' + lo_export15: 'False' + lo_export16: 'False' + lo_export17: 'False' + lo_export18: 'False' + lo_export19: 'False' + lo_export2: 'False' + lo_export20: 'False' + lo_export21: 'False' + lo_export22: 'False' + lo_export23: 'False' + lo_export24: 'False' + lo_export25: 'False' + lo_export26: 'False' + lo_export27: 'False' + lo_export28: 'False' + lo_export29: 'False' + lo_export3: 'False' + lo_export30: 'False' + lo_export31: 'False' + lo_export4: 'False' + lo_export5: 'False' + lo_export6: 'False' + lo_export7: 'False' + lo_export8: 'False' + lo_export9: 'False' + lo_source0: internal + lo_source1: internal + lo_source10: internal + lo_source11: internal + lo_source12: internal + lo_source13: internal + lo_source14: internal + lo_source15: internal + lo_source16: internal + lo_source17: internal + lo_source18: internal + lo_source19: internal + lo_source2: internal + lo_source20: internal + lo_source21: internal + lo_source22: internal + lo_source23: internal + lo_source24: internal + lo_source25: internal + lo_source26: internal + lo_source27: internal + lo_source28: internal + lo_source29: internal + lo_source3: internal + lo_source30: internal + lo_source31: internal + lo_source4: internal + lo_source5: internal + lo_source6: internal + lo_source7: internal + lo_source8: internal + lo_source9: internal + maxoutbuf: '0' + minoutbuf: '0' + nchan: '1' + norm_gain0: 'False' + norm_gain1: 'False' + norm_gain10: 'False' + norm_gain11: 'False' + norm_gain12: 'False' + norm_gain13: 'False' + norm_gain14: 'False' + norm_gain15: 'False' + norm_gain16: 'False' + norm_gain17: 'False' + norm_gain18: 'False' + norm_gain19: 'False' + norm_gain2: 'False' + norm_gain20: 'False' + norm_gain21: 'False' + norm_gain22: 'False' + norm_gain23: 'False' + norm_gain24: 'False' + norm_gain25: 'False' + norm_gain26: 'False' + norm_gain27: 'False' + norm_gain28: 'False' + norm_gain29: 'False' + norm_gain3: 'False' + norm_gain30: 'False' + norm_gain31: 'False' + norm_gain4: 'False' + norm_gain5: 'False' + norm_gain6: 'False' + norm_gain7: 'False' + norm_gain8: 'False' + norm_gain9: 'False' + num_mboards: '1' + otw: '' + samp_rate: float(sample_rate)*1e6 + sd_spec0: tx_channel + sd_spec1: '' + sd_spec2: '' + sd_spec3: '' + sd_spec4: '' + sd_spec5: '' + sd_spec6: '' + sd_spec7: '' + show_lo_controls: 'False' + stream_args: '' + stream_chans: '[]' + sync: sync + time_source0: '' + time_source1: '' + time_source2: '' + time_source3: '' + time_source4: '' + time_source5: '' + time_source6: '' + time_source7: '' + type: fc32 + states: + bus_sink: false + bus_source: false + bus_structure: null + coordinate: [864, 74] + rotation: 0 + state: enabled + +connections: +- [blocks_file_source_0, '0', uhd_usrp_sink_0, '0'] + +metadata: + file_format: 1 diff --git a/Flow Graph Library/IQ Flow Graphs/iq_playback_usrp2.py b/Flow Graph Library/IQ Flow Graphs/iq_playback_usrp2.py new file mode 100755 index 00000000..8b3f0698 --- /dev/null +++ b/Flow Graph Library/IQ Flow Graphs/iq_playback_usrp2.py @@ -0,0 +1,132 @@ +#!/usr/bin/env python3 +# -*- coding: utf-8 -*- + +# +# SPDX-License-Identifier: GPL-3.0 +# +# GNU Radio Python Flow Graph +# Title: Iq Playback Usrp2 +# GNU Radio version: 3.10.1.1 + +from gnuradio import blocks +import pmt +from gnuradio import gr +from gnuradio.filter import firdes +from gnuradio.fft import window +import sys +import signal +from argparse import ArgumentParser +from gnuradio.eng_arg import eng_float, intx +from gnuradio import eng_notation +from gnuradio import uhd +import time + + + + +class iq_playback_usrp2(gr.top_block): + + def __init__(self): + gr.top_block.__init__(self, "Iq Playback Usrp2", catch_exceptions=True) + + ################################################## + # Variables + ################################################## + self.tx_gain = tx_gain = 30 + self.tx_frequency = tx_frequency = 2425.715 + self.tx_channel = tx_channel = "A:0" + self.sample_rate = sample_rate = 4 + self.ip_address = ip_address = "192.168.10.2" + self.filepath = filepath = "" + + ################################################## + # Blocks + ################################################## + self.uhd_usrp_sink_0 = uhd.usrp_sink( + ",".join(("ip_addr="+ip_address, "")), + uhd.stream_args( + cpu_format="fc32", + args='', + channels=list(range(0,1)), + ), + '', + ) + self.uhd_usrp_sink_0.set_subdev_spec(tx_channel, 0) + self.uhd_usrp_sink_0.set_samp_rate(float(sample_rate)*1e6) + self.uhd_usrp_sink_0.set_time_unknown_pps(uhd.time_spec(0)) + + self.uhd_usrp_sink_0.set_center_freq(float(tx_frequency)*1e6, 0) + self.uhd_usrp_sink_0.set_antenna('TX/RX', 0) + self.uhd_usrp_sink_0.set_gain(float(tx_gain), 0) + self.blocks_file_source_0 = blocks.file_source(gr.sizeof_gr_complex*1, filepath, True, 0, 0) + self.blocks_file_source_0.set_begin_tag(pmt.PMT_NIL) + + + ################################################## + # Connections + ################################################## + self.connect((self.blocks_file_source_0, 0), (self.uhd_usrp_sink_0, 0)) + + + def get_tx_gain(self): + return self.tx_gain + + def set_tx_gain(self, tx_gain): + self.tx_gain = tx_gain + self.uhd_usrp_sink_0.set_gain(float(self.tx_gain), 0) + + def get_tx_frequency(self): + return self.tx_frequency + + def set_tx_frequency(self, tx_frequency): + self.tx_frequency = tx_frequency + self.uhd_usrp_sink_0.set_center_freq(float(self.tx_frequency)*1e6, 0) + + def get_tx_channel(self): + return self.tx_channel + + def set_tx_channel(self, tx_channel): + self.tx_channel = tx_channel + + def get_sample_rate(self): + return self.sample_rate + + def set_sample_rate(self, sample_rate): + self.sample_rate = sample_rate + self.uhd_usrp_sink_0.set_samp_rate(float(self.sample_rate)*1e6) + + def get_ip_address(self): + return self.ip_address + + def set_ip_address(self, ip_address): + self.ip_address = ip_address + + def get_filepath(self): + return self.filepath + + def set_filepath(self, filepath): + self.filepath = filepath + self.blocks_file_source_0.open(self.filepath, True) + + + + +def main(top_block_cls=iq_playback_usrp2, options=None): + tb = top_block_cls() + + def sig_handler(sig=None, frame=None): + tb.stop() + tb.wait() + + sys.exit(0) + + signal.signal(signal.SIGINT, sig_handler) + signal.signal(signal.SIGTERM, sig_handler) + + tb.start() + + tb.wait() + + +if __name__ == '__main__': + main() diff --git a/Flow Graph Library/IQ Flow Graphs/iq_playback_usrp_n2xx.grc b/Flow Graph Library/IQ Flow Graphs/iq_playback_usrp_n2xx.grc new file mode 100644 index 00000000..2b4ff8f1 --- /dev/null +++ b/Flow Graph Library/IQ Flow Graphs/iq_playback_usrp_n2xx.grc @@ -0,0 +1,604 @@ +options: + parameters: + author: '' + category: Custom + cmake_opt: '' + comment: '' + copyright: '' + description: '' + gen_cmake: 'On' + gen_linking: dynamic + generate_options: no_gui + hier_block_src_path: '.:' + id: iq_playback_usrp_n2xx + max_nouts: '0' + output_language: python + placement: (0,0) + qt_qss_theme: '' + realtime_scheduling: '' + run: 'True' + run_command: '{python} -u {filename}' + run_options: run + sizing_mode: fixed + thread_safe_setters: '' + title: '' + window_size: 1280, 1024 + states: + bus_sink: false + bus_source: false + bus_structure: null + coordinate: [10, 10] + rotation: 0 + state: enabled + +blocks: +- name: filepath + id: variable + parameters: + comment: '' + value: '""' + states: + bus_sink: false + bus_source: false + bus_structure: null + coordinate: [8, 164] + rotation: 0 + state: enabled +- name: ip_address + id: variable + parameters: + comment: '' + value: '"192.168.10.2"' + states: + bus_sink: false + bus_source: false + bus_structure: null + coordinate: [8, 100] + rotation: 0 + state: enabled +- name: sample_rate + id: variable + parameters: + comment: '' + value: '4' + states: + bus_sink: false + bus_source: false + bus_structure: null + coordinate: [8, 356] + rotation: 0 + state: enabled +- name: tx_channel + id: variable + parameters: + comment: '' + value: '"A:0"' + states: + bus_sink: false + bus_source: false + bus_structure: null + coordinate: [8, 228] + rotation: 0 + state: enabled +- name: tx_frequency + id: variable + parameters: + comment: '' + value: '2425.715' + states: + bus_sink: false + bus_source: false + bus_structure: null + coordinate: [8, 292] + rotation: 0 + state: enabled +- name: tx_gain + id: variable + parameters: + comment: '' + value: '30' + states: + bus_sink: false + bus_source: false + bus_structure: null + coordinate: [8, 420] + rotation: 0 + state: enabled +- name: blocks_file_source_0 + id: blocks_file_source + parameters: + affinity: '' + alias: '' + begin_tag: pmt.PMT_NIL + comment: '' + file: filepath + length: '0' + maxoutbuf: '0' + minoutbuf: '0' + offset: '0' + repeat: 'True' + type: complex + vlen: '1' + states: + bus_sink: false + bus_source: false + bus_structure: null + coordinate: [304, 125] + rotation: 0 + state: enabled +- name: qtgui_time_sink_x_0 + id: qtgui_time_sink_x + parameters: + affinity: '' + alias: '' + alpha1: '1.0' + alpha10: '1.0' + alpha2: '1.0' + alpha3: '1.0' + alpha4: '1.0' + alpha5: '1.0' + alpha6: '1.0' + alpha7: '1.0' + alpha8: '1.0' + alpha9: '1.0' + autoscale: 'True' + axislabels: 'True' + color1: blue + color10: dark blue + color2: red + color3: green + color4: black + color5: cyan + color6: magenta + color7: yellow + color8: dark red + color9: dark green + comment: '' + ctrlpanel: 'False' + entags: 'True' + grid: 'False' + gui_hint: '' + label1: '' + label10: '' + label2: '' + label3: '' + label4: '' + label5: '' + label6: '' + label7: '' + label8: '' + label9: '' + legend: 'True' + marker1: '-1' + marker10: '-1' + marker2: '-1' + marker3: '-1' + marker4: '-1' + marker5: '-1' + marker6: '-1' + marker7: '-1' + marker8: '-1' + marker9: '-1' + name: '""' + nconnections: '1' + size: '1024' + srate: sample_rate + stemplot: 'False' + style1: '1' + style10: '1' + style2: '1' + style3: '1' + style4: '1' + style5: '1' + style6: '1' + style7: '1' + style8: '1' + style9: '1' + tr_chan: '0' + tr_delay: '0' + tr_level: '0.0' + tr_mode: qtgui.TRIG_MODE_FREE + tr_slope: qtgui.TRIG_SLOPE_POS + tr_tag: '""' + type: complex + update_time: '0.10' + width1: '1' + width10: '1' + width2: '1' + width3: '1' + width4: '1' + width5: '1' + width6: '1' + width7: '1' + width8: '1' + width9: '1' + ylabel: Amplitude + ymax: '1' + ymin: '-1' + yunit: '""' + states: + bus_sink: false + bus_source: false + bus_structure: null + coordinate: [712, 459] + rotation: 0 + state: disabled +- name: qtgui_time_sink_x_0_0 + id: qtgui_time_sink_x + parameters: + affinity: '' + alias: '' + alpha1: '1.0' + alpha10: '1.0' + alpha2: '1.0' + alpha3: '1.0' + alpha4: '1.0' + alpha5: '1.0' + alpha6: '1.0' + alpha7: '1.0' + alpha8: '1.0' + alpha9: '1.0' + autoscale: 'True' + axislabels: 'True' + color1: blue + color10: dark blue + color2: red + color3: green + color4: black + color5: cyan + color6: magenta + color7: yellow + color8: dark red + color9: dark green + comment: '' + ctrlpanel: 'False' + entags: 'True' + grid: 'False' + gui_hint: '' + label1: '' + label10: '' + label2: '' + label3: '' + label4: '' + label5: '' + label6: '' + label7: '' + label8: '' + label9: '' + legend: 'True' + marker1: '-1' + marker10: '-1' + marker2: '-1' + marker3: '-1' + marker4: '-1' + marker5: '-1' + marker6: '-1' + marker7: '-1' + marker8: '-1' + marker9: '-1' + name: '""' + nconnections: '1' + size: '1024' + srate: sample_rate + stemplot: 'False' + style1: '1' + style10: '1' + style2: '1' + style3: '1' + style4: '1' + style5: '1' + style6: '1' + style7: '1' + style8: '1' + style9: '1' + tr_chan: '0' + tr_delay: '0' + tr_level: '0.0' + tr_mode: qtgui.TRIG_MODE_FREE + tr_slope: qtgui.TRIG_SLOPE_POS + tr_tag: '""' + type: complex + update_time: '0.10' + width1: '1' + width10: '1' + width2: '1' + width3: '1' + width4: '1' + width5: '1' + width6: '1' + width7: '1' + width8: '1' + width9: '1' + ylabel: Amplitude + ymax: '1' + ymin: '-1' + yunit: '""' + states: + bus_sink: false + bus_source: false + bus_structure: null + coordinate: [1000, 387] + rotation: 0 + state: disabled +- name: uhd_usrp_sink_0 + id: uhd_usrp_sink + parameters: + affinity: '' + alias: '' + ant0: TX/RX + ant1: '' + ant10: '' + ant11: '' + ant12: '' + ant13: '' + ant14: '' + ant15: '' + ant16: '' + ant17: '' + ant18: '' + ant19: '' + ant2: '' + ant20: '' + ant21: '' + ant22: '' + ant23: '' + ant24: '' + ant25: '' + ant26: '' + ant27: '' + ant28: '' + ant29: '' + ant3: '' + ant30: '' + ant31: '' + ant4: '' + ant5: '' + ant6: '' + ant7: '' + ant8: '' + ant9: '' + bw0: '0' + bw1: '0' + bw10: '0' + bw11: '0' + bw12: '0' + bw13: '0' + bw14: '0' + bw15: '0' + bw16: '0' + bw17: '0' + bw18: '0' + bw19: '0' + bw2: '0' + bw20: '0' + bw21: '0' + bw22: '0' + bw23: '0' + bw24: '0' + bw25: '0' + bw26: '0' + bw27: '0' + bw28: '0' + bw29: '0' + bw3: '0' + bw30: '0' + bw31: '0' + bw4: '0' + bw5: '0' + bw6: '0' + bw7: '0' + bw8: '0' + bw9: '0' + center_freq0: float(tx_frequency)*1e6 + center_freq1: '0' + center_freq10: '0' + center_freq11: '0' + center_freq12: '0' + center_freq13: '0' + center_freq14: '0' + center_freq15: '0' + center_freq16: '0' + center_freq17: '0' + center_freq18: '0' + center_freq19: '0' + center_freq2: '0' + center_freq20: '0' + center_freq21: '0' + center_freq22: '0' + center_freq23: '0' + center_freq24: '0' + center_freq25: '0' + center_freq26: '0' + center_freq27: '0' + center_freq28: '0' + center_freq29: '0' + center_freq3: '0' + center_freq30: '0' + center_freq31: '0' + center_freq4: '0' + center_freq5: '0' + center_freq6: '0' + center_freq7: '0' + center_freq8: '0' + center_freq9: '0' + clock_rate: '0.0' + clock_source0: '' + clock_source1: '' + clock_source2: '' + clock_source3: '' + clock_source4: '' + clock_source5: '' + clock_source6: '' + clock_source7: '' + comment: '' + dev_addr: '"ip_addr="+ip_address' + dev_args: '""' + gain0: float(tx_gain) + gain1: '0' + gain10: '0' + gain11: '0' + gain12: '0' + gain13: '0' + gain14: '0' + gain15: '0' + gain16: '0' + gain17: '0' + gain18: '0' + gain19: '0' + gain2: '0' + gain20: '0' + gain21: '0' + gain22: '0' + gain23: '0' + gain24: '0' + gain25: '0' + gain26: '0' + gain27: '0' + gain28: '0' + gain29: '0' + gain3: '0' + gain30: '0' + gain31: '0' + gain4: '0' + gain5: '0' + gain6: '0' + gain7: '0' + gain8: '0' + gain9: '0' + len_tag_name: '' + lo_export0: 'False' + lo_export1: 'False' + lo_export10: 'False' + lo_export11: 'False' + lo_export12: 'False' + lo_export13: 'False' + lo_export14: 'False' + lo_export15: 'False' + lo_export16: 'False' + lo_export17: 'False' + lo_export18: 'False' + lo_export19: 'False' + lo_export2: 'False' + lo_export20: 'False' + lo_export21: 'False' + lo_export22: 'False' + lo_export23: 'False' + lo_export24: 'False' + lo_export25: 'False' + lo_export26: 'False' + lo_export27: 'False' + lo_export28: 'False' + lo_export29: 'False' + lo_export3: 'False' + lo_export30: 'False' + lo_export31: 'False' + lo_export4: 'False' + lo_export5: 'False' + lo_export6: 'False' + lo_export7: 'False' + lo_export8: 'False' + lo_export9: 'False' + lo_source0: internal + lo_source1: internal + lo_source10: internal + lo_source11: internal + lo_source12: internal + lo_source13: internal + lo_source14: internal + lo_source15: internal + lo_source16: internal + lo_source17: internal + lo_source18: internal + lo_source19: internal + lo_source2: internal + lo_source20: internal + lo_source21: internal + lo_source22: internal + lo_source23: internal + lo_source24: internal + lo_source25: internal + lo_source26: internal + lo_source27: internal + lo_source28: internal + lo_source29: internal + lo_source3: internal + lo_source30: internal + lo_source31: internal + lo_source4: internal + lo_source5: internal + lo_source6: internal + lo_source7: internal + lo_source8: internal + lo_source9: internal + maxoutbuf: '0' + minoutbuf: '0' + nchan: '1' + norm_gain0: 'False' + norm_gain1: 'False' + norm_gain10: 'False' + norm_gain11: 'False' + norm_gain12: 'False' + norm_gain13: 'False' + norm_gain14: 'False' + norm_gain15: 'False' + norm_gain16: 'False' + norm_gain17: 'False' + norm_gain18: 'False' + norm_gain19: 'False' + norm_gain2: 'False' + norm_gain20: 'False' + norm_gain21: 'False' + norm_gain22: 'False' + norm_gain23: 'False' + norm_gain24: 'False' + norm_gain25: 'False' + norm_gain26: 'False' + norm_gain27: 'False' + norm_gain28: 'False' + norm_gain29: 'False' + norm_gain3: 'False' + norm_gain30: 'False' + norm_gain31: 'False' + norm_gain4: 'False' + norm_gain5: 'False' + norm_gain6: 'False' + norm_gain7: 'False' + norm_gain8: 'False' + norm_gain9: 'False' + num_mboards: '1' + otw: '' + samp_rate: float(sample_rate)*1e6 + sd_spec0: tx_channel + sd_spec1: '' + sd_spec2: '' + sd_spec3: '' + sd_spec4: '' + sd_spec5: '' + sd_spec6: '' + sd_spec7: '' + show_lo_controls: 'False' + stream_args: '' + stream_chans: '[]' + sync: sync + time_source0: '' + time_source1: '' + time_source2: '' + time_source3: '' + time_source4: '' + time_source5: '' + time_source6: '' + time_source7: '' + type: fc32 + states: + bus_sink: false + bus_source: false + bus_structure: null + coordinate: [864, 74] + rotation: 0 + state: enabled + +connections: +- [blocks_file_source_0, '0', uhd_usrp_sink_0, '0'] + +metadata: + file_format: 1 diff --git a/Flow Graph Library/IQ Flow Graphs/iq_playback_usrp_n2xx.py b/Flow Graph Library/IQ Flow Graphs/iq_playback_usrp_n2xx.py new file mode 100755 index 00000000..5b185704 --- /dev/null +++ b/Flow Graph Library/IQ Flow Graphs/iq_playback_usrp_n2xx.py @@ -0,0 +1,132 @@ +#!/usr/bin/env python3 +# -*- coding: utf-8 -*- + +# +# SPDX-License-Identifier: GPL-3.0 +# +# GNU Radio Python Flow Graph +# Title: Iq Playback Usrp N2Xx +# GNU Radio version: 3.10.1.1 + +from gnuradio import blocks +import pmt +from gnuradio import gr +from gnuradio.filter import firdes +from gnuradio.fft import window +import sys +import signal +from argparse import ArgumentParser +from gnuradio.eng_arg import eng_float, intx +from gnuradio import eng_notation +from gnuradio import uhd +import time + + + + +class iq_playback_usrp_n2xx(gr.top_block): + + def __init__(self): + gr.top_block.__init__(self, "Iq Playback Usrp N2Xx", catch_exceptions=True) + + ################################################## + # Variables + ################################################## + self.tx_gain = tx_gain = 30 + self.tx_frequency = tx_frequency = 2425.715 + self.tx_channel = tx_channel = "A:0" + self.sample_rate = sample_rate = 4 + self.ip_address = ip_address = "192.168.10.2" + self.filepath = filepath = "" + + ################################################## + # Blocks + ################################################## + self.uhd_usrp_sink_0 = uhd.usrp_sink( + ",".join(("ip_addr="+ip_address, "")), + uhd.stream_args( + cpu_format="fc32", + args='', + channels=list(range(0,1)), + ), + '', + ) + self.uhd_usrp_sink_0.set_subdev_spec(tx_channel, 0) + self.uhd_usrp_sink_0.set_samp_rate(float(sample_rate)*1e6) + self.uhd_usrp_sink_0.set_time_unknown_pps(uhd.time_spec(0)) + + self.uhd_usrp_sink_0.set_center_freq(float(tx_frequency)*1e6, 0) + self.uhd_usrp_sink_0.set_antenna('TX/RX', 0) + self.uhd_usrp_sink_0.set_gain(float(tx_gain), 0) + self.blocks_file_source_0 = blocks.file_source(gr.sizeof_gr_complex*1, filepath, True, 0, 0) + self.blocks_file_source_0.set_begin_tag(pmt.PMT_NIL) + + + ################################################## + # Connections + ################################################## + self.connect((self.blocks_file_source_0, 0), (self.uhd_usrp_sink_0, 0)) + + + def get_tx_gain(self): + return self.tx_gain + + def set_tx_gain(self, tx_gain): + self.tx_gain = tx_gain + self.uhd_usrp_sink_0.set_gain(float(self.tx_gain), 0) + + def get_tx_frequency(self): + return self.tx_frequency + + def set_tx_frequency(self, tx_frequency): + self.tx_frequency = tx_frequency + self.uhd_usrp_sink_0.set_center_freq(float(self.tx_frequency)*1e6, 0) + + def get_tx_channel(self): + return self.tx_channel + + def set_tx_channel(self, tx_channel): + self.tx_channel = tx_channel + + def get_sample_rate(self): + return self.sample_rate + + def set_sample_rate(self, sample_rate): + self.sample_rate = sample_rate + self.uhd_usrp_sink_0.set_samp_rate(float(self.sample_rate)*1e6) + + def get_ip_address(self): + return self.ip_address + + def set_ip_address(self, ip_address): + self.ip_address = ip_address + + def get_filepath(self): + return self.filepath + + def set_filepath(self, filepath): + self.filepath = filepath + self.blocks_file_source_0.open(self.filepath, True) + + + + +def main(top_block_cls=iq_playback_usrp_n2xx, options=None): + tb = top_block_cls() + + def sig_handler(sig=None, frame=None): + tb.stop() + tb.wait() + + sys.exit(0) + + signal.signal(signal.SIGINT, sig_handler) + signal.signal(signal.SIGTERM, sig_handler) + + tb.start() + + tb.wait() + + +if __name__ == '__main__': + main() diff --git a/Flow Graph Library/IQ Flow Graphs/iq_recorder_usrp2.grc b/Flow Graph Library/IQ Flow Graphs/iq_recorder_usrp2.grc new file mode 100644 index 00000000..c29773e2 --- /dev/null +++ b/Flow Graph Library/IQ Flow Graphs/iq_recorder_usrp2.grc @@ -0,0 +1,842 @@ +options: + parameters: + author: '' + category: Custom + cmake_opt: '' + comment: '' + copyright: '' + description: '' + gen_cmake: 'On' + gen_linking: dynamic + generate_options: no_gui + hier_block_src_path: '.:' + id: iq_recorder_usrp2 + max_nouts: '0' + output_language: python + placement: (0,0) + qt_qss_theme: '' + realtime_scheduling: '' + run: 'True' + run_command: '{python} -u {filename}' + run_options: run + sizing_mode: fixed + thread_safe_setters: '' + title: '' + window_size: 1280, 1024 + states: + bus_sink: false + bus_source: false + bus_structure: null + coordinate: [10, 10] + rotation: 0 + state: enabled + +blocks: +- name: file_length + id: variable + parameters: + comment: '' + value: '100000' + states: + bus_sink: false + bus_source: false + bus_structure: null + coordinate: [128, 467] + rotation: 0 + state: enabled +- name: filepath + id: variable + parameters: + comment: '' + value: '""' + states: + bus_sink: false + bus_source: false + bus_structure: null + coordinate: [8, 315] + rotation: 0 + state: enabled +- name: ip_address + id: variable + parameters: + comment: '' + value: '"192.168.10.2"' + states: + bus_sink: false + bus_source: false + bus_structure: null + coordinate: [9, 251] + rotation: 0 + state: enabled +- name: lpf_cutoff + id: variable + parameters: + comment: '' + value: '200000' + states: + bus_sink: false + bus_source: false + bus_structure: null + coordinate: [8, 723] + rotation: 0 + state: disabled +- name: lpf_transition_width + id: variable + parameters: + comment: '' + value: '50000' + states: + bus_sink: false + bus_source: false + bus_structure: null + coordinate: [8, 787] + rotation: 0 + state: disabled +- name: rx_antenna + id: variable + parameters: + comment: '' + value: '"TX/RX"' + states: + bus_sink: false + bus_source: false + bus_structure: null + coordinate: [8, 651] + rotation: 0 + state: enabled +- name: rx_channel + id: variable + parameters: + comment: '' + value: '"A:0"' + states: + bus_sink: false + bus_source: false + bus_structure: null + coordinate: [8, 379] + rotation: 0 + state: enabled +- name: rx_frequency + id: variable + parameters: + comment: '' + value: '2412' + states: + bus_sink: false + bus_source: false + bus_structure: null + coordinate: [8, 459] + rotation: 0 + state: enabled +- name: rx_gain + id: variable + parameters: + comment: '' + value: '20' + states: + bus_sink: false + bus_source: false + bus_structure: null + coordinate: [8, 587] + rotation: 0 + state: enabled +- name: sample_rate + id: variable + parameters: + comment: '' + value: '1' + states: + bus_sink: false + bus_source: false + bus_structure: null + coordinate: [8, 523] + rotation: 0 + state: enabled +- name: squelch_threshold + id: variable + parameters: + comment: '' + value: '-50' + states: + bus_sink: false + bus_source: false + bus_structure: null + coordinate: [128, 531] + rotation: 0 + state: disabled +- name: analog_pwr_squelch_xx_0 + id: analog_pwr_squelch_xx + parameters: + affinity: '' + alias: '' + alpha: '0.5' + comment: '' + gate: 'True' + maxoutbuf: '0' + minoutbuf: '0' + ramp: '100' + threshold: squelch_threshold + type: complex + states: + bus_sink: false + bus_source: false + bus_structure: null + coordinate: [536, 324] + rotation: 0 + state: disabled +- name: blocks_file_sink_0 + id: blocks_file_sink + parameters: + affinity: '' + alias: '' + append: 'False' + comment: '' + file: filepath + type: complex + unbuffered: 'False' + vlen: '1' + states: + bus_sink: false + bus_source: false + bus_structure: null + coordinate: [1096, 195] + rotation: 0 + state: enabled +- name: blocks_head_0 + id: blocks_head + parameters: + affinity: '' + alias: '' + comment: '' + maxoutbuf: '0' + minoutbuf: '0' + num_items: file_length + type: complex + vlen: '1' + states: + bus_sink: false + bus_source: false + bus_structure: null + coordinate: [904, 212] + rotation: 0 + state: enabled +- name: blocks_skiphead_0 + id: blocks_skiphead + parameters: + affinity: '' + alias: '' + comment: '' + maxoutbuf: '0' + minoutbuf: '0' + num_items: '200000' + type: complex + vlen: '1' + states: + bus_sink: false + bus_source: false + bus_structure: null + coordinate: [616, 212] + rotation: 0 + state: enabled +- name: low_pass_filter_0 + id: low_pass_filter + parameters: + affinity: '' + alias: '' + beta: '6.76' + comment: '' + cutoff_freq: lpf_cutoff + decim: '1' + gain: '1' + interp: '1' + maxoutbuf: '0' + minoutbuf: '0' + samp_rate: sample_rate + type: fir_filter_ccf + width: lpf_transition_width + win: firdes.WIN_HAMMING + states: + bus_sink: false + bus_source: false + bus_structure: null + coordinate: [720, 300] + rotation: 0 + state: disabled +- name: qtgui_time_sink_x_0 + id: qtgui_time_sink_x + parameters: + affinity: '' + alias: '' + alpha1: '1.0' + alpha10: '1.0' + alpha2: '1.0' + alpha3: '1.0' + alpha4: '1.0' + alpha5: '1.0' + alpha6: '1.0' + alpha7: '1.0' + alpha8: '1.0' + alpha9: '1.0' + autoscale: 'True' + axislabels: 'True' + color1: blue + color10: dark blue + color2: red + color3: green + color4: black + color5: cyan + color6: magenta + color7: yellow + color8: dark red + color9: dark green + comment: '' + ctrlpanel: 'False' + entags: 'True' + grid: 'False' + gui_hint: '' + label1: '' + label10: '' + label2: '' + label3: '' + label4: '' + label5: '' + label6: '' + label7: '' + label8: '' + label9: '' + legend: 'True' + marker1: '-1' + marker10: '-1' + marker2: '-1' + marker3: '-1' + marker4: '-1' + marker5: '-1' + marker6: '-1' + marker7: '-1' + marker8: '-1' + marker9: '-1' + name: '""' + nconnections: '1' + size: '1024' + srate: sample_rate + stemplot: 'False' + style1: '1' + style10: '1' + style2: '1' + style3: '1' + style4: '1' + style5: '1' + style6: '1' + style7: '1' + style8: '1' + style9: '1' + tr_chan: '0' + tr_delay: '0' + tr_level: '0.0' + tr_mode: qtgui.TRIG_MODE_FREE + tr_slope: qtgui.TRIG_SLOPE_POS + tr_tag: '""' + type: complex + update_time: '0.10' + width1: '1' + width10: '1' + width2: '1' + width3: '1' + width4: '1' + width5: '1' + width6: '1' + width7: '1' + width8: '1' + width9: '1' + ylabel: Amplitude + ymax: '1' + ymin: '-1' + yunit: '""' + states: + bus_sink: false + bus_source: false + bus_structure: null + coordinate: [712, 459] + rotation: 0 + state: disabled +- name: qtgui_time_sink_x_0_0 + id: qtgui_time_sink_x + parameters: + affinity: '' + alias: '' + alpha1: '1.0' + alpha10: '1.0' + alpha2: '1.0' + alpha3: '1.0' + alpha4: '1.0' + alpha5: '1.0' + alpha6: '1.0' + alpha7: '1.0' + alpha8: '1.0' + alpha9: '1.0' + autoscale: 'True' + axislabels: 'True' + color1: blue + color10: dark blue + color2: red + color3: green + color4: black + color5: cyan + color6: magenta + color7: yellow + color8: dark red + color9: dark green + comment: '' + ctrlpanel: 'False' + entags: 'True' + grid: 'False' + gui_hint: '' + label1: '' + label10: '' + label2: '' + label3: '' + label4: '' + label5: '' + label6: '' + label7: '' + label8: '' + label9: '' + legend: 'True' + marker1: '-1' + marker10: '-1' + marker2: '-1' + marker3: '-1' + marker4: '-1' + marker5: '-1' + marker6: '-1' + marker7: '-1' + marker8: '-1' + marker9: '-1' + name: '""' + nconnections: '1' + size: '1024' + srate: sample_rate + stemplot: 'False' + style1: '1' + style10: '1' + style2: '1' + style3: '1' + style4: '1' + style5: '1' + style6: '1' + style7: '1' + style8: '1' + style9: '1' + tr_chan: '0' + tr_delay: '0' + tr_level: '0.0' + tr_mode: qtgui.TRIG_MODE_FREE + tr_slope: qtgui.TRIG_SLOPE_POS + tr_tag: '""' + type: complex + update_time: '0.10' + width1: '1' + width10: '1' + width2: '1' + width3: '1' + width4: '1' + width5: '1' + width6: '1' + width7: '1' + width8: '1' + width9: '1' + ylabel: Amplitude + ymax: '1' + ymin: '-1' + yunit: '""' + states: + bus_sink: false + bus_source: false + bus_structure: null + coordinate: [1000, 387] + rotation: 0 + state: disabled +- name: uhd_usrp_source_0_0 + id: uhd_usrp_source + parameters: + affinity: '' + alias: '' + ant0: rx_antenna + ant1: '' + ant10: '' + ant11: '' + ant12: '' + ant13: '' + ant14: '' + ant15: '' + ant16: '' + ant17: '' + ant18: '' + ant19: '' + ant2: '' + ant20: '' + ant21: '' + ant22: '' + ant23: '' + ant24: '' + ant25: '' + ant26: '' + ant27: '' + ant28: '' + ant29: '' + ant3: '' + ant30: '' + ant31: '' + ant4: '' + ant5: '' + ant6: '' + ant7: '' + ant8: '' + ant9: '' + bw0: '0' + bw1: '0' + bw10: '0' + bw11: '0' + bw12: '0' + bw13: '0' + bw14: '0' + bw15: '0' + bw16: '0' + bw17: '0' + bw18: '0' + bw19: '0' + bw2: '0' + bw20: '0' + bw21: '0' + bw22: '0' + bw23: '0' + bw24: '0' + bw25: '0' + bw26: '0' + bw27: '0' + bw28: '0' + bw29: '0' + bw3: '0' + bw30: '0' + bw31: '0' + bw4: '0' + bw5: '0' + bw6: '0' + bw7: '0' + bw8: '0' + bw9: '0' + center_freq0: float(rx_frequency)*1e6 + center_freq1: '0' + center_freq10: '0' + center_freq11: '0' + center_freq12: '0' + center_freq13: '0' + center_freq14: '0' + center_freq15: '0' + center_freq16: '0' + center_freq17: '0' + center_freq18: '0' + center_freq19: '0' + center_freq2: '0' + center_freq20: '0' + center_freq21: '0' + center_freq22: '0' + center_freq23: '0' + center_freq24: '0' + center_freq25: '0' + center_freq26: '0' + center_freq27: '0' + center_freq28: '0' + center_freq29: '0' + center_freq3: '0' + center_freq30: '0' + center_freq31: '0' + center_freq4: '0' + center_freq5: '0' + center_freq6: '0' + center_freq7: '0' + center_freq8: '0' + center_freq9: '0' + clock_rate: '0.0' + clock_source0: '' + clock_source1: '' + clock_source2: '' + clock_source3: '' + clock_source4: '' + clock_source5: '' + clock_source6: '' + clock_source7: '' + comment: '' + dc_offs_enb0: '""' + dc_offs_enb1: '""' + dc_offs_enb10: '""' + dc_offs_enb11: '""' + dc_offs_enb12: '""' + dc_offs_enb13: '""' + dc_offs_enb14: '""' + dc_offs_enb15: '""' + dc_offs_enb16: '""' + dc_offs_enb17: '""' + dc_offs_enb18: '""' + dc_offs_enb19: '""' + dc_offs_enb2: '""' + dc_offs_enb20: '""' + dc_offs_enb21: '""' + dc_offs_enb22: '""' + dc_offs_enb23: '""' + dc_offs_enb24: '""' + dc_offs_enb25: '""' + dc_offs_enb26: '""' + dc_offs_enb27: '""' + dc_offs_enb28: '""' + dc_offs_enb29: '""' + dc_offs_enb3: '""' + dc_offs_enb30: '""' + dc_offs_enb31: '""' + dc_offs_enb4: '""' + dc_offs_enb5: '""' + dc_offs_enb6: '""' + dc_offs_enb7: '""' + dc_offs_enb8: '""' + dc_offs_enb9: '""' + dev_addr: '"addr="+ip_address' + dev_args: '""' + gain0: float(rx_gain) + gain1: '0' + gain10: '0' + gain11: '0' + gain12: '0' + gain13: '0' + gain14: '0' + gain15: '0' + gain16: '0' + gain17: '0' + gain18: '0' + gain19: '0' + gain2: '0' + gain20: '0' + gain21: '0' + gain22: '0' + gain23: '0' + gain24: '0' + gain25: '0' + gain26: '0' + gain27: '0' + gain28: '0' + gain29: '0' + gain3: '0' + gain30: '0' + gain31: '0' + gain4: '0' + gain5: '0' + gain6: '0' + gain7: '0' + gain8: '0' + gain9: '0' + iq_imbal_enb0: '""' + iq_imbal_enb1: '""' + iq_imbal_enb10: '""' + iq_imbal_enb11: '""' + iq_imbal_enb12: '""' + iq_imbal_enb13: '""' + iq_imbal_enb14: '""' + iq_imbal_enb15: '""' + iq_imbal_enb16: '""' + iq_imbal_enb17: '""' + iq_imbal_enb18: '""' + iq_imbal_enb19: '""' + iq_imbal_enb2: '""' + iq_imbal_enb20: '""' + iq_imbal_enb21: '""' + iq_imbal_enb22: '""' + iq_imbal_enb23: '""' + iq_imbal_enb24: '""' + iq_imbal_enb25: '""' + iq_imbal_enb26: '""' + iq_imbal_enb27: '""' + iq_imbal_enb28: '""' + iq_imbal_enb29: '""' + iq_imbal_enb3: '""' + iq_imbal_enb30: '""' + iq_imbal_enb31: '""' + iq_imbal_enb4: '""' + iq_imbal_enb5: '""' + iq_imbal_enb6: '""' + iq_imbal_enb7: '""' + iq_imbal_enb8: '""' + iq_imbal_enb9: '""' + lo_export0: 'False' + lo_export1: 'False' + lo_export10: 'False' + lo_export11: 'False' + lo_export12: 'False' + lo_export13: 'False' + lo_export14: 'False' + lo_export15: 'False' + lo_export16: 'False' + lo_export17: 'False' + lo_export18: 'False' + lo_export19: 'False' + lo_export2: 'False' + lo_export20: 'False' + lo_export21: 'False' + lo_export22: 'False' + lo_export23: 'False' + lo_export24: 'False' + lo_export25: 'False' + lo_export26: 'False' + lo_export27: 'False' + lo_export28: 'False' + lo_export29: 'False' + lo_export3: 'False' + lo_export30: 'False' + lo_export31: 'False' + lo_export4: 'False' + lo_export5: 'False' + lo_export6: 'False' + lo_export7: 'False' + lo_export8: 'False' + lo_export9: 'False' + lo_source0: internal + lo_source1: internal + lo_source10: internal + lo_source11: internal + lo_source12: internal + lo_source13: internal + lo_source14: internal + lo_source15: internal + lo_source16: internal + lo_source17: internal + lo_source18: internal + lo_source19: internal + lo_source2: internal + lo_source20: internal + lo_source21: internal + lo_source22: internal + lo_source23: internal + lo_source24: internal + lo_source25: internal + lo_source26: internal + lo_source27: internal + lo_source28: internal + lo_source29: internal + lo_source3: internal + lo_source30: internal + lo_source31: internal + lo_source4: internal + lo_source5: internal + lo_source6: internal + lo_source7: internal + lo_source8: internal + lo_source9: internal + maxoutbuf: '0' + minoutbuf: '0' + nchan: '1' + norm_gain0: 'False' + norm_gain1: 'False' + norm_gain10: 'False' + norm_gain11: 'False' + norm_gain12: 'False' + norm_gain13: 'False' + norm_gain14: 'False' + norm_gain15: 'False' + norm_gain16: 'False' + norm_gain17: 'False' + norm_gain18: 'False' + norm_gain19: 'False' + norm_gain2: 'False' + norm_gain20: 'False' + norm_gain21: 'False' + norm_gain22: 'False' + norm_gain23: 'False' + norm_gain24: 'False' + norm_gain25: 'False' + norm_gain26: 'False' + norm_gain27: 'False' + norm_gain28: 'False' + norm_gain29: 'False' + norm_gain3: 'False' + norm_gain30: 'False' + norm_gain31: 'False' + norm_gain4: 'False' + norm_gain5: 'False' + norm_gain6: 'False' + norm_gain7: 'False' + norm_gain8: 'False' + norm_gain9: 'False' + num_mboards: '1' + otw: '' + rx_agc0: Default + rx_agc1: Default + rx_agc10: Default + rx_agc11: Default + rx_agc12: Default + rx_agc13: Default + rx_agc14: Default + rx_agc15: Default + rx_agc16: Default + rx_agc17: Default + rx_agc18: Default + rx_agc19: Default + rx_agc2: Default + rx_agc20: Default + rx_agc21: Default + rx_agc22: Default + rx_agc23: Default + rx_agc24: Default + rx_agc25: Default + rx_agc26: Default + rx_agc27: Default + rx_agc28: Default + rx_agc29: Default + rx_agc3: Default + rx_agc30: Default + rx_agc31: Default + rx_agc4: Default + rx_agc5: Default + rx_agc6: Default + rx_agc7: Default + rx_agc8: Default + rx_agc9: Default + samp_rate: float(sample_rate)*1e6 + sd_spec0: rx_channel + sd_spec1: '' + sd_spec2: '' + sd_spec3: '' + sd_spec4: '' + sd_spec5: '' + sd_spec6: '' + sd_spec7: '' + show_lo_controls: 'False' + stream_args: '' + stream_chans: '[]' + sync: sync + time_source0: '' + time_source1: '' + time_source2: '' + time_source3: '' + time_source4: '' + time_source5: '' + time_source6: '' + time_source7: '' + type: fc32 + states: + bus_sink: false + bus_source: false + bus_structure: null + coordinate: [296, 171] + rotation: 0 + state: enabled + +connections: +- [analog_pwr_squelch_xx_0, '0', low_pass_filter_0, '0'] +- [analog_pwr_squelch_xx_0, '0', qtgui_time_sink_x_0, '0'] +- [blocks_head_0, '0', blocks_file_sink_0, '0'] +- [blocks_skiphead_0, '0', blocks_head_0, '0'] +- [low_pass_filter_0, '0', blocks_head_0, '0'] +- [low_pass_filter_0, '0', qtgui_time_sink_x_0_0, '0'] +- [uhd_usrp_source_0_0, '0', analog_pwr_squelch_xx_0, '0'] +- [uhd_usrp_source_0_0, '0', blocks_skiphead_0, '0'] + +metadata: + file_format: 1 diff --git a/Flow Graph Library/IQ Flow Graphs/iq_recorder_usrp2.py b/Flow Graph Library/IQ Flow Graphs/iq_recorder_usrp2.py new file mode 100755 index 00000000..a932cd95 --- /dev/null +++ b/Flow Graph Library/IQ Flow Graphs/iq_recorder_usrp2.py @@ -0,0 +1,150 @@ +#!/usr/bin/env python3 +# -*- coding: utf-8 -*- + +# +# SPDX-License-Identifier: GPL-3.0 +# +# GNU Radio Python Flow Graph +# Title: Iq Recorder Usrp2 +# GNU Radio version: 3.10.1.1 + +from gnuradio import blocks +from gnuradio import gr +from gnuradio.filter import firdes +from gnuradio.fft import window +import sys +import signal +from argparse import ArgumentParser +from gnuradio.eng_arg import eng_float, intx +from gnuradio import eng_notation +from gnuradio import uhd +import time + + + + +class iq_recorder_usrp2(gr.top_block): + + def __init__(self): + gr.top_block.__init__(self, "Iq Recorder Usrp2", catch_exceptions=True) + + ################################################## + # Variables + ################################################## + self.sample_rate = sample_rate = 1 + self.rx_gain = rx_gain = 20 + self.rx_frequency = rx_frequency = 2412 + self.rx_channel = rx_channel = "A:0" + self.rx_antenna = rx_antenna = "TX/RX" + self.ip_address = ip_address = "192.168.10.2" + self.filepath = filepath = "" + self.file_length = file_length = 100000 + + ################################################## + # Blocks + ################################################## + self.uhd_usrp_source_0_0 = uhd.usrp_source( + ",".join(("addr="+ip_address, "")), + uhd.stream_args( + cpu_format="fc32", + args='', + channels=list(range(0,1)), + ), + ) + self.uhd_usrp_source_0_0.set_subdev_spec(rx_channel, 0) + self.uhd_usrp_source_0_0.set_samp_rate(float(sample_rate)*1e6) + self.uhd_usrp_source_0_0.set_time_unknown_pps(uhd.time_spec(0)) + + self.uhd_usrp_source_0_0.set_center_freq(float(rx_frequency)*1e6, 0) + self.uhd_usrp_source_0_0.set_antenna(rx_antenna, 0) + self.uhd_usrp_source_0_0.set_gain(float(rx_gain), 0) + self.blocks_skiphead_0 = blocks.skiphead(gr.sizeof_gr_complex*1, 200000) + self.blocks_head_0 = blocks.head(gr.sizeof_gr_complex*1, file_length) + self.blocks_file_sink_0 = blocks.file_sink(gr.sizeof_gr_complex*1, filepath, False) + self.blocks_file_sink_0.set_unbuffered(False) + + + ################################################## + # Connections + ################################################## + self.connect((self.blocks_head_0, 0), (self.blocks_file_sink_0, 0)) + self.connect((self.blocks_skiphead_0, 0), (self.blocks_head_0, 0)) + self.connect((self.uhd_usrp_source_0_0, 0), (self.blocks_skiphead_0, 0)) + + + def get_sample_rate(self): + return self.sample_rate + + def set_sample_rate(self, sample_rate): + self.sample_rate = sample_rate + self.uhd_usrp_source_0_0.set_samp_rate(float(self.sample_rate)*1e6) + + def get_rx_gain(self): + return self.rx_gain + + def set_rx_gain(self, rx_gain): + self.rx_gain = rx_gain + self.uhd_usrp_source_0_0.set_gain(float(self.rx_gain), 0) + + def get_rx_frequency(self): + return self.rx_frequency + + def set_rx_frequency(self, rx_frequency): + self.rx_frequency = rx_frequency + self.uhd_usrp_source_0_0.set_center_freq(float(self.rx_frequency)*1e6, 0) + + def get_rx_channel(self): + return self.rx_channel + + def set_rx_channel(self, rx_channel): + self.rx_channel = rx_channel + + def get_rx_antenna(self): + return self.rx_antenna + + def set_rx_antenna(self, rx_antenna): + self.rx_antenna = rx_antenna + self.uhd_usrp_source_0_0.set_antenna(self.rx_antenna, 0) + + def get_ip_address(self): + return self.ip_address + + def set_ip_address(self, ip_address): + self.ip_address = ip_address + + def get_filepath(self): + return self.filepath + + def set_filepath(self, filepath): + self.filepath = filepath + self.blocks_file_sink_0.open(self.filepath) + + def get_file_length(self): + return self.file_length + + def set_file_length(self, file_length): + self.file_length = file_length + self.blocks_head_0.set_length(self.file_length) + + + + +def main(top_block_cls=iq_recorder_usrp2, options=None): + tb = top_block_cls() + + def sig_handler(sig=None, frame=None): + tb.stop() + tb.wait() + + sys.exit(0) + + signal.signal(signal.SIGINT, sig_handler) + signal.signal(signal.SIGTERM, sig_handler) + + tb.start() + + tb.wait() + + +if __name__ == '__main__': + main() diff --git a/Flow Graph Library/IQ Flow Graphs/iq_recorder_usrp_n2xx.grc b/Flow Graph Library/IQ Flow Graphs/iq_recorder_usrp_n2xx.grc new file mode 100644 index 00000000..906226e8 --- /dev/null +++ b/Flow Graph Library/IQ Flow Graphs/iq_recorder_usrp_n2xx.grc @@ -0,0 +1,842 @@ +options: + parameters: + author: '' + category: Custom + cmake_opt: '' + comment: '' + copyright: '' + description: '' + gen_cmake: 'On' + gen_linking: dynamic + generate_options: no_gui + hier_block_src_path: '.:' + id: iq_recorder_usrp_n2xx + max_nouts: '0' + output_language: python + placement: (0,0) + qt_qss_theme: '' + realtime_scheduling: '' + run: 'True' + run_command: '{python} -u {filename}' + run_options: run + sizing_mode: fixed + thread_safe_setters: '' + title: '' + window_size: 1280, 1024 + states: + bus_sink: false + bus_source: false + bus_structure: null + coordinate: [10, 10] + rotation: 0 + state: enabled + +blocks: +- name: file_length + id: variable + parameters: + comment: '' + value: '100000' + states: + bus_sink: false + bus_source: false + bus_structure: null + coordinate: [128, 467] + rotation: 0 + state: enabled +- name: filepath + id: variable + parameters: + comment: '' + value: '""' + states: + bus_sink: false + bus_source: false + bus_structure: null + coordinate: [8, 315] + rotation: 0 + state: enabled +- name: ip_address + id: variable + parameters: + comment: '' + value: '"192.168.10.2"' + states: + bus_sink: false + bus_source: false + bus_structure: null + coordinate: [8, 251] + rotation: 0 + state: enabled +- name: lpf_cutoff + id: variable + parameters: + comment: '' + value: '200000' + states: + bus_sink: false + bus_source: false + bus_structure: null + coordinate: [8, 723] + rotation: 0 + state: disabled +- name: lpf_transition_width + id: variable + parameters: + comment: '' + value: '50000' + states: + bus_sink: false + bus_source: false + bus_structure: null + coordinate: [8, 787] + rotation: 0 + state: disabled +- name: rx_antenna + id: variable + parameters: + comment: '' + value: '"TX/RX"' + states: + bus_sink: false + bus_source: false + bus_structure: null + coordinate: [8, 651] + rotation: 0 + state: enabled +- name: rx_channel + id: variable + parameters: + comment: '' + value: '"A:0"' + states: + bus_sink: false + bus_source: false + bus_structure: null + coordinate: [8, 379] + rotation: 0 + state: enabled +- name: rx_frequency + id: variable + parameters: + comment: '' + value: '2412' + states: + bus_sink: false + bus_source: false + bus_structure: null + coordinate: [8, 459] + rotation: 0 + state: enabled +- name: rx_gain + id: variable + parameters: + comment: '' + value: '20' + states: + bus_sink: false + bus_source: false + bus_structure: null + coordinate: [8, 587] + rotation: 0 + state: enabled +- name: sample_rate + id: variable + parameters: + comment: '' + value: '1' + states: + bus_sink: false + bus_source: false + bus_structure: null + coordinate: [8, 523] + rotation: 0 + state: enabled +- name: squelch_threshold + id: variable + parameters: + comment: '' + value: '-50' + states: + bus_sink: false + bus_source: false + bus_structure: null + coordinate: [128, 531] + rotation: 0 + state: disabled +- name: analog_pwr_squelch_xx_0 + id: analog_pwr_squelch_xx + parameters: + affinity: '' + alias: '' + alpha: '0.5' + comment: '' + gate: 'True' + maxoutbuf: '0' + minoutbuf: '0' + ramp: '100' + threshold: squelch_threshold + type: complex + states: + bus_sink: false + bus_source: false + bus_structure: null + coordinate: [536, 324] + rotation: 0 + state: disabled +- name: blocks_file_sink_0 + id: blocks_file_sink + parameters: + affinity: '' + alias: '' + append: 'False' + comment: '' + file: filepath + type: complex + unbuffered: 'False' + vlen: '1' + states: + bus_sink: false + bus_source: false + bus_structure: null + coordinate: [1096, 195] + rotation: 0 + state: enabled +- name: blocks_head_0 + id: blocks_head + parameters: + affinity: '' + alias: '' + comment: '' + maxoutbuf: '0' + minoutbuf: '0' + num_items: file_length + type: complex + vlen: '1' + states: + bus_sink: false + bus_source: false + bus_structure: null + coordinate: [904, 212] + rotation: 0 + state: enabled +- name: blocks_skiphead_0 + id: blocks_skiphead + parameters: + affinity: '' + alias: '' + comment: '' + maxoutbuf: '0' + minoutbuf: '0' + num_items: '200000' + type: complex + vlen: '1' + states: + bus_sink: false + bus_source: false + bus_structure: null + coordinate: [616, 212] + rotation: 0 + state: enabled +- name: low_pass_filter_0 + id: low_pass_filter + parameters: + affinity: '' + alias: '' + beta: '6.76' + comment: '' + cutoff_freq: lpf_cutoff + decim: '1' + gain: '1' + interp: '1' + maxoutbuf: '0' + minoutbuf: '0' + samp_rate: sample_rate + type: fir_filter_ccf + width: lpf_transition_width + win: firdes.WIN_HAMMING + states: + bus_sink: false + bus_source: false + bus_structure: null + coordinate: [720, 300] + rotation: 0 + state: disabled +- name: qtgui_time_sink_x_0 + id: qtgui_time_sink_x + parameters: + affinity: '' + alias: '' + alpha1: '1.0' + alpha10: '1.0' + alpha2: '1.0' + alpha3: '1.0' + alpha4: '1.0' + alpha5: '1.0' + alpha6: '1.0' + alpha7: '1.0' + alpha8: '1.0' + alpha9: '1.0' + autoscale: 'True' + axislabels: 'True' + color1: blue + color10: dark blue + color2: red + color3: green + color4: black + color5: cyan + color6: magenta + color7: yellow + color8: dark red + color9: dark green + comment: '' + ctrlpanel: 'False' + entags: 'True' + grid: 'False' + gui_hint: '' + label1: '' + label10: '' + label2: '' + label3: '' + label4: '' + label5: '' + label6: '' + label7: '' + label8: '' + label9: '' + legend: 'True' + marker1: '-1' + marker10: '-1' + marker2: '-1' + marker3: '-1' + marker4: '-1' + marker5: '-1' + marker6: '-1' + marker7: '-1' + marker8: '-1' + marker9: '-1' + name: '""' + nconnections: '1' + size: '1024' + srate: sample_rate + stemplot: 'False' + style1: '1' + style10: '1' + style2: '1' + style3: '1' + style4: '1' + style5: '1' + style6: '1' + style7: '1' + style8: '1' + style9: '1' + tr_chan: '0' + tr_delay: '0' + tr_level: '0.0' + tr_mode: qtgui.TRIG_MODE_FREE + tr_slope: qtgui.TRIG_SLOPE_POS + tr_tag: '""' + type: complex + update_time: '0.10' + width1: '1' + width10: '1' + width2: '1' + width3: '1' + width4: '1' + width5: '1' + width6: '1' + width7: '1' + width8: '1' + width9: '1' + ylabel: Amplitude + ymax: '1' + ymin: '-1' + yunit: '""' + states: + bus_sink: false + bus_source: false + bus_structure: null + coordinate: [712, 459] + rotation: 0 + state: disabled +- name: qtgui_time_sink_x_0_0 + id: qtgui_time_sink_x + parameters: + affinity: '' + alias: '' + alpha1: '1.0' + alpha10: '1.0' + alpha2: '1.0' + alpha3: '1.0' + alpha4: '1.0' + alpha5: '1.0' + alpha6: '1.0' + alpha7: '1.0' + alpha8: '1.0' + alpha9: '1.0' + autoscale: 'True' + axislabels: 'True' + color1: blue + color10: dark blue + color2: red + color3: green + color4: black + color5: cyan + color6: magenta + color7: yellow + color8: dark red + color9: dark green + comment: '' + ctrlpanel: 'False' + entags: 'True' + grid: 'False' + gui_hint: '' + label1: '' + label10: '' + label2: '' + label3: '' + label4: '' + label5: '' + label6: '' + label7: '' + label8: '' + label9: '' + legend: 'True' + marker1: '-1' + marker10: '-1' + marker2: '-1' + marker3: '-1' + marker4: '-1' + marker5: '-1' + marker6: '-1' + marker7: '-1' + marker8: '-1' + marker9: '-1' + name: '""' + nconnections: '1' + size: '1024' + srate: sample_rate + stemplot: 'False' + style1: '1' + style10: '1' + style2: '1' + style3: '1' + style4: '1' + style5: '1' + style6: '1' + style7: '1' + style8: '1' + style9: '1' + tr_chan: '0' + tr_delay: '0' + tr_level: '0.0' + tr_mode: qtgui.TRIG_MODE_FREE + tr_slope: qtgui.TRIG_SLOPE_POS + tr_tag: '""' + type: complex + update_time: '0.10' + width1: '1' + width10: '1' + width2: '1' + width3: '1' + width4: '1' + width5: '1' + width6: '1' + width7: '1' + width8: '1' + width9: '1' + ylabel: Amplitude + ymax: '1' + ymin: '-1' + yunit: '""' + states: + bus_sink: false + bus_source: false + bus_structure: null + coordinate: [1000, 387] + rotation: 0 + state: disabled +- name: uhd_usrp_source_0_0 + id: uhd_usrp_source + parameters: + affinity: '' + alias: '' + ant0: rx_antenna + ant1: '' + ant10: '' + ant11: '' + ant12: '' + ant13: '' + ant14: '' + ant15: '' + ant16: '' + ant17: '' + ant18: '' + ant19: '' + ant2: '' + ant20: '' + ant21: '' + ant22: '' + ant23: '' + ant24: '' + ant25: '' + ant26: '' + ant27: '' + ant28: '' + ant29: '' + ant3: '' + ant30: '' + ant31: '' + ant4: '' + ant5: '' + ant6: '' + ant7: '' + ant8: '' + ant9: '' + bw0: '0' + bw1: '0' + bw10: '0' + bw11: '0' + bw12: '0' + bw13: '0' + bw14: '0' + bw15: '0' + bw16: '0' + bw17: '0' + bw18: '0' + bw19: '0' + bw2: '0' + bw20: '0' + bw21: '0' + bw22: '0' + bw23: '0' + bw24: '0' + bw25: '0' + bw26: '0' + bw27: '0' + bw28: '0' + bw29: '0' + bw3: '0' + bw30: '0' + bw31: '0' + bw4: '0' + bw5: '0' + bw6: '0' + bw7: '0' + bw8: '0' + bw9: '0' + center_freq0: float(rx_frequency)*1e6 + center_freq1: '0' + center_freq10: '0' + center_freq11: '0' + center_freq12: '0' + center_freq13: '0' + center_freq14: '0' + center_freq15: '0' + center_freq16: '0' + center_freq17: '0' + center_freq18: '0' + center_freq19: '0' + center_freq2: '0' + center_freq20: '0' + center_freq21: '0' + center_freq22: '0' + center_freq23: '0' + center_freq24: '0' + center_freq25: '0' + center_freq26: '0' + center_freq27: '0' + center_freq28: '0' + center_freq29: '0' + center_freq3: '0' + center_freq30: '0' + center_freq31: '0' + center_freq4: '0' + center_freq5: '0' + center_freq6: '0' + center_freq7: '0' + center_freq8: '0' + center_freq9: '0' + clock_rate: '0.0' + clock_source0: '' + clock_source1: '' + clock_source2: '' + clock_source3: '' + clock_source4: '' + clock_source5: '' + clock_source6: '' + clock_source7: '' + comment: '' + dc_offs_enb0: '""' + dc_offs_enb1: '""' + dc_offs_enb10: '""' + dc_offs_enb11: '""' + dc_offs_enb12: '""' + dc_offs_enb13: '""' + dc_offs_enb14: '""' + dc_offs_enb15: '""' + dc_offs_enb16: '""' + dc_offs_enb17: '""' + dc_offs_enb18: '""' + dc_offs_enb19: '""' + dc_offs_enb2: '""' + dc_offs_enb20: '""' + dc_offs_enb21: '""' + dc_offs_enb22: '""' + dc_offs_enb23: '""' + dc_offs_enb24: '""' + dc_offs_enb25: '""' + dc_offs_enb26: '""' + dc_offs_enb27: '""' + dc_offs_enb28: '""' + dc_offs_enb29: '""' + dc_offs_enb3: '""' + dc_offs_enb30: '""' + dc_offs_enb31: '""' + dc_offs_enb4: '""' + dc_offs_enb5: '""' + dc_offs_enb6: '""' + dc_offs_enb7: '""' + dc_offs_enb8: '""' + dc_offs_enb9: '""' + dev_addr: '"addr="+ip_address' + dev_args: '""' + gain0: float(rx_gain) + gain1: '0' + gain10: '0' + gain11: '0' + gain12: '0' + gain13: '0' + gain14: '0' + gain15: '0' + gain16: '0' + gain17: '0' + gain18: '0' + gain19: '0' + gain2: '0' + gain20: '0' + gain21: '0' + gain22: '0' + gain23: '0' + gain24: '0' + gain25: '0' + gain26: '0' + gain27: '0' + gain28: '0' + gain29: '0' + gain3: '0' + gain30: '0' + gain31: '0' + gain4: '0' + gain5: '0' + gain6: '0' + gain7: '0' + gain8: '0' + gain9: '0' + iq_imbal_enb0: '""' + iq_imbal_enb1: '""' + iq_imbal_enb10: '""' + iq_imbal_enb11: '""' + iq_imbal_enb12: '""' + iq_imbal_enb13: '""' + iq_imbal_enb14: '""' + iq_imbal_enb15: '""' + iq_imbal_enb16: '""' + iq_imbal_enb17: '""' + iq_imbal_enb18: '""' + iq_imbal_enb19: '""' + iq_imbal_enb2: '""' + iq_imbal_enb20: '""' + iq_imbal_enb21: '""' + iq_imbal_enb22: '""' + iq_imbal_enb23: '""' + iq_imbal_enb24: '""' + iq_imbal_enb25: '""' + iq_imbal_enb26: '""' + iq_imbal_enb27: '""' + iq_imbal_enb28: '""' + iq_imbal_enb29: '""' + iq_imbal_enb3: '""' + iq_imbal_enb30: '""' + iq_imbal_enb31: '""' + iq_imbal_enb4: '""' + iq_imbal_enb5: '""' + iq_imbal_enb6: '""' + iq_imbal_enb7: '""' + iq_imbal_enb8: '""' + iq_imbal_enb9: '""' + lo_export0: 'False' + lo_export1: 'False' + lo_export10: 'False' + lo_export11: 'False' + lo_export12: 'False' + lo_export13: 'False' + lo_export14: 'False' + lo_export15: 'False' + lo_export16: 'False' + lo_export17: 'False' + lo_export18: 'False' + lo_export19: 'False' + lo_export2: 'False' + lo_export20: 'False' + lo_export21: 'False' + lo_export22: 'False' + lo_export23: 'False' + lo_export24: 'False' + lo_export25: 'False' + lo_export26: 'False' + lo_export27: 'False' + lo_export28: 'False' + lo_export29: 'False' + lo_export3: 'False' + lo_export30: 'False' + lo_export31: 'False' + lo_export4: 'False' + lo_export5: 'False' + lo_export6: 'False' + lo_export7: 'False' + lo_export8: 'False' + lo_export9: 'False' + lo_source0: internal + lo_source1: internal + lo_source10: internal + lo_source11: internal + lo_source12: internal + lo_source13: internal + lo_source14: internal + lo_source15: internal + lo_source16: internal + lo_source17: internal + lo_source18: internal + lo_source19: internal + lo_source2: internal + lo_source20: internal + lo_source21: internal + lo_source22: internal + lo_source23: internal + lo_source24: internal + lo_source25: internal + lo_source26: internal + lo_source27: internal + lo_source28: internal + lo_source29: internal + lo_source3: internal + lo_source30: internal + lo_source31: internal + lo_source4: internal + lo_source5: internal + lo_source6: internal + lo_source7: internal + lo_source8: internal + lo_source9: internal + maxoutbuf: '0' + minoutbuf: '0' + nchan: '1' + norm_gain0: 'False' + norm_gain1: 'False' + norm_gain10: 'False' + norm_gain11: 'False' + norm_gain12: 'False' + norm_gain13: 'False' + norm_gain14: 'False' + norm_gain15: 'False' + norm_gain16: 'False' + norm_gain17: 'False' + norm_gain18: 'False' + norm_gain19: 'False' + norm_gain2: 'False' + norm_gain20: 'False' + norm_gain21: 'False' + norm_gain22: 'False' + norm_gain23: 'False' + norm_gain24: 'False' + norm_gain25: 'False' + norm_gain26: 'False' + norm_gain27: 'False' + norm_gain28: 'False' + norm_gain29: 'False' + norm_gain3: 'False' + norm_gain30: 'False' + norm_gain31: 'False' + norm_gain4: 'False' + norm_gain5: 'False' + norm_gain6: 'False' + norm_gain7: 'False' + norm_gain8: 'False' + norm_gain9: 'False' + num_mboards: '1' + otw: '' + rx_agc0: Default + rx_agc1: Default + rx_agc10: Default + rx_agc11: Default + rx_agc12: Default + rx_agc13: Default + rx_agc14: Default + rx_agc15: Default + rx_agc16: Default + rx_agc17: Default + rx_agc18: Default + rx_agc19: Default + rx_agc2: Default + rx_agc20: Default + rx_agc21: Default + rx_agc22: Default + rx_agc23: Default + rx_agc24: Default + rx_agc25: Default + rx_agc26: Default + rx_agc27: Default + rx_agc28: Default + rx_agc29: Default + rx_agc3: Default + rx_agc30: Default + rx_agc31: Default + rx_agc4: Default + rx_agc5: Default + rx_agc6: Default + rx_agc7: Default + rx_agc8: Default + rx_agc9: Default + samp_rate: float(sample_rate)*1e6 + sd_spec0: rx_channel + sd_spec1: '' + sd_spec2: '' + sd_spec3: '' + sd_spec4: '' + sd_spec5: '' + sd_spec6: '' + sd_spec7: '' + show_lo_controls: 'False' + stream_args: '' + stream_chans: '[]' + sync: sync + time_source0: '' + time_source1: '' + time_source2: '' + time_source3: '' + time_source4: '' + time_source5: '' + time_source6: '' + time_source7: '' + type: fc32 + states: + bus_sink: false + bus_source: false + bus_structure: null + coordinate: [296, 171] + rotation: 0 + state: enabled + +connections: +- [analog_pwr_squelch_xx_0, '0', low_pass_filter_0, '0'] +- [analog_pwr_squelch_xx_0, '0', qtgui_time_sink_x_0, '0'] +- [blocks_head_0, '0', blocks_file_sink_0, '0'] +- [blocks_skiphead_0, '0', blocks_head_0, '0'] +- [low_pass_filter_0, '0', blocks_head_0, '0'] +- [low_pass_filter_0, '0', qtgui_time_sink_x_0_0, '0'] +- [uhd_usrp_source_0_0, '0', analog_pwr_squelch_xx_0, '0'] +- [uhd_usrp_source_0_0, '0', blocks_skiphead_0, '0'] + +metadata: + file_format: 1 diff --git a/Flow Graph Library/IQ Flow Graphs/iq_recorder_usrp_n2xx.py b/Flow Graph Library/IQ Flow Graphs/iq_recorder_usrp_n2xx.py new file mode 100755 index 00000000..bb0a5e23 --- /dev/null +++ b/Flow Graph Library/IQ Flow Graphs/iq_recorder_usrp_n2xx.py @@ -0,0 +1,150 @@ +#!/usr/bin/env python3 +# -*- coding: utf-8 -*- + +# +# SPDX-License-Identifier: GPL-3.0 +# +# GNU Radio Python Flow Graph +# Title: Iq Recorder Usrp N2Xx +# GNU Radio version: 3.10.1.1 + +from gnuradio import blocks +from gnuradio import gr +from gnuradio.filter import firdes +from gnuradio.fft import window +import sys +import signal +from argparse import ArgumentParser +from gnuradio.eng_arg import eng_float, intx +from gnuradio import eng_notation +from gnuradio import uhd +import time + + + + +class iq_recorder_usrp_n2xx(gr.top_block): + + def __init__(self): + gr.top_block.__init__(self, "Iq Recorder Usrp N2Xx", catch_exceptions=True) + + ################################################## + # Variables + ################################################## + self.sample_rate = sample_rate = 1 + self.rx_gain = rx_gain = 20 + self.rx_frequency = rx_frequency = 2412 + self.rx_channel = rx_channel = "A:0" + self.rx_antenna = rx_antenna = "TX/RX" + self.ip_address = ip_address = "192.168.10.2" + self.filepath = filepath = "" + self.file_length = file_length = 100000 + + ################################################## + # Blocks + ################################################## + self.uhd_usrp_source_0_0 = uhd.usrp_source( + ",".join(("addr="+ip_address, "")), + uhd.stream_args( + cpu_format="fc32", + args='', + channels=list(range(0,1)), + ), + ) + self.uhd_usrp_source_0_0.set_subdev_spec(rx_channel, 0) + self.uhd_usrp_source_0_0.set_samp_rate(float(sample_rate)*1e6) + self.uhd_usrp_source_0_0.set_time_unknown_pps(uhd.time_spec(0)) + + self.uhd_usrp_source_0_0.set_center_freq(float(rx_frequency)*1e6, 0) + self.uhd_usrp_source_0_0.set_antenna(rx_antenna, 0) + self.uhd_usrp_source_0_0.set_gain(float(rx_gain), 0) + self.blocks_skiphead_0 = blocks.skiphead(gr.sizeof_gr_complex*1, 200000) + self.blocks_head_0 = blocks.head(gr.sizeof_gr_complex*1, file_length) + self.blocks_file_sink_0 = blocks.file_sink(gr.sizeof_gr_complex*1, filepath, False) + self.blocks_file_sink_0.set_unbuffered(False) + + + ################################################## + # Connections + ################################################## + self.connect((self.blocks_head_0, 0), (self.blocks_file_sink_0, 0)) + self.connect((self.blocks_skiphead_0, 0), (self.blocks_head_0, 0)) + self.connect((self.uhd_usrp_source_0_0, 0), (self.blocks_skiphead_0, 0)) + + + def get_sample_rate(self): + return self.sample_rate + + def set_sample_rate(self, sample_rate): + self.sample_rate = sample_rate + self.uhd_usrp_source_0_0.set_samp_rate(float(self.sample_rate)*1e6) + + def get_rx_gain(self): + return self.rx_gain + + def set_rx_gain(self, rx_gain): + self.rx_gain = rx_gain + self.uhd_usrp_source_0_0.set_gain(float(self.rx_gain), 0) + + def get_rx_frequency(self): + return self.rx_frequency + + def set_rx_frequency(self, rx_frequency): + self.rx_frequency = rx_frequency + self.uhd_usrp_source_0_0.set_center_freq(float(self.rx_frequency)*1e6, 0) + + def get_rx_channel(self): + return self.rx_channel + + def set_rx_channel(self, rx_channel): + self.rx_channel = rx_channel + + def get_rx_antenna(self): + return self.rx_antenna + + def set_rx_antenna(self, rx_antenna): + self.rx_antenna = rx_antenna + self.uhd_usrp_source_0_0.set_antenna(self.rx_antenna, 0) + + def get_ip_address(self): + return self.ip_address + + def set_ip_address(self, ip_address): + self.ip_address = ip_address + + def get_filepath(self): + return self.filepath + + def set_filepath(self, filepath): + self.filepath = filepath + self.blocks_file_sink_0.open(self.filepath) + + def get_file_length(self): + return self.file_length + + def set_file_length(self, file_length): + self.file_length = file_length + self.blocks_head_0.set_length(self.file_length) + + + + +def main(top_block_cls=iq_recorder_usrp_n2xx, options=None): + tb = top_block_cls() + + def sig_handler(sig=None, frame=None): + tb.stop() + tb.wait() + + sys.exit(0) + + signal.signal(signal.SIGINT, sig_handler) + signal.signal(signal.SIGTERM, sig_handler) + + tb.start() + + tb.wait() + + +if __name__ == '__main__': + main() diff --git a/Flow Graph Library/Inspection Flow Graphs/instantaneous_frequency_usrp2.grc b/Flow Graph Library/Inspection Flow Graphs/instantaneous_frequency_usrp2.grc new file mode 100644 index 00000000..930715c8 --- /dev/null +++ b/Flow Graph Library/Inspection Flow Graphs/instantaneous_frequency_usrp2.grc @@ -0,0 +1,696 @@ +options: + parameters: + author: '' + category: Custom + cmake_opt: '' + comment: '' + copyright: '' + description: '' + gen_cmake: 'On' + gen_linking: dynamic + generate_options: qt_gui + hier_block_src_path: '.:' + id: instantaneous_frequency_usrp2 + max_nouts: '0' + output_language: python + placement: (0,0) + qt_qss_theme: '' + realtime_scheduling: '' + run: 'True' + run_command: '{python} -u {filename}' + run_options: prompt + sizing_mode: fixed + thread_safe_setters: '' + title: '' + window_size: 1280, 1024 + states: + bus_sink: false + bus_source: false + bus_structure: null + coordinate: [10, 10] + rotation: 0 + state: enabled + +blocks: +- name: decimation + id: variable_qtgui_chooser + parameters: + comment: '' + gui_hint: 0,2,1,1 + label: ' Keep 1 in N' + label0: '' + label1: '' + label2: '' + label3: '' + label4: '' + labels: '["1","10","100","1000"]' + num_opts: '0' + option1: '1' + option2: '2' + option3: '3' + option4: '4' + options: '[1,10,100,1000]' + orient: Qt.QVBoxLayout + type: int + value: '1' + widget: combo_box + states: + bus_sink: false + bus_source: false + bus_structure: null + coordinate: [192, 268] + rotation: 0 + state: enabled +- name: ip_address + id: variable + parameters: + comment: '' + value: '"192.168.140.2"' + states: + bus_sink: false + bus_source: false + bus_structure: null + coordinate: [8, 148] + rotation: 0 + state: disabled +- name: rx_frequency + id: variable_qtgui_range + parameters: + comment: '' + gui_hint: 2,0,1,4 + label: ' Freq. (MHz):' + min_len: '200' + orient: Qt.Horizontal + rangeType: float + start: '50' + step: '.1' + stop: '6000' + value: '2412' + widget: counter_slider + states: + bus_sink: false + bus_source: false + bus_structure: null + coordinate: [360, 140] + rotation: 0 + state: enabled +- name: rx_usrp_antenna + id: variable_qtgui_chooser + parameters: + comment: '' + gui_hint: 0,1,1,1 + label: ' Antenna' + label0: '' + label1: '' + label2: '' + label3: '' + label4: '' + labels: '["TX/RX", "RX2"]' + num_opts: '0' + option1: '1' + option2: '2' + option3: '3' + option4: '4' + options: '["TX/RX", "RX2"]' + orient: Qt.QVBoxLayout + type: string + value: '"TX/RX"' + widget: combo_box + states: + bus_sink: false + bus_source: false + bus_structure: null + coordinate: [192, 140] + rotation: 0 + state: enabled +- name: rx_usrp_channel + id: variable + parameters: + comment: '' + value: '"A:0"' + states: + bus_sink: false + bus_source: false + bus_structure: null + coordinate: [8, 220] + rotation: 0 + state: enabled +- name: rx_usrp_gain + id: variable_qtgui_range + parameters: + comment: '' + gui_hint: 1,0,1,4 + label: ' Gain:' + min_len: '200' + orient: Qt.Horizontal + rangeType: float + start: '0' + step: '1' + stop: '34' + value: '30' + widget: counter_slider + states: + bus_sink: false + bus_source: false + bus_structure: null + coordinate: [360, 12] + rotation: 0 + state: enabled +- name: sample_rate + id: variable_qtgui_chooser + parameters: + comment: '' + gui_hint: 0,0,1,1 + label: Sample Rate + label0: '' + label1: '' + label2: '' + label3: '' + label4: '' + labels: '["1 MS/s", "5 MS/s", "10 MS/s", "20 MS/s"]' + num_opts: '0' + option1: '1' + option2: '2' + option3: '3' + option4: '4' + options: '[1e6, 5e6, 10e6, 20e6]' + orient: Qt.QVBoxLayout + type: real + value: 1e6 + widget: combo_box + states: + bus_sink: false + bus_source: false + bus_structure: null + coordinate: [192, 12] + rotation: 0 + state: enabled +- name: blocks_keep_one_in_n_0 + id: blocks_keep_one_in_n + parameters: + affinity: '' + alias: '' + comment: '' + maxoutbuf: '0' + minoutbuf: '0' + n: decimation + type: complex + vlen: '1' + states: + bus_sink: false + bus_source: false + bus_structure: null + coordinate: [496, 496] + rotation: 0 + state: enabled +- name: dect2_phase_diff_0 + id: dect2_phase_diff + parameters: + affinity: '' + alias: '' + comment: '' + maxoutbuf: '0' + minoutbuf: '0' + states: + bus_sink: false + bus_source: false + bus_structure: null + coordinate: [632, 496] + rotation: 0 + state: enabled +- name: qtgui_time_sink_x_0 + id: qtgui_time_sink_x + parameters: + affinity: '' + alias: '' + alpha1: '1.0' + alpha10: '1.0' + alpha2: '1.0' + alpha3: '1.0' + alpha4: '1.0' + alpha5: '1.0' + alpha6: '1.0' + alpha7: '1.0' + alpha8: '1.0' + alpha9: '1.0' + autoscale: 'False' + axislabels: 'True' + color1: blue + color10: dark blue + color2: red + color3: green + color4: black + color5: cyan + color6: magenta + color7: yellow + color8: dark red + color9: dark green + comment: '' + ctrlpanel: 'False' + entags: 'True' + grid: 'True' + gui_hint: 3,0,20,4 + label1: '' + label10: '' + label2: '' + label3: '' + label4: '' + label5: '' + label6: '' + label7: '' + label8: '' + label9: '' + legend: 'True' + marker1: '-1' + marker10: '-1' + marker2: '-1' + marker3: '-1' + marker4: '-1' + marker5: '-1' + marker6: '-1' + marker7: '-1' + marker8: '-1' + marker9: '-1' + name: '""' + nconnections: '1' + size: '100000' + srate: sample_rate/decimation + stemplot: 'False' + style1: '1' + style10: '1' + style2: '1' + style3: '1' + style4: '1' + style5: '1' + style6: '1' + style7: '1' + style8: '1' + style9: '1' + tr_chan: '0' + tr_delay: '0' + tr_level: '0.005' + tr_mode: qtgui.TRIG_MODE_FREE + tr_slope: qtgui.TRIG_SLOPE_POS + tr_tag: '""' + type: float + update_time: '0.1' + width1: '1' + width10: '1' + width2: '1' + width3: '1' + width4: '1' + width5: '1' + width6: '1' + width7: '1' + width8: '1' + width9: '1' + ylabel: Amplitude + ymax: '5' + ymin: '-5' + yunit: '""' + states: + bus_sink: false + bus_source: false + bus_structure: null + coordinate: [776, 476] + rotation: 0 + state: enabled +- name: uhd_usrp_source_0 + id: uhd_usrp_source + parameters: + affinity: '' + alias: '' + ant0: rx_usrp_antenna + ant1: '' + ant10: '' + ant11: '' + ant12: '' + ant13: '' + ant14: '' + ant15: '' + ant16: '' + ant17: '' + ant18: '' + ant19: '' + ant2: '' + ant20: '' + ant21: '' + ant22: '' + ant23: '' + ant24: '' + ant25: '' + ant26: '' + ant27: '' + ant28: '' + ant29: '' + ant3: '' + ant30: '' + ant31: '' + ant4: '' + ant5: '' + ant6: '' + ant7: '' + ant8: '' + ant9: '' + bw0: '0' + bw1: '0' + bw10: '0' + bw11: '0' + bw12: '0' + bw13: '0' + bw14: '0' + bw15: '0' + bw16: '0' + bw17: '0' + bw18: '0' + bw19: '0' + bw2: '0' + bw20: '0' + bw21: '0' + bw22: '0' + bw23: '0' + bw24: '0' + bw25: '0' + bw26: '0' + bw27: '0' + bw28: '0' + bw29: '0' + bw3: '0' + bw30: '0' + bw31: '0' + bw4: '0' + bw5: '0' + bw6: '0' + bw7: '0' + bw8: '0' + bw9: '0' + center_freq0: rx_frequency*1e6 + center_freq1: '0' + center_freq10: '0' + center_freq11: '0' + center_freq12: '0' + center_freq13: '0' + center_freq14: '0' + center_freq15: '0' + center_freq16: '0' + center_freq17: '0' + center_freq18: '0' + center_freq19: '0' + center_freq2: '0' + center_freq20: '0' + center_freq21: '0' + center_freq22: '0' + center_freq23: '0' + center_freq24: '0' + center_freq25: '0' + center_freq26: '0' + center_freq27: '0' + center_freq28: '0' + center_freq29: '0' + center_freq3: '0' + center_freq30: '0' + center_freq31: '0' + center_freq4: '0' + center_freq5: '0' + center_freq6: '0' + center_freq7: '0' + center_freq8: '0' + center_freq9: '0' + clock_rate: '0.0' + clock_source0: '' + clock_source1: '' + clock_source2: '' + clock_source3: '' + clock_source4: '' + clock_source5: '' + clock_source6: '' + clock_source7: '' + comment: '' + dc_offs_enb0: '""' + dc_offs_enb1: '""' + dc_offs_enb10: '""' + dc_offs_enb11: '""' + dc_offs_enb12: '""' + dc_offs_enb13: '""' + dc_offs_enb14: '""' + dc_offs_enb15: '""' + dc_offs_enb16: '""' + dc_offs_enb17: '""' + dc_offs_enb18: '""' + dc_offs_enb19: '""' + dc_offs_enb2: '""' + dc_offs_enb20: '""' + dc_offs_enb21: '""' + dc_offs_enb22: '""' + dc_offs_enb23: '""' + dc_offs_enb24: '""' + dc_offs_enb25: '""' + dc_offs_enb26: '""' + dc_offs_enb27: '""' + dc_offs_enb28: '""' + dc_offs_enb29: '""' + dc_offs_enb3: '""' + dc_offs_enb30: '""' + dc_offs_enb31: '""' + dc_offs_enb4: '""' + dc_offs_enb5: '""' + dc_offs_enb6: '""' + dc_offs_enb7: '""' + dc_offs_enb8: '""' + dc_offs_enb9: '""' + dev_addr: '' + dev_args: '""' + gain0: rx_usrp_gain + gain1: '0' + gain10: '0' + gain11: '0' + gain12: '0' + gain13: '0' + gain14: '0' + gain15: '0' + gain16: '0' + gain17: '0' + gain18: '0' + gain19: '0' + gain2: '0' + gain20: '0' + gain21: '0' + gain22: '0' + gain23: '0' + gain24: '0' + gain25: '0' + gain26: '0' + gain27: '0' + gain28: '0' + gain29: '0' + gain3: '0' + gain30: '0' + gain31: '0' + gain4: '0' + gain5: '0' + gain6: '0' + gain7: '0' + gain8: '0' + gain9: '0' + iq_imbal_enb0: '""' + iq_imbal_enb1: '""' + iq_imbal_enb10: '""' + iq_imbal_enb11: '""' + iq_imbal_enb12: '""' + iq_imbal_enb13: '""' + iq_imbal_enb14: '""' + iq_imbal_enb15: '""' + iq_imbal_enb16: '""' + iq_imbal_enb17: '""' + iq_imbal_enb18: '""' + iq_imbal_enb19: '""' + iq_imbal_enb2: '""' + iq_imbal_enb20: '""' + iq_imbal_enb21: '""' + iq_imbal_enb22: '""' + iq_imbal_enb23: '""' + iq_imbal_enb24: '""' + iq_imbal_enb25: '""' + iq_imbal_enb26: '""' + iq_imbal_enb27: '""' + iq_imbal_enb28: '""' + iq_imbal_enb29: '""' + iq_imbal_enb3: '""' + iq_imbal_enb30: '""' + iq_imbal_enb31: '""' + iq_imbal_enb4: '""' + iq_imbal_enb5: '""' + iq_imbal_enb6: '""' + iq_imbal_enb7: '""' + iq_imbal_enb8: '""' + iq_imbal_enb9: '""' + lo_export0: 'False' + lo_export1: 'False' + lo_export10: 'False' + lo_export11: 'False' + lo_export12: 'False' + lo_export13: 'False' + lo_export14: 'False' + lo_export15: 'False' + lo_export16: 'False' + lo_export17: 'False' + lo_export18: 'False' + lo_export19: 'False' + lo_export2: 'False' + lo_export20: 'False' + lo_export21: 'False' + lo_export22: 'False' + lo_export23: 'False' + lo_export24: 'False' + lo_export25: 'False' + lo_export26: 'False' + lo_export27: 'False' + lo_export28: 'False' + lo_export29: 'False' + lo_export3: 'False' + lo_export30: 'False' + lo_export31: 'False' + lo_export4: 'False' + lo_export5: 'False' + lo_export6: 'False' + lo_export7: 'False' + lo_export8: 'False' + lo_export9: 'False' + lo_source0: internal + lo_source1: internal + lo_source10: internal + lo_source11: internal + lo_source12: internal + lo_source13: internal + lo_source14: internal + lo_source15: internal + lo_source16: internal + lo_source17: internal + lo_source18: internal + lo_source19: internal + lo_source2: internal + lo_source20: internal + lo_source21: internal + lo_source22: internal + lo_source23: internal + lo_source24: internal + lo_source25: internal + lo_source26: internal + lo_source27: internal + lo_source28: internal + lo_source29: internal + lo_source3: internal + lo_source30: internal + lo_source31: internal + lo_source4: internal + lo_source5: internal + lo_source6: internal + lo_source7: internal + lo_source8: internal + lo_source9: internal + maxoutbuf: '0' + minoutbuf: '0' + nchan: '1' + norm_gain0: 'False' + norm_gain1: 'False' + norm_gain10: 'False' + norm_gain11: 'False' + norm_gain12: 'False' + norm_gain13: 'False' + norm_gain14: 'False' + norm_gain15: 'False' + norm_gain16: 'False' + norm_gain17: 'False' + norm_gain18: 'False' + norm_gain19: 'False' + norm_gain2: 'False' + norm_gain20: 'False' + norm_gain21: 'False' + norm_gain22: 'False' + norm_gain23: 'False' + norm_gain24: 'False' + norm_gain25: 'False' + norm_gain26: 'False' + norm_gain27: 'False' + norm_gain28: 'False' + norm_gain29: 'False' + norm_gain3: 'False' + norm_gain30: 'False' + norm_gain31: 'False' + norm_gain4: 'False' + norm_gain5: 'False' + norm_gain6: 'False' + norm_gain7: 'False' + norm_gain8: 'False' + norm_gain9: 'False' + num_mboards: '1' + otw: '' + rx_agc0: Default + rx_agc1: Default + rx_agc10: Default + rx_agc11: Default + rx_agc12: Default + rx_agc13: Default + rx_agc14: Default + rx_agc15: Default + rx_agc16: Default + rx_agc17: Default + rx_agc18: Default + rx_agc19: Default + rx_agc2: Default + rx_agc20: Default + rx_agc21: Default + rx_agc22: Default + rx_agc23: Default + rx_agc24: Default + rx_agc25: Default + rx_agc26: Default + rx_agc27: Default + rx_agc28: Default + rx_agc29: Default + rx_agc3: Default + rx_agc30: Default + rx_agc31: Default + rx_agc4: Default + rx_agc5: Default + rx_agc6: Default + rx_agc7: Default + rx_agc8: Default + rx_agc9: Default + samp_rate: sample_rate + sd_spec0: rx_usrp_channel + sd_spec1: '' + sd_spec2: '' + sd_spec3: '' + sd_spec4: '' + sd_spec5: '' + sd_spec6: '' + sd_spec7: '' + show_lo_controls: 'False' + stream_args: '' + stream_chans: '[]' + sync: sync + time_source0: '' + time_source1: '' + time_source2: '' + time_source3: '' + time_source4: '' + time_source5: '' + time_source6: '' + time_source7: '' + type: fc32 + states: + bus_sink: false + bus_source: false + bus_structure: null + coordinate: [208, 452] + rotation: 0 + state: enabled + +connections: +- [blocks_keep_one_in_n_0, '0', dect2_phase_diff_0, '0'] +- [dect2_phase_diff_0, '0', qtgui_time_sink_x_0, '0'] +- [uhd_usrp_source_0, '0', blocks_keep_one_in_n_0, '0'] + +metadata: + file_format: 1 diff --git a/Flow Graph Library/Inspection Flow Graphs/instantaneous_frequency_usrp2.py b/Flow Graph Library/Inspection Flow Graphs/instantaneous_frequency_usrp2.py new file mode 100755 index 00000000..76414825 --- /dev/null +++ b/Flow Graph Library/Inspection Flow Graphs/instantaneous_frequency_usrp2.py @@ -0,0 +1,331 @@ +#!/usr/bin/env python3 +# -*- coding: utf-8 -*- + +# +# SPDX-License-Identifier: GPL-3.0 +# +# GNU Radio Python Flow Graph +# Title: Instantaneous Frequency Usrp2 +# GNU Radio version: 3.10.1.1 + +from packaging.version import Version as StrictVersion + +if __name__ == '__main__': + import ctypes + import sys + if sys.platform.startswith('linux'): + try: + x11 = ctypes.cdll.LoadLibrary('libX11.so') + x11.XInitThreads() + except: + print("Warning: failed to XInitThreads()") + +from PyQt5 import Qt +from PyQt5.QtCore import QObject, pyqtSlot +from gnuradio import qtgui +from gnuradio.filter import firdes +import sip +from gnuradio import blocks +from gnuradio import gr +from gnuradio.fft import window +import sys +import signal +from argparse import ArgumentParser +from gnuradio.eng_arg import eng_float, intx +from gnuradio import eng_notation +from gnuradio import uhd +import time +from gnuradio.qtgui import Range, RangeWidget +from PyQt5 import QtCore +import gnuradio.dect2 as dect2 + + + +from gnuradio import qtgui + +class instantaneous_frequency_usrp2(gr.top_block, Qt.QWidget): + + def __init__(self): + gr.top_block.__init__(self, "Instantaneous Frequency Usrp2", catch_exceptions=True) + Qt.QWidget.__init__(self) + self.setWindowTitle("Instantaneous Frequency Usrp2") + qtgui.util.check_set_qss() + try: + self.setWindowIcon(Qt.QIcon.fromTheme('gnuradio-grc')) + except: + pass + self.top_scroll_layout = Qt.QVBoxLayout() + self.setLayout(self.top_scroll_layout) + self.top_scroll = Qt.QScrollArea() + self.top_scroll.setFrameStyle(Qt.QFrame.NoFrame) + self.top_scroll_layout.addWidget(self.top_scroll) + self.top_scroll.setWidgetResizable(True) + self.top_widget = Qt.QWidget() + self.top_scroll.setWidget(self.top_widget) + self.top_layout = Qt.QVBoxLayout(self.top_widget) + self.top_grid_layout = Qt.QGridLayout() + self.top_layout.addLayout(self.top_grid_layout) + + self.settings = Qt.QSettings("GNU Radio", "instantaneous_frequency_usrp2") + + try: + if StrictVersion(Qt.qVersion()) < StrictVersion("5.0.0"): + self.restoreGeometry(self.settings.value("geometry").toByteArray()) + else: + self.restoreGeometry(self.settings.value("geometry")) + except: + pass + + ################################################## + # Variables + ################################################## + self.sample_rate = sample_rate = 1e6 + self.rx_usrp_gain = rx_usrp_gain = 30 + self.rx_usrp_channel = rx_usrp_channel = "A:0" + self.rx_usrp_antenna = rx_usrp_antenna = "TX/RX" + self.rx_frequency = rx_frequency = 2412 + self.decimation = decimation = 1 + + ################################################## + # Blocks + ################################################## + # Create the options list + self._sample_rate_options = [1000000.0, 5000000.0, 10000000.0, 20000000.0] + # Create the labels list + self._sample_rate_labels = ['1 MS/s', '5 MS/s', '10 MS/s', '20 MS/s'] + # Create the combo box + self._sample_rate_tool_bar = Qt.QToolBar(self) + self._sample_rate_tool_bar.addWidget(Qt.QLabel("Sample Rate" + ": ")) + self._sample_rate_combo_box = Qt.QComboBox() + self._sample_rate_tool_bar.addWidget(self._sample_rate_combo_box) + for _label in self._sample_rate_labels: self._sample_rate_combo_box.addItem(_label) + self._sample_rate_callback = lambda i: Qt.QMetaObject.invokeMethod(self._sample_rate_combo_box, "setCurrentIndex", Qt.Q_ARG("int", self._sample_rate_options.index(i))) + self._sample_rate_callback(self.sample_rate) + self._sample_rate_combo_box.currentIndexChanged.connect( + lambda i: self.set_sample_rate(self._sample_rate_options[i])) + # Create the radio buttons + self.top_grid_layout.addWidget(self._sample_rate_tool_bar, 0, 0, 1, 1) + for r in range(0, 1): + self.top_grid_layout.setRowStretch(r, 1) + for c in range(0, 1): + self.top_grid_layout.setColumnStretch(c, 1) + self._rx_usrp_gain_range = Range(0, 34, 1, 30, 200) + self._rx_usrp_gain_win = RangeWidget(self._rx_usrp_gain_range, self.set_rx_usrp_gain, " Gain:", "counter_slider", float, QtCore.Qt.Horizontal) + self.top_grid_layout.addWidget(self._rx_usrp_gain_win, 1, 0, 1, 4) + for r in range(1, 2): + self.top_grid_layout.setRowStretch(r, 1) + for c in range(0, 4): + self.top_grid_layout.setColumnStretch(c, 1) + # Create the options list + self._rx_usrp_antenna_options = ['TX/RX', 'RX2'] + # Create the labels list + self._rx_usrp_antenna_labels = ['TX/RX', 'RX2'] + # Create the combo box + self._rx_usrp_antenna_tool_bar = Qt.QToolBar(self) + self._rx_usrp_antenna_tool_bar.addWidget(Qt.QLabel(" Antenna" + ": ")) + self._rx_usrp_antenna_combo_box = Qt.QComboBox() + self._rx_usrp_antenna_tool_bar.addWidget(self._rx_usrp_antenna_combo_box) + for _label in self._rx_usrp_antenna_labels: self._rx_usrp_antenna_combo_box.addItem(_label) + self._rx_usrp_antenna_callback = lambda i: Qt.QMetaObject.invokeMethod(self._rx_usrp_antenna_combo_box, "setCurrentIndex", Qt.Q_ARG("int", self._rx_usrp_antenna_options.index(i))) + self._rx_usrp_antenna_callback(self.rx_usrp_antenna) + self._rx_usrp_antenna_combo_box.currentIndexChanged.connect( + lambda i: self.set_rx_usrp_antenna(self._rx_usrp_antenna_options[i])) + # Create the radio buttons + self.top_grid_layout.addWidget(self._rx_usrp_antenna_tool_bar, 0, 1, 1, 1) + for r in range(0, 1): + self.top_grid_layout.setRowStretch(r, 1) + for c in range(1, 2): + self.top_grid_layout.setColumnStretch(c, 1) + self._rx_frequency_range = Range(50, 6000, .1, 2412, 200) + self._rx_frequency_win = RangeWidget(self._rx_frequency_range, self.set_rx_frequency, " Freq. (MHz):", "counter_slider", float, QtCore.Qt.Horizontal) + self.top_grid_layout.addWidget(self._rx_frequency_win, 2, 0, 1, 4) + for r in range(2, 3): + self.top_grid_layout.setRowStretch(r, 1) + for c in range(0, 4): + self.top_grid_layout.setColumnStretch(c, 1) + # Create the options list + self._decimation_options = [1, 10, 100, 1000] + # Create the labels list + self._decimation_labels = ['1', '10', '100', '1000'] + # Create the combo box + self._decimation_tool_bar = Qt.QToolBar(self) + self._decimation_tool_bar.addWidget(Qt.QLabel(" Keep 1 in N" + ": ")) + self._decimation_combo_box = Qt.QComboBox() + self._decimation_tool_bar.addWidget(self._decimation_combo_box) + for _label in self._decimation_labels: self._decimation_combo_box.addItem(_label) + self._decimation_callback = lambda i: Qt.QMetaObject.invokeMethod(self._decimation_combo_box, "setCurrentIndex", Qt.Q_ARG("int", self._decimation_options.index(i))) + self._decimation_callback(self.decimation) + self._decimation_combo_box.currentIndexChanged.connect( + lambda i: self.set_decimation(self._decimation_options[i])) + # Create the radio buttons + self.top_grid_layout.addWidget(self._decimation_tool_bar, 0, 2, 1, 1) + for r in range(0, 1): + self.top_grid_layout.setRowStretch(r, 1) + for c in range(2, 3): + self.top_grid_layout.setColumnStretch(c, 1) + self.uhd_usrp_source_0 = uhd.usrp_source( + ",".join(('', "")), + uhd.stream_args( + cpu_format="fc32", + args='', + channels=list(range(0,1)), + ), + ) + self.uhd_usrp_source_0.set_subdev_spec(rx_usrp_channel, 0) + self.uhd_usrp_source_0.set_samp_rate(sample_rate) + self.uhd_usrp_source_0.set_time_unknown_pps(uhd.time_spec(0)) + + self.uhd_usrp_source_0.set_center_freq(rx_frequency*1e6, 0) + self.uhd_usrp_source_0.set_antenna(rx_usrp_antenna, 0) + self.uhd_usrp_source_0.set_gain(rx_usrp_gain, 0) + self.qtgui_time_sink_x_0 = qtgui.time_sink_f( + 100000, #size + sample_rate/decimation, #samp_rate + "", #name + 1, #number of inputs + None # parent + ) + self.qtgui_time_sink_x_0.set_update_time(0.1) + self.qtgui_time_sink_x_0.set_y_axis(-5, 5) + + self.qtgui_time_sink_x_0.set_y_label('Amplitude', "") + + self.qtgui_time_sink_x_0.enable_tags(True) + self.qtgui_time_sink_x_0.set_trigger_mode(qtgui.TRIG_MODE_FREE, qtgui.TRIG_SLOPE_POS, 0.005, 0, 0, "") + self.qtgui_time_sink_x_0.enable_autoscale(False) + self.qtgui_time_sink_x_0.enable_grid(True) + self.qtgui_time_sink_x_0.enable_axis_labels(True) + self.qtgui_time_sink_x_0.enable_control_panel(False) + self.qtgui_time_sink_x_0.enable_stem_plot(False) + + + labels = ['', '', '', '', '', + '', '', '', '', ''] + widths = [1, 1, 1, 1, 1, + 1, 1, 1, 1, 1] + colors = ['blue', 'red', 'green', 'black', 'cyan', + 'magenta', 'yellow', 'dark red', 'dark green', 'dark blue'] + alphas = [1.0, 1.0, 1.0, 1.0, 1.0, + 1.0, 1.0, 1.0, 1.0, 1.0] + styles = [1, 1, 1, 1, 1, + 1, 1, 1, 1, 1] + markers = [-1, -1, -1, -1, -1, + -1, -1, -1, -1, -1] + + + for i in range(1): + if len(labels[i]) == 0: + self.qtgui_time_sink_x_0.set_line_label(i, "Data {0}".format(i)) + else: + self.qtgui_time_sink_x_0.set_line_label(i, labels[i]) + self.qtgui_time_sink_x_0.set_line_width(i, widths[i]) + self.qtgui_time_sink_x_0.set_line_color(i, colors[i]) + self.qtgui_time_sink_x_0.set_line_style(i, styles[i]) + self.qtgui_time_sink_x_0.set_line_marker(i, markers[i]) + self.qtgui_time_sink_x_0.set_line_alpha(i, alphas[i]) + + self._qtgui_time_sink_x_0_win = sip.wrapinstance(self.qtgui_time_sink_x_0.qwidget(), Qt.QWidget) + self.top_grid_layout.addWidget(self._qtgui_time_sink_x_0_win, 3, 0, 20, 4) + for r in range(3, 23): + self.top_grid_layout.setRowStretch(r, 1) + for c in range(0, 4): + self.top_grid_layout.setColumnStretch(c, 1) + self.dect2_phase_diff_0 = dect2.phase_diff() + self.blocks_keep_one_in_n_0 = blocks.keep_one_in_n(gr.sizeof_gr_complex*1, decimation) + + + ################################################## + # Connections + ################################################## + self.connect((self.blocks_keep_one_in_n_0, 0), (self.dect2_phase_diff_0, 0)) + self.connect((self.dect2_phase_diff_0, 0), (self.qtgui_time_sink_x_0, 0)) + self.connect((self.uhd_usrp_source_0, 0), (self.blocks_keep_one_in_n_0, 0)) + + + def closeEvent(self, event): + self.settings = Qt.QSettings("GNU Radio", "instantaneous_frequency_usrp2") + self.settings.setValue("geometry", self.saveGeometry()) + self.stop() + self.wait() + + event.accept() + + def get_sample_rate(self): + return self.sample_rate + + def set_sample_rate(self, sample_rate): + self.sample_rate = sample_rate + self._sample_rate_callback(self.sample_rate) + self.qtgui_time_sink_x_0.set_samp_rate(self.sample_rate/self.decimation) + self.uhd_usrp_source_0.set_samp_rate(self.sample_rate) + + def get_rx_usrp_gain(self): + return self.rx_usrp_gain + + def set_rx_usrp_gain(self, rx_usrp_gain): + self.rx_usrp_gain = rx_usrp_gain + self.uhd_usrp_source_0.set_gain(self.rx_usrp_gain, 0) + + def get_rx_usrp_channel(self): + return self.rx_usrp_channel + + def set_rx_usrp_channel(self, rx_usrp_channel): + self.rx_usrp_channel = rx_usrp_channel + + def get_rx_usrp_antenna(self): + return self.rx_usrp_antenna + + def set_rx_usrp_antenna(self, rx_usrp_antenna): + self.rx_usrp_antenna = rx_usrp_antenna + self._rx_usrp_antenna_callback(self.rx_usrp_antenna) + self.uhd_usrp_source_0.set_antenna(self.rx_usrp_antenna, 0) + + def get_rx_frequency(self): + return self.rx_frequency + + def set_rx_frequency(self, rx_frequency): + self.rx_frequency = rx_frequency + self.uhd_usrp_source_0.set_center_freq(self.rx_frequency*1e6, 0) + + def get_decimation(self): + return self.decimation + + def set_decimation(self, decimation): + self.decimation = decimation + self._decimation_callback(self.decimation) + self.blocks_keep_one_in_n_0.set_n(self.decimation) + self.qtgui_time_sink_x_0.set_samp_rate(self.sample_rate/self.decimation) + + + + +def main(top_block_cls=instantaneous_frequency_usrp2, options=None): + + if StrictVersion("4.5.0") <= StrictVersion(Qt.qVersion()) < StrictVersion("5.0.0"): + style = gr.prefs().get_string('qtgui', 'style', 'raster') + Qt.QApplication.setGraphicsSystem(style) + qapp = Qt.QApplication(sys.argv) + + tb = top_block_cls() + + tb.start() + + tb.show() + + def sig_handler(sig=None, frame=None): + tb.stop() + tb.wait() + + Qt.QApplication.quit() + + signal.signal(signal.SIGINT, sig_handler) + signal.signal(signal.SIGTERM, sig_handler) + + timer = Qt.QTimer() + timer.start(500) + timer.timeout.connect(lambda: None) + + qapp.exec_() + +if __name__ == '__main__': + main() diff --git a/Flow Graph Library/Inspection Flow Graphs/instantaneous_frequency_usrp_n2xx.grc b/Flow Graph Library/Inspection Flow Graphs/instantaneous_frequency_usrp_n2xx.grc new file mode 100644 index 00000000..de2193f5 --- /dev/null +++ b/Flow Graph Library/Inspection Flow Graphs/instantaneous_frequency_usrp_n2xx.grc @@ -0,0 +1,696 @@ +options: + parameters: + author: '' + category: Custom + cmake_opt: '' + comment: '' + copyright: '' + description: '' + gen_cmake: 'On' + gen_linking: dynamic + generate_options: qt_gui + hier_block_src_path: '.:' + id: instantaneous_frequency_usrp_n2xx + max_nouts: '0' + output_language: python + placement: (0,0) + qt_qss_theme: '' + realtime_scheduling: '' + run: 'True' + run_command: '{python} -u {filename}' + run_options: prompt + sizing_mode: fixed + thread_safe_setters: '' + title: '' + window_size: 1280, 1024 + states: + bus_sink: false + bus_source: false + bus_structure: null + coordinate: [10, 10] + rotation: 0 + state: enabled + +blocks: +- name: decimation + id: variable_qtgui_chooser + parameters: + comment: '' + gui_hint: 0,2,1,1 + label: ' Keep 1 in N' + label0: '' + label1: '' + label2: '' + label3: '' + label4: '' + labels: '["1","10","100","1000"]' + num_opts: '0' + option1: '1' + option2: '2' + option3: '3' + option4: '4' + options: '[1,10,100,1000]' + orient: Qt.QVBoxLayout + type: int + value: '1' + widget: combo_box + states: + bus_sink: false + bus_source: false + bus_structure: null + coordinate: [192, 268] + rotation: 0 + state: enabled +- name: ip_address + id: variable + parameters: + comment: '' + value: '"192.168.140.2"' + states: + bus_sink: false + bus_source: false + bus_structure: null + coordinate: [8, 148] + rotation: 0 + state: disabled +- name: rx_frequency + id: variable_qtgui_range + parameters: + comment: '' + gui_hint: 2,0,1,4 + label: ' Freq. (MHz):' + min_len: '200' + orient: Qt.Horizontal + rangeType: float + start: '50' + step: '.1' + stop: '6000' + value: '2412' + widget: counter_slider + states: + bus_sink: false + bus_source: false + bus_structure: null + coordinate: [360, 140] + rotation: 0 + state: enabled +- name: rx_usrp_antenna + id: variable_qtgui_chooser + parameters: + comment: '' + gui_hint: 0,1,1,1 + label: ' Antenna' + label0: '' + label1: '' + label2: '' + label3: '' + label4: '' + labels: '["TX/RX", "RX2"]' + num_opts: '0' + option1: '1' + option2: '2' + option3: '3' + option4: '4' + options: '["TX/RX", "RX2"]' + orient: Qt.QVBoxLayout + type: string + value: '"TX/RX"' + widget: combo_box + states: + bus_sink: false + bus_source: false + bus_structure: null + coordinate: [192, 140] + rotation: 0 + state: enabled +- name: rx_usrp_channel + id: variable + parameters: + comment: '' + value: '"A:0"' + states: + bus_sink: false + bus_source: false + bus_structure: null + coordinate: [8, 220] + rotation: 0 + state: enabled +- name: rx_usrp_gain + id: variable_qtgui_range + parameters: + comment: '' + gui_hint: 1,0,1,4 + label: ' Gain:' + min_len: '200' + orient: Qt.Horizontal + rangeType: float + start: '0' + step: '1' + stop: '34' + value: '30' + widget: counter_slider + states: + bus_sink: false + bus_source: false + bus_structure: null + coordinate: [360, 12] + rotation: 0 + state: enabled +- name: sample_rate + id: variable_qtgui_chooser + parameters: + comment: '' + gui_hint: 0,0,1,1 + label: Sample Rate + label0: '' + label1: '' + label2: '' + label3: '' + label4: '' + labels: '["1 MS/s", "5 MS/s", "10 MS/s", "20 MS/s"]' + num_opts: '0' + option1: '1' + option2: '2' + option3: '3' + option4: '4' + options: '[1e6, 5e6, 10e6, 20e6]' + orient: Qt.QVBoxLayout + type: real + value: 1e6 + widget: combo_box + states: + bus_sink: false + bus_source: false + bus_structure: null + coordinate: [192, 12] + rotation: 0 + state: enabled +- name: blocks_keep_one_in_n_0 + id: blocks_keep_one_in_n + parameters: + affinity: '' + alias: '' + comment: '' + maxoutbuf: '0' + minoutbuf: '0' + n: decimation + type: complex + vlen: '1' + states: + bus_sink: false + bus_source: false + bus_structure: null + coordinate: [496, 496] + rotation: 0 + state: enabled +- name: dect2_phase_diff_0 + id: dect2_phase_diff + parameters: + affinity: '' + alias: '' + comment: '' + maxoutbuf: '0' + minoutbuf: '0' + states: + bus_sink: false + bus_source: false + bus_structure: null + coordinate: [632, 496] + rotation: 0 + state: enabled +- name: qtgui_time_sink_x_0 + id: qtgui_time_sink_x + parameters: + affinity: '' + alias: '' + alpha1: '1.0' + alpha10: '1.0' + alpha2: '1.0' + alpha3: '1.0' + alpha4: '1.0' + alpha5: '1.0' + alpha6: '1.0' + alpha7: '1.0' + alpha8: '1.0' + alpha9: '1.0' + autoscale: 'False' + axislabels: 'True' + color1: blue + color10: dark blue + color2: red + color3: green + color4: black + color5: cyan + color6: magenta + color7: yellow + color8: dark red + color9: dark green + comment: '' + ctrlpanel: 'False' + entags: 'True' + grid: 'True' + gui_hint: 3,0,20,4 + label1: '' + label10: '' + label2: '' + label3: '' + label4: '' + label5: '' + label6: '' + label7: '' + label8: '' + label9: '' + legend: 'True' + marker1: '-1' + marker10: '-1' + marker2: '-1' + marker3: '-1' + marker4: '-1' + marker5: '-1' + marker6: '-1' + marker7: '-1' + marker8: '-1' + marker9: '-1' + name: '""' + nconnections: '1' + size: '100000' + srate: sample_rate/decimation + stemplot: 'False' + style1: '1' + style10: '1' + style2: '1' + style3: '1' + style4: '1' + style5: '1' + style6: '1' + style7: '1' + style8: '1' + style9: '1' + tr_chan: '0' + tr_delay: '0' + tr_level: '0.005' + tr_mode: qtgui.TRIG_MODE_FREE + tr_slope: qtgui.TRIG_SLOPE_POS + tr_tag: '""' + type: float + update_time: '0.1' + width1: '1' + width10: '1' + width2: '1' + width3: '1' + width4: '1' + width5: '1' + width6: '1' + width7: '1' + width8: '1' + width9: '1' + ylabel: Amplitude + ymax: '5' + ymin: '-5' + yunit: '""' + states: + bus_sink: false + bus_source: false + bus_structure: null + coordinate: [776, 476] + rotation: 0 + state: enabled +- name: uhd_usrp_source_0 + id: uhd_usrp_source + parameters: + affinity: '' + alias: '' + ant0: rx_usrp_antenna + ant1: '' + ant10: '' + ant11: '' + ant12: '' + ant13: '' + ant14: '' + ant15: '' + ant16: '' + ant17: '' + ant18: '' + ant19: '' + ant2: '' + ant20: '' + ant21: '' + ant22: '' + ant23: '' + ant24: '' + ant25: '' + ant26: '' + ant27: '' + ant28: '' + ant29: '' + ant3: '' + ant30: '' + ant31: '' + ant4: '' + ant5: '' + ant6: '' + ant7: '' + ant8: '' + ant9: '' + bw0: '0' + bw1: '0' + bw10: '0' + bw11: '0' + bw12: '0' + bw13: '0' + bw14: '0' + bw15: '0' + bw16: '0' + bw17: '0' + bw18: '0' + bw19: '0' + bw2: '0' + bw20: '0' + bw21: '0' + bw22: '0' + bw23: '0' + bw24: '0' + bw25: '0' + bw26: '0' + bw27: '0' + bw28: '0' + bw29: '0' + bw3: '0' + bw30: '0' + bw31: '0' + bw4: '0' + bw5: '0' + bw6: '0' + bw7: '0' + bw8: '0' + bw9: '0' + center_freq0: rx_frequency*1e6 + center_freq1: '0' + center_freq10: '0' + center_freq11: '0' + center_freq12: '0' + center_freq13: '0' + center_freq14: '0' + center_freq15: '0' + center_freq16: '0' + center_freq17: '0' + center_freq18: '0' + center_freq19: '0' + center_freq2: '0' + center_freq20: '0' + center_freq21: '0' + center_freq22: '0' + center_freq23: '0' + center_freq24: '0' + center_freq25: '0' + center_freq26: '0' + center_freq27: '0' + center_freq28: '0' + center_freq29: '0' + center_freq3: '0' + center_freq30: '0' + center_freq31: '0' + center_freq4: '0' + center_freq5: '0' + center_freq6: '0' + center_freq7: '0' + center_freq8: '0' + center_freq9: '0' + clock_rate: '0.0' + clock_source0: '' + clock_source1: '' + clock_source2: '' + clock_source3: '' + clock_source4: '' + clock_source5: '' + clock_source6: '' + clock_source7: '' + comment: '' + dc_offs_enb0: '""' + dc_offs_enb1: '""' + dc_offs_enb10: '""' + dc_offs_enb11: '""' + dc_offs_enb12: '""' + dc_offs_enb13: '""' + dc_offs_enb14: '""' + dc_offs_enb15: '""' + dc_offs_enb16: '""' + dc_offs_enb17: '""' + dc_offs_enb18: '""' + dc_offs_enb19: '""' + dc_offs_enb2: '""' + dc_offs_enb20: '""' + dc_offs_enb21: '""' + dc_offs_enb22: '""' + dc_offs_enb23: '""' + dc_offs_enb24: '""' + dc_offs_enb25: '""' + dc_offs_enb26: '""' + dc_offs_enb27: '""' + dc_offs_enb28: '""' + dc_offs_enb29: '""' + dc_offs_enb3: '""' + dc_offs_enb30: '""' + dc_offs_enb31: '""' + dc_offs_enb4: '""' + dc_offs_enb5: '""' + dc_offs_enb6: '""' + dc_offs_enb7: '""' + dc_offs_enb8: '""' + dc_offs_enb9: '""' + dev_addr: '' + dev_args: '""' + gain0: rx_usrp_gain + gain1: '0' + gain10: '0' + gain11: '0' + gain12: '0' + gain13: '0' + gain14: '0' + gain15: '0' + gain16: '0' + gain17: '0' + gain18: '0' + gain19: '0' + gain2: '0' + gain20: '0' + gain21: '0' + gain22: '0' + gain23: '0' + gain24: '0' + gain25: '0' + gain26: '0' + gain27: '0' + gain28: '0' + gain29: '0' + gain3: '0' + gain30: '0' + gain31: '0' + gain4: '0' + gain5: '0' + gain6: '0' + gain7: '0' + gain8: '0' + gain9: '0' + iq_imbal_enb0: '""' + iq_imbal_enb1: '""' + iq_imbal_enb10: '""' + iq_imbal_enb11: '""' + iq_imbal_enb12: '""' + iq_imbal_enb13: '""' + iq_imbal_enb14: '""' + iq_imbal_enb15: '""' + iq_imbal_enb16: '""' + iq_imbal_enb17: '""' + iq_imbal_enb18: '""' + iq_imbal_enb19: '""' + iq_imbal_enb2: '""' + iq_imbal_enb20: '""' + iq_imbal_enb21: '""' + iq_imbal_enb22: '""' + iq_imbal_enb23: '""' + iq_imbal_enb24: '""' + iq_imbal_enb25: '""' + iq_imbal_enb26: '""' + iq_imbal_enb27: '""' + iq_imbal_enb28: '""' + iq_imbal_enb29: '""' + iq_imbal_enb3: '""' + iq_imbal_enb30: '""' + iq_imbal_enb31: '""' + iq_imbal_enb4: '""' + iq_imbal_enb5: '""' + iq_imbal_enb6: '""' + iq_imbal_enb7: '""' + iq_imbal_enb8: '""' + iq_imbal_enb9: '""' + lo_export0: 'False' + lo_export1: 'False' + lo_export10: 'False' + lo_export11: 'False' + lo_export12: 'False' + lo_export13: 'False' + lo_export14: 'False' + lo_export15: 'False' + lo_export16: 'False' + lo_export17: 'False' + lo_export18: 'False' + lo_export19: 'False' + lo_export2: 'False' + lo_export20: 'False' + lo_export21: 'False' + lo_export22: 'False' + lo_export23: 'False' + lo_export24: 'False' + lo_export25: 'False' + lo_export26: 'False' + lo_export27: 'False' + lo_export28: 'False' + lo_export29: 'False' + lo_export3: 'False' + lo_export30: 'False' + lo_export31: 'False' + lo_export4: 'False' + lo_export5: 'False' + lo_export6: 'False' + lo_export7: 'False' + lo_export8: 'False' + lo_export9: 'False' + lo_source0: internal + lo_source1: internal + lo_source10: internal + lo_source11: internal + lo_source12: internal + lo_source13: internal + lo_source14: internal + lo_source15: internal + lo_source16: internal + lo_source17: internal + lo_source18: internal + lo_source19: internal + lo_source2: internal + lo_source20: internal + lo_source21: internal + lo_source22: internal + lo_source23: internal + lo_source24: internal + lo_source25: internal + lo_source26: internal + lo_source27: internal + lo_source28: internal + lo_source29: internal + lo_source3: internal + lo_source30: internal + lo_source31: internal + lo_source4: internal + lo_source5: internal + lo_source6: internal + lo_source7: internal + lo_source8: internal + lo_source9: internal + maxoutbuf: '0' + minoutbuf: '0' + nchan: '1' + norm_gain0: 'False' + norm_gain1: 'False' + norm_gain10: 'False' + norm_gain11: 'False' + norm_gain12: 'False' + norm_gain13: 'False' + norm_gain14: 'False' + norm_gain15: 'False' + norm_gain16: 'False' + norm_gain17: 'False' + norm_gain18: 'False' + norm_gain19: 'False' + norm_gain2: 'False' + norm_gain20: 'False' + norm_gain21: 'False' + norm_gain22: 'False' + norm_gain23: 'False' + norm_gain24: 'False' + norm_gain25: 'False' + norm_gain26: 'False' + norm_gain27: 'False' + norm_gain28: 'False' + norm_gain29: 'False' + norm_gain3: 'False' + norm_gain30: 'False' + norm_gain31: 'False' + norm_gain4: 'False' + norm_gain5: 'False' + norm_gain6: 'False' + norm_gain7: 'False' + norm_gain8: 'False' + norm_gain9: 'False' + num_mboards: '1' + otw: '' + rx_agc0: Default + rx_agc1: Default + rx_agc10: Default + rx_agc11: Default + rx_agc12: Default + rx_agc13: Default + rx_agc14: Default + rx_agc15: Default + rx_agc16: Default + rx_agc17: Default + rx_agc18: Default + rx_agc19: Default + rx_agc2: Default + rx_agc20: Default + rx_agc21: Default + rx_agc22: Default + rx_agc23: Default + rx_agc24: Default + rx_agc25: Default + rx_agc26: Default + rx_agc27: Default + rx_agc28: Default + rx_agc29: Default + rx_agc3: Default + rx_agc30: Default + rx_agc31: Default + rx_agc4: Default + rx_agc5: Default + rx_agc6: Default + rx_agc7: Default + rx_agc8: Default + rx_agc9: Default + samp_rate: sample_rate + sd_spec0: rx_usrp_channel + sd_spec1: '' + sd_spec2: '' + sd_spec3: '' + sd_spec4: '' + sd_spec5: '' + sd_spec6: '' + sd_spec7: '' + show_lo_controls: 'False' + stream_args: '' + stream_chans: '[]' + sync: sync + time_source0: '' + time_source1: '' + time_source2: '' + time_source3: '' + time_source4: '' + time_source5: '' + time_source6: '' + time_source7: '' + type: fc32 + states: + bus_sink: false + bus_source: false + bus_structure: null + coordinate: [208, 452] + rotation: 0 + state: enabled + +connections: +- [blocks_keep_one_in_n_0, '0', dect2_phase_diff_0, '0'] +- [dect2_phase_diff_0, '0', qtgui_time_sink_x_0, '0'] +- [uhd_usrp_source_0, '0', blocks_keep_one_in_n_0, '0'] + +metadata: + file_format: 1 diff --git a/Flow Graph Library/Inspection Flow Graphs/instantaneous_frequency_usrp_n2xx.py b/Flow Graph Library/Inspection Flow Graphs/instantaneous_frequency_usrp_n2xx.py new file mode 100755 index 00000000..fdda9e92 --- /dev/null +++ b/Flow Graph Library/Inspection Flow Graphs/instantaneous_frequency_usrp_n2xx.py @@ -0,0 +1,331 @@ +#!/usr/bin/env python3 +# -*- coding: utf-8 -*- + +# +# SPDX-License-Identifier: GPL-3.0 +# +# GNU Radio Python Flow Graph +# Title: Instantaneous Frequency Usrp N2Xx +# GNU Radio version: 3.10.1.1 + +from packaging.version import Version as StrictVersion + +if __name__ == '__main__': + import ctypes + import sys + if sys.platform.startswith('linux'): + try: + x11 = ctypes.cdll.LoadLibrary('libX11.so') + x11.XInitThreads() + except: + print("Warning: failed to XInitThreads()") + +from PyQt5 import Qt +from PyQt5.QtCore import QObject, pyqtSlot +from gnuradio import qtgui +from gnuradio.filter import firdes +import sip +from gnuradio import blocks +from gnuradio import gr +from gnuradio.fft import window +import sys +import signal +from argparse import ArgumentParser +from gnuradio.eng_arg import eng_float, intx +from gnuradio import eng_notation +from gnuradio import uhd +import time +from gnuradio.qtgui import Range, RangeWidget +from PyQt5 import QtCore +import gnuradio.dect2 as dect2 + + + +from gnuradio import qtgui + +class instantaneous_frequency_usrp_n2xx(gr.top_block, Qt.QWidget): + + def __init__(self): + gr.top_block.__init__(self, "Instantaneous Frequency Usrp N2Xx", catch_exceptions=True) + Qt.QWidget.__init__(self) + self.setWindowTitle("Instantaneous Frequency Usrp N2Xx") + qtgui.util.check_set_qss() + try: + self.setWindowIcon(Qt.QIcon.fromTheme('gnuradio-grc')) + except: + pass + self.top_scroll_layout = Qt.QVBoxLayout() + self.setLayout(self.top_scroll_layout) + self.top_scroll = Qt.QScrollArea() + self.top_scroll.setFrameStyle(Qt.QFrame.NoFrame) + self.top_scroll_layout.addWidget(self.top_scroll) + self.top_scroll.setWidgetResizable(True) + self.top_widget = Qt.QWidget() + self.top_scroll.setWidget(self.top_widget) + self.top_layout = Qt.QVBoxLayout(self.top_widget) + self.top_grid_layout = Qt.QGridLayout() + self.top_layout.addLayout(self.top_grid_layout) + + self.settings = Qt.QSettings("GNU Radio", "instantaneous_frequency_usrp_n2xx") + + try: + if StrictVersion(Qt.qVersion()) < StrictVersion("5.0.0"): + self.restoreGeometry(self.settings.value("geometry").toByteArray()) + else: + self.restoreGeometry(self.settings.value("geometry")) + except: + pass + + ################################################## + # Variables + ################################################## + self.sample_rate = sample_rate = 1e6 + self.rx_usrp_gain = rx_usrp_gain = 30 + self.rx_usrp_channel = rx_usrp_channel = "A:0" + self.rx_usrp_antenna = rx_usrp_antenna = "TX/RX" + self.rx_frequency = rx_frequency = 2412 + self.decimation = decimation = 1 + + ################################################## + # Blocks + ################################################## + # Create the options list + self._sample_rate_options = [1000000.0, 5000000.0, 10000000.0, 20000000.0] + # Create the labels list + self._sample_rate_labels = ['1 MS/s', '5 MS/s', '10 MS/s', '20 MS/s'] + # Create the combo box + self._sample_rate_tool_bar = Qt.QToolBar(self) + self._sample_rate_tool_bar.addWidget(Qt.QLabel("Sample Rate" + ": ")) + self._sample_rate_combo_box = Qt.QComboBox() + self._sample_rate_tool_bar.addWidget(self._sample_rate_combo_box) + for _label in self._sample_rate_labels: self._sample_rate_combo_box.addItem(_label) + self._sample_rate_callback = lambda i: Qt.QMetaObject.invokeMethod(self._sample_rate_combo_box, "setCurrentIndex", Qt.Q_ARG("int", self._sample_rate_options.index(i))) + self._sample_rate_callback(self.sample_rate) + self._sample_rate_combo_box.currentIndexChanged.connect( + lambda i: self.set_sample_rate(self._sample_rate_options[i])) + # Create the radio buttons + self.top_grid_layout.addWidget(self._sample_rate_tool_bar, 0, 0, 1, 1) + for r in range(0, 1): + self.top_grid_layout.setRowStretch(r, 1) + for c in range(0, 1): + self.top_grid_layout.setColumnStretch(c, 1) + self._rx_usrp_gain_range = Range(0, 34, 1, 30, 200) + self._rx_usrp_gain_win = RangeWidget(self._rx_usrp_gain_range, self.set_rx_usrp_gain, " Gain:", "counter_slider", float, QtCore.Qt.Horizontal) + self.top_grid_layout.addWidget(self._rx_usrp_gain_win, 1, 0, 1, 4) + for r in range(1, 2): + self.top_grid_layout.setRowStretch(r, 1) + for c in range(0, 4): + self.top_grid_layout.setColumnStretch(c, 1) + # Create the options list + self._rx_usrp_antenna_options = ['TX/RX', 'RX2'] + # Create the labels list + self._rx_usrp_antenna_labels = ['TX/RX', 'RX2'] + # Create the combo box + self._rx_usrp_antenna_tool_bar = Qt.QToolBar(self) + self._rx_usrp_antenna_tool_bar.addWidget(Qt.QLabel(" Antenna" + ": ")) + self._rx_usrp_antenna_combo_box = Qt.QComboBox() + self._rx_usrp_antenna_tool_bar.addWidget(self._rx_usrp_antenna_combo_box) + for _label in self._rx_usrp_antenna_labels: self._rx_usrp_antenna_combo_box.addItem(_label) + self._rx_usrp_antenna_callback = lambda i: Qt.QMetaObject.invokeMethod(self._rx_usrp_antenna_combo_box, "setCurrentIndex", Qt.Q_ARG("int", self._rx_usrp_antenna_options.index(i))) + self._rx_usrp_antenna_callback(self.rx_usrp_antenna) + self._rx_usrp_antenna_combo_box.currentIndexChanged.connect( + lambda i: self.set_rx_usrp_antenna(self._rx_usrp_antenna_options[i])) + # Create the radio buttons + self.top_grid_layout.addWidget(self._rx_usrp_antenna_tool_bar, 0, 1, 1, 1) + for r in range(0, 1): + self.top_grid_layout.setRowStretch(r, 1) + for c in range(1, 2): + self.top_grid_layout.setColumnStretch(c, 1) + self._rx_frequency_range = Range(50, 6000, .1, 2412, 200) + self._rx_frequency_win = RangeWidget(self._rx_frequency_range, self.set_rx_frequency, " Freq. (MHz):", "counter_slider", float, QtCore.Qt.Horizontal) + self.top_grid_layout.addWidget(self._rx_frequency_win, 2, 0, 1, 4) + for r in range(2, 3): + self.top_grid_layout.setRowStretch(r, 1) + for c in range(0, 4): + self.top_grid_layout.setColumnStretch(c, 1) + # Create the options list + self._decimation_options = [1, 10, 100, 1000] + # Create the labels list + self._decimation_labels = ['1', '10', '100', '1000'] + # Create the combo box + self._decimation_tool_bar = Qt.QToolBar(self) + self._decimation_tool_bar.addWidget(Qt.QLabel(" Keep 1 in N" + ": ")) + self._decimation_combo_box = Qt.QComboBox() + self._decimation_tool_bar.addWidget(self._decimation_combo_box) + for _label in self._decimation_labels: self._decimation_combo_box.addItem(_label) + self._decimation_callback = lambda i: Qt.QMetaObject.invokeMethod(self._decimation_combo_box, "setCurrentIndex", Qt.Q_ARG("int", self._decimation_options.index(i))) + self._decimation_callback(self.decimation) + self._decimation_combo_box.currentIndexChanged.connect( + lambda i: self.set_decimation(self._decimation_options[i])) + # Create the radio buttons + self.top_grid_layout.addWidget(self._decimation_tool_bar, 0, 2, 1, 1) + for r in range(0, 1): + self.top_grid_layout.setRowStretch(r, 1) + for c in range(2, 3): + self.top_grid_layout.setColumnStretch(c, 1) + self.uhd_usrp_source_0 = uhd.usrp_source( + ",".join(('', "")), + uhd.stream_args( + cpu_format="fc32", + args='', + channels=list(range(0,1)), + ), + ) + self.uhd_usrp_source_0.set_subdev_spec(rx_usrp_channel, 0) + self.uhd_usrp_source_0.set_samp_rate(sample_rate) + self.uhd_usrp_source_0.set_time_unknown_pps(uhd.time_spec(0)) + + self.uhd_usrp_source_0.set_center_freq(rx_frequency*1e6, 0) + self.uhd_usrp_source_0.set_antenna(rx_usrp_antenna, 0) + self.uhd_usrp_source_0.set_gain(rx_usrp_gain, 0) + self.qtgui_time_sink_x_0 = qtgui.time_sink_f( + 100000, #size + sample_rate/decimation, #samp_rate + "", #name + 1, #number of inputs + None # parent + ) + self.qtgui_time_sink_x_0.set_update_time(0.1) + self.qtgui_time_sink_x_0.set_y_axis(-5, 5) + + self.qtgui_time_sink_x_0.set_y_label('Amplitude', "") + + self.qtgui_time_sink_x_0.enable_tags(True) + self.qtgui_time_sink_x_0.set_trigger_mode(qtgui.TRIG_MODE_FREE, qtgui.TRIG_SLOPE_POS, 0.005, 0, 0, "") + self.qtgui_time_sink_x_0.enable_autoscale(False) + self.qtgui_time_sink_x_0.enable_grid(True) + self.qtgui_time_sink_x_0.enable_axis_labels(True) + self.qtgui_time_sink_x_0.enable_control_panel(False) + self.qtgui_time_sink_x_0.enable_stem_plot(False) + + + labels = ['', '', '', '', '', + '', '', '', '', ''] + widths = [1, 1, 1, 1, 1, + 1, 1, 1, 1, 1] + colors = ['blue', 'red', 'green', 'black', 'cyan', + 'magenta', 'yellow', 'dark red', 'dark green', 'dark blue'] + alphas = [1.0, 1.0, 1.0, 1.0, 1.0, + 1.0, 1.0, 1.0, 1.0, 1.0] + styles = [1, 1, 1, 1, 1, + 1, 1, 1, 1, 1] + markers = [-1, -1, -1, -1, -1, + -1, -1, -1, -1, -1] + + + for i in range(1): + if len(labels[i]) == 0: + self.qtgui_time_sink_x_0.set_line_label(i, "Data {0}".format(i)) + else: + self.qtgui_time_sink_x_0.set_line_label(i, labels[i]) + self.qtgui_time_sink_x_0.set_line_width(i, widths[i]) + self.qtgui_time_sink_x_0.set_line_color(i, colors[i]) + self.qtgui_time_sink_x_0.set_line_style(i, styles[i]) + self.qtgui_time_sink_x_0.set_line_marker(i, markers[i]) + self.qtgui_time_sink_x_0.set_line_alpha(i, alphas[i]) + + self._qtgui_time_sink_x_0_win = sip.wrapinstance(self.qtgui_time_sink_x_0.qwidget(), Qt.QWidget) + self.top_grid_layout.addWidget(self._qtgui_time_sink_x_0_win, 3, 0, 20, 4) + for r in range(3, 23): + self.top_grid_layout.setRowStretch(r, 1) + for c in range(0, 4): + self.top_grid_layout.setColumnStretch(c, 1) + self.dect2_phase_diff_0 = dect2.phase_diff() + self.blocks_keep_one_in_n_0 = blocks.keep_one_in_n(gr.sizeof_gr_complex*1, decimation) + + + ################################################## + # Connections + ################################################## + self.connect((self.blocks_keep_one_in_n_0, 0), (self.dect2_phase_diff_0, 0)) + self.connect((self.dect2_phase_diff_0, 0), (self.qtgui_time_sink_x_0, 0)) + self.connect((self.uhd_usrp_source_0, 0), (self.blocks_keep_one_in_n_0, 0)) + + + def closeEvent(self, event): + self.settings = Qt.QSettings("GNU Radio", "instantaneous_frequency_usrp_n2xx") + self.settings.setValue("geometry", self.saveGeometry()) + self.stop() + self.wait() + + event.accept() + + def get_sample_rate(self): + return self.sample_rate + + def set_sample_rate(self, sample_rate): + self.sample_rate = sample_rate + self._sample_rate_callback(self.sample_rate) + self.qtgui_time_sink_x_0.set_samp_rate(self.sample_rate/self.decimation) + self.uhd_usrp_source_0.set_samp_rate(self.sample_rate) + + def get_rx_usrp_gain(self): + return self.rx_usrp_gain + + def set_rx_usrp_gain(self, rx_usrp_gain): + self.rx_usrp_gain = rx_usrp_gain + self.uhd_usrp_source_0.set_gain(self.rx_usrp_gain, 0) + + def get_rx_usrp_channel(self): + return self.rx_usrp_channel + + def set_rx_usrp_channel(self, rx_usrp_channel): + self.rx_usrp_channel = rx_usrp_channel + + def get_rx_usrp_antenna(self): + return self.rx_usrp_antenna + + def set_rx_usrp_antenna(self, rx_usrp_antenna): + self.rx_usrp_antenna = rx_usrp_antenna + self._rx_usrp_antenna_callback(self.rx_usrp_antenna) + self.uhd_usrp_source_0.set_antenna(self.rx_usrp_antenna, 0) + + def get_rx_frequency(self): + return self.rx_frequency + + def set_rx_frequency(self, rx_frequency): + self.rx_frequency = rx_frequency + self.uhd_usrp_source_0.set_center_freq(self.rx_frequency*1e6, 0) + + def get_decimation(self): + return self.decimation + + def set_decimation(self, decimation): + self.decimation = decimation + self._decimation_callback(self.decimation) + self.blocks_keep_one_in_n_0.set_n(self.decimation) + self.qtgui_time_sink_x_0.set_samp_rate(self.sample_rate/self.decimation) + + + + +def main(top_block_cls=instantaneous_frequency_usrp_n2xx, options=None): + + if StrictVersion("4.5.0") <= StrictVersion(Qt.qVersion()) < StrictVersion("5.0.0"): + style = gr.prefs().get_string('qtgui', 'style', 'raster') + Qt.QApplication.setGraphicsSystem(style) + qapp = Qt.QApplication(sys.argv) + + tb = top_block_cls() + + tb.start() + + tb.show() + + def sig_handler(sig=None, frame=None): + tb.stop() + tb.wait() + + Qt.QApplication.quit() + + signal.signal(signal.SIGINT, sig_handler) + signal.signal(signal.SIGTERM, sig_handler) + + timer = Qt.QTimer() + timer.start(500) + timer.timeout.connect(lambda: None) + + qapp.exec_() + +if __name__ == '__main__': + main() diff --git a/Flow Graph Library/Inspection Flow Graphs/signal_envelope_usrp2.grc b/Flow Graph Library/Inspection Flow Graphs/signal_envelope_usrp2.grc new file mode 100644 index 00000000..0920fbef --- /dev/null +++ b/Flow Graph Library/Inspection Flow Graphs/signal_envelope_usrp2.grc @@ -0,0 +1,697 @@ +options: + parameters: + author: '' + category: Custom + cmake_opt: '' + comment: '' + copyright: '' + description: '' + gen_cmake: 'On' + gen_linking: dynamic + generate_options: qt_gui + hier_block_src_path: '.:' + id: signal_envelope_usrp2 + max_nouts: '0' + output_language: python + placement: (0,0) + qt_qss_theme: '' + realtime_scheduling: '' + run: 'True' + run_command: '{python} -u {filename}' + run_options: prompt + sizing_mode: fixed + thread_safe_setters: '' + title: '' + window_size: 1280, 1024 + states: + bus_sink: false + bus_source: false + bus_structure: null + coordinate: [10, 10] + rotation: 0 + state: enabled + +blocks: +- name: decimation + id: variable_qtgui_chooser + parameters: + comment: '' + gui_hint: 0,2,1,1 + label: ' Keep 1 in N' + label0: '' + label1: '' + label2: '' + label3: '' + label4: '' + labels: '["1","10","100","1000"]' + num_opts: '0' + option1: '1' + option2: '2' + option3: '3' + option4: '4' + options: '[1,10,100,1000]' + orient: Qt.QVBoxLayout + type: int + value: '1' + widget: combo_box + states: + bus_sink: false + bus_source: false + bus_structure: null + coordinate: [232, 276] + rotation: 0 + state: enabled +- name: ip_address + id: variable + parameters: + comment: '' + value: '"192.168.140.2"' + states: + bus_sink: false + bus_source: false + bus_structure: null + coordinate: [8, 140] + rotation: 0 + state: disabled +- name: rx_frequency + id: variable_qtgui_range + parameters: + comment: '' + gui_hint: 2,0,1,4 + label: ' Freq. (MHz):' + min_len: '200' + orient: Qt.Horizontal + rangeType: float + start: '50' + step: '.1' + stop: '6000' + value: '2412' + widget: counter_slider + states: + bus_sink: false + bus_source: false + bus_structure: null + coordinate: [400, 148] + rotation: 0 + state: enabled +- name: rx_usrp_antenna + id: variable_qtgui_chooser + parameters: + comment: '' + gui_hint: 0,1,1,1 + label: ' Antenna' + label0: '' + label1: '' + label2: '' + label3: '' + label4: '' + labels: '["TX/RX", "RX2"]' + num_opts: '0' + option1: '1' + option2: '2' + option3: '3' + option4: '4' + options: '["TX/RX", "RX2"]' + orient: Qt.QVBoxLayout + type: string + value: '"TX/RX"' + widget: combo_box + states: + bus_sink: false + bus_source: false + bus_structure: null + coordinate: [232, 148] + rotation: 0 + state: enabled +- name: rx_usrp_channel + id: variable + parameters: + comment: '' + value: '"A:0"' + states: + bus_sink: false + bus_source: false + bus_structure: null + coordinate: [8, 76] + rotation: 0 + state: enabled +- name: rx_usrp_gain + id: variable_qtgui_range + parameters: + comment: '' + gui_hint: 1,0,1,4 + label: ' Gain:' + min_len: '200' + orient: Qt.Horizontal + rangeType: float + start: '0' + step: '1' + stop: '34' + value: '30' + widget: counter_slider + states: + bus_sink: false + bus_source: false + bus_structure: null + coordinate: [400, 20] + rotation: 0 + state: enabled +- name: sample_rate + id: variable_qtgui_chooser + parameters: + comment: '' + gui_hint: 0,0,1,1 + label: Sample Rate + label0: '' + label1: '' + label2: '' + label3: '' + label4: '' + labels: '["1 MS/s", "5 MS/s", "10 MS/s", "20 MS/s"]' + num_opts: '0' + option1: '1' + option2: '2' + option3: '3' + option4: '4' + options: '[1e6, 5e6, 10e6, 20e6]' + orient: Qt.QVBoxLayout + type: real + value: 1e6 + widget: combo_box + states: + bus_sink: false + bus_source: false + bus_structure: null + coordinate: [232, 20] + rotation: 0 + state: enabled +- name: blocks_complex_to_mag_squared_0 + id: blocks_complex_to_mag_squared + parameters: + affinity: '' + alias: '' + comment: '' + maxoutbuf: '0' + minoutbuf: '0' + vlen: '1' + states: + bus_sink: false + bus_source: false + bus_structure: null + coordinate: [784, 520] + rotation: 0 + state: enabled +- name: blocks_keep_one_in_n_0 + id: blocks_keep_one_in_n + parameters: + affinity: '' + alias: '' + comment: '' + maxoutbuf: '0' + minoutbuf: '0' + n: decimation + type: complex + vlen: '1' + states: + bus_sink: false + bus_source: false + bus_structure: null + coordinate: [616, 520] + rotation: 0 + state: enabled +- name: qtgui_time_sink_x_0 + id: qtgui_time_sink_x + parameters: + affinity: '' + alias: '' + alpha1: '1.0' + alpha10: '1.0' + alpha2: '1.0' + alpha3: '1.0' + alpha4: '1.0' + alpha5: '1.0' + alpha6: '1.0' + alpha7: '1.0' + alpha8: '1.0' + alpha9: '1.0' + autoscale: 'False' + axislabels: 'True' + color1: blue + color10: dark blue + color2: red + color3: green + color4: black + color5: cyan + color6: magenta + color7: yellow + color8: dark red + color9: dark green + comment: '' + ctrlpanel: 'False' + entags: 'True' + grid: 'True' + gui_hint: 3,0,20,4 + label1: '' + label10: '' + label2: '' + label3: '' + label4: '' + label5: '' + label6: '' + label7: '' + label8: '' + label9: '' + legend: 'True' + marker1: '-1' + marker10: '-1' + marker2: '-1' + marker3: '-1' + marker4: '-1' + marker5: '-1' + marker6: '-1' + marker7: '-1' + marker8: '-1' + marker9: '-1' + name: '""' + nconnections: '1' + size: '100000' + srate: sample_rate/decimation + stemplot: 'False' + style1: '1' + style10: '1' + style2: '1' + style3: '1' + style4: '1' + style5: '1' + style6: '1' + style7: '1' + style8: '1' + style9: '1' + tr_chan: '0' + tr_delay: '0' + tr_level: '0.005' + tr_mode: qtgui.TRIG_MODE_FREE + tr_slope: qtgui.TRIG_SLOPE_POS + tr_tag: '""' + type: float + update_time: '0.1' + width1: '1' + width10: '1' + width2: '1' + width3: '1' + width4: '1' + width5: '1' + width6: '1' + width7: '1' + width8: '1' + width9: '1' + ylabel: Amplitude + ymax: '1' + ymin: -.1 + yunit: '""' + states: + bus_sink: false + bus_source: false + bus_structure: null + coordinate: [968, 500] + rotation: 0 + state: enabled +- name: uhd_usrp_source_0 + id: uhd_usrp_source + parameters: + affinity: '' + alias: '' + ant0: rx_usrp_antenna + ant1: '' + ant10: '' + ant11: '' + ant12: '' + ant13: '' + ant14: '' + ant15: '' + ant16: '' + ant17: '' + ant18: '' + ant19: '' + ant2: '' + ant20: '' + ant21: '' + ant22: '' + ant23: '' + ant24: '' + ant25: '' + ant26: '' + ant27: '' + ant28: '' + ant29: '' + ant3: '' + ant30: '' + ant31: '' + ant4: '' + ant5: '' + ant6: '' + ant7: '' + ant8: '' + ant9: '' + bw0: '0' + bw1: '0' + bw10: '0' + bw11: '0' + bw12: '0' + bw13: '0' + bw14: '0' + bw15: '0' + bw16: '0' + bw17: '0' + bw18: '0' + bw19: '0' + bw2: '0' + bw20: '0' + bw21: '0' + bw22: '0' + bw23: '0' + bw24: '0' + bw25: '0' + bw26: '0' + bw27: '0' + bw28: '0' + bw29: '0' + bw3: '0' + bw30: '0' + bw31: '0' + bw4: '0' + bw5: '0' + bw6: '0' + bw7: '0' + bw8: '0' + bw9: '0' + center_freq0: rx_frequency*1e6 + center_freq1: '0' + center_freq10: '0' + center_freq11: '0' + center_freq12: '0' + center_freq13: '0' + center_freq14: '0' + center_freq15: '0' + center_freq16: '0' + center_freq17: '0' + center_freq18: '0' + center_freq19: '0' + center_freq2: '0' + center_freq20: '0' + center_freq21: '0' + center_freq22: '0' + center_freq23: '0' + center_freq24: '0' + center_freq25: '0' + center_freq26: '0' + center_freq27: '0' + center_freq28: '0' + center_freq29: '0' + center_freq3: '0' + center_freq30: '0' + center_freq31: '0' + center_freq4: '0' + center_freq5: '0' + center_freq6: '0' + center_freq7: '0' + center_freq8: '0' + center_freq9: '0' + clock_rate: '0.0' + clock_source0: '' + clock_source1: '' + clock_source2: '' + clock_source3: '' + clock_source4: '' + clock_source5: '' + clock_source6: '' + clock_source7: '' + comment: '' + dc_offs_enb0: '""' + dc_offs_enb1: '""' + dc_offs_enb10: '""' + dc_offs_enb11: '""' + dc_offs_enb12: '""' + dc_offs_enb13: '""' + dc_offs_enb14: '""' + dc_offs_enb15: '""' + dc_offs_enb16: '""' + dc_offs_enb17: '""' + dc_offs_enb18: '""' + dc_offs_enb19: '""' + dc_offs_enb2: '""' + dc_offs_enb20: '""' + dc_offs_enb21: '""' + dc_offs_enb22: '""' + dc_offs_enb23: '""' + dc_offs_enb24: '""' + dc_offs_enb25: '""' + dc_offs_enb26: '""' + dc_offs_enb27: '""' + dc_offs_enb28: '""' + dc_offs_enb29: '""' + dc_offs_enb3: '""' + dc_offs_enb30: '""' + dc_offs_enb31: '""' + dc_offs_enb4: '""' + dc_offs_enb5: '""' + dc_offs_enb6: '""' + dc_offs_enb7: '""' + dc_offs_enb8: '""' + dc_offs_enb9: '""' + dev_addr: '' + dev_args: '""' + gain0: rx_usrp_gain + gain1: '0' + gain10: '0' + gain11: '0' + gain12: '0' + gain13: '0' + gain14: '0' + gain15: '0' + gain16: '0' + gain17: '0' + gain18: '0' + gain19: '0' + gain2: '0' + gain20: '0' + gain21: '0' + gain22: '0' + gain23: '0' + gain24: '0' + gain25: '0' + gain26: '0' + gain27: '0' + gain28: '0' + gain29: '0' + gain3: '0' + gain30: '0' + gain31: '0' + gain4: '0' + gain5: '0' + gain6: '0' + gain7: '0' + gain8: '0' + gain9: '0' + iq_imbal_enb0: '""' + iq_imbal_enb1: '""' + iq_imbal_enb10: '""' + iq_imbal_enb11: '""' + iq_imbal_enb12: '""' + iq_imbal_enb13: '""' + iq_imbal_enb14: '""' + iq_imbal_enb15: '""' + iq_imbal_enb16: '""' + iq_imbal_enb17: '""' + iq_imbal_enb18: '""' + iq_imbal_enb19: '""' + iq_imbal_enb2: '""' + iq_imbal_enb20: '""' + iq_imbal_enb21: '""' + iq_imbal_enb22: '""' + iq_imbal_enb23: '""' + iq_imbal_enb24: '""' + iq_imbal_enb25: '""' + iq_imbal_enb26: '""' + iq_imbal_enb27: '""' + iq_imbal_enb28: '""' + iq_imbal_enb29: '""' + iq_imbal_enb3: '""' + iq_imbal_enb30: '""' + iq_imbal_enb31: '""' + iq_imbal_enb4: '""' + iq_imbal_enb5: '""' + iq_imbal_enb6: '""' + iq_imbal_enb7: '""' + iq_imbal_enb8: '""' + iq_imbal_enb9: '""' + lo_export0: 'False' + lo_export1: 'False' + lo_export10: 'False' + lo_export11: 'False' + lo_export12: 'False' + lo_export13: 'False' + lo_export14: 'False' + lo_export15: 'False' + lo_export16: 'False' + lo_export17: 'False' + lo_export18: 'False' + lo_export19: 'False' + lo_export2: 'False' + lo_export20: 'False' + lo_export21: 'False' + lo_export22: 'False' + lo_export23: 'False' + lo_export24: 'False' + lo_export25: 'False' + lo_export26: 'False' + lo_export27: 'False' + lo_export28: 'False' + lo_export29: 'False' + lo_export3: 'False' + lo_export30: 'False' + lo_export31: 'False' + lo_export4: 'False' + lo_export5: 'False' + lo_export6: 'False' + lo_export7: 'False' + lo_export8: 'False' + lo_export9: 'False' + lo_source0: internal + lo_source1: internal + lo_source10: internal + lo_source11: internal + lo_source12: internal + lo_source13: internal + lo_source14: internal + lo_source15: internal + lo_source16: internal + lo_source17: internal + lo_source18: internal + lo_source19: internal + lo_source2: internal + lo_source20: internal + lo_source21: internal + lo_source22: internal + lo_source23: internal + lo_source24: internal + lo_source25: internal + lo_source26: internal + lo_source27: internal + lo_source28: internal + lo_source29: internal + lo_source3: internal + lo_source30: internal + lo_source31: internal + lo_source4: internal + lo_source5: internal + lo_source6: internal + lo_source7: internal + lo_source8: internal + lo_source9: internal + maxoutbuf: '0' + minoutbuf: '0' + nchan: '1' + norm_gain0: 'False' + norm_gain1: 'False' + norm_gain10: 'False' + norm_gain11: 'False' + norm_gain12: 'False' + norm_gain13: 'False' + norm_gain14: 'False' + norm_gain15: 'False' + norm_gain16: 'False' + norm_gain17: 'False' + norm_gain18: 'False' + norm_gain19: 'False' + norm_gain2: 'False' + norm_gain20: 'False' + norm_gain21: 'False' + norm_gain22: 'False' + norm_gain23: 'False' + norm_gain24: 'False' + norm_gain25: 'False' + norm_gain26: 'False' + norm_gain27: 'False' + norm_gain28: 'False' + norm_gain29: 'False' + norm_gain3: 'False' + norm_gain30: 'False' + norm_gain31: 'False' + norm_gain4: 'False' + norm_gain5: 'False' + norm_gain6: 'False' + norm_gain7: 'False' + norm_gain8: 'False' + norm_gain9: 'False' + num_mboards: '1' + otw: '' + rx_agc0: Default + rx_agc1: Default + rx_agc10: Default + rx_agc11: Default + rx_agc12: Default + rx_agc13: Default + rx_agc14: Default + rx_agc15: Default + rx_agc16: Default + rx_agc17: Default + rx_agc18: Default + rx_agc19: Default + rx_agc2: Default + rx_agc20: Default + rx_agc21: Default + rx_agc22: Default + rx_agc23: Default + rx_agc24: Default + rx_agc25: Default + rx_agc26: Default + rx_agc27: Default + rx_agc28: Default + rx_agc29: Default + rx_agc3: Default + rx_agc30: Default + rx_agc31: Default + rx_agc4: Default + rx_agc5: Default + rx_agc6: Default + rx_agc7: Default + rx_agc8: Default + rx_agc9: Default + samp_rate: sample_rate + sd_spec0: rx_usrp_channel + sd_spec1: '' + sd_spec2: '' + sd_spec3: '' + sd_spec4: '' + sd_spec5: '' + sd_spec6: '' + sd_spec7: '' + show_lo_controls: 'False' + stream_args: '' + stream_chans: '[]' + sync: sync + time_source0: '' + time_source1: '' + time_source2: '' + time_source3: '' + time_source4: '' + time_source5: '' + time_source6: '' + time_source7: '' + type: fc32 + states: + bus_sink: false + bus_source: false + bus_structure: null + coordinate: [280, 484] + rotation: 0 + state: enabled + +connections: +- [blocks_complex_to_mag_squared_0, '0', qtgui_time_sink_x_0, '0'] +- [blocks_keep_one_in_n_0, '0', blocks_complex_to_mag_squared_0, '0'] +- [uhd_usrp_source_0, '0', blocks_keep_one_in_n_0, '0'] + +metadata: + file_format: 1 diff --git a/Flow Graph Library/Inspection Flow Graphs/signal_envelope_usrp2.py b/Flow Graph Library/Inspection Flow Graphs/signal_envelope_usrp2.py new file mode 100755 index 00000000..67f4c2ab --- /dev/null +++ b/Flow Graph Library/Inspection Flow Graphs/signal_envelope_usrp2.py @@ -0,0 +1,330 @@ +#!/usr/bin/env python3 +# -*- coding: utf-8 -*- + +# +# SPDX-License-Identifier: GPL-3.0 +# +# GNU Radio Python Flow Graph +# Title: Signal Envelope Usrp2 +# GNU Radio version: 3.10.1.1 + +from packaging.version import Version as StrictVersion + +if __name__ == '__main__': + import ctypes + import sys + if sys.platform.startswith('linux'): + try: + x11 = ctypes.cdll.LoadLibrary('libX11.so') + x11.XInitThreads() + except: + print("Warning: failed to XInitThreads()") + +from PyQt5 import Qt +from PyQt5.QtCore import QObject, pyqtSlot +from gnuradio import qtgui +from gnuradio.filter import firdes +import sip +from gnuradio import blocks +from gnuradio import gr +from gnuradio.fft import window +import sys +import signal +from argparse import ArgumentParser +from gnuradio.eng_arg import eng_float, intx +from gnuradio import eng_notation +from gnuradio import uhd +import time +from gnuradio.qtgui import Range, RangeWidget +from PyQt5 import QtCore + + + +from gnuradio import qtgui + +class signal_envelope_usrp2(gr.top_block, Qt.QWidget): + + def __init__(self): + gr.top_block.__init__(self, "Signal Envelope Usrp2", catch_exceptions=True) + Qt.QWidget.__init__(self) + self.setWindowTitle("Signal Envelope Usrp2") + qtgui.util.check_set_qss() + try: + self.setWindowIcon(Qt.QIcon.fromTheme('gnuradio-grc')) + except: + pass + self.top_scroll_layout = Qt.QVBoxLayout() + self.setLayout(self.top_scroll_layout) + self.top_scroll = Qt.QScrollArea() + self.top_scroll.setFrameStyle(Qt.QFrame.NoFrame) + self.top_scroll_layout.addWidget(self.top_scroll) + self.top_scroll.setWidgetResizable(True) + self.top_widget = Qt.QWidget() + self.top_scroll.setWidget(self.top_widget) + self.top_layout = Qt.QVBoxLayout(self.top_widget) + self.top_grid_layout = Qt.QGridLayout() + self.top_layout.addLayout(self.top_grid_layout) + + self.settings = Qt.QSettings("GNU Radio", "signal_envelope_usrp2") + + try: + if StrictVersion(Qt.qVersion()) < StrictVersion("5.0.0"): + self.restoreGeometry(self.settings.value("geometry").toByteArray()) + else: + self.restoreGeometry(self.settings.value("geometry")) + except: + pass + + ################################################## + # Variables + ################################################## + self.sample_rate = sample_rate = 1e6 + self.rx_usrp_gain = rx_usrp_gain = 30 + self.rx_usrp_channel = rx_usrp_channel = "A:0" + self.rx_usrp_antenna = rx_usrp_antenna = "TX/RX" + self.rx_frequency = rx_frequency = 2412 + self.decimation = decimation = 1 + + ################################################## + # Blocks + ################################################## + # Create the options list + self._sample_rate_options = [1000000.0, 5000000.0, 10000000.0, 20000000.0] + # Create the labels list + self._sample_rate_labels = ['1 MS/s', '5 MS/s', '10 MS/s', '20 MS/s'] + # Create the combo box + self._sample_rate_tool_bar = Qt.QToolBar(self) + self._sample_rate_tool_bar.addWidget(Qt.QLabel("Sample Rate" + ": ")) + self._sample_rate_combo_box = Qt.QComboBox() + self._sample_rate_tool_bar.addWidget(self._sample_rate_combo_box) + for _label in self._sample_rate_labels: self._sample_rate_combo_box.addItem(_label) + self._sample_rate_callback = lambda i: Qt.QMetaObject.invokeMethod(self._sample_rate_combo_box, "setCurrentIndex", Qt.Q_ARG("int", self._sample_rate_options.index(i))) + self._sample_rate_callback(self.sample_rate) + self._sample_rate_combo_box.currentIndexChanged.connect( + lambda i: self.set_sample_rate(self._sample_rate_options[i])) + # Create the radio buttons + self.top_grid_layout.addWidget(self._sample_rate_tool_bar, 0, 0, 1, 1) + for r in range(0, 1): + self.top_grid_layout.setRowStretch(r, 1) + for c in range(0, 1): + self.top_grid_layout.setColumnStretch(c, 1) + self._rx_usrp_gain_range = Range(0, 34, 1, 30, 200) + self._rx_usrp_gain_win = RangeWidget(self._rx_usrp_gain_range, self.set_rx_usrp_gain, " Gain:", "counter_slider", float, QtCore.Qt.Horizontal) + self.top_grid_layout.addWidget(self._rx_usrp_gain_win, 1, 0, 1, 4) + for r in range(1, 2): + self.top_grid_layout.setRowStretch(r, 1) + for c in range(0, 4): + self.top_grid_layout.setColumnStretch(c, 1) + # Create the options list + self._rx_usrp_antenna_options = ['TX/RX', 'RX2'] + # Create the labels list + self._rx_usrp_antenna_labels = ['TX/RX', 'RX2'] + # Create the combo box + self._rx_usrp_antenna_tool_bar = Qt.QToolBar(self) + self._rx_usrp_antenna_tool_bar.addWidget(Qt.QLabel(" Antenna" + ": ")) + self._rx_usrp_antenna_combo_box = Qt.QComboBox() + self._rx_usrp_antenna_tool_bar.addWidget(self._rx_usrp_antenna_combo_box) + for _label in self._rx_usrp_antenna_labels: self._rx_usrp_antenna_combo_box.addItem(_label) + self._rx_usrp_antenna_callback = lambda i: Qt.QMetaObject.invokeMethod(self._rx_usrp_antenna_combo_box, "setCurrentIndex", Qt.Q_ARG("int", self._rx_usrp_antenna_options.index(i))) + self._rx_usrp_antenna_callback(self.rx_usrp_antenna) + self._rx_usrp_antenna_combo_box.currentIndexChanged.connect( + lambda i: self.set_rx_usrp_antenna(self._rx_usrp_antenna_options[i])) + # Create the radio buttons + self.top_grid_layout.addWidget(self._rx_usrp_antenna_tool_bar, 0, 1, 1, 1) + for r in range(0, 1): + self.top_grid_layout.setRowStretch(r, 1) + for c in range(1, 2): + self.top_grid_layout.setColumnStretch(c, 1) + self._rx_frequency_range = Range(50, 6000, .1, 2412, 200) + self._rx_frequency_win = RangeWidget(self._rx_frequency_range, self.set_rx_frequency, " Freq. (MHz):", "counter_slider", float, QtCore.Qt.Horizontal) + self.top_grid_layout.addWidget(self._rx_frequency_win, 2, 0, 1, 4) + for r in range(2, 3): + self.top_grid_layout.setRowStretch(r, 1) + for c in range(0, 4): + self.top_grid_layout.setColumnStretch(c, 1) + # Create the options list + self._decimation_options = [1, 10, 100, 1000] + # Create the labels list + self._decimation_labels = ['1', '10', '100', '1000'] + # Create the combo box + self._decimation_tool_bar = Qt.QToolBar(self) + self._decimation_tool_bar.addWidget(Qt.QLabel(" Keep 1 in N" + ": ")) + self._decimation_combo_box = Qt.QComboBox() + self._decimation_tool_bar.addWidget(self._decimation_combo_box) + for _label in self._decimation_labels: self._decimation_combo_box.addItem(_label) + self._decimation_callback = lambda i: Qt.QMetaObject.invokeMethod(self._decimation_combo_box, "setCurrentIndex", Qt.Q_ARG("int", self._decimation_options.index(i))) + self._decimation_callback(self.decimation) + self._decimation_combo_box.currentIndexChanged.connect( + lambda i: self.set_decimation(self._decimation_options[i])) + # Create the radio buttons + self.top_grid_layout.addWidget(self._decimation_tool_bar, 0, 2, 1, 1) + for r in range(0, 1): + self.top_grid_layout.setRowStretch(r, 1) + for c in range(2, 3): + self.top_grid_layout.setColumnStretch(c, 1) + self.uhd_usrp_source_0 = uhd.usrp_source( + ",".join(('', "")), + uhd.stream_args( + cpu_format="fc32", + args='', + channels=list(range(0,1)), + ), + ) + self.uhd_usrp_source_0.set_subdev_spec(rx_usrp_channel, 0) + self.uhd_usrp_source_0.set_samp_rate(sample_rate) + self.uhd_usrp_source_0.set_time_unknown_pps(uhd.time_spec(0)) + + self.uhd_usrp_source_0.set_center_freq(rx_frequency*1e6, 0) + self.uhd_usrp_source_0.set_antenna(rx_usrp_antenna, 0) + self.uhd_usrp_source_0.set_gain(rx_usrp_gain, 0) + self.qtgui_time_sink_x_0 = qtgui.time_sink_f( + 100000, #size + sample_rate/decimation, #samp_rate + "", #name + 1, #number of inputs + None # parent + ) + self.qtgui_time_sink_x_0.set_update_time(0.1) + self.qtgui_time_sink_x_0.set_y_axis(-.1, 1) + + self.qtgui_time_sink_x_0.set_y_label('Amplitude', "") + + self.qtgui_time_sink_x_0.enable_tags(True) + self.qtgui_time_sink_x_0.set_trigger_mode(qtgui.TRIG_MODE_FREE, qtgui.TRIG_SLOPE_POS, 0.005, 0, 0, "") + self.qtgui_time_sink_x_0.enable_autoscale(False) + self.qtgui_time_sink_x_0.enable_grid(True) + self.qtgui_time_sink_x_0.enable_axis_labels(True) + self.qtgui_time_sink_x_0.enable_control_panel(False) + self.qtgui_time_sink_x_0.enable_stem_plot(False) + + + labels = ['', '', '', '', '', + '', '', '', '', ''] + widths = [1, 1, 1, 1, 1, + 1, 1, 1, 1, 1] + colors = ['blue', 'red', 'green', 'black', 'cyan', + 'magenta', 'yellow', 'dark red', 'dark green', 'dark blue'] + alphas = [1.0, 1.0, 1.0, 1.0, 1.0, + 1.0, 1.0, 1.0, 1.0, 1.0] + styles = [1, 1, 1, 1, 1, + 1, 1, 1, 1, 1] + markers = [-1, -1, -1, -1, -1, + -1, -1, -1, -1, -1] + + + for i in range(1): + if len(labels[i]) == 0: + self.qtgui_time_sink_x_0.set_line_label(i, "Data {0}".format(i)) + else: + self.qtgui_time_sink_x_0.set_line_label(i, labels[i]) + self.qtgui_time_sink_x_0.set_line_width(i, widths[i]) + self.qtgui_time_sink_x_0.set_line_color(i, colors[i]) + self.qtgui_time_sink_x_0.set_line_style(i, styles[i]) + self.qtgui_time_sink_x_0.set_line_marker(i, markers[i]) + self.qtgui_time_sink_x_0.set_line_alpha(i, alphas[i]) + + self._qtgui_time_sink_x_0_win = sip.wrapinstance(self.qtgui_time_sink_x_0.qwidget(), Qt.QWidget) + self.top_grid_layout.addWidget(self._qtgui_time_sink_x_0_win, 3, 0, 20, 4) + for r in range(3, 23): + self.top_grid_layout.setRowStretch(r, 1) + for c in range(0, 4): + self.top_grid_layout.setColumnStretch(c, 1) + self.blocks_keep_one_in_n_0 = blocks.keep_one_in_n(gr.sizeof_gr_complex*1, decimation) + self.blocks_complex_to_mag_squared_0 = blocks.complex_to_mag_squared(1) + + + ################################################## + # Connections + ################################################## + self.connect((self.blocks_complex_to_mag_squared_0, 0), (self.qtgui_time_sink_x_0, 0)) + self.connect((self.blocks_keep_one_in_n_0, 0), (self.blocks_complex_to_mag_squared_0, 0)) + self.connect((self.uhd_usrp_source_0, 0), (self.blocks_keep_one_in_n_0, 0)) + + + def closeEvent(self, event): + self.settings = Qt.QSettings("GNU Radio", "signal_envelope_usrp2") + self.settings.setValue("geometry", self.saveGeometry()) + self.stop() + self.wait() + + event.accept() + + def get_sample_rate(self): + return self.sample_rate + + def set_sample_rate(self, sample_rate): + self.sample_rate = sample_rate + self._sample_rate_callback(self.sample_rate) + self.qtgui_time_sink_x_0.set_samp_rate(self.sample_rate/self.decimation) + self.uhd_usrp_source_0.set_samp_rate(self.sample_rate) + + def get_rx_usrp_gain(self): + return self.rx_usrp_gain + + def set_rx_usrp_gain(self, rx_usrp_gain): + self.rx_usrp_gain = rx_usrp_gain + self.uhd_usrp_source_0.set_gain(self.rx_usrp_gain, 0) + + def get_rx_usrp_channel(self): + return self.rx_usrp_channel + + def set_rx_usrp_channel(self, rx_usrp_channel): + self.rx_usrp_channel = rx_usrp_channel + + def get_rx_usrp_antenna(self): + return self.rx_usrp_antenna + + def set_rx_usrp_antenna(self, rx_usrp_antenna): + self.rx_usrp_antenna = rx_usrp_antenna + self._rx_usrp_antenna_callback(self.rx_usrp_antenna) + self.uhd_usrp_source_0.set_antenna(self.rx_usrp_antenna, 0) + + def get_rx_frequency(self): + return self.rx_frequency + + def set_rx_frequency(self, rx_frequency): + self.rx_frequency = rx_frequency + self.uhd_usrp_source_0.set_center_freq(self.rx_frequency*1e6, 0) + + def get_decimation(self): + return self.decimation + + def set_decimation(self, decimation): + self.decimation = decimation + self._decimation_callback(self.decimation) + self.blocks_keep_one_in_n_0.set_n(self.decimation) + self.qtgui_time_sink_x_0.set_samp_rate(self.sample_rate/self.decimation) + + + + +def main(top_block_cls=signal_envelope_usrp2, options=None): + + if StrictVersion("4.5.0") <= StrictVersion(Qt.qVersion()) < StrictVersion("5.0.0"): + style = gr.prefs().get_string('qtgui', 'style', 'raster') + Qt.QApplication.setGraphicsSystem(style) + qapp = Qt.QApplication(sys.argv) + + tb = top_block_cls() + + tb.start() + + tb.show() + + def sig_handler(sig=None, frame=None): + tb.stop() + tb.wait() + + Qt.QApplication.quit() + + signal.signal(signal.SIGINT, sig_handler) + signal.signal(signal.SIGTERM, sig_handler) + + timer = Qt.QTimer() + timer.start(500) + timer.timeout.connect(lambda: None) + + qapp.exec_() + +if __name__ == '__main__': + main() diff --git a/Flow Graph Library/Inspection Flow Graphs/signal_envelope_usrp_n2xx.grc b/Flow Graph Library/Inspection Flow Graphs/signal_envelope_usrp_n2xx.grc new file mode 100644 index 00000000..13b354a2 --- /dev/null +++ b/Flow Graph Library/Inspection Flow Graphs/signal_envelope_usrp_n2xx.grc @@ -0,0 +1,697 @@ +options: + parameters: + author: '' + category: Custom + cmake_opt: '' + comment: '' + copyright: '' + description: '' + gen_cmake: 'On' + gen_linking: dynamic + generate_options: qt_gui + hier_block_src_path: '.:' + id: signal_envelope_usrp_n2xx + max_nouts: '0' + output_language: python + placement: (0,0) + qt_qss_theme: '' + realtime_scheduling: '' + run: 'True' + run_command: '{python} -u {filename}' + run_options: prompt + sizing_mode: fixed + thread_safe_setters: '' + title: '' + window_size: 1280, 1024 + states: + bus_sink: false + bus_source: false + bus_structure: null + coordinate: [10, 10] + rotation: 0 + state: enabled + +blocks: +- name: decimation + id: variable_qtgui_chooser + parameters: + comment: '' + gui_hint: 0,2,1,1 + label: ' Keep 1 in N' + label0: '' + label1: '' + label2: '' + label3: '' + label4: '' + labels: '["1","10","100","1000"]' + num_opts: '0' + option1: '1' + option2: '2' + option3: '3' + option4: '4' + options: '[1,10,100,1000]' + orient: Qt.QVBoxLayout + type: int + value: '1' + widget: combo_box + states: + bus_sink: false + bus_source: false + bus_structure: null + coordinate: [232, 276] + rotation: 0 + state: enabled +- name: ip_address + id: variable + parameters: + comment: '' + value: '"192.168.140.2"' + states: + bus_sink: false + bus_source: false + bus_structure: null + coordinate: [8, 140] + rotation: 0 + state: disabled +- name: rx_frequency + id: variable_qtgui_range + parameters: + comment: '' + gui_hint: 2,0,1,4 + label: ' Freq. (MHz):' + min_len: '200' + orient: Qt.Horizontal + rangeType: float + start: '50' + step: '.1' + stop: '6000' + value: '2412' + widget: counter_slider + states: + bus_sink: false + bus_source: false + bus_structure: null + coordinate: [400, 148] + rotation: 0 + state: enabled +- name: rx_usrp_antenna + id: variable_qtgui_chooser + parameters: + comment: '' + gui_hint: 0,1,1,1 + label: ' Antenna' + label0: '' + label1: '' + label2: '' + label3: '' + label4: '' + labels: '["TX/RX", "RX2"]' + num_opts: '0' + option1: '1' + option2: '2' + option3: '3' + option4: '4' + options: '["TX/RX", "RX2"]' + orient: Qt.QVBoxLayout + type: string + value: '"TX/RX"' + widget: combo_box + states: + bus_sink: false + bus_source: false + bus_structure: null + coordinate: [232, 148] + rotation: 0 + state: enabled +- name: rx_usrp_channel + id: variable + parameters: + comment: '' + value: '"A:0"' + states: + bus_sink: false + bus_source: false + bus_structure: null + coordinate: [8, 76] + rotation: 0 + state: enabled +- name: rx_usrp_gain + id: variable_qtgui_range + parameters: + comment: '' + gui_hint: 1,0,1,4 + label: ' Gain:' + min_len: '200' + orient: Qt.Horizontal + rangeType: float + start: '0' + step: '1' + stop: '34' + value: '30' + widget: counter_slider + states: + bus_sink: false + bus_source: false + bus_structure: null + coordinate: [400, 20] + rotation: 0 + state: enabled +- name: sample_rate + id: variable_qtgui_chooser + parameters: + comment: '' + gui_hint: 0,0,1,1 + label: Sample Rate + label0: '' + label1: '' + label2: '' + label3: '' + label4: '' + labels: '["1 MS/s", "5 MS/s", "10 MS/s", "20 MS/s"]' + num_opts: '0' + option1: '1' + option2: '2' + option3: '3' + option4: '4' + options: '[1e6, 5e6, 10e6, 20e6]' + orient: Qt.QVBoxLayout + type: real + value: 1e6 + widget: combo_box + states: + bus_sink: false + bus_source: false + bus_structure: null + coordinate: [232, 20] + rotation: 0 + state: enabled +- name: blocks_complex_to_mag_squared_0 + id: blocks_complex_to_mag_squared + parameters: + affinity: '' + alias: '' + comment: '' + maxoutbuf: '0' + minoutbuf: '0' + vlen: '1' + states: + bus_sink: false + bus_source: false + bus_structure: null + coordinate: [784, 520] + rotation: 0 + state: enabled +- name: blocks_keep_one_in_n_0 + id: blocks_keep_one_in_n + parameters: + affinity: '' + alias: '' + comment: '' + maxoutbuf: '0' + minoutbuf: '0' + n: decimation + type: complex + vlen: '1' + states: + bus_sink: false + bus_source: false + bus_structure: null + coordinate: [616, 520] + rotation: 0 + state: enabled +- name: qtgui_time_sink_x_0 + id: qtgui_time_sink_x + parameters: + affinity: '' + alias: '' + alpha1: '1.0' + alpha10: '1.0' + alpha2: '1.0' + alpha3: '1.0' + alpha4: '1.0' + alpha5: '1.0' + alpha6: '1.0' + alpha7: '1.0' + alpha8: '1.0' + alpha9: '1.0' + autoscale: 'False' + axislabels: 'True' + color1: blue + color10: dark blue + color2: red + color3: green + color4: black + color5: cyan + color6: magenta + color7: yellow + color8: dark red + color9: dark green + comment: '' + ctrlpanel: 'False' + entags: 'True' + grid: 'True' + gui_hint: 3,0,20,4 + label1: '' + label10: '' + label2: '' + label3: '' + label4: '' + label5: '' + label6: '' + label7: '' + label8: '' + label9: '' + legend: 'True' + marker1: '-1' + marker10: '-1' + marker2: '-1' + marker3: '-1' + marker4: '-1' + marker5: '-1' + marker6: '-1' + marker7: '-1' + marker8: '-1' + marker9: '-1' + name: '""' + nconnections: '1' + size: '100000' + srate: sample_rate/decimation + stemplot: 'False' + style1: '1' + style10: '1' + style2: '1' + style3: '1' + style4: '1' + style5: '1' + style6: '1' + style7: '1' + style8: '1' + style9: '1' + tr_chan: '0' + tr_delay: '0' + tr_level: '0.005' + tr_mode: qtgui.TRIG_MODE_FREE + tr_slope: qtgui.TRIG_SLOPE_POS + tr_tag: '""' + type: float + update_time: '0.1' + width1: '1' + width10: '1' + width2: '1' + width3: '1' + width4: '1' + width5: '1' + width6: '1' + width7: '1' + width8: '1' + width9: '1' + ylabel: Amplitude + ymax: '1' + ymin: -.1 + yunit: '""' + states: + bus_sink: false + bus_source: false + bus_structure: null + coordinate: [968, 500] + rotation: 0 + state: enabled +- name: uhd_usrp_source_0 + id: uhd_usrp_source + parameters: + affinity: '' + alias: '' + ant0: rx_usrp_antenna + ant1: '' + ant10: '' + ant11: '' + ant12: '' + ant13: '' + ant14: '' + ant15: '' + ant16: '' + ant17: '' + ant18: '' + ant19: '' + ant2: '' + ant20: '' + ant21: '' + ant22: '' + ant23: '' + ant24: '' + ant25: '' + ant26: '' + ant27: '' + ant28: '' + ant29: '' + ant3: '' + ant30: '' + ant31: '' + ant4: '' + ant5: '' + ant6: '' + ant7: '' + ant8: '' + ant9: '' + bw0: '0' + bw1: '0' + bw10: '0' + bw11: '0' + bw12: '0' + bw13: '0' + bw14: '0' + bw15: '0' + bw16: '0' + bw17: '0' + bw18: '0' + bw19: '0' + bw2: '0' + bw20: '0' + bw21: '0' + bw22: '0' + bw23: '0' + bw24: '0' + bw25: '0' + bw26: '0' + bw27: '0' + bw28: '0' + bw29: '0' + bw3: '0' + bw30: '0' + bw31: '0' + bw4: '0' + bw5: '0' + bw6: '0' + bw7: '0' + bw8: '0' + bw9: '0' + center_freq0: rx_frequency*1e6 + center_freq1: '0' + center_freq10: '0' + center_freq11: '0' + center_freq12: '0' + center_freq13: '0' + center_freq14: '0' + center_freq15: '0' + center_freq16: '0' + center_freq17: '0' + center_freq18: '0' + center_freq19: '0' + center_freq2: '0' + center_freq20: '0' + center_freq21: '0' + center_freq22: '0' + center_freq23: '0' + center_freq24: '0' + center_freq25: '0' + center_freq26: '0' + center_freq27: '0' + center_freq28: '0' + center_freq29: '0' + center_freq3: '0' + center_freq30: '0' + center_freq31: '0' + center_freq4: '0' + center_freq5: '0' + center_freq6: '0' + center_freq7: '0' + center_freq8: '0' + center_freq9: '0' + clock_rate: '0.0' + clock_source0: '' + clock_source1: '' + clock_source2: '' + clock_source3: '' + clock_source4: '' + clock_source5: '' + clock_source6: '' + clock_source7: '' + comment: '' + dc_offs_enb0: '""' + dc_offs_enb1: '""' + dc_offs_enb10: '""' + dc_offs_enb11: '""' + dc_offs_enb12: '""' + dc_offs_enb13: '""' + dc_offs_enb14: '""' + dc_offs_enb15: '""' + dc_offs_enb16: '""' + dc_offs_enb17: '""' + dc_offs_enb18: '""' + dc_offs_enb19: '""' + dc_offs_enb2: '""' + dc_offs_enb20: '""' + dc_offs_enb21: '""' + dc_offs_enb22: '""' + dc_offs_enb23: '""' + dc_offs_enb24: '""' + dc_offs_enb25: '""' + dc_offs_enb26: '""' + dc_offs_enb27: '""' + dc_offs_enb28: '""' + dc_offs_enb29: '""' + dc_offs_enb3: '""' + dc_offs_enb30: '""' + dc_offs_enb31: '""' + dc_offs_enb4: '""' + dc_offs_enb5: '""' + dc_offs_enb6: '""' + dc_offs_enb7: '""' + dc_offs_enb8: '""' + dc_offs_enb9: '""' + dev_addr: '' + dev_args: '""' + gain0: rx_usrp_gain + gain1: '0' + gain10: '0' + gain11: '0' + gain12: '0' + gain13: '0' + gain14: '0' + gain15: '0' + gain16: '0' + gain17: '0' + gain18: '0' + gain19: '0' + gain2: '0' + gain20: '0' + gain21: '0' + gain22: '0' + gain23: '0' + gain24: '0' + gain25: '0' + gain26: '0' + gain27: '0' + gain28: '0' + gain29: '0' + gain3: '0' + gain30: '0' + gain31: '0' + gain4: '0' + gain5: '0' + gain6: '0' + gain7: '0' + gain8: '0' + gain9: '0' + iq_imbal_enb0: '""' + iq_imbal_enb1: '""' + iq_imbal_enb10: '""' + iq_imbal_enb11: '""' + iq_imbal_enb12: '""' + iq_imbal_enb13: '""' + iq_imbal_enb14: '""' + iq_imbal_enb15: '""' + iq_imbal_enb16: '""' + iq_imbal_enb17: '""' + iq_imbal_enb18: '""' + iq_imbal_enb19: '""' + iq_imbal_enb2: '""' + iq_imbal_enb20: '""' + iq_imbal_enb21: '""' + iq_imbal_enb22: '""' + iq_imbal_enb23: '""' + iq_imbal_enb24: '""' + iq_imbal_enb25: '""' + iq_imbal_enb26: '""' + iq_imbal_enb27: '""' + iq_imbal_enb28: '""' + iq_imbal_enb29: '""' + iq_imbal_enb3: '""' + iq_imbal_enb30: '""' + iq_imbal_enb31: '""' + iq_imbal_enb4: '""' + iq_imbal_enb5: '""' + iq_imbal_enb6: '""' + iq_imbal_enb7: '""' + iq_imbal_enb8: '""' + iq_imbal_enb9: '""' + lo_export0: 'False' + lo_export1: 'False' + lo_export10: 'False' + lo_export11: 'False' + lo_export12: 'False' + lo_export13: 'False' + lo_export14: 'False' + lo_export15: 'False' + lo_export16: 'False' + lo_export17: 'False' + lo_export18: 'False' + lo_export19: 'False' + lo_export2: 'False' + lo_export20: 'False' + lo_export21: 'False' + lo_export22: 'False' + lo_export23: 'False' + lo_export24: 'False' + lo_export25: 'False' + lo_export26: 'False' + lo_export27: 'False' + lo_export28: 'False' + lo_export29: 'False' + lo_export3: 'False' + lo_export30: 'False' + lo_export31: 'False' + lo_export4: 'False' + lo_export5: 'False' + lo_export6: 'False' + lo_export7: 'False' + lo_export8: 'False' + lo_export9: 'False' + lo_source0: internal + lo_source1: internal + lo_source10: internal + lo_source11: internal + lo_source12: internal + lo_source13: internal + lo_source14: internal + lo_source15: internal + lo_source16: internal + lo_source17: internal + lo_source18: internal + lo_source19: internal + lo_source2: internal + lo_source20: internal + lo_source21: internal + lo_source22: internal + lo_source23: internal + lo_source24: internal + lo_source25: internal + lo_source26: internal + lo_source27: internal + lo_source28: internal + lo_source29: internal + lo_source3: internal + lo_source30: internal + lo_source31: internal + lo_source4: internal + lo_source5: internal + lo_source6: internal + lo_source7: internal + lo_source8: internal + lo_source9: internal + maxoutbuf: '0' + minoutbuf: '0' + nchan: '1' + norm_gain0: 'False' + norm_gain1: 'False' + norm_gain10: 'False' + norm_gain11: 'False' + norm_gain12: 'False' + norm_gain13: 'False' + norm_gain14: 'False' + norm_gain15: 'False' + norm_gain16: 'False' + norm_gain17: 'False' + norm_gain18: 'False' + norm_gain19: 'False' + norm_gain2: 'False' + norm_gain20: 'False' + norm_gain21: 'False' + norm_gain22: 'False' + norm_gain23: 'False' + norm_gain24: 'False' + norm_gain25: 'False' + norm_gain26: 'False' + norm_gain27: 'False' + norm_gain28: 'False' + norm_gain29: 'False' + norm_gain3: 'False' + norm_gain30: 'False' + norm_gain31: 'False' + norm_gain4: 'False' + norm_gain5: 'False' + norm_gain6: 'False' + norm_gain7: 'False' + norm_gain8: 'False' + norm_gain9: 'False' + num_mboards: '1' + otw: '' + rx_agc0: Default + rx_agc1: Default + rx_agc10: Default + rx_agc11: Default + rx_agc12: Default + rx_agc13: Default + rx_agc14: Default + rx_agc15: Default + rx_agc16: Default + rx_agc17: Default + rx_agc18: Default + rx_agc19: Default + rx_agc2: Default + rx_agc20: Default + rx_agc21: Default + rx_agc22: Default + rx_agc23: Default + rx_agc24: Default + rx_agc25: Default + rx_agc26: Default + rx_agc27: Default + rx_agc28: Default + rx_agc29: Default + rx_agc3: Default + rx_agc30: Default + rx_agc31: Default + rx_agc4: Default + rx_agc5: Default + rx_agc6: Default + rx_agc7: Default + rx_agc8: Default + rx_agc9: Default + samp_rate: sample_rate + sd_spec0: rx_usrp_channel + sd_spec1: '' + sd_spec2: '' + sd_spec3: '' + sd_spec4: '' + sd_spec5: '' + sd_spec6: '' + sd_spec7: '' + show_lo_controls: 'False' + stream_args: '' + stream_chans: '[]' + sync: sync + time_source0: '' + time_source1: '' + time_source2: '' + time_source3: '' + time_source4: '' + time_source5: '' + time_source6: '' + time_source7: '' + type: fc32 + states: + bus_sink: false + bus_source: false + bus_structure: null + coordinate: [280, 484] + rotation: 0 + state: enabled + +connections: +- [blocks_complex_to_mag_squared_0, '0', qtgui_time_sink_x_0, '0'] +- [blocks_keep_one_in_n_0, '0', blocks_complex_to_mag_squared_0, '0'] +- [uhd_usrp_source_0, '0', blocks_keep_one_in_n_0, '0'] + +metadata: + file_format: 1 diff --git a/Flow Graph Library/Inspection Flow Graphs/signal_envelope_usrp_n2xx.py b/Flow Graph Library/Inspection Flow Graphs/signal_envelope_usrp_n2xx.py new file mode 100755 index 00000000..8eb49ddd --- /dev/null +++ b/Flow Graph Library/Inspection Flow Graphs/signal_envelope_usrp_n2xx.py @@ -0,0 +1,330 @@ +#!/usr/bin/env python3 +# -*- coding: utf-8 -*- + +# +# SPDX-License-Identifier: GPL-3.0 +# +# GNU Radio Python Flow Graph +# Title: Signal Envelope Usrp N2Xx +# GNU Radio version: 3.10.1.1 + +from packaging.version import Version as StrictVersion + +if __name__ == '__main__': + import ctypes + import sys + if sys.platform.startswith('linux'): + try: + x11 = ctypes.cdll.LoadLibrary('libX11.so') + x11.XInitThreads() + except: + print("Warning: failed to XInitThreads()") + +from PyQt5 import Qt +from PyQt5.QtCore import QObject, pyqtSlot +from gnuradio import qtgui +from gnuradio.filter import firdes +import sip +from gnuradio import blocks +from gnuradio import gr +from gnuradio.fft import window +import sys +import signal +from argparse import ArgumentParser +from gnuradio.eng_arg import eng_float, intx +from gnuradio import eng_notation +from gnuradio import uhd +import time +from gnuradio.qtgui import Range, RangeWidget +from PyQt5 import QtCore + + + +from gnuradio import qtgui + +class signal_envelope_usrp_n2xx(gr.top_block, Qt.QWidget): + + def __init__(self): + gr.top_block.__init__(self, "Signal Envelope Usrp N2Xx", catch_exceptions=True) + Qt.QWidget.__init__(self) + self.setWindowTitle("Signal Envelope Usrp N2Xx") + qtgui.util.check_set_qss() + try: + self.setWindowIcon(Qt.QIcon.fromTheme('gnuradio-grc')) + except: + pass + self.top_scroll_layout = Qt.QVBoxLayout() + self.setLayout(self.top_scroll_layout) + self.top_scroll = Qt.QScrollArea() + self.top_scroll.setFrameStyle(Qt.QFrame.NoFrame) + self.top_scroll_layout.addWidget(self.top_scroll) + self.top_scroll.setWidgetResizable(True) + self.top_widget = Qt.QWidget() + self.top_scroll.setWidget(self.top_widget) + self.top_layout = Qt.QVBoxLayout(self.top_widget) + self.top_grid_layout = Qt.QGridLayout() + self.top_layout.addLayout(self.top_grid_layout) + + self.settings = Qt.QSettings("GNU Radio", "signal_envelope_usrp_n2xx") + + try: + if StrictVersion(Qt.qVersion()) < StrictVersion("5.0.0"): + self.restoreGeometry(self.settings.value("geometry").toByteArray()) + else: + self.restoreGeometry(self.settings.value("geometry")) + except: + pass + + ################################################## + # Variables + ################################################## + self.sample_rate = sample_rate = 1e6 + self.rx_usrp_gain = rx_usrp_gain = 30 + self.rx_usrp_channel = rx_usrp_channel = "A:0" + self.rx_usrp_antenna = rx_usrp_antenna = "TX/RX" + self.rx_frequency = rx_frequency = 2412 + self.decimation = decimation = 1 + + ################################################## + # Blocks + ################################################## + # Create the options list + self._sample_rate_options = [1000000.0, 5000000.0, 10000000.0, 20000000.0] + # Create the labels list + self._sample_rate_labels = ['1 MS/s', '5 MS/s', '10 MS/s', '20 MS/s'] + # Create the combo box + self._sample_rate_tool_bar = Qt.QToolBar(self) + self._sample_rate_tool_bar.addWidget(Qt.QLabel("Sample Rate" + ": ")) + self._sample_rate_combo_box = Qt.QComboBox() + self._sample_rate_tool_bar.addWidget(self._sample_rate_combo_box) + for _label in self._sample_rate_labels: self._sample_rate_combo_box.addItem(_label) + self._sample_rate_callback = lambda i: Qt.QMetaObject.invokeMethod(self._sample_rate_combo_box, "setCurrentIndex", Qt.Q_ARG("int", self._sample_rate_options.index(i))) + self._sample_rate_callback(self.sample_rate) + self._sample_rate_combo_box.currentIndexChanged.connect( + lambda i: self.set_sample_rate(self._sample_rate_options[i])) + # Create the radio buttons + self.top_grid_layout.addWidget(self._sample_rate_tool_bar, 0, 0, 1, 1) + for r in range(0, 1): + self.top_grid_layout.setRowStretch(r, 1) + for c in range(0, 1): + self.top_grid_layout.setColumnStretch(c, 1) + self._rx_usrp_gain_range = Range(0, 34, 1, 30, 200) + self._rx_usrp_gain_win = RangeWidget(self._rx_usrp_gain_range, self.set_rx_usrp_gain, " Gain:", "counter_slider", float, QtCore.Qt.Horizontal) + self.top_grid_layout.addWidget(self._rx_usrp_gain_win, 1, 0, 1, 4) + for r in range(1, 2): + self.top_grid_layout.setRowStretch(r, 1) + for c in range(0, 4): + self.top_grid_layout.setColumnStretch(c, 1) + # Create the options list + self._rx_usrp_antenna_options = ['TX/RX', 'RX2'] + # Create the labels list + self._rx_usrp_antenna_labels = ['TX/RX', 'RX2'] + # Create the combo box + self._rx_usrp_antenna_tool_bar = Qt.QToolBar(self) + self._rx_usrp_antenna_tool_bar.addWidget(Qt.QLabel(" Antenna" + ": ")) + self._rx_usrp_antenna_combo_box = Qt.QComboBox() + self._rx_usrp_antenna_tool_bar.addWidget(self._rx_usrp_antenna_combo_box) + for _label in self._rx_usrp_antenna_labels: self._rx_usrp_antenna_combo_box.addItem(_label) + self._rx_usrp_antenna_callback = lambda i: Qt.QMetaObject.invokeMethod(self._rx_usrp_antenna_combo_box, "setCurrentIndex", Qt.Q_ARG("int", self._rx_usrp_antenna_options.index(i))) + self._rx_usrp_antenna_callback(self.rx_usrp_antenna) + self._rx_usrp_antenna_combo_box.currentIndexChanged.connect( + lambda i: self.set_rx_usrp_antenna(self._rx_usrp_antenna_options[i])) + # Create the radio buttons + self.top_grid_layout.addWidget(self._rx_usrp_antenna_tool_bar, 0, 1, 1, 1) + for r in range(0, 1): + self.top_grid_layout.setRowStretch(r, 1) + for c in range(1, 2): + self.top_grid_layout.setColumnStretch(c, 1) + self._rx_frequency_range = Range(50, 6000, .1, 2412, 200) + self._rx_frequency_win = RangeWidget(self._rx_frequency_range, self.set_rx_frequency, " Freq. (MHz):", "counter_slider", float, QtCore.Qt.Horizontal) + self.top_grid_layout.addWidget(self._rx_frequency_win, 2, 0, 1, 4) + for r in range(2, 3): + self.top_grid_layout.setRowStretch(r, 1) + for c in range(0, 4): + self.top_grid_layout.setColumnStretch(c, 1) + # Create the options list + self._decimation_options = [1, 10, 100, 1000] + # Create the labels list + self._decimation_labels = ['1', '10', '100', '1000'] + # Create the combo box + self._decimation_tool_bar = Qt.QToolBar(self) + self._decimation_tool_bar.addWidget(Qt.QLabel(" Keep 1 in N" + ": ")) + self._decimation_combo_box = Qt.QComboBox() + self._decimation_tool_bar.addWidget(self._decimation_combo_box) + for _label in self._decimation_labels: self._decimation_combo_box.addItem(_label) + self._decimation_callback = lambda i: Qt.QMetaObject.invokeMethod(self._decimation_combo_box, "setCurrentIndex", Qt.Q_ARG("int", self._decimation_options.index(i))) + self._decimation_callback(self.decimation) + self._decimation_combo_box.currentIndexChanged.connect( + lambda i: self.set_decimation(self._decimation_options[i])) + # Create the radio buttons + self.top_grid_layout.addWidget(self._decimation_tool_bar, 0, 2, 1, 1) + for r in range(0, 1): + self.top_grid_layout.setRowStretch(r, 1) + for c in range(2, 3): + self.top_grid_layout.setColumnStretch(c, 1) + self.uhd_usrp_source_0 = uhd.usrp_source( + ",".join(('', "")), + uhd.stream_args( + cpu_format="fc32", + args='', + channels=list(range(0,1)), + ), + ) + self.uhd_usrp_source_0.set_subdev_spec(rx_usrp_channel, 0) + self.uhd_usrp_source_0.set_samp_rate(sample_rate) + self.uhd_usrp_source_0.set_time_unknown_pps(uhd.time_spec(0)) + + self.uhd_usrp_source_0.set_center_freq(rx_frequency*1e6, 0) + self.uhd_usrp_source_0.set_antenna(rx_usrp_antenna, 0) + self.uhd_usrp_source_0.set_gain(rx_usrp_gain, 0) + self.qtgui_time_sink_x_0 = qtgui.time_sink_f( + 100000, #size + sample_rate/decimation, #samp_rate + "", #name + 1, #number of inputs + None # parent + ) + self.qtgui_time_sink_x_0.set_update_time(0.1) + self.qtgui_time_sink_x_0.set_y_axis(-.1, 1) + + self.qtgui_time_sink_x_0.set_y_label('Amplitude', "") + + self.qtgui_time_sink_x_0.enable_tags(True) + self.qtgui_time_sink_x_0.set_trigger_mode(qtgui.TRIG_MODE_FREE, qtgui.TRIG_SLOPE_POS, 0.005, 0, 0, "") + self.qtgui_time_sink_x_0.enable_autoscale(False) + self.qtgui_time_sink_x_0.enable_grid(True) + self.qtgui_time_sink_x_0.enable_axis_labels(True) + self.qtgui_time_sink_x_0.enable_control_panel(False) + self.qtgui_time_sink_x_0.enable_stem_plot(False) + + + labels = ['', '', '', '', '', + '', '', '', '', ''] + widths = [1, 1, 1, 1, 1, + 1, 1, 1, 1, 1] + colors = ['blue', 'red', 'green', 'black', 'cyan', + 'magenta', 'yellow', 'dark red', 'dark green', 'dark blue'] + alphas = [1.0, 1.0, 1.0, 1.0, 1.0, + 1.0, 1.0, 1.0, 1.0, 1.0] + styles = [1, 1, 1, 1, 1, + 1, 1, 1, 1, 1] + markers = [-1, -1, -1, -1, -1, + -1, -1, -1, -1, -1] + + + for i in range(1): + if len(labels[i]) == 0: + self.qtgui_time_sink_x_0.set_line_label(i, "Data {0}".format(i)) + else: + self.qtgui_time_sink_x_0.set_line_label(i, labels[i]) + self.qtgui_time_sink_x_0.set_line_width(i, widths[i]) + self.qtgui_time_sink_x_0.set_line_color(i, colors[i]) + self.qtgui_time_sink_x_0.set_line_style(i, styles[i]) + self.qtgui_time_sink_x_0.set_line_marker(i, markers[i]) + self.qtgui_time_sink_x_0.set_line_alpha(i, alphas[i]) + + self._qtgui_time_sink_x_0_win = sip.wrapinstance(self.qtgui_time_sink_x_0.qwidget(), Qt.QWidget) + self.top_grid_layout.addWidget(self._qtgui_time_sink_x_0_win, 3, 0, 20, 4) + for r in range(3, 23): + self.top_grid_layout.setRowStretch(r, 1) + for c in range(0, 4): + self.top_grid_layout.setColumnStretch(c, 1) + self.blocks_keep_one_in_n_0 = blocks.keep_one_in_n(gr.sizeof_gr_complex*1, decimation) + self.blocks_complex_to_mag_squared_0 = blocks.complex_to_mag_squared(1) + + + ################################################## + # Connections + ################################################## + self.connect((self.blocks_complex_to_mag_squared_0, 0), (self.qtgui_time_sink_x_0, 0)) + self.connect((self.blocks_keep_one_in_n_0, 0), (self.blocks_complex_to_mag_squared_0, 0)) + self.connect((self.uhd_usrp_source_0, 0), (self.blocks_keep_one_in_n_0, 0)) + + + def closeEvent(self, event): + self.settings = Qt.QSettings("GNU Radio", "signal_envelope_usrp_n2xx") + self.settings.setValue("geometry", self.saveGeometry()) + self.stop() + self.wait() + + event.accept() + + def get_sample_rate(self): + return self.sample_rate + + def set_sample_rate(self, sample_rate): + self.sample_rate = sample_rate + self._sample_rate_callback(self.sample_rate) + self.qtgui_time_sink_x_0.set_samp_rate(self.sample_rate/self.decimation) + self.uhd_usrp_source_0.set_samp_rate(self.sample_rate) + + def get_rx_usrp_gain(self): + return self.rx_usrp_gain + + def set_rx_usrp_gain(self, rx_usrp_gain): + self.rx_usrp_gain = rx_usrp_gain + self.uhd_usrp_source_0.set_gain(self.rx_usrp_gain, 0) + + def get_rx_usrp_channel(self): + return self.rx_usrp_channel + + def set_rx_usrp_channel(self, rx_usrp_channel): + self.rx_usrp_channel = rx_usrp_channel + + def get_rx_usrp_antenna(self): + return self.rx_usrp_antenna + + def set_rx_usrp_antenna(self, rx_usrp_antenna): + self.rx_usrp_antenna = rx_usrp_antenna + self._rx_usrp_antenna_callback(self.rx_usrp_antenna) + self.uhd_usrp_source_0.set_antenna(self.rx_usrp_antenna, 0) + + def get_rx_frequency(self): + return self.rx_frequency + + def set_rx_frequency(self, rx_frequency): + self.rx_frequency = rx_frequency + self.uhd_usrp_source_0.set_center_freq(self.rx_frequency*1e6, 0) + + def get_decimation(self): + return self.decimation + + def set_decimation(self, decimation): + self.decimation = decimation + self._decimation_callback(self.decimation) + self.blocks_keep_one_in_n_0.set_n(self.decimation) + self.qtgui_time_sink_x_0.set_samp_rate(self.sample_rate/self.decimation) + + + + +def main(top_block_cls=signal_envelope_usrp_n2xx, options=None): + + if StrictVersion("4.5.0") <= StrictVersion(Qt.qVersion()) < StrictVersion("5.0.0"): + style = gr.prefs().get_string('qtgui', 'style', 'raster') + Qt.QApplication.setGraphicsSystem(style) + qapp = Qt.QApplication(sys.argv) + + tb = top_block_cls() + + tb.start() + + tb.show() + + def sig_handler(sig=None, frame=None): + tb.stop() + tb.wait() + + Qt.QApplication.quit() + + signal.signal(signal.SIGINT, sig_handler) + signal.signal(signal.SIGTERM, sig_handler) + + timer = Qt.QTimer() + timer.start(500) + timer.timeout.connect(lambda: None) + + qapp.exec_() + +if __name__ == '__main__': + main() diff --git a/Flow Graph Library/Inspection Flow Graphs/time_sink_1_10_100_usrp2.grc b/Flow Graph Library/Inspection Flow Graphs/time_sink_1_10_100_usrp2.grc new file mode 100644 index 00000000..eabb37f7 --- /dev/null +++ b/Flow Graph Library/Inspection Flow Graphs/time_sink_1_10_100_usrp2.grc @@ -0,0 +1,866 @@ +options: + parameters: + author: '' + category: Custom + cmake_opt: '' + comment: '' + copyright: '' + description: '' + gen_cmake: 'On' + gen_linking: dynamic + generate_options: qt_gui + hier_block_src_path: '.:' + id: time_sink_1_10_100_usrp2 + max_nouts: '0' + output_language: python + placement: (0,0) + qt_qss_theme: '' + realtime_scheduling: '' + run: 'True' + run_command: '{python} -u {filename}' + run_options: prompt + sizing_mode: fixed + thread_safe_setters: '' + title: '' + window_size: 1280, 1024 + states: + bus_sink: false + bus_source: false + bus_structure: null + coordinate: [10, 10] + rotation: 0 + state: enabled + +blocks: +- name: ip_address + id: variable + parameters: + comment: '' + value: '"192.168.140.2"' + states: + bus_sink: false + bus_source: false + bus_structure: null + coordinate: [8, 148] + rotation: 0 + state: disabled +- name: rx_frequency + id: variable_qtgui_range + parameters: + comment: '' + gui_hint: 2,0,1,4 + label: ' Freq. (MHz):' + min_len: '200' + orient: Qt.Horizontal + rangeType: float + start: '50' + step: '.1' + stop: '6000' + value: '2412' + widget: counter_slider + states: + bus_sink: false + bus_source: false + bus_structure: null + coordinate: [400, 140] + rotation: 0 + state: enabled +- name: rx_usrp_antenna + id: variable_qtgui_chooser + parameters: + comment: '' + gui_hint: 0,1,1,1 + label: ' Antenna' + label0: '' + label1: '' + label2: '' + label3: '' + label4: '' + labels: '["TX/RX", "RX2"]' + num_opts: '0' + option1: '1' + option2: '2' + option3: '3' + option4: '4' + options: '["TX/RX", "RX2"]' + orient: Qt.QVBoxLayout + type: string + value: '"TX/RX"' + widget: combo_box + states: + bus_sink: false + bus_source: false + bus_structure: null + coordinate: [232, 140] + rotation: 0 + state: enabled +- name: rx_usrp_channel + id: variable + parameters: + comment: '' + value: '"A:0"' + states: + bus_sink: false + bus_source: false + bus_structure: null + coordinate: [8, 76] + rotation: 0 + state: enabled +- name: rx_usrp_gain + id: variable_qtgui_range + parameters: + comment: '' + gui_hint: 1,0,1,4 + label: ' Gain:' + min_len: '200' + orient: Qt.Horizontal + rangeType: float + start: '0' + step: '1' + stop: '34' + value: '30' + widget: counter_slider + states: + bus_sink: false + bus_source: false + bus_structure: null + coordinate: [400, 12] + rotation: 0 + state: enabled +- name: sample_rate + id: variable_qtgui_chooser + parameters: + comment: '' + gui_hint: 0,0,1,1 + label: Sample Rate + label0: '' + label1: '' + label2: '' + label3: '' + label4: '' + labels: '["1 MS/s", "5 MS/s", "10 MS/s", "20 MS/s"]' + num_opts: '0' + option1: '1' + option2: '2' + option3: '3' + option4: '4' + options: '[1e6, 5e6, 10e6, 20e6]' + orient: Qt.QVBoxLayout + type: real + value: 1e6 + widget: combo_box + states: + bus_sink: false + bus_source: false + bus_structure: null + coordinate: [232, 12] + rotation: 0 + state: enabled +- name: blocks_keep_one_in_n_0 + id: blocks_keep_one_in_n + parameters: + affinity: '' + alias: '' + comment: '' + maxoutbuf: '0' + minoutbuf: '0' + n: '10' + type: complex + vlen: '1' + states: + bus_sink: false + bus_source: false + bus_structure: null + coordinate: [744, 500] + rotation: 0 + state: enabled +- name: blocks_keep_one_in_n_0_0 + id: blocks_keep_one_in_n + parameters: + affinity: '' + alias: '' + comment: '' + maxoutbuf: '0' + minoutbuf: '0' + n: '100' + type: complex + vlen: '1' + states: + bus_sink: false + bus_source: false + bus_structure: null + coordinate: [744, 604] + rotation: 0 + state: enabled +- name: qtgui_time_sink_x_0 + id: qtgui_time_sink_x + parameters: + affinity: '' + alias: '' + alpha1: '1.0' + alpha10: '1.0' + alpha2: '1.0' + alpha3: '1.0' + alpha4: '1.0' + alpha5: '1.0' + alpha6: '1.0' + alpha7: '1.0' + alpha8: '1.0' + alpha9: '1.0' + autoscale: 'False' + axislabels: 'True' + color1: blue + color10: dark blue + color2: red + color3: green + color4: black + color5: cyan + color6: magenta + color7: yellow + color8: dark red + color9: dark green + comment: '' + ctrlpanel: 'False' + entags: 'True' + grid: 'True' + gui_hint: 3,0,10,4 + label1: '' + label10: '' + label2: '' + label3: '' + label4: '' + label5: '' + label6: '' + label7: '' + label8: '' + label9: '' + legend: 'True' + marker1: '-1' + marker10: '-1' + marker2: '-1' + marker3: '-1' + marker4: '-1' + marker5: '-1' + marker6: '-1' + marker7: '-1' + marker8: '-1' + marker9: '-1' + name: '"1 in 1"' + nconnections: '1' + size: '100000' + srate: sample_rate + stemplot: 'False' + style1: '1' + style10: '1' + style2: '1' + style3: '1' + style4: '1' + style5: '1' + style6: '1' + style7: '1' + style8: '1' + style9: '1' + tr_chan: '0' + tr_delay: '0' + tr_level: '0.005' + tr_mode: qtgui.TRIG_MODE_FREE + tr_slope: qtgui.TRIG_SLOPE_POS + tr_tag: '""' + type: complex + update_time: '0.1' + width1: '1' + width10: '1' + width2: '1' + width3: '1' + width4: '1' + width5: '1' + width6: '1' + width7: '1' + width8: '1' + width9: '1' + ylabel: Amplitude + ymax: '1' + ymin: '-1' + yunit: '""' + states: + bus_sink: false + bus_source: false + bus_structure: null + coordinate: [904, 372] + rotation: 0 + state: enabled +- name: qtgui_time_sink_x_0_0 + id: qtgui_time_sink_x + parameters: + affinity: '' + alias: '' + alpha1: '1.0' + alpha10: '1.0' + alpha2: '1.0' + alpha3: '1.0' + alpha4: '1.0' + alpha5: '1.0' + alpha6: '1.0' + alpha7: '1.0' + alpha8: '1.0' + alpha9: '1.0' + autoscale: 'False' + axislabels: 'True' + color1: blue + color10: dark blue + color2: red + color3: green + color4: black + color5: cyan + color6: magenta + color7: yellow + color8: dark red + color9: dark green + comment: '' + ctrlpanel: 'False' + entags: 'True' + grid: 'True' + gui_hint: 15,0,10,4 + label1: '' + label10: '' + label2: '' + label3: '' + label4: '' + label5: '' + label6: '' + label7: '' + label8: '' + label9: '' + legend: 'True' + marker1: '-1' + marker10: '-1' + marker2: '-1' + marker3: '-1' + marker4: '-1' + marker5: '-1' + marker6: '-1' + marker7: '-1' + marker8: '-1' + marker9: '-1' + name: '"1 in 10"' + nconnections: '1' + size: '100000' + srate: sample_rate + stemplot: 'False' + style1: '1' + style10: '1' + style2: '1' + style3: '1' + style4: '1' + style5: '1' + style6: '1' + style7: '1' + style8: '1' + style9: '1' + tr_chan: '0' + tr_delay: '0' + tr_level: '0.005' + tr_mode: qtgui.TRIG_MODE_FREE + tr_slope: qtgui.TRIG_SLOPE_POS + tr_tag: '""' + type: complex + update_time: '0.1' + width1: '1' + width10: '1' + width2: '1' + width3: '1' + width4: '1' + width5: '1' + width6: '1' + width7: '1' + width8: '1' + width9: '1' + ylabel: Amplitude + ymax: '1' + ymin: '-1' + yunit: '""' + states: + bus_sink: false + bus_source: false + bus_structure: null + coordinate: [904, 476] + rotation: 0 + state: enabled +- name: qtgui_time_sink_x_0_1 + id: qtgui_time_sink_x + parameters: + affinity: '' + alias: '' + alpha1: '1.0' + alpha10: '1.0' + alpha2: '1.0' + alpha3: '1.0' + alpha4: '1.0' + alpha5: '1.0' + alpha6: '1.0' + alpha7: '1.0' + alpha8: '1.0' + alpha9: '1.0' + autoscale: 'False' + axislabels: 'True' + color1: blue + color10: dark blue + color2: red + color3: green + color4: black + color5: cyan + color6: magenta + color7: yellow + color8: dark red + color9: dark green + comment: '' + ctrlpanel: 'False' + entags: 'True' + grid: 'True' + gui_hint: 26,0,10,4 + label1: '' + label10: '' + label2: '' + label3: '' + label4: '' + label5: '' + label6: '' + label7: '' + label8: '' + label9: '' + legend: 'True' + marker1: '-1' + marker10: '-1' + marker2: '-1' + marker3: '-1' + marker4: '-1' + marker5: '-1' + marker6: '-1' + marker7: '-1' + marker8: '-1' + marker9: '-1' + name: '"1 in 100"' + nconnections: '1' + size: '100000' + srate: sample_rate + stemplot: 'False' + style1: '1' + style10: '1' + style2: '1' + style3: '1' + style4: '1' + style5: '1' + style6: '1' + style7: '1' + style8: '1' + style9: '1' + tr_chan: '0' + tr_delay: '0' + tr_level: '0.005' + tr_mode: qtgui.TRIG_MODE_FREE + tr_slope: qtgui.TRIG_SLOPE_POS + tr_tag: '""' + type: complex + update_time: '0.1' + width1: '1' + width10: '1' + width2: '1' + width3: '1' + width4: '1' + width5: '1' + width6: '1' + width7: '1' + width8: '1' + width9: '1' + ylabel: Amplitude + ymax: '1' + ymin: '-1' + yunit: '""' + states: + bus_sink: false + bus_source: false + bus_structure: null + coordinate: [904, 580] + rotation: 0 + state: enabled +- name: uhd_usrp_source_0_0 + id: uhd_usrp_source + parameters: + affinity: '' + alias: '' + ant0: rx_usrp_antenna + ant1: '' + ant10: '' + ant11: '' + ant12: '' + ant13: '' + ant14: '' + ant15: '' + ant16: '' + ant17: '' + ant18: '' + ant19: '' + ant2: '' + ant20: '' + ant21: '' + ant22: '' + ant23: '' + ant24: '' + ant25: '' + ant26: '' + ant27: '' + ant28: '' + ant29: '' + ant3: '' + ant30: '' + ant31: '' + ant4: '' + ant5: '' + ant6: '' + ant7: '' + ant8: '' + ant9: '' + bw0: '0' + bw1: '0' + bw10: '0' + bw11: '0' + bw12: '0' + bw13: '0' + bw14: '0' + bw15: '0' + bw16: '0' + bw17: '0' + bw18: '0' + bw19: '0' + bw2: '0' + bw20: '0' + bw21: '0' + bw22: '0' + bw23: '0' + bw24: '0' + bw25: '0' + bw26: '0' + bw27: '0' + bw28: '0' + bw29: '0' + bw3: '0' + bw30: '0' + bw31: '0' + bw4: '0' + bw5: '0' + bw6: '0' + bw7: '0' + bw8: '0' + bw9: '0' + center_freq0: rx_frequency*1e6 + center_freq1: '0' + center_freq10: '0' + center_freq11: '0' + center_freq12: '0' + center_freq13: '0' + center_freq14: '0' + center_freq15: '0' + center_freq16: '0' + center_freq17: '0' + center_freq18: '0' + center_freq19: '0' + center_freq2: '0' + center_freq20: '0' + center_freq21: '0' + center_freq22: '0' + center_freq23: '0' + center_freq24: '0' + center_freq25: '0' + center_freq26: '0' + center_freq27: '0' + center_freq28: '0' + center_freq29: '0' + center_freq3: '0' + center_freq30: '0' + center_freq31: '0' + center_freq4: '0' + center_freq5: '0' + center_freq6: '0' + center_freq7: '0' + center_freq8: '0' + center_freq9: '0' + clock_rate: '0.0' + clock_source0: '' + clock_source1: '' + clock_source2: '' + clock_source3: '' + clock_source4: '' + clock_source5: '' + clock_source6: '' + clock_source7: '' + comment: '' + dc_offs_enb0: '""' + dc_offs_enb1: '""' + dc_offs_enb10: '""' + dc_offs_enb11: '""' + dc_offs_enb12: '""' + dc_offs_enb13: '""' + dc_offs_enb14: '""' + dc_offs_enb15: '""' + dc_offs_enb16: '""' + dc_offs_enb17: '""' + dc_offs_enb18: '""' + dc_offs_enb19: '""' + dc_offs_enb2: '""' + dc_offs_enb20: '""' + dc_offs_enb21: '""' + dc_offs_enb22: '""' + dc_offs_enb23: '""' + dc_offs_enb24: '""' + dc_offs_enb25: '""' + dc_offs_enb26: '""' + dc_offs_enb27: '""' + dc_offs_enb28: '""' + dc_offs_enb29: '""' + dc_offs_enb3: '""' + dc_offs_enb30: '""' + dc_offs_enb31: '""' + dc_offs_enb4: '""' + dc_offs_enb5: '""' + dc_offs_enb6: '""' + dc_offs_enb7: '""' + dc_offs_enb8: '""' + dc_offs_enb9: '""' + dev_addr: '' + dev_args: '""' + gain0: rx_usrp_gain + gain1: '0' + gain10: '0' + gain11: '0' + gain12: '0' + gain13: '0' + gain14: '0' + gain15: '0' + gain16: '0' + gain17: '0' + gain18: '0' + gain19: '0' + gain2: '0' + gain20: '0' + gain21: '0' + gain22: '0' + gain23: '0' + gain24: '0' + gain25: '0' + gain26: '0' + gain27: '0' + gain28: '0' + gain29: '0' + gain3: '0' + gain30: '0' + gain31: '0' + gain4: '0' + gain5: '0' + gain6: '0' + gain7: '0' + gain8: '0' + gain9: '0' + iq_imbal_enb0: '""' + iq_imbal_enb1: '""' + iq_imbal_enb10: '""' + iq_imbal_enb11: '""' + iq_imbal_enb12: '""' + iq_imbal_enb13: '""' + iq_imbal_enb14: '""' + iq_imbal_enb15: '""' + iq_imbal_enb16: '""' + iq_imbal_enb17: '""' + iq_imbal_enb18: '""' + iq_imbal_enb19: '""' + iq_imbal_enb2: '""' + iq_imbal_enb20: '""' + iq_imbal_enb21: '""' + iq_imbal_enb22: '""' + iq_imbal_enb23: '""' + iq_imbal_enb24: '""' + iq_imbal_enb25: '""' + iq_imbal_enb26: '""' + iq_imbal_enb27: '""' + iq_imbal_enb28: '""' + iq_imbal_enb29: '""' + iq_imbal_enb3: '""' + iq_imbal_enb30: '""' + iq_imbal_enb31: '""' + iq_imbal_enb4: '""' + iq_imbal_enb5: '""' + iq_imbal_enb6: '""' + iq_imbal_enb7: '""' + iq_imbal_enb8: '""' + iq_imbal_enb9: '""' + lo_export0: 'False' + lo_export1: 'False' + lo_export10: 'False' + lo_export11: 'False' + lo_export12: 'False' + lo_export13: 'False' + lo_export14: 'False' + lo_export15: 'False' + lo_export16: 'False' + lo_export17: 'False' + lo_export18: 'False' + lo_export19: 'False' + lo_export2: 'False' + lo_export20: 'False' + lo_export21: 'False' + lo_export22: 'False' + lo_export23: 'False' + lo_export24: 'False' + lo_export25: 'False' + lo_export26: 'False' + lo_export27: 'False' + lo_export28: 'False' + lo_export29: 'False' + lo_export3: 'False' + lo_export30: 'False' + lo_export31: 'False' + lo_export4: 'False' + lo_export5: 'False' + lo_export6: 'False' + lo_export7: 'False' + lo_export8: 'False' + lo_export9: 'False' + lo_source0: internal + lo_source1: internal + lo_source10: internal + lo_source11: internal + lo_source12: internal + lo_source13: internal + lo_source14: internal + lo_source15: internal + lo_source16: internal + lo_source17: internal + lo_source18: internal + lo_source19: internal + lo_source2: internal + lo_source20: internal + lo_source21: internal + lo_source22: internal + lo_source23: internal + lo_source24: internal + lo_source25: internal + lo_source26: internal + lo_source27: internal + lo_source28: internal + lo_source29: internal + lo_source3: internal + lo_source30: internal + lo_source31: internal + lo_source4: internal + lo_source5: internal + lo_source6: internal + lo_source7: internal + lo_source8: internal + lo_source9: internal + maxoutbuf: '0' + minoutbuf: '0' + nchan: '1' + norm_gain0: 'False' + norm_gain1: 'False' + norm_gain10: 'False' + norm_gain11: 'False' + norm_gain12: 'False' + norm_gain13: 'False' + norm_gain14: 'False' + norm_gain15: 'False' + norm_gain16: 'False' + norm_gain17: 'False' + norm_gain18: 'False' + norm_gain19: 'False' + norm_gain2: 'False' + norm_gain20: 'False' + norm_gain21: 'False' + norm_gain22: 'False' + norm_gain23: 'False' + norm_gain24: 'False' + norm_gain25: 'False' + norm_gain26: 'False' + norm_gain27: 'False' + norm_gain28: 'False' + norm_gain29: 'False' + norm_gain3: 'False' + norm_gain30: 'False' + norm_gain31: 'False' + norm_gain4: 'False' + norm_gain5: 'False' + norm_gain6: 'False' + norm_gain7: 'False' + norm_gain8: 'False' + norm_gain9: 'False' + num_mboards: '1' + otw: '' + rx_agc0: Default + rx_agc1: Default + rx_agc10: Default + rx_agc11: Default + rx_agc12: Default + rx_agc13: Default + rx_agc14: Default + rx_agc15: Default + rx_agc16: Default + rx_agc17: Default + rx_agc18: Default + rx_agc19: Default + rx_agc2: Default + rx_agc20: Default + rx_agc21: Default + rx_agc22: Default + rx_agc23: Default + rx_agc24: Default + rx_agc25: Default + rx_agc26: Default + rx_agc27: Default + rx_agc28: Default + rx_agc29: Default + rx_agc3: Default + rx_agc30: Default + rx_agc31: Default + rx_agc4: Default + rx_agc5: Default + rx_agc6: Default + rx_agc7: Default + rx_agc8: Default + rx_agc9: Default + samp_rate: sample_rate + sd_spec0: rx_usrp_channel + sd_spec1: '' + sd_spec2: '' + sd_spec3: '' + sd_spec4: '' + sd_spec5: '' + sd_spec6: '' + sd_spec7: '' + show_lo_controls: 'False' + stream_args: '' + stream_chans: '[]' + sync: sync + time_source0: '' + time_source1: '' + time_source2: '' + time_source3: '' + time_source4: '' + time_source5: '' + time_source6: '' + time_source7: '' + type: fc32 + states: + bus_sink: false + bus_source: false + bus_structure: null + coordinate: [320, 468] + rotation: 0 + state: enabled + +connections: +- [blocks_keep_one_in_n_0, '0', qtgui_time_sink_x_0_0, '0'] +- [blocks_keep_one_in_n_0_0, '0', qtgui_time_sink_x_0_1, '0'] +- [uhd_usrp_source_0_0, '0', blocks_keep_one_in_n_0, '0'] +- [uhd_usrp_source_0_0, '0', blocks_keep_one_in_n_0_0, '0'] +- [uhd_usrp_source_0_0, '0', qtgui_time_sink_x_0, '0'] + +metadata: + file_format: 1 diff --git a/Flow Graph Library/Inspection Flow Graphs/time_sink_1_10_100_usrp2.py b/Flow Graph Library/Inspection Flow Graphs/time_sink_1_10_100_usrp2.py new file mode 100755 index 00000000..ba9f54a5 --- /dev/null +++ b/Flow Graph Library/Inspection Flow Graphs/time_sink_1_10_100_usrp2.py @@ -0,0 +1,417 @@ +#!/usr/bin/env python3 +# -*- coding: utf-8 -*- + +# +# SPDX-License-Identifier: GPL-3.0 +# +# GNU Radio Python Flow Graph +# Title: Time Sink 1 10 100 Usrp2 +# GNU Radio version: 3.10.1.1 + +from packaging.version import Version as StrictVersion + +if __name__ == '__main__': + import ctypes + import sys + if sys.platform.startswith('linux'): + try: + x11 = ctypes.cdll.LoadLibrary('libX11.so') + x11.XInitThreads() + except: + print("Warning: failed to XInitThreads()") + +from PyQt5 import Qt +from PyQt5.QtCore import QObject, pyqtSlot +from gnuradio import qtgui +from gnuradio.filter import firdes +import sip +from gnuradio import blocks +from gnuradio import gr +from gnuradio.fft import window +import sys +import signal +from argparse import ArgumentParser +from gnuradio.eng_arg import eng_float, intx +from gnuradio import eng_notation +from gnuradio import uhd +import time +from gnuradio.qtgui import Range, RangeWidget +from PyQt5 import QtCore + + + +from gnuradio import qtgui + +class time_sink_1_10_100_usrp2(gr.top_block, Qt.QWidget): + + def __init__(self): + gr.top_block.__init__(self, "Time Sink 1 10 100 Usrp2", catch_exceptions=True) + Qt.QWidget.__init__(self) + self.setWindowTitle("Time Sink 1 10 100 Usrp2") + qtgui.util.check_set_qss() + try: + self.setWindowIcon(Qt.QIcon.fromTheme('gnuradio-grc')) + except: + pass + self.top_scroll_layout = Qt.QVBoxLayout() + self.setLayout(self.top_scroll_layout) + self.top_scroll = Qt.QScrollArea() + self.top_scroll.setFrameStyle(Qt.QFrame.NoFrame) + self.top_scroll_layout.addWidget(self.top_scroll) + self.top_scroll.setWidgetResizable(True) + self.top_widget = Qt.QWidget() + self.top_scroll.setWidget(self.top_widget) + self.top_layout = Qt.QVBoxLayout(self.top_widget) + self.top_grid_layout = Qt.QGridLayout() + self.top_layout.addLayout(self.top_grid_layout) + + self.settings = Qt.QSettings("GNU Radio", "time_sink_1_10_100_usrp2") + + try: + if StrictVersion(Qt.qVersion()) < StrictVersion("5.0.0"): + self.restoreGeometry(self.settings.value("geometry").toByteArray()) + else: + self.restoreGeometry(self.settings.value("geometry")) + except: + pass + + ################################################## + # Variables + ################################################## + self.sample_rate = sample_rate = 1e6 + self.rx_usrp_gain = rx_usrp_gain = 30 + self.rx_usrp_channel = rx_usrp_channel = "A:0" + self.rx_usrp_antenna = rx_usrp_antenna = "TX/RX" + self.rx_frequency = rx_frequency = 2412 + + ################################################## + # Blocks + ################################################## + # Create the options list + self._sample_rate_options = [1000000.0, 5000000.0, 10000000.0, 20000000.0] + # Create the labels list + self._sample_rate_labels = ['1 MS/s', '5 MS/s', '10 MS/s', '20 MS/s'] + # Create the combo box + self._sample_rate_tool_bar = Qt.QToolBar(self) + self._sample_rate_tool_bar.addWidget(Qt.QLabel("Sample Rate" + ": ")) + self._sample_rate_combo_box = Qt.QComboBox() + self._sample_rate_tool_bar.addWidget(self._sample_rate_combo_box) + for _label in self._sample_rate_labels: self._sample_rate_combo_box.addItem(_label) + self._sample_rate_callback = lambda i: Qt.QMetaObject.invokeMethod(self._sample_rate_combo_box, "setCurrentIndex", Qt.Q_ARG("int", self._sample_rate_options.index(i))) + self._sample_rate_callback(self.sample_rate) + self._sample_rate_combo_box.currentIndexChanged.connect( + lambda i: self.set_sample_rate(self._sample_rate_options[i])) + # Create the radio buttons + self.top_grid_layout.addWidget(self._sample_rate_tool_bar, 0, 0, 1, 1) + for r in range(0, 1): + self.top_grid_layout.setRowStretch(r, 1) + for c in range(0, 1): + self.top_grid_layout.setColumnStretch(c, 1) + self._rx_usrp_gain_range = Range(0, 34, 1, 30, 200) + self._rx_usrp_gain_win = RangeWidget(self._rx_usrp_gain_range, self.set_rx_usrp_gain, " Gain:", "counter_slider", float, QtCore.Qt.Horizontal) + self.top_grid_layout.addWidget(self._rx_usrp_gain_win, 1, 0, 1, 4) + for r in range(1, 2): + self.top_grid_layout.setRowStretch(r, 1) + for c in range(0, 4): + self.top_grid_layout.setColumnStretch(c, 1) + # Create the options list + self._rx_usrp_antenna_options = ['TX/RX', 'RX2'] + # Create the labels list + self._rx_usrp_antenna_labels = ['TX/RX', 'RX2'] + # Create the combo box + self._rx_usrp_antenna_tool_bar = Qt.QToolBar(self) + self._rx_usrp_antenna_tool_bar.addWidget(Qt.QLabel(" Antenna" + ": ")) + self._rx_usrp_antenna_combo_box = Qt.QComboBox() + self._rx_usrp_antenna_tool_bar.addWidget(self._rx_usrp_antenna_combo_box) + for _label in self._rx_usrp_antenna_labels: self._rx_usrp_antenna_combo_box.addItem(_label) + self._rx_usrp_antenna_callback = lambda i: Qt.QMetaObject.invokeMethod(self._rx_usrp_antenna_combo_box, "setCurrentIndex", Qt.Q_ARG("int", self._rx_usrp_antenna_options.index(i))) + self._rx_usrp_antenna_callback(self.rx_usrp_antenna) + self._rx_usrp_antenna_combo_box.currentIndexChanged.connect( + lambda i: self.set_rx_usrp_antenna(self._rx_usrp_antenna_options[i])) + # Create the radio buttons + self.top_grid_layout.addWidget(self._rx_usrp_antenna_tool_bar, 0, 1, 1, 1) + for r in range(0, 1): + self.top_grid_layout.setRowStretch(r, 1) + for c in range(1, 2): + self.top_grid_layout.setColumnStretch(c, 1) + self._rx_frequency_range = Range(50, 6000, .1, 2412, 200) + self._rx_frequency_win = RangeWidget(self._rx_frequency_range, self.set_rx_frequency, " Freq. (MHz):", "counter_slider", float, QtCore.Qt.Horizontal) + self.top_grid_layout.addWidget(self._rx_frequency_win, 2, 0, 1, 4) + for r in range(2, 3): + self.top_grid_layout.setRowStretch(r, 1) + for c in range(0, 4): + self.top_grid_layout.setColumnStretch(c, 1) + self.uhd_usrp_source_0_0 = uhd.usrp_source( + ",".join(('', "")), + uhd.stream_args( + cpu_format="fc32", + args='', + channels=list(range(0,1)), + ), + ) + self.uhd_usrp_source_0_0.set_subdev_spec(rx_usrp_channel, 0) + self.uhd_usrp_source_0_0.set_samp_rate(sample_rate) + self.uhd_usrp_source_0_0.set_time_unknown_pps(uhd.time_spec(0)) + + self.uhd_usrp_source_0_0.set_center_freq(rx_frequency*1e6, 0) + self.uhd_usrp_source_0_0.set_antenna(rx_usrp_antenna, 0) + self.uhd_usrp_source_0_0.set_gain(rx_usrp_gain, 0) + self.qtgui_time_sink_x_0_1 = qtgui.time_sink_c( + 100000, #size + sample_rate, #samp_rate + "1 in 100", #name + 1, #number of inputs + None # parent + ) + self.qtgui_time_sink_x_0_1.set_update_time(0.1) + self.qtgui_time_sink_x_0_1.set_y_axis(-1, 1) + + self.qtgui_time_sink_x_0_1.set_y_label('Amplitude', "") + + self.qtgui_time_sink_x_0_1.enable_tags(True) + self.qtgui_time_sink_x_0_1.set_trigger_mode(qtgui.TRIG_MODE_FREE, qtgui.TRIG_SLOPE_POS, 0.005, 0, 0, "") + self.qtgui_time_sink_x_0_1.enable_autoscale(False) + self.qtgui_time_sink_x_0_1.enable_grid(True) + self.qtgui_time_sink_x_0_1.enable_axis_labels(True) + self.qtgui_time_sink_x_0_1.enable_control_panel(False) + self.qtgui_time_sink_x_0_1.enable_stem_plot(False) + + + labels = ['', '', '', '', '', + '', '', '', '', ''] + widths = [1, 1, 1, 1, 1, + 1, 1, 1, 1, 1] + colors = ['blue', 'red', 'green', 'black', 'cyan', + 'magenta', 'yellow', 'dark red', 'dark green', 'dark blue'] + alphas = [1.0, 1.0, 1.0, 1.0, 1.0, + 1.0, 1.0, 1.0, 1.0, 1.0] + styles = [1, 1, 1, 1, 1, + 1, 1, 1, 1, 1] + markers = [-1, -1, -1, -1, -1, + -1, -1, -1, -1, -1] + + + for i in range(2): + if len(labels[i]) == 0: + if (i % 2 == 0): + self.qtgui_time_sink_x_0_1.set_line_label(i, "Re{{Data {0}}}".format(i/2)) + else: + self.qtgui_time_sink_x_0_1.set_line_label(i, "Im{{Data {0}}}".format(i/2)) + else: + self.qtgui_time_sink_x_0_1.set_line_label(i, labels[i]) + self.qtgui_time_sink_x_0_1.set_line_width(i, widths[i]) + self.qtgui_time_sink_x_0_1.set_line_color(i, colors[i]) + self.qtgui_time_sink_x_0_1.set_line_style(i, styles[i]) + self.qtgui_time_sink_x_0_1.set_line_marker(i, markers[i]) + self.qtgui_time_sink_x_0_1.set_line_alpha(i, alphas[i]) + + self._qtgui_time_sink_x_0_1_win = sip.wrapinstance(self.qtgui_time_sink_x_0_1.qwidget(), Qt.QWidget) + self.top_grid_layout.addWidget(self._qtgui_time_sink_x_0_1_win, 26, 0, 10, 4) + for r in range(26, 36): + self.top_grid_layout.setRowStretch(r, 1) + for c in range(0, 4): + self.top_grid_layout.setColumnStretch(c, 1) + self.qtgui_time_sink_x_0_0 = qtgui.time_sink_c( + 100000, #size + sample_rate, #samp_rate + "1 in 10", #name + 1, #number of inputs + None # parent + ) + self.qtgui_time_sink_x_0_0.set_update_time(0.1) + self.qtgui_time_sink_x_0_0.set_y_axis(-1, 1) + + self.qtgui_time_sink_x_0_0.set_y_label('Amplitude', "") + + self.qtgui_time_sink_x_0_0.enable_tags(True) + self.qtgui_time_sink_x_0_0.set_trigger_mode(qtgui.TRIG_MODE_FREE, qtgui.TRIG_SLOPE_POS, 0.005, 0, 0, "") + self.qtgui_time_sink_x_0_0.enable_autoscale(False) + self.qtgui_time_sink_x_0_0.enable_grid(True) + self.qtgui_time_sink_x_0_0.enable_axis_labels(True) + self.qtgui_time_sink_x_0_0.enable_control_panel(False) + self.qtgui_time_sink_x_0_0.enable_stem_plot(False) + + + labels = ['', '', '', '', '', + '', '', '', '', ''] + widths = [1, 1, 1, 1, 1, + 1, 1, 1, 1, 1] + colors = ['blue', 'red', 'green', 'black', 'cyan', + 'magenta', 'yellow', 'dark red', 'dark green', 'dark blue'] + alphas = [1.0, 1.0, 1.0, 1.0, 1.0, + 1.0, 1.0, 1.0, 1.0, 1.0] + styles = [1, 1, 1, 1, 1, + 1, 1, 1, 1, 1] + markers = [-1, -1, -1, -1, -1, + -1, -1, -1, -1, -1] + + + for i in range(2): + if len(labels[i]) == 0: + if (i % 2 == 0): + self.qtgui_time_sink_x_0_0.set_line_label(i, "Re{{Data {0}}}".format(i/2)) + else: + self.qtgui_time_sink_x_0_0.set_line_label(i, "Im{{Data {0}}}".format(i/2)) + else: + self.qtgui_time_sink_x_0_0.set_line_label(i, labels[i]) + self.qtgui_time_sink_x_0_0.set_line_width(i, widths[i]) + self.qtgui_time_sink_x_0_0.set_line_color(i, colors[i]) + self.qtgui_time_sink_x_0_0.set_line_style(i, styles[i]) + self.qtgui_time_sink_x_0_0.set_line_marker(i, markers[i]) + self.qtgui_time_sink_x_0_0.set_line_alpha(i, alphas[i]) + + self._qtgui_time_sink_x_0_0_win = sip.wrapinstance(self.qtgui_time_sink_x_0_0.qwidget(), Qt.QWidget) + self.top_grid_layout.addWidget(self._qtgui_time_sink_x_0_0_win, 15, 0, 10, 4) + for r in range(15, 25): + self.top_grid_layout.setRowStretch(r, 1) + for c in range(0, 4): + self.top_grid_layout.setColumnStretch(c, 1) + self.qtgui_time_sink_x_0 = qtgui.time_sink_c( + 100000, #size + sample_rate, #samp_rate + "1 in 1", #name + 1, #number of inputs + None # parent + ) + self.qtgui_time_sink_x_0.set_update_time(0.1) + self.qtgui_time_sink_x_0.set_y_axis(-1, 1) + + self.qtgui_time_sink_x_0.set_y_label('Amplitude', "") + + self.qtgui_time_sink_x_0.enable_tags(True) + self.qtgui_time_sink_x_0.set_trigger_mode(qtgui.TRIG_MODE_FREE, qtgui.TRIG_SLOPE_POS, 0.005, 0, 0, "") + self.qtgui_time_sink_x_0.enable_autoscale(False) + self.qtgui_time_sink_x_0.enable_grid(True) + self.qtgui_time_sink_x_0.enable_axis_labels(True) + self.qtgui_time_sink_x_0.enable_control_panel(False) + self.qtgui_time_sink_x_0.enable_stem_plot(False) + + + labels = ['', '', '', '', '', + '', '', '', '', ''] + widths = [1, 1, 1, 1, 1, + 1, 1, 1, 1, 1] + colors = ['blue', 'red', 'green', 'black', 'cyan', + 'magenta', 'yellow', 'dark red', 'dark green', 'dark blue'] + alphas = [1.0, 1.0, 1.0, 1.0, 1.0, + 1.0, 1.0, 1.0, 1.0, 1.0] + styles = [1, 1, 1, 1, 1, + 1, 1, 1, 1, 1] + markers = [-1, -1, -1, -1, -1, + -1, -1, -1, -1, -1] + + + for i in range(2): + if len(labels[i]) == 0: + if (i % 2 == 0): + self.qtgui_time_sink_x_0.set_line_label(i, "Re{{Data {0}}}".format(i/2)) + else: + self.qtgui_time_sink_x_0.set_line_label(i, "Im{{Data {0}}}".format(i/2)) + else: + self.qtgui_time_sink_x_0.set_line_label(i, labels[i]) + self.qtgui_time_sink_x_0.set_line_width(i, widths[i]) + self.qtgui_time_sink_x_0.set_line_color(i, colors[i]) + self.qtgui_time_sink_x_0.set_line_style(i, styles[i]) + self.qtgui_time_sink_x_0.set_line_marker(i, markers[i]) + self.qtgui_time_sink_x_0.set_line_alpha(i, alphas[i]) + + self._qtgui_time_sink_x_0_win = sip.wrapinstance(self.qtgui_time_sink_x_0.qwidget(), Qt.QWidget) + self.top_grid_layout.addWidget(self._qtgui_time_sink_x_0_win, 3, 0, 10, 4) + for r in range(3, 13): + self.top_grid_layout.setRowStretch(r, 1) + for c in range(0, 4): + self.top_grid_layout.setColumnStretch(c, 1) + self.blocks_keep_one_in_n_0_0 = blocks.keep_one_in_n(gr.sizeof_gr_complex*1, 100) + self.blocks_keep_one_in_n_0 = blocks.keep_one_in_n(gr.sizeof_gr_complex*1, 10) + + + ################################################## + # Connections + ################################################## + self.connect((self.blocks_keep_one_in_n_0, 0), (self.qtgui_time_sink_x_0_0, 0)) + self.connect((self.blocks_keep_one_in_n_0_0, 0), (self.qtgui_time_sink_x_0_1, 0)) + self.connect((self.uhd_usrp_source_0_0, 0), (self.blocks_keep_one_in_n_0, 0)) + self.connect((self.uhd_usrp_source_0_0, 0), (self.blocks_keep_one_in_n_0_0, 0)) + self.connect((self.uhd_usrp_source_0_0, 0), (self.qtgui_time_sink_x_0, 0)) + + + def closeEvent(self, event): + self.settings = Qt.QSettings("GNU Radio", "time_sink_1_10_100_usrp2") + self.settings.setValue("geometry", self.saveGeometry()) + self.stop() + self.wait() + + event.accept() + + def get_sample_rate(self): + return self.sample_rate + + def set_sample_rate(self, sample_rate): + self.sample_rate = sample_rate + self._sample_rate_callback(self.sample_rate) + self.qtgui_time_sink_x_0.set_samp_rate(self.sample_rate) + self.qtgui_time_sink_x_0_0.set_samp_rate(self.sample_rate) + self.qtgui_time_sink_x_0_1.set_samp_rate(self.sample_rate) + self.uhd_usrp_source_0_0.set_samp_rate(self.sample_rate) + + def get_rx_usrp_gain(self): + return self.rx_usrp_gain + + def set_rx_usrp_gain(self, rx_usrp_gain): + self.rx_usrp_gain = rx_usrp_gain + self.uhd_usrp_source_0_0.set_gain(self.rx_usrp_gain, 0) + + def get_rx_usrp_channel(self): + return self.rx_usrp_channel + + def set_rx_usrp_channel(self, rx_usrp_channel): + self.rx_usrp_channel = rx_usrp_channel + + def get_rx_usrp_antenna(self): + return self.rx_usrp_antenna + + def set_rx_usrp_antenna(self, rx_usrp_antenna): + self.rx_usrp_antenna = rx_usrp_antenna + self._rx_usrp_antenna_callback(self.rx_usrp_antenna) + self.uhd_usrp_source_0_0.set_antenna(self.rx_usrp_antenna, 0) + + def get_rx_frequency(self): + return self.rx_frequency + + def set_rx_frequency(self, rx_frequency): + self.rx_frequency = rx_frequency + self.uhd_usrp_source_0_0.set_center_freq(self.rx_frequency*1e6, 0) + + + + +def main(top_block_cls=time_sink_1_10_100_usrp2, options=None): + + if StrictVersion("4.5.0") <= StrictVersion(Qt.qVersion()) < StrictVersion("5.0.0"): + style = gr.prefs().get_string('qtgui', 'style', 'raster') + Qt.QApplication.setGraphicsSystem(style) + qapp = Qt.QApplication(sys.argv) + + tb = top_block_cls() + + tb.start() + + tb.show() + + def sig_handler(sig=None, frame=None): + tb.stop() + tb.wait() + + Qt.QApplication.quit() + + signal.signal(signal.SIGINT, sig_handler) + signal.signal(signal.SIGTERM, sig_handler) + + timer = Qt.QTimer() + timer.start(500) + timer.timeout.connect(lambda: None) + + qapp.exec_() + +if __name__ == '__main__': + main() diff --git a/Flow Graph Library/Inspection Flow Graphs/time_sink_1_10_100_usrp_n2xx.grc b/Flow Graph Library/Inspection Flow Graphs/time_sink_1_10_100_usrp_n2xx.grc new file mode 100644 index 00000000..d82cfc1e --- /dev/null +++ b/Flow Graph Library/Inspection Flow Graphs/time_sink_1_10_100_usrp_n2xx.grc @@ -0,0 +1,866 @@ +options: + parameters: + author: '' + category: Custom + cmake_opt: '' + comment: '' + copyright: '' + description: '' + gen_cmake: 'On' + gen_linking: dynamic + generate_options: qt_gui + hier_block_src_path: '.:' + id: time_sink_1_10_100_usrp_n2xx + max_nouts: '0' + output_language: python + placement: (0,0) + qt_qss_theme: '' + realtime_scheduling: '' + run: 'True' + run_command: '{python} -u {filename}' + run_options: prompt + sizing_mode: fixed + thread_safe_setters: '' + title: '' + window_size: 1280, 1024 + states: + bus_sink: false + bus_source: false + bus_structure: null + coordinate: [10, 10] + rotation: 0 + state: enabled + +blocks: +- name: ip_address + id: variable + parameters: + comment: '' + value: '"192.168.140.2"' + states: + bus_sink: false + bus_source: false + bus_structure: null + coordinate: [8, 148] + rotation: 0 + state: disabled +- name: rx_frequency + id: variable_qtgui_range + parameters: + comment: '' + gui_hint: 2,0,1,4 + label: ' Freq. (MHz):' + min_len: '200' + orient: Qt.Horizontal + rangeType: float + start: '50' + step: '.1' + stop: '6000' + value: '2412' + widget: counter_slider + states: + bus_sink: false + bus_source: false + bus_structure: null + coordinate: [400, 140] + rotation: 0 + state: enabled +- name: rx_usrp_antenna + id: variable_qtgui_chooser + parameters: + comment: '' + gui_hint: 0,1,1,1 + label: ' Antenna' + label0: '' + label1: '' + label2: '' + label3: '' + label4: '' + labels: '["TX/RX", "RX2"]' + num_opts: '0' + option1: '1' + option2: '2' + option3: '3' + option4: '4' + options: '["TX/RX", "RX2"]' + orient: Qt.QVBoxLayout + type: string + value: '"TX/RX"' + widget: combo_box + states: + bus_sink: false + bus_source: false + bus_structure: null + coordinate: [232, 140] + rotation: 0 + state: enabled +- name: rx_usrp_channel + id: variable + parameters: + comment: '' + value: '"A:0"' + states: + bus_sink: false + bus_source: false + bus_structure: null + coordinate: [8, 76] + rotation: 0 + state: enabled +- name: rx_usrp_gain + id: variable_qtgui_range + parameters: + comment: '' + gui_hint: 1,0,1,4 + label: ' Gain:' + min_len: '200' + orient: Qt.Horizontal + rangeType: float + start: '0' + step: '1' + stop: '34' + value: '30' + widget: counter_slider + states: + bus_sink: false + bus_source: false + bus_structure: null + coordinate: [400, 12] + rotation: 0 + state: enabled +- name: sample_rate + id: variable_qtgui_chooser + parameters: + comment: '' + gui_hint: 0,0,1,1 + label: Sample Rate + label0: '' + label1: '' + label2: '' + label3: '' + label4: '' + labels: '["1 MS/s", "5 MS/s", "10 MS/s", "20 MS/s"]' + num_opts: '0' + option1: '1' + option2: '2' + option3: '3' + option4: '4' + options: '[1e6, 5e6, 10e6, 20e6]' + orient: Qt.QVBoxLayout + type: real + value: 1e6 + widget: combo_box + states: + bus_sink: false + bus_source: false + bus_structure: null + coordinate: [232, 12] + rotation: 0 + state: enabled +- name: blocks_keep_one_in_n_0 + id: blocks_keep_one_in_n + parameters: + affinity: '' + alias: '' + comment: '' + maxoutbuf: '0' + minoutbuf: '0' + n: '10' + type: complex + vlen: '1' + states: + bus_sink: false + bus_source: false + bus_structure: null + coordinate: [744, 500] + rotation: 0 + state: enabled +- name: blocks_keep_one_in_n_0_0 + id: blocks_keep_one_in_n + parameters: + affinity: '' + alias: '' + comment: '' + maxoutbuf: '0' + minoutbuf: '0' + n: '100' + type: complex + vlen: '1' + states: + bus_sink: false + bus_source: false + bus_structure: null + coordinate: [744, 604] + rotation: 0 + state: enabled +- name: qtgui_time_sink_x_0 + id: qtgui_time_sink_x + parameters: + affinity: '' + alias: '' + alpha1: '1.0' + alpha10: '1.0' + alpha2: '1.0' + alpha3: '1.0' + alpha4: '1.0' + alpha5: '1.0' + alpha6: '1.0' + alpha7: '1.0' + alpha8: '1.0' + alpha9: '1.0' + autoscale: 'False' + axislabels: 'True' + color1: blue + color10: dark blue + color2: red + color3: green + color4: black + color5: cyan + color6: magenta + color7: yellow + color8: dark red + color9: dark green + comment: '' + ctrlpanel: 'False' + entags: 'True' + grid: 'True' + gui_hint: 3,0,10,4 + label1: '' + label10: '' + label2: '' + label3: '' + label4: '' + label5: '' + label6: '' + label7: '' + label8: '' + label9: '' + legend: 'True' + marker1: '-1' + marker10: '-1' + marker2: '-1' + marker3: '-1' + marker4: '-1' + marker5: '-1' + marker6: '-1' + marker7: '-1' + marker8: '-1' + marker9: '-1' + name: '"1 in 1"' + nconnections: '1' + size: '100000' + srate: sample_rate + stemplot: 'False' + style1: '1' + style10: '1' + style2: '1' + style3: '1' + style4: '1' + style5: '1' + style6: '1' + style7: '1' + style8: '1' + style9: '1' + tr_chan: '0' + tr_delay: '0' + tr_level: '0.005' + tr_mode: qtgui.TRIG_MODE_FREE + tr_slope: qtgui.TRIG_SLOPE_POS + tr_tag: '""' + type: complex + update_time: '0.1' + width1: '1' + width10: '1' + width2: '1' + width3: '1' + width4: '1' + width5: '1' + width6: '1' + width7: '1' + width8: '1' + width9: '1' + ylabel: Amplitude + ymax: '1' + ymin: '-1' + yunit: '""' + states: + bus_sink: false + bus_source: false + bus_structure: null + coordinate: [904, 372] + rotation: 0 + state: enabled +- name: qtgui_time_sink_x_0_0 + id: qtgui_time_sink_x + parameters: + affinity: '' + alias: '' + alpha1: '1.0' + alpha10: '1.0' + alpha2: '1.0' + alpha3: '1.0' + alpha4: '1.0' + alpha5: '1.0' + alpha6: '1.0' + alpha7: '1.0' + alpha8: '1.0' + alpha9: '1.0' + autoscale: 'False' + axislabels: 'True' + color1: blue + color10: dark blue + color2: red + color3: green + color4: black + color5: cyan + color6: magenta + color7: yellow + color8: dark red + color9: dark green + comment: '' + ctrlpanel: 'False' + entags: 'True' + grid: 'True' + gui_hint: 15,0,10,4 + label1: '' + label10: '' + label2: '' + label3: '' + label4: '' + label5: '' + label6: '' + label7: '' + label8: '' + label9: '' + legend: 'True' + marker1: '-1' + marker10: '-1' + marker2: '-1' + marker3: '-1' + marker4: '-1' + marker5: '-1' + marker6: '-1' + marker7: '-1' + marker8: '-1' + marker9: '-1' + name: '"1 in 10"' + nconnections: '1' + size: '100000' + srate: sample_rate + stemplot: 'False' + style1: '1' + style10: '1' + style2: '1' + style3: '1' + style4: '1' + style5: '1' + style6: '1' + style7: '1' + style8: '1' + style9: '1' + tr_chan: '0' + tr_delay: '0' + tr_level: '0.005' + tr_mode: qtgui.TRIG_MODE_FREE + tr_slope: qtgui.TRIG_SLOPE_POS + tr_tag: '""' + type: complex + update_time: '0.1' + width1: '1' + width10: '1' + width2: '1' + width3: '1' + width4: '1' + width5: '1' + width6: '1' + width7: '1' + width8: '1' + width9: '1' + ylabel: Amplitude + ymax: '1' + ymin: '-1' + yunit: '""' + states: + bus_sink: false + bus_source: false + bus_structure: null + coordinate: [904, 476] + rotation: 0 + state: enabled +- name: qtgui_time_sink_x_0_1 + id: qtgui_time_sink_x + parameters: + affinity: '' + alias: '' + alpha1: '1.0' + alpha10: '1.0' + alpha2: '1.0' + alpha3: '1.0' + alpha4: '1.0' + alpha5: '1.0' + alpha6: '1.0' + alpha7: '1.0' + alpha8: '1.0' + alpha9: '1.0' + autoscale: 'False' + axislabels: 'True' + color1: blue + color10: dark blue + color2: red + color3: green + color4: black + color5: cyan + color6: magenta + color7: yellow + color8: dark red + color9: dark green + comment: '' + ctrlpanel: 'False' + entags: 'True' + grid: 'True' + gui_hint: 26,0,10,4 + label1: '' + label10: '' + label2: '' + label3: '' + label4: '' + label5: '' + label6: '' + label7: '' + label8: '' + label9: '' + legend: 'True' + marker1: '-1' + marker10: '-1' + marker2: '-1' + marker3: '-1' + marker4: '-1' + marker5: '-1' + marker6: '-1' + marker7: '-1' + marker8: '-1' + marker9: '-1' + name: '"1 in 100"' + nconnections: '1' + size: '100000' + srate: sample_rate + stemplot: 'False' + style1: '1' + style10: '1' + style2: '1' + style3: '1' + style4: '1' + style5: '1' + style6: '1' + style7: '1' + style8: '1' + style9: '1' + tr_chan: '0' + tr_delay: '0' + tr_level: '0.005' + tr_mode: qtgui.TRIG_MODE_FREE + tr_slope: qtgui.TRIG_SLOPE_POS + tr_tag: '""' + type: complex + update_time: '0.1' + width1: '1' + width10: '1' + width2: '1' + width3: '1' + width4: '1' + width5: '1' + width6: '1' + width7: '1' + width8: '1' + width9: '1' + ylabel: Amplitude + ymax: '1' + ymin: '-1' + yunit: '""' + states: + bus_sink: false + bus_source: false + bus_structure: null + coordinate: [904, 580] + rotation: 0 + state: enabled +- name: uhd_usrp_source_0_0 + id: uhd_usrp_source + parameters: + affinity: '' + alias: '' + ant0: rx_usrp_antenna + ant1: '' + ant10: '' + ant11: '' + ant12: '' + ant13: '' + ant14: '' + ant15: '' + ant16: '' + ant17: '' + ant18: '' + ant19: '' + ant2: '' + ant20: '' + ant21: '' + ant22: '' + ant23: '' + ant24: '' + ant25: '' + ant26: '' + ant27: '' + ant28: '' + ant29: '' + ant3: '' + ant30: '' + ant31: '' + ant4: '' + ant5: '' + ant6: '' + ant7: '' + ant8: '' + ant9: '' + bw0: '0' + bw1: '0' + bw10: '0' + bw11: '0' + bw12: '0' + bw13: '0' + bw14: '0' + bw15: '0' + bw16: '0' + bw17: '0' + bw18: '0' + bw19: '0' + bw2: '0' + bw20: '0' + bw21: '0' + bw22: '0' + bw23: '0' + bw24: '0' + bw25: '0' + bw26: '0' + bw27: '0' + bw28: '0' + bw29: '0' + bw3: '0' + bw30: '0' + bw31: '0' + bw4: '0' + bw5: '0' + bw6: '0' + bw7: '0' + bw8: '0' + bw9: '0' + center_freq0: rx_frequency*1e6 + center_freq1: '0' + center_freq10: '0' + center_freq11: '0' + center_freq12: '0' + center_freq13: '0' + center_freq14: '0' + center_freq15: '0' + center_freq16: '0' + center_freq17: '0' + center_freq18: '0' + center_freq19: '0' + center_freq2: '0' + center_freq20: '0' + center_freq21: '0' + center_freq22: '0' + center_freq23: '0' + center_freq24: '0' + center_freq25: '0' + center_freq26: '0' + center_freq27: '0' + center_freq28: '0' + center_freq29: '0' + center_freq3: '0' + center_freq30: '0' + center_freq31: '0' + center_freq4: '0' + center_freq5: '0' + center_freq6: '0' + center_freq7: '0' + center_freq8: '0' + center_freq9: '0' + clock_rate: '0.0' + clock_source0: '' + clock_source1: '' + clock_source2: '' + clock_source3: '' + clock_source4: '' + clock_source5: '' + clock_source6: '' + clock_source7: '' + comment: '' + dc_offs_enb0: '""' + dc_offs_enb1: '""' + dc_offs_enb10: '""' + dc_offs_enb11: '""' + dc_offs_enb12: '""' + dc_offs_enb13: '""' + dc_offs_enb14: '""' + dc_offs_enb15: '""' + dc_offs_enb16: '""' + dc_offs_enb17: '""' + dc_offs_enb18: '""' + dc_offs_enb19: '""' + dc_offs_enb2: '""' + dc_offs_enb20: '""' + dc_offs_enb21: '""' + dc_offs_enb22: '""' + dc_offs_enb23: '""' + dc_offs_enb24: '""' + dc_offs_enb25: '""' + dc_offs_enb26: '""' + dc_offs_enb27: '""' + dc_offs_enb28: '""' + dc_offs_enb29: '""' + dc_offs_enb3: '""' + dc_offs_enb30: '""' + dc_offs_enb31: '""' + dc_offs_enb4: '""' + dc_offs_enb5: '""' + dc_offs_enb6: '""' + dc_offs_enb7: '""' + dc_offs_enb8: '""' + dc_offs_enb9: '""' + dev_addr: '' + dev_args: '""' + gain0: rx_usrp_gain + gain1: '0' + gain10: '0' + gain11: '0' + gain12: '0' + gain13: '0' + gain14: '0' + gain15: '0' + gain16: '0' + gain17: '0' + gain18: '0' + gain19: '0' + gain2: '0' + gain20: '0' + gain21: '0' + gain22: '0' + gain23: '0' + gain24: '0' + gain25: '0' + gain26: '0' + gain27: '0' + gain28: '0' + gain29: '0' + gain3: '0' + gain30: '0' + gain31: '0' + gain4: '0' + gain5: '0' + gain6: '0' + gain7: '0' + gain8: '0' + gain9: '0' + iq_imbal_enb0: '""' + iq_imbal_enb1: '""' + iq_imbal_enb10: '""' + iq_imbal_enb11: '""' + iq_imbal_enb12: '""' + iq_imbal_enb13: '""' + iq_imbal_enb14: '""' + iq_imbal_enb15: '""' + iq_imbal_enb16: '""' + iq_imbal_enb17: '""' + iq_imbal_enb18: '""' + iq_imbal_enb19: '""' + iq_imbal_enb2: '""' + iq_imbal_enb20: '""' + iq_imbal_enb21: '""' + iq_imbal_enb22: '""' + iq_imbal_enb23: '""' + iq_imbal_enb24: '""' + iq_imbal_enb25: '""' + iq_imbal_enb26: '""' + iq_imbal_enb27: '""' + iq_imbal_enb28: '""' + iq_imbal_enb29: '""' + iq_imbal_enb3: '""' + iq_imbal_enb30: '""' + iq_imbal_enb31: '""' + iq_imbal_enb4: '""' + iq_imbal_enb5: '""' + iq_imbal_enb6: '""' + iq_imbal_enb7: '""' + iq_imbal_enb8: '""' + iq_imbal_enb9: '""' + lo_export0: 'False' + lo_export1: 'False' + lo_export10: 'False' + lo_export11: 'False' + lo_export12: 'False' + lo_export13: 'False' + lo_export14: 'False' + lo_export15: 'False' + lo_export16: 'False' + lo_export17: 'False' + lo_export18: 'False' + lo_export19: 'False' + lo_export2: 'False' + lo_export20: 'False' + lo_export21: 'False' + lo_export22: 'False' + lo_export23: 'False' + lo_export24: 'False' + lo_export25: 'False' + lo_export26: 'False' + lo_export27: 'False' + lo_export28: 'False' + lo_export29: 'False' + lo_export3: 'False' + lo_export30: 'False' + lo_export31: 'False' + lo_export4: 'False' + lo_export5: 'False' + lo_export6: 'False' + lo_export7: 'False' + lo_export8: 'False' + lo_export9: 'False' + lo_source0: internal + lo_source1: internal + lo_source10: internal + lo_source11: internal + lo_source12: internal + lo_source13: internal + lo_source14: internal + lo_source15: internal + lo_source16: internal + lo_source17: internal + lo_source18: internal + lo_source19: internal + lo_source2: internal + lo_source20: internal + lo_source21: internal + lo_source22: internal + lo_source23: internal + lo_source24: internal + lo_source25: internal + lo_source26: internal + lo_source27: internal + lo_source28: internal + lo_source29: internal + lo_source3: internal + lo_source30: internal + lo_source31: internal + lo_source4: internal + lo_source5: internal + lo_source6: internal + lo_source7: internal + lo_source8: internal + lo_source9: internal + maxoutbuf: '0' + minoutbuf: '0' + nchan: '1' + norm_gain0: 'False' + norm_gain1: 'False' + norm_gain10: 'False' + norm_gain11: 'False' + norm_gain12: 'False' + norm_gain13: 'False' + norm_gain14: 'False' + norm_gain15: 'False' + norm_gain16: 'False' + norm_gain17: 'False' + norm_gain18: 'False' + norm_gain19: 'False' + norm_gain2: 'False' + norm_gain20: 'False' + norm_gain21: 'False' + norm_gain22: 'False' + norm_gain23: 'False' + norm_gain24: 'False' + norm_gain25: 'False' + norm_gain26: 'False' + norm_gain27: 'False' + norm_gain28: 'False' + norm_gain29: 'False' + norm_gain3: 'False' + norm_gain30: 'False' + norm_gain31: 'False' + norm_gain4: 'False' + norm_gain5: 'False' + norm_gain6: 'False' + norm_gain7: 'False' + norm_gain8: 'False' + norm_gain9: 'False' + num_mboards: '1' + otw: '' + rx_agc0: Default + rx_agc1: Default + rx_agc10: Default + rx_agc11: Default + rx_agc12: Default + rx_agc13: Default + rx_agc14: Default + rx_agc15: Default + rx_agc16: Default + rx_agc17: Default + rx_agc18: Default + rx_agc19: Default + rx_agc2: Default + rx_agc20: Default + rx_agc21: Default + rx_agc22: Default + rx_agc23: Default + rx_agc24: Default + rx_agc25: Default + rx_agc26: Default + rx_agc27: Default + rx_agc28: Default + rx_agc29: Default + rx_agc3: Default + rx_agc30: Default + rx_agc31: Default + rx_agc4: Default + rx_agc5: Default + rx_agc6: Default + rx_agc7: Default + rx_agc8: Default + rx_agc9: Default + samp_rate: sample_rate + sd_spec0: rx_usrp_channel + sd_spec1: '' + sd_spec2: '' + sd_spec3: '' + sd_spec4: '' + sd_spec5: '' + sd_spec6: '' + sd_spec7: '' + show_lo_controls: 'False' + stream_args: '' + stream_chans: '[]' + sync: sync + time_source0: '' + time_source1: '' + time_source2: '' + time_source3: '' + time_source4: '' + time_source5: '' + time_source6: '' + time_source7: '' + type: fc32 + states: + bus_sink: false + bus_source: false + bus_structure: null + coordinate: [320, 468] + rotation: 0 + state: enabled + +connections: +- [blocks_keep_one_in_n_0, '0', qtgui_time_sink_x_0_0, '0'] +- [blocks_keep_one_in_n_0_0, '0', qtgui_time_sink_x_0_1, '0'] +- [uhd_usrp_source_0_0, '0', blocks_keep_one_in_n_0, '0'] +- [uhd_usrp_source_0_0, '0', blocks_keep_one_in_n_0_0, '0'] +- [uhd_usrp_source_0_0, '0', qtgui_time_sink_x_0, '0'] + +metadata: + file_format: 1 diff --git a/Flow Graph Library/Inspection Flow Graphs/time_sink_1_10_100_usrp_n2xx.py b/Flow Graph Library/Inspection Flow Graphs/time_sink_1_10_100_usrp_n2xx.py new file mode 100755 index 00000000..88d77267 --- /dev/null +++ b/Flow Graph Library/Inspection Flow Graphs/time_sink_1_10_100_usrp_n2xx.py @@ -0,0 +1,417 @@ +#!/usr/bin/env python3 +# -*- coding: utf-8 -*- + +# +# SPDX-License-Identifier: GPL-3.0 +# +# GNU Radio Python Flow Graph +# Title: Time Sink 1 10 100 Usrp N2Xx +# GNU Radio version: 3.10.1.1 + +from packaging.version import Version as StrictVersion + +if __name__ == '__main__': + import ctypes + import sys + if sys.platform.startswith('linux'): + try: + x11 = ctypes.cdll.LoadLibrary('libX11.so') + x11.XInitThreads() + except: + print("Warning: failed to XInitThreads()") + +from PyQt5 import Qt +from PyQt5.QtCore import QObject, pyqtSlot +from gnuradio import qtgui +from gnuradio.filter import firdes +import sip +from gnuradio import blocks +from gnuradio import gr +from gnuradio.fft import window +import sys +import signal +from argparse import ArgumentParser +from gnuradio.eng_arg import eng_float, intx +from gnuradio import eng_notation +from gnuradio import uhd +import time +from gnuradio.qtgui import Range, RangeWidget +from PyQt5 import QtCore + + + +from gnuradio import qtgui + +class time_sink_1_10_100_usrp_n2xx(gr.top_block, Qt.QWidget): + + def __init__(self): + gr.top_block.__init__(self, "Time Sink 1 10 100 Usrp N2Xx", catch_exceptions=True) + Qt.QWidget.__init__(self) + self.setWindowTitle("Time Sink 1 10 100 Usrp N2Xx") + qtgui.util.check_set_qss() + try: + self.setWindowIcon(Qt.QIcon.fromTheme('gnuradio-grc')) + except: + pass + self.top_scroll_layout = Qt.QVBoxLayout() + self.setLayout(self.top_scroll_layout) + self.top_scroll = Qt.QScrollArea() + self.top_scroll.setFrameStyle(Qt.QFrame.NoFrame) + self.top_scroll_layout.addWidget(self.top_scroll) + self.top_scroll.setWidgetResizable(True) + self.top_widget = Qt.QWidget() + self.top_scroll.setWidget(self.top_widget) + self.top_layout = Qt.QVBoxLayout(self.top_widget) + self.top_grid_layout = Qt.QGridLayout() + self.top_layout.addLayout(self.top_grid_layout) + + self.settings = Qt.QSettings("GNU Radio", "time_sink_1_10_100_usrp_n2xx") + + try: + if StrictVersion(Qt.qVersion()) < StrictVersion("5.0.0"): + self.restoreGeometry(self.settings.value("geometry").toByteArray()) + else: + self.restoreGeometry(self.settings.value("geometry")) + except: + pass + + ################################################## + # Variables + ################################################## + self.sample_rate = sample_rate = 1e6 + self.rx_usrp_gain = rx_usrp_gain = 30 + self.rx_usrp_channel = rx_usrp_channel = "A:0" + self.rx_usrp_antenna = rx_usrp_antenna = "TX/RX" + self.rx_frequency = rx_frequency = 2412 + + ################################################## + # Blocks + ################################################## + # Create the options list + self._sample_rate_options = [1000000.0, 5000000.0, 10000000.0, 20000000.0] + # Create the labels list + self._sample_rate_labels = ['1 MS/s', '5 MS/s', '10 MS/s', '20 MS/s'] + # Create the combo box + self._sample_rate_tool_bar = Qt.QToolBar(self) + self._sample_rate_tool_bar.addWidget(Qt.QLabel("Sample Rate" + ": ")) + self._sample_rate_combo_box = Qt.QComboBox() + self._sample_rate_tool_bar.addWidget(self._sample_rate_combo_box) + for _label in self._sample_rate_labels: self._sample_rate_combo_box.addItem(_label) + self._sample_rate_callback = lambda i: Qt.QMetaObject.invokeMethod(self._sample_rate_combo_box, "setCurrentIndex", Qt.Q_ARG("int", self._sample_rate_options.index(i))) + self._sample_rate_callback(self.sample_rate) + self._sample_rate_combo_box.currentIndexChanged.connect( + lambda i: self.set_sample_rate(self._sample_rate_options[i])) + # Create the radio buttons + self.top_grid_layout.addWidget(self._sample_rate_tool_bar, 0, 0, 1, 1) + for r in range(0, 1): + self.top_grid_layout.setRowStretch(r, 1) + for c in range(0, 1): + self.top_grid_layout.setColumnStretch(c, 1) + self._rx_usrp_gain_range = Range(0, 34, 1, 30, 200) + self._rx_usrp_gain_win = RangeWidget(self._rx_usrp_gain_range, self.set_rx_usrp_gain, " Gain:", "counter_slider", float, QtCore.Qt.Horizontal) + self.top_grid_layout.addWidget(self._rx_usrp_gain_win, 1, 0, 1, 4) + for r in range(1, 2): + self.top_grid_layout.setRowStretch(r, 1) + for c in range(0, 4): + self.top_grid_layout.setColumnStretch(c, 1) + # Create the options list + self._rx_usrp_antenna_options = ['TX/RX', 'RX2'] + # Create the labels list + self._rx_usrp_antenna_labels = ['TX/RX', 'RX2'] + # Create the combo box + self._rx_usrp_antenna_tool_bar = Qt.QToolBar(self) + self._rx_usrp_antenna_tool_bar.addWidget(Qt.QLabel(" Antenna" + ": ")) + self._rx_usrp_antenna_combo_box = Qt.QComboBox() + self._rx_usrp_antenna_tool_bar.addWidget(self._rx_usrp_antenna_combo_box) + for _label in self._rx_usrp_antenna_labels: self._rx_usrp_antenna_combo_box.addItem(_label) + self._rx_usrp_antenna_callback = lambda i: Qt.QMetaObject.invokeMethod(self._rx_usrp_antenna_combo_box, "setCurrentIndex", Qt.Q_ARG("int", self._rx_usrp_antenna_options.index(i))) + self._rx_usrp_antenna_callback(self.rx_usrp_antenna) + self._rx_usrp_antenna_combo_box.currentIndexChanged.connect( + lambda i: self.set_rx_usrp_antenna(self._rx_usrp_antenna_options[i])) + # Create the radio buttons + self.top_grid_layout.addWidget(self._rx_usrp_antenna_tool_bar, 0, 1, 1, 1) + for r in range(0, 1): + self.top_grid_layout.setRowStretch(r, 1) + for c in range(1, 2): + self.top_grid_layout.setColumnStretch(c, 1) + self._rx_frequency_range = Range(50, 6000, .1, 2412, 200) + self._rx_frequency_win = RangeWidget(self._rx_frequency_range, self.set_rx_frequency, " Freq. (MHz):", "counter_slider", float, QtCore.Qt.Horizontal) + self.top_grid_layout.addWidget(self._rx_frequency_win, 2, 0, 1, 4) + for r in range(2, 3): + self.top_grid_layout.setRowStretch(r, 1) + for c in range(0, 4): + self.top_grid_layout.setColumnStretch(c, 1) + self.uhd_usrp_source_0_0 = uhd.usrp_source( + ",".join(('', "")), + uhd.stream_args( + cpu_format="fc32", + args='', + channels=list(range(0,1)), + ), + ) + self.uhd_usrp_source_0_0.set_subdev_spec(rx_usrp_channel, 0) + self.uhd_usrp_source_0_0.set_samp_rate(sample_rate) + self.uhd_usrp_source_0_0.set_time_unknown_pps(uhd.time_spec(0)) + + self.uhd_usrp_source_0_0.set_center_freq(rx_frequency*1e6, 0) + self.uhd_usrp_source_0_0.set_antenna(rx_usrp_antenna, 0) + self.uhd_usrp_source_0_0.set_gain(rx_usrp_gain, 0) + self.qtgui_time_sink_x_0_1 = qtgui.time_sink_c( + 100000, #size + sample_rate, #samp_rate + "1 in 100", #name + 1, #number of inputs + None # parent + ) + self.qtgui_time_sink_x_0_1.set_update_time(0.1) + self.qtgui_time_sink_x_0_1.set_y_axis(-1, 1) + + self.qtgui_time_sink_x_0_1.set_y_label('Amplitude', "") + + self.qtgui_time_sink_x_0_1.enable_tags(True) + self.qtgui_time_sink_x_0_1.set_trigger_mode(qtgui.TRIG_MODE_FREE, qtgui.TRIG_SLOPE_POS, 0.005, 0, 0, "") + self.qtgui_time_sink_x_0_1.enable_autoscale(False) + self.qtgui_time_sink_x_0_1.enable_grid(True) + self.qtgui_time_sink_x_0_1.enable_axis_labels(True) + self.qtgui_time_sink_x_0_1.enable_control_panel(False) + self.qtgui_time_sink_x_0_1.enable_stem_plot(False) + + + labels = ['', '', '', '', '', + '', '', '', '', ''] + widths = [1, 1, 1, 1, 1, + 1, 1, 1, 1, 1] + colors = ['blue', 'red', 'green', 'black', 'cyan', + 'magenta', 'yellow', 'dark red', 'dark green', 'dark blue'] + alphas = [1.0, 1.0, 1.0, 1.0, 1.0, + 1.0, 1.0, 1.0, 1.0, 1.0] + styles = [1, 1, 1, 1, 1, + 1, 1, 1, 1, 1] + markers = [-1, -1, -1, -1, -1, + -1, -1, -1, -1, -1] + + + for i in range(2): + if len(labels[i]) == 0: + if (i % 2 == 0): + self.qtgui_time_sink_x_0_1.set_line_label(i, "Re{{Data {0}}}".format(i/2)) + else: + self.qtgui_time_sink_x_0_1.set_line_label(i, "Im{{Data {0}}}".format(i/2)) + else: + self.qtgui_time_sink_x_0_1.set_line_label(i, labels[i]) + self.qtgui_time_sink_x_0_1.set_line_width(i, widths[i]) + self.qtgui_time_sink_x_0_1.set_line_color(i, colors[i]) + self.qtgui_time_sink_x_0_1.set_line_style(i, styles[i]) + self.qtgui_time_sink_x_0_1.set_line_marker(i, markers[i]) + self.qtgui_time_sink_x_0_1.set_line_alpha(i, alphas[i]) + + self._qtgui_time_sink_x_0_1_win = sip.wrapinstance(self.qtgui_time_sink_x_0_1.qwidget(), Qt.QWidget) + self.top_grid_layout.addWidget(self._qtgui_time_sink_x_0_1_win, 26, 0, 10, 4) + for r in range(26, 36): + self.top_grid_layout.setRowStretch(r, 1) + for c in range(0, 4): + self.top_grid_layout.setColumnStretch(c, 1) + self.qtgui_time_sink_x_0_0 = qtgui.time_sink_c( + 100000, #size + sample_rate, #samp_rate + "1 in 10", #name + 1, #number of inputs + None # parent + ) + self.qtgui_time_sink_x_0_0.set_update_time(0.1) + self.qtgui_time_sink_x_0_0.set_y_axis(-1, 1) + + self.qtgui_time_sink_x_0_0.set_y_label('Amplitude', "") + + self.qtgui_time_sink_x_0_0.enable_tags(True) + self.qtgui_time_sink_x_0_0.set_trigger_mode(qtgui.TRIG_MODE_FREE, qtgui.TRIG_SLOPE_POS, 0.005, 0, 0, "") + self.qtgui_time_sink_x_0_0.enable_autoscale(False) + self.qtgui_time_sink_x_0_0.enable_grid(True) + self.qtgui_time_sink_x_0_0.enable_axis_labels(True) + self.qtgui_time_sink_x_0_0.enable_control_panel(False) + self.qtgui_time_sink_x_0_0.enable_stem_plot(False) + + + labels = ['', '', '', '', '', + '', '', '', '', ''] + widths = [1, 1, 1, 1, 1, + 1, 1, 1, 1, 1] + colors = ['blue', 'red', 'green', 'black', 'cyan', + 'magenta', 'yellow', 'dark red', 'dark green', 'dark blue'] + alphas = [1.0, 1.0, 1.0, 1.0, 1.0, + 1.0, 1.0, 1.0, 1.0, 1.0] + styles = [1, 1, 1, 1, 1, + 1, 1, 1, 1, 1] + markers = [-1, -1, -1, -1, -1, + -1, -1, -1, -1, -1] + + + for i in range(2): + if len(labels[i]) == 0: + if (i % 2 == 0): + self.qtgui_time_sink_x_0_0.set_line_label(i, "Re{{Data {0}}}".format(i/2)) + else: + self.qtgui_time_sink_x_0_0.set_line_label(i, "Im{{Data {0}}}".format(i/2)) + else: + self.qtgui_time_sink_x_0_0.set_line_label(i, labels[i]) + self.qtgui_time_sink_x_0_0.set_line_width(i, widths[i]) + self.qtgui_time_sink_x_0_0.set_line_color(i, colors[i]) + self.qtgui_time_sink_x_0_0.set_line_style(i, styles[i]) + self.qtgui_time_sink_x_0_0.set_line_marker(i, markers[i]) + self.qtgui_time_sink_x_0_0.set_line_alpha(i, alphas[i]) + + self._qtgui_time_sink_x_0_0_win = sip.wrapinstance(self.qtgui_time_sink_x_0_0.qwidget(), Qt.QWidget) + self.top_grid_layout.addWidget(self._qtgui_time_sink_x_0_0_win, 15, 0, 10, 4) + for r in range(15, 25): + self.top_grid_layout.setRowStretch(r, 1) + for c in range(0, 4): + self.top_grid_layout.setColumnStretch(c, 1) + self.qtgui_time_sink_x_0 = qtgui.time_sink_c( + 100000, #size + sample_rate, #samp_rate + "1 in 1", #name + 1, #number of inputs + None # parent + ) + self.qtgui_time_sink_x_0.set_update_time(0.1) + self.qtgui_time_sink_x_0.set_y_axis(-1, 1) + + self.qtgui_time_sink_x_0.set_y_label('Amplitude', "") + + self.qtgui_time_sink_x_0.enable_tags(True) + self.qtgui_time_sink_x_0.set_trigger_mode(qtgui.TRIG_MODE_FREE, qtgui.TRIG_SLOPE_POS, 0.005, 0, 0, "") + self.qtgui_time_sink_x_0.enable_autoscale(False) + self.qtgui_time_sink_x_0.enable_grid(True) + self.qtgui_time_sink_x_0.enable_axis_labels(True) + self.qtgui_time_sink_x_0.enable_control_panel(False) + self.qtgui_time_sink_x_0.enable_stem_plot(False) + + + labels = ['', '', '', '', '', + '', '', '', '', ''] + widths = [1, 1, 1, 1, 1, + 1, 1, 1, 1, 1] + colors = ['blue', 'red', 'green', 'black', 'cyan', + 'magenta', 'yellow', 'dark red', 'dark green', 'dark blue'] + alphas = [1.0, 1.0, 1.0, 1.0, 1.0, + 1.0, 1.0, 1.0, 1.0, 1.0] + styles = [1, 1, 1, 1, 1, + 1, 1, 1, 1, 1] + markers = [-1, -1, -1, -1, -1, + -1, -1, -1, -1, -1] + + + for i in range(2): + if len(labels[i]) == 0: + if (i % 2 == 0): + self.qtgui_time_sink_x_0.set_line_label(i, "Re{{Data {0}}}".format(i/2)) + else: + self.qtgui_time_sink_x_0.set_line_label(i, "Im{{Data {0}}}".format(i/2)) + else: + self.qtgui_time_sink_x_0.set_line_label(i, labels[i]) + self.qtgui_time_sink_x_0.set_line_width(i, widths[i]) + self.qtgui_time_sink_x_0.set_line_color(i, colors[i]) + self.qtgui_time_sink_x_0.set_line_style(i, styles[i]) + self.qtgui_time_sink_x_0.set_line_marker(i, markers[i]) + self.qtgui_time_sink_x_0.set_line_alpha(i, alphas[i]) + + self._qtgui_time_sink_x_0_win = sip.wrapinstance(self.qtgui_time_sink_x_0.qwidget(), Qt.QWidget) + self.top_grid_layout.addWidget(self._qtgui_time_sink_x_0_win, 3, 0, 10, 4) + for r in range(3, 13): + self.top_grid_layout.setRowStretch(r, 1) + for c in range(0, 4): + self.top_grid_layout.setColumnStretch(c, 1) + self.blocks_keep_one_in_n_0_0 = blocks.keep_one_in_n(gr.sizeof_gr_complex*1, 100) + self.blocks_keep_one_in_n_0 = blocks.keep_one_in_n(gr.sizeof_gr_complex*1, 10) + + + ################################################## + # Connections + ################################################## + self.connect((self.blocks_keep_one_in_n_0, 0), (self.qtgui_time_sink_x_0_0, 0)) + self.connect((self.blocks_keep_one_in_n_0_0, 0), (self.qtgui_time_sink_x_0_1, 0)) + self.connect((self.uhd_usrp_source_0_0, 0), (self.blocks_keep_one_in_n_0, 0)) + self.connect((self.uhd_usrp_source_0_0, 0), (self.blocks_keep_one_in_n_0_0, 0)) + self.connect((self.uhd_usrp_source_0_0, 0), (self.qtgui_time_sink_x_0, 0)) + + + def closeEvent(self, event): + self.settings = Qt.QSettings("GNU Radio", "time_sink_1_10_100_usrp_n2xx") + self.settings.setValue("geometry", self.saveGeometry()) + self.stop() + self.wait() + + event.accept() + + def get_sample_rate(self): + return self.sample_rate + + def set_sample_rate(self, sample_rate): + self.sample_rate = sample_rate + self._sample_rate_callback(self.sample_rate) + self.qtgui_time_sink_x_0.set_samp_rate(self.sample_rate) + self.qtgui_time_sink_x_0_0.set_samp_rate(self.sample_rate) + self.qtgui_time_sink_x_0_1.set_samp_rate(self.sample_rate) + self.uhd_usrp_source_0_0.set_samp_rate(self.sample_rate) + + def get_rx_usrp_gain(self): + return self.rx_usrp_gain + + def set_rx_usrp_gain(self, rx_usrp_gain): + self.rx_usrp_gain = rx_usrp_gain + self.uhd_usrp_source_0_0.set_gain(self.rx_usrp_gain, 0) + + def get_rx_usrp_channel(self): + return self.rx_usrp_channel + + def set_rx_usrp_channel(self, rx_usrp_channel): + self.rx_usrp_channel = rx_usrp_channel + + def get_rx_usrp_antenna(self): + return self.rx_usrp_antenna + + def set_rx_usrp_antenna(self, rx_usrp_antenna): + self.rx_usrp_antenna = rx_usrp_antenna + self._rx_usrp_antenna_callback(self.rx_usrp_antenna) + self.uhd_usrp_source_0_0.set_antenna(self.rx_usrp_antenna, 0) + + def get_rx_frequency(self): + return self.rx_frequency + + def set_rx_frequency(self, rx_frequency): + self.rx_frequency = rx_frequency + self.uhd_usrp_source_0_0.set_center_freq(self.rx_frequency*1e6, 0) + + + + +def main(top_block_cls=time_sink_1_10_100_usrp_n2xx, options=None): + + if StrictVersion("4.5.0") <= StrictVersion(Qt.qVersion()) < StrictVersion("5.0.0"): + style = gr.prefs().get_string('qtgui', 'style', 'raster') + Qt.QApplication.setGraphicsSystem(style) + qapp = Qt.QApplication(sys.argv) + + tb = top_block_cls() + + tb.start() + + tb.show() + + def sig_handler(sig=None, frame=None): + tb.stop() + tb.wait() + + Qt.QApplication.quit() + + signal.signal(signal.SIGINT, sig_handler) + signal.signal(signal.SIGTERM, sig_handler) + + timer = Qt.QTimer() + timer.start(500) + timer.timeout.connect(lambda: None) + + qapp.exec_() + +if __name__ == '__main__': + main() diff --git a/Flow Graph Library/Inspection Flow Graphs/time_sink_usrp2.grc b/Flow Graph Library/Inspection Flow Graphs/time_sink_usrp2.grc new file mode 100644 index 00000000..797484d4 --- /dev/null +++ b/Flow Graph Library/Inspection Flow Graphs/time_sink_usrp2.grc @@ -0,0 +1,761 @@ +options: + parameters: + author: '' + category: Custom + cmake_opt: '' + comment: '' + copyright: '' + description: '' + gen_cmake: 'On' + gen_linking: dynamic + generate_options: qt_gui + hier_block_src_path: '.:' + id: time_sink_usrp2 + max_nouts: '0' + output_language: python + placement: (0,0) + qt_qss_theme: '' + realtime_scheduling: '' + run: 'True' + run_command: '{python} -u {filename}' + run_options: prompt + sizing_mode: fixed + thread_safe_setters: '' + title: '' + window_size: 1280, 1024 + states: + bus_sink: false + bus_source: false + bus_structure: null + coordinate: [10, 10] + rotation: 0 + state: enabled + +blocks: +- name: decimation + id: variable_qtgui_chooser + parameters: + comment: '' + gui_hint: 0,2,1,1 + label: ' Keep 1 in N' + label0: '' + label1: '' + label2: '' + label3: '' + label4: '' + labels: '["1","10","100","1000"]' + num_opts: '0' + option1: '1' + option2: '2' + option3: '3' + option4: '4' + options: '[1,10,100,1000]' + orient: Qt.QVBoxLayout + type: int + value: '1' + widget: combo_box + states: + bus_sink: false + bus_source: false + bus_structure: null + coordinate: [232, 268] + rotation: 0 + state: enabled +- name: ip_address + id: variable + parameters: + comment: '' + value: '"192.168.140.2"' + states: + bus_sink: false + bus_source: false + bus_structure: null + coordinate: [8, 148] + rotation: 0 + state: disabled +- name: rx_frequency + id: variable_qtgui_range + parameters: + comment: '' + gui_hint: 2,0,1,4 + label: ' Freq. (MHz):' + min_len: '200' + orient: Qt.Horizontal + rangeType: float + start: '50' + step: '.1' + stop: '6000' + value: '2412' + widget: counter_slider + states: + bus_sink: false + bus_source: false + bus_structure: null + coordinate: [400, 140] + rotation: 0 + state: enabled +- name: rx_usrp_antenna + id: variable_qtgui_chooser + parameters: + comment: '' + gui_hint: 0,1,1,1 + label: ' Antenna' + label0: '' + label1: '' + label2: '' + label3: '' + label4: '' + labels: '["TX/RX", "RX2"]' + num_opts: '0' + option1: '1' + option2: '2' + option3: '3' + option4: '4' + options: '["TX/RX", "RX2"]' + orient: Qt.QVBoxLayout + type: string + value: '"TX/RX"' + widget: combo_box + states: + bus_sink: false + bus_source: false + bus_structure: null + coordinate: [232, 140] + rotation: 0 + state: enabled +- name: rx_usrp_channel + id: variable + parameters: + comment: '' + value: '"A:0"' + states: + bus_sink: false + bus_source: false + bus_structure: null + coordinate: [8, 76] + rotation: 0 + state: enabled +- name: rx_usrp_gain + id: variable_qtgui_range + parameters: + comment: '' + gui_hint: 1,0,1,4 + label: ' Gain:' + min_len: '200' + orient: Qt.Horizontal + rangeType: float + start: '0' + step: '1' + stop: '34' + value: '30' + widget: counter_slider + states: + bus_sink: false + bus_source: false + bus_structure: null + coordinate: [400, 12] + rotation: 0 + state: enabled +- name: sample_rate + id: variable_qtgui_chooser + parameters: + comment: '' + gui_hint: 0,0,1,1 + label: Sample Rate + label0: '' + label1: '' + label2: '' + label3: '' + label4: '' + labels: '["1 MS/s", "5 MS/s", "10 MS/s", "20 MS/s"]' + num_opts: '0' + option1: '1' + option2: '2' + option3: '3' + option4: '4' + options: '[1e6, 5e6, 10e6, 20e6]' + orient: Qt.QVBoxLayout + type: real + value: 1e6 + widget: combo_box + states: + bus_sink: false + bus_source: false + bus_structure: null + coordinate: [232, 12] + rotation: 0 + state: enabled +- name: blocks_keep_one_in_n_0 + id: blocks_keep_one_in_n + parameters: + affinity: '' + alias: '' + comment: '' + maxoutbuf: '0' + minoutbuf: '0' + n: decimation + type: complex + vlen: '1' + states: + bus_sink: false + bus_source: false + bus_structure: null + coordinate: [616, 512] + rotation: 0 + state: enabled +- name: qtgui_freq_sink_x_0 + id: qtgui_freq_sink_x + parameters: + affinity: '' + alias: '' + alpha1: '1.0' + alpha10: '1.0' + alpha2: '1.0' + alpha3: '1.0' + alpha4: '1.0' + alpha5: '1.0' + alpha6: '1.0' + alpha7: '1.0' + alpha8: '1.0' + alpha9: '1.0' + autoscale: 'False' + average: '1.0' + axislabels: 'True' + bw: sample_rate + color1: '"blue"' + color10: '"dark blue"' + color2: '"red"' + color3: '"green"' + color4: '"black"' + color5: '"cyan"' + color6: '"magenta"' + color7: '"yellow"' + color8: '"dark red"' + color9: '"dark green"' + comment: '' + ctrlpanel: 'False' + fc: '0' + fftsize: '2048' + freqhalf: 'True' + grid: 'False' + gui_hint: 14,0,10,4 + label: Relative Gain + label1: '' + label10: '' + label2: '' + label3: '' + label4: '' + label5: '' + label6: '' + label7: '' + label8: '' + label9: '' + legend: 'True' + maxoutbuf: '0' + minoutbuf: '0' + name: '""' + nconnections: '1' + showports: 'True' + tr_chan: '0' + tr_level: '0.0' + tr_mode: qtgui.TRIG_MODE_FREE + tr_tag: '""' + type: complex + units: dB + update_time: '0.10' + width1: '1' + width10: '1' + width2: '1' + width3: '1' + width4: '1' + width5: '1' + width6: '1' + width7: '1' + width8: '1' + width9: '1' + wintype: firdes.WIN_BLACKMAN_hARRIS + ymax: '10' + ymin: '-140' + states: + bus_sink: false + bus_source: false + bus_structure: null + coordinate: [856, 492] + rotation: 0 + state: enabled +- name: qtgui_time_sink_x_0 + id: qtgui_time_sink_x + parameters: + affinity: '' + alias: '' + alpha1: '1.0' + alpha10: '1.0' + alpha2: '1.0' + alpha3: '1.0' + alpha4: '1.0' + alpha5: '1.0' + alpha6: '1.0' + alpha7: '1.0' + alpha8: '1.0' + alpha9: '1.0' + autoscale: 'False' + axislabels: 'True' + color1: blue + color10: dark blue + color2: red + color3: green + color4: black + color5: cyan + color6: magenta + color7: yellow + color8: dark red + color9: dark green + comment: '' + ctrlpanel: 'False' + entags: 'True' + grid: 'True' + gui_hint: 3,0,10,4 + label1: '' + label10: '' + label2: '' + label3: '' + label4: '' + label5: '' + label6: '' + label7: '' + label8: '' + label9: '' + legend: 'True' + marker1: '-1' + marker10: '-1' + marker2: '-1' + marker3: '-1' + marker4: '-1' + marker5: '-1' + marker6: '-1' + marker7: '-1' + marker8: '-1' + marker9: '-1' + name: '""' + nconnections: '1' + size: '100000' + srate: sample_rate/decimation + stemplot: 'False' + style1: '1' + style10: '1' + style2: '1' + style3: '1' + style4: '1' + style5: '1' + style6: '1' + style7: '1' + style8: '1' + style9: '1' + tr_chan: '0' + tr_delay: '0' + tr_level: '0.005' + tr_mode: qtgui.TRIG_MODE_FREE + tr_slope: qtgui.TRIG_SLOPE_POS + tr_tag: '""' + type: complex + update_time: '0.1' + width1: '1' + width10: '1' + width2: '1' + width3: '1' + width4: '1' + width5: '1' + width6: '1' + width7: '1' + width8: '1' + width9: '1' + ylabel: Amplitude + ymax: '1' + ymin: '-1' + yunit: '""' + states: + bus_sink: false + bus_source: false + bus_structure: null + coordinate: [856, 404] + rotation: 0 + state: enabled +- name: uhd_usrp_source_0_0 + id: uhd_usrp_source + parameters: + affinity: '' + alias: '' + ant0: rx_usrp_antenna + ant1: '' + ant10: '' + ant11: '' + ant12: '' + ant13: '' + ant14: '' + ant15: '' + ant16: '' + ant17: '' + ant18: '' + ant19: '' + ant2: '' + ant20: '' + ant21: '' + ant22: '' + ant23: '' + ant24: '' + ant25: '' + ant26: '' + ant27: '' + ant28: '' + ant29: '' + ant3: '' + ant30: '' + ant31: '' + ant4: '' + ant5: '' + ant6: '' + ant7: '' + ant8: '' + ant9: '' + bw0: '0' + bw1: '0' + bw10: '0' + bw11: '0' + bw12: '0' + bw13: '0' + bw14: '0' + bw15: '0' + bw16: '0' + bw17: '0' + bw18: '0' + bw19: '0' + bw2: '0' + bw20: '0' + bw21: '0' + bw22: '0' + bw23: '0' + bw24: '0' + bw25: '0' + bw26: '0' + bw27: '0' + bw28: '0' + bw29: '0' + bw3: '0' + bw30: '0' + bw31: '0' + bw4: '0' + bw5: '0' + bw6: '0' + bw7: '0' + bw8: '0' + bw9: '0' + center_freq0: rx_frequency*1e6 + center_freq1: '0' + center_freq10: '0' + center_freq11: '0' + center_freq12: '0' + center_freq13: '0' + center_freq14: '0' + center_freq15: '0' + center_freq16: '0' + center_freq17: '0' + center_freq18: '0' + center_freq19: '0' + center_freq2: '0' + center_freq20: '0' + center_freq21: '0' + center_freq22: '0' + center_freq23: '0' + center_freq24: '0' + center_freq25: '0' + center_freq26: '0' + center_freq27: '0' + center_freq28: '0' + center_freq29: '0' + center_freq3: '0' + center_freq30: '0' + center_freq31: '0' + center_freq4: '0' + center_freq5: '0' + center_freq6: '0' + center_freq7: '0' + center_freq8: '0' + center_freq9: '0' + clock_rate: '0.0' + clock_source0: '' + clock_source1: '' + clock_source2: '' + clock_source3: '' + clock_source4: '' + clock_source5: '' + clock_source6: '' + clock_source7: '' + comment: '' + dc_offs_enb0: '""' + dc_offs_enb1: '""' + dc_offs_enb10: '""' + dc_offs_enb11: '""' + dc_offs_enb12: '""' + dc_offs_enb13: '""' + dc_offs_enb14: '""' + dc_offs_enb15: '""' + dc_offs_enb16: '""' + dc_offs_enb17: '""' + dc_offs_enb18: '""' + dc_offs_enb19: '""' + dc_offs_enb2: '""' + dc_offs_enb20: '""' + dc_offs_enb21: '""' + dc_offs_enb22: '""' + dc_offs_enb23: '""' + dc_offs_enb24: '""' + dc_offs_enb25: '""' + dc_offs_enb26: '""' + dc_offs_enb27: '""' + dc_offs_enb28: '""' + dc_offs_enb29: '""' + dc_offs_enb3: '""' + dc_offs_enb30: '""' + dc_offs_enb31: '""' + dc_offs_enb4: '""' + dc_offs_enb5: '""' + dc_offs_enb6: '""' + dc_offs_enb7: '""' + dc_offs_enb8: '""' + dc_offs_enb9: '""' + dev_addr: '' + dev_args: '""' + gain0: rx_usrp_gain + gain1: '0' + gain10: '0' + gain11: '0' + gain12: '0' + gain13: '0' + gain14: '0' + gain15: '0' + gain16: '0' + gain17: '0' + gain18: '0' + gain19: '0' + gain2: '0' + gain20: '0' + gain21: '0' + gain22: '0' + gain23: '0' + gain24: '0' + gain25: '0' + gain26: '0' + gain27: '0' + gain28: '0' + gain29: '0' + gain3: '0' + gain30: '0' + gain31: '0' + gain4: '0' + gain5: '0' + gain6: '0' + gain7: '0' + gain8: '0' + gain9: '0' + iq_imbal_enb0: '""' + iq_imbal_enb1: '""' + iq_imbal_enb10: '""' + iq_imbal_enb11: '""' + iq_imbal_enb12: '""' + iq_imbal_enb13: '""' + iq_imbal_enb14: '""' + iq_imbal_enb15: '""' + iq_imbal_enb16: '""' + iq_imbal_enb17: '""' + iq_imbal_enb18: '""' + iq_imbal_enb19: '""' + iq_imbal_enb2: '""' + iq_imbal_enb20: '""' + iq_imbal_enb21: '""' + iq_imbal_enb22: '""' + iq_imbal_enb23: '""' + iq_imbal_enb24: '""' + iq_imbal_enb25: '""' + iq_imbal_enb26: '""' + iq_imbal_enb27: '""' + iq_imbal_enb28: '""' + iq_imbal_enb29: '""' + iq_imbal_enb3: '""' + iq_imbal_enb30: '""' + iq_imbal_enb31: '""' + iq_imbal_enb4: '""' + iq_imbal_enb5: '""' + iq_imbal_enb6: '""' + iq_imbal_enb7: '""' + iq_imbal_enb8: '""' + iq_imbal_enb9: '""' + lo_export0: 'False' + lo_export1: 'False' + lo_export10: 'False' + lo_export11: 'False' + lo_export12: 'False' + lo_export13: 'False' + lo_export14: 'False' + lo_export15: 'False' + lo_export16: 'False' + lo_export17: 'False' + lo_export18: 'False' + lo_export19: 'False' + lo_export2: 'False' + lo_export20: 'False' + lo_export21: 'False' + lo_export22: 'False' + lo_export23: 'False' + lo_export24: 'False' + lo_export25: 'False' + lo_export26: 'False' + lo_export27: 'False' + lo_export28: 'False' + lo_export29: 'False' + lo_export3: 'False' + lo_export30: 'False' + lo_export31: 'False' + lo_export4: 'False' + lo_export5: 'False' + lo_export6: 'False' + lo_export7: 'False' + lo_export8: 'False' + lo_export9: 'False' + lo_source0: internal + lo_source1: internal + lo_source10: internal + lo_source11: internal + lo_source12: internal + lo_source13: internal + lo_source14: internal + lo_source15: internal + lo_source16: internal + lo_source17: internal + lo_source18: internal + lo_source19: internal + lo_source2: internal + lo_source20: internal + lo_source21: internal + lo_source22: internal + lo_source23: internal + lo_source24: internal + lo_source25: internal + lo_source26: internal + lo_source27: internal + lo_source28: internal + lo_source29: internal + lo_source3: internal + lo_source30: internal + lo_source31: internal + lo_source4: internal + lo_source5: internal + lo_source6: internal + lo_source7: internal + lo_source8: internal + lo_source9: internal + maxoutbuf: '0' + minoutbuf: '0' + nchan: '1' + norm_gain0: 'False' + norm_gain1: 'False' + norm_gain10: 'False' + norm_gain11: 'False' + norm_gain12: 'False' + norm_gain13: 'False' + norm_gain14: 'False' + norm_gain15: 'False' + norm_gain16: 'False' + norm_gain17: 'False' + norm_gain18: 'False' + norm_gain19: 'False' + norm_gain2: 'False' + norm_gain20: 'False' + norm_gain21: 'False' + norm_gain22: 'False' + norm_gain23: 'False' + norm_gain24: 'False' + norm_gain25: 'False' + norm_gain26: 'False' + norm_gain27: 'False' + norm_gain28: 'False' + norm_gain29: 'False' + norm_gain3: 'False' + norm_gain30: 'False' + norm_gain31: 'False' + norm_gain4: 'False' + norm_gain5: 'False' + norm_gain6: 'False' + norm_gain7: 'False' + norm_gain8: 'False' + norm_gain9: 'False' + num_mboards: '1' + otw: '' + rx_agc0: Default + rx_agc1: Default + rx_agc10: Default + rx_agc11: Default + rx_agc12: Default + rx_agc13: Default + rx_agc14: Default + rx_agc15: Default + rx_agc16: Default + rx_agc17: Default + rx_agc18: Default + rx_agc19: Default + rx_agc2: Default + rx_agc20: Default + rx_agc21: Default + rx_agc22: Default + rx_agc23: Default + rx_agc24: Default + rx_agc25: Default + rx_agc26: Default + rx_agc27: Default + rx_agc28: Default + rx_agc29: Default + rx_agc3: Default + rx_agc30: Default + rx_agc31: Default + rx_agc4: Default + rx_agc5: Default + rx_agc6: Default + rx_agc7: Default + rx_agc8: Default + rx_agc9: Default + samp_rate: sample_rate + sd_spec0: rx_usrp_channel + sd_spec1: '' + sd_spec2: '' + sd_spec3: '' + sd_spec4: '' + sd_spec5: '' + sd_spec6: '' + sd_spec7: '' + show_lo_controls: 'False' + stream_args: '' + stream_chans: '[]' + sync: sync + time_source0: '' + time_source1: '' + time_source2: '' + time_source3: '' + time_source4: '' + time_source5: '' + time_source6: '' + time_source7: '' + type: fc32 + states: + bus_sink: false + bus_source: false + bus_structure: null + coordinate: [320, 468] + rotation: 0 + state: enabled + +connections: +- [blocks_keep_one_in_n_0, '0', qtgui_freq_sink_x_0, '0'] +- [blocks_keep_one_in_n_0, '0', qtgui_time_sink_x_0, '0'] +- [uhd_usrp_source_0_0, '0', blocks_keep_one_in_n_0, '0'] + +metadata: + file_format: 1 diff --git a/Flow Graph Library/Inspection Flow Graphs/time_sink_usrp2.py b/Flow Graph Library/Inspection Flow Graphs/time_sink_usrp2.py new file mode 100755 index 00000000..d8b9c05b --- /dev/null +++ b/Flow Graph Library/Inspection Flow Graphs/time_sink_usrp2.py @@ -0,0 +1,379 @@ +#!/usr/bin/env python3 +# -*- coding: utf-8 -*- + +# +# SPDX-License-Identifier: GPL-3.0 +# +# GNU Radio Python Flow Graph +# Title: Time Sink Usrp2 +# GNU Radio version: 3.10.1.1 + +from packaging.version import Version as StrictVersion + +if __name__ == '__main__': + import ctypes + import sys + if sys.platform.startswith('linux'): + try: + x11 = ctypes.cdll.LoadLibrary('libX11.so') + x11.XInitThreads() + except: + print("Warning: failed to XInitThreads()") + +from PyQt5 import Qt +from PyQt5.QtCore import QObject, pyqtSlot +from gnuradio import qtgui +from gnuradio.filter import firdes +import sip +from gnuradio import blocks +from gnuradio import gr +from gnuradio.fft import window +import sys +import signal +from argparse import ArgumentParser +from gnuradio.eng_arg import eng_float, intx +from gnuradio import eng_notation +from gnuradio import uhd +import time +from gnuradio.qtgui import Range, RangeWidget +from PyQt5 import QtCore + + + +from gnuradio import qtgui + +class time_sink_usrp2(gr.top_block, Qt.QWidget): + + def __init__(self): + gr.top_block.__init__(self, "Time Sink Usrp2", catch_exceptions=True) + Qt.QWidget.__init__(self) + self.setWindowTitle("Time Sink Usrp2") + qtgui.util.check_set_qss() + try: + self.setWindowIcon(Qt.QIcon.fromTheme('gnuradio-grc')) + except: + pass + self.top_scroll_layout = Qt.QVBoxLayout() + self.setLayout(self.top_scroll_layout) + self.top_scroll = Qt.QScrollArea() + self.top_scroll.setFrameStyle(Qt.QFrame.NoFrame) + self.top_scroll_layout.addWidget(self.top_scroll) + self.top_scroll.setWidgetResizable(True) + self.top_widget = Qt.QWidget() + self.top_scroll.setWidget(self.top_widget) + self.top_layout = Qt.QVBoxLayout(self.top_widget) + self.top_grid_layout = Qt.QGridLayout() + self.top_layout.addLayout(self.top_grid_layout) + + self.settings = Qt.QSettings("GNU Radio", "time_sink_usrp2") + + try: + if StrictVersion(Qt.qVersion()) < StrictVersion("5.0.0"): + self.restoreGeometry(self.settings.value("geometry").toByteArray()) + else: + self.restoreGeometry(self.settings.value("geometry")) + except: + pass + + ################################################## + # Variables + ################################################## + self.sample_rate = sample_rate = 1e6 + self.rx_usrp_gain = rx_usrp_gain = 30 + self.rx_usrp_channel = rx_usrp_channel = "A:0" + self.rx_usrp_antenna = rx_usrp_antenna = "TX/RX" + self.rx_frequency = rx_frequency = 2412 + self.decimation = decimation = 1 + + ################################################## + # Blocks + ################################################## + # Create the options list + self._sample_rate_options = [1000000.0, 5000000.0, 10000000.0, 20000000.0] + # Create the labels list + self._sample_rate_labels = ['1 MS/s', '5 MS/s', '10 MS/s', '20 MS/s'] + # Create the combo box + self._sample_rate_tool_bar = Qt.QToolBar(self) + self._sample_rate_tool_bar.addWidget(Qt.QLabel("Sample Rate" + ": ")) + self._sample_rate_combo_box = Qt.QComboBox() + self._sample_rate_tool_bar.addWidget(self._sample_rate_combo_box) + for _label in self._sample_rate_labels: self._sample_rate_combo_box.addItem(_label) + self._sample_rate_callback = lambda i: Qt.QMetaObject.invokeMethod(self._sample_rate_combo_box, "setCurrentIndex", Qt.Q_ARG("int", self._sample_rate_options.index(i))) + self._sample_rate_callback(self.sample_rate) + self._sample_rate_combo_box.currentIndexChanged.connect( + lambda i: self.set_sample_rate(self._sample_rate_options[i])) + # Create the radio buttons + self.top_grid_layout.addWidget(self._sample_rate_tool_bar, 0, 0, 1, 1) + for r in range(0, 1): + self.top_grid_layout.setRowStretch(r, 1) + for c in range(0, 1): + self.top_grid_layout.setColumnStretch(c, 1) + self._rx_usrp_gain_range = Range(0, 34, 1, 30, 200) + self._rx_usrp_gain_win = RangeWidget(self._rx_usrp_gain_range, self.set_rx_usrp_gain, " Gain:", "counter_slider", float, QtCore.Qt.Horizontal) + self.top_grid_layout.addWidget(self._rx_usrp_gain_win, 1, 0, 1, 4) + for r in range(1, 2): + self.top_grid_layout.setRowStretch(r, 1) + for c in range(0, 4): + self.top_grid_layout.setColumnStretch(c, 1) + # Create the options list + self._rx_usrp_antenna_options = ['TX/RX', 'RX2'] + # Create the labels list + self._rx_usrp_antenna_labels = ['TX/RX', 'RX2'] + # Create the combo box + self._rx_usrp_antenna_tool_bar = Qt.QToolBar(self) + self._rx_usrp_antenna_tool_bar.addWidget(Qt.QLabel(" Antenna" + ": ")) + self._rx_usrp_antenna_combo_box = Qt.QComboBox() + self._rx_usrp_antenna_tool_bar.addWidget(self._rx_usrp_antenna_combo_box) + for _label in self._rx_usrp_antenna_labels: self._rx_usrp_antenna_combo_box.addItem(_label) + self._rx_usrp_antenna_callback = lambda i: Qt.QMetaObject.invokeMethod(self._rx_usrp_antenna_combo_box, "setCurrentIndex", Qt.Q_ARG("int", self._rx_usrp_antenna_options.index(i))) + self._rx_usrp_antenna_callback(self.rx_usrp_antenna) + self._rx_usrp_antenna_combo_box.currentIndexChanged.connect( + lambda i: self.set_rx_usrp_antenna(self._rx_usrp_antenna_options[i])) + # Create the radio buttons + self.top_grid_layout.addWidget(self._rx_usrp_antenna_tool_bar, 0, 1, 1, 1) + for r in range(0, 1): + self.top_grid_layout.setRowStretch(r, 1) + for c in range(1, 2): + self.top_grid_layout.setColumnStretch(c, 1) + self._rx_frequency_range = Range(50, 6000, .1, 2412, 200) + self._rx_frequency_win = RangeWidget(self._rx_frequency_range, self.set_rx_frequency, " Freq. (MHz):", "counter_slider", float, QtCore.Qt.Horizontal) + self.top_grid_layout.addWidget(self._rx_frequency_win, 2, 0, 1, 4) + for r in range(2, 3): + self.top_grid_layout.setRowStretch(r, 1) + for c in range(0, 4): + self.top_grid_layout.setColumnStretch(c, 1) + # Create the options list + self._decimation_options = [1, 10, 100, 1000] + # Create the labels list + self._decimation_labels = ['1', '10', '100', '1000'] + # Create the combo box + self._decimation_tool_bar = Qt.QToolBar(self) + self._decimation_tool_bar.addWidget(Qt.QLabel(" Keep 1 in N" + ": ")) + self._decimation_combo_box = Qt.QComboBox() + self._decimation_tool_bar.addWidget(self._decimation_combo_box) + for _label in self._decimation_labels: self._decimation_combo_box.addItem(_label) + self._decimation_callback = lambda i: Qt.QMetaObject.invokeMethod(self._decimation_combo_box, "setCurrentIndex", Qt.Q_ARG("int", self._decimation_options.index(i))) + self._decimation_callback(self.decimation) + self._decimation_combo_box.currentIndexChanged.connect( + lambda i: self.set_decimation(self._decimation_options[i])) + # Create the radio buttons + self.top_grid_layout.addWidget(self._decimation_tool_bar, 0, 2, 1, 1) + for r in range(0, 1): + self.top_grid_layout.setRowStretch(r, 1) + for c in range(2, 3): + self.top_grid_layout.setColumnStretch(c, 1) + self.uhd_usrp_source_0_0 = uhd.usrp_source( + ",".join(('', "")), + uhd.stream_args( + cpu_format="fc32", + args='', + channels=list(range(0,1)), + ), + ) + self.uhd_usrp_source_0_0.set_subdev_spec(rx_usrp_channel, 0) + self.uhd_usrp_source_0_0.set_samp_rate(sample_rate) + self.uhd_usrp_source_0_0.set_time_unknown_pps(uhd.time_spec(0)) + + self.uhd_usrp_source_0_0.set_center_freq(rx_frequency*1e6, 0) + self.uhd_usrp_source_0_0.set_antenna(rx_usrp_antenna, 0) + self.uhd_usrp_source_0_0.set_gain(rx_usrp_gain, 0) + self.qtgui_time_sink_x_0 = qtgui.time_sink_c( + 100000, #size + sample_rate/decimation, #samp_rate + "", #name + 1, #number of inputs + None # parent + ) + self.qtgui_time_sink_x_0.set_update_time(0.1) + self.qtgui_time_sink_x_0.set_y_axis(-1, 1) + + self.qtgui_time_sink_x_0.set_y_label('Amplitude', "") + + self.qtgui_time_sink_x_0.enable_tags(True) + self.qtgui_time_sink_x_0.set_trigger_mode(qtgui.TRIG_MODE_FREE, qtgui.TRIG_SLOPE_POS, 0.005, 0, 0, "") + self.qtgui_time_sink_x_0.enable_autoscale(False) + self.qtgui_time_sink_x_0.enable_grid(True) + self.qtgui_time_sink_x_0.enable_axis_labels(True) + self.qtgui_time_sink_x_0.enable_control_panel(False) + self.qtgui_time_sink_x_0.enable_stem_plot(False) + + + labels = ['', '', '', '', '', + '', '', '', '', ''] + widths = [1, 1, 1, 1, 1, + 1, 1, 1, 1, 1] + colors = ['blue', 'red', 'green', 'black', 'cyan', + 'magenta', 'yellow', 'dark red', 'dark green', 'dark blue'] + alphas = [1.0, 1.0, 1.0, 1.0, 1.0, + 1.0, 1.0, 1.0, 1.0, 1.0] + styles = [1, 1, 1, 1, 1, + 1, 1, 1, 1, 1] + markers = [-1, -1, -1, -1, -1, + -1, -1, -1, -1, -1] + + + for i in range(2): + if len(labels[i]) == 0: + if (i % 2 == 0): + self.qtgui_time_sink_x_0.set_line_label(i, "Re{{Data {0}}}".format(i/2)) + else: + self.qtgui_time_sink_x_0.set_line_label(i, "Im{{Data {0}}}".format(i/2)) + else: + self.qtgui_time_sink_x_0.set_line_label(i, labels[i]) + self.qtgui_time_sink_x_0.set_line_width(i, widths[i]) + self.qtgui_time_sink_x_0.set_line_color(i, colors[i]) + self.qtgui_time_sink_x_0.set_line_style(i, styles[i]) + self.qtgui_time_sink_x_0.set_line_marker(i, markers[i]) + self.qtgui_time_sink_x_0.set_line_alpha(i, alphas[i]) + + self._qtgui_time_sink_x_0_win = sip.wrapinstance(self.qtgui_time_sink_x_0.qwidget(), Qt.QWidget) + self.top_grid_layout.addWidget(self._qtgui_time_sink_x_0_win, 3, 0, 10, 4) + for r in range(3, 13): + self.top_grid_layout.setRowStretch(r, 1) + for c in range(0, 4): + self.top_grid_layout.setColumnStretch(c, 1) + self.qtgui_freq_sink_x_0 = qtgui.freq_sink_c( + 2048, #size + window.WIN_BLACKMAN_hARRIS, #wintype + 0, #fc + sample_rate, #bw + "", #name + 1, + None # parent + ) + self.qtgui_freq_sink_x_0.set_update_time(0.10) + self.qtgui_freq_sink_x_0.set_y_axis(-140, 10) + self.qtgui_freq_sink_x_0.set_y_label('Relative Gain', 'dB') + self.qtgui_freq_sink_x_0.set_trigger_mode(qtgui.TRIG_MODE_FREE, 0.0, 0, "") + self.qtgui_freq_sink_x_0.enable_autoscale(False) + self.qtgui_freq_sink_x_0.enable_grid(False) + self.qtgui_freq_sink_x_0.set_fft_average(1.0) + self.qtgui_freq_sink_x_0.enable_axis_labels(True) + self.qtgui_freq_sink_x_0.enable_control_panel(False) + self.qtgui_freq_sink_x_0.set_fft_window_normalized(False) + + + + labels = ['', '', '', '', '', + '', '', '', '', ''] + widths = [1, 1, 1, 1, 1, + 1, 1, 1, 1, 1] + colors = ["blue", "red", "green", "black", "cyan", + "magenta", "yellow", "dark red", "dark green", "dark blue"] + alphas = [1.0, 1.0, 1.0, 1.0, 1.0, + 1.0, 1.0, 1.0, 1.0, 1.0] + + for i in range(1): + if len(labels[i]) == 0: + self.qtgui_freq_sink_x_0.set_line_label(i, "Data {0}".format(i)) + else: + self.qtgui_freq_sink_x_0.set_line_label(i, labels[i]) + self.qtgui_freq_sink_x_0.set_line_width(i, widths[i]) + self.qtgui_freq_sink_x_0.set_line_color(i, colors[i]) + self.qtgui_freq_sink_x_0.set_line_alpha(i, alphas[i]) + + self._qtgui_freq_sink_x_0_win = sip.wrapinstance(self.qtgui_freq_sink_x_0.qwidget(), Qt.QWidget) + self.top_grid_layout.addWidget(self._qtgui_freq_sink_x_0_win, 14, 0, 10, 4) + for r in range(14, 24): + self.top_grid_layout.setRowStretch(r, 1) + for c in range(0, 4): + self.top_grid_layout.setColumnStretch(c, 1) + self.blocks_keep_one_in_n_0 = blocks.keep_one_in_n(gr.sizeof_gr_complex*1, decimation) + + + ################################################## + # Connections + ################################################## + self.connect((self.blocks_keep_one_in_n_0, 0), (self.qtgui_freq_sink_x_0, 0)) + self.connect((self.blocks_keep_one_in_n_0, 0), (self.qtgui_time_sink_x_0, 0)) + self.connect((self.uhd_usrp_source_0_0, 0), (self.blocks_keep_one_in_n_0, 0)) + + + def closeEvent(self, event): + self.settings = Qt.QSettings("GNU Radio", "time_sink_usrp2") + self.settings.setValue("geometry", self.saveGeometry()) + self.stop() + self.wait() + + event.accept() + + def get_sample_rate(self): + return self.sample_rate + + def set_sample_rate(self, sample_rate): + self.sample_rate = sample_rate + self._sample_rate_callback(self.sample_rate) + self.qtgui_freq_sink_x_0.set_frequency_range(0, self.sample_rate) + self.qtgui_time_sink_x_0.set_samp_rate(self.sample_rate/self.decimation) + self.uhd_usrp_source_0_0.set_samp_rate(self.sample_rate) + + def get_rx_usrp_gain(self): + return self.rx_usrp_gain + + def set_rx_usrp_gain(self, rx_usrp_gain): + self.rx_usrp_gain = rx_usrp_gain + self.uhd_usrp_source_0_0.set_gain(self.rx_usrp_gain, 0) + + def get_rx_usrp_channel(self): + return self.rx_usrp_channel + + def set_rx_usrp_channel(self, rx_usrp_channel): + self.rx_usrp_channel = rx_usrp_channel + + def get_rx_usrp_antenna(self): + return self.rx_usrp_antenna + + def set_rx_usrp_antenna(self, rx_usrp_antenna): + self.rx_usrp_antenna = rx_usrp_antenna + self._rx_usrp_antenna_callback(self.rx_usrp_antenna) + self.uhd_usrp_source_0_0.set_antenna(self.rx_usrp_antenna, 0) + + def get_rx_frequency(self): + return self.rx_frequency + + def set_rx_frequency(self, rx_frequency): + self.rx_frequency = rx_frequency + self.uhd_usrp_source_0_0.set_center_freq(self.rx_frequency*1e6, 0) + + def get_decimation(self): + return self.decimation + + def set_decimation(self, decimation): + self.decimation = decimation + self._decimation_callback(self.decimation) + self.blocks_keep_one_in_n_0.set_n(self.decimation) + self.qtgui_time_sink_x_0.set_samp_rate(self.sample_rate/self.decimation) + + + + +def main(top_block_cls=time_sink_usrp2, options=None): + + if StrictVersion("4.5.0") <= StrictVersion(Qt.qVersion()) < StrictVersion("5.0.0"): + style = gr.prefs().get_string('qtgui', 'style', 'raster') + Qt.QApplication.setGraphicsSystem(style) + qapp = Qt.QApplication(sys.argv) + + tb = top_block_cls() + + tb.start() + + tb.show() + + def sig_handler(sig=None, frame=None): + tb.stop() + tb.wait() + + Qt.QApplication.quit() + + signal.signal(signal.SIGINT, sig_handler) + signal.signal(signal.SIGTERM, sig_handler) + + timer = Qt.QTimer() + timer.start(500) + timer.timeout.connect(lambda: None) + + qapp.exec_() + +if __name__ == '__main__': + main() diff --git a/Flow Graph Library/Inspection Flow Graphs/time_sink_usrp_n2xx.grc b/Flow Graph Library/Inspection Flow Graphs/time_sink_usrp_n2xx.grc new file mode 100644 index 00000000..8de571ad --- /dev/null +++ b/Flow Graph Library/Inspection Flow Graphs/time_sink_usrp_n2xx.grc @@ -0,0 +1,761 @@ +options: + parameters: + author: '' + category: Custom + cmake_opt: '' + comment: '' + copyright: '' + description: '' + gen_cmake: 'On' + gen_linking: dynamic + generate_options: qt_gui + hier_block_src_path: '.:' + id: time_sink_usrp_n2xx + max_nouts: '0' + output_language: python + placement: (0,0) + qt_qss_theme: '' + realtime_scheduling: '' + run: 'True' + run_command: '{python} -u {filename}' + run_options: prompt + sizing_mode: fixed + thread_safe_setters: '' + title: '' + window_size: 1280, 1024 + states: + bus_sink: false + bus_source: false + bus_structure: null + coordinate: [10, 10] + rotation: 0 + state: enabled + +blocks: +- name: decimation + id: variable_qtgui_chooser + parameters: + comment: '' + gui_hint: 0,2,1,1 + label: ' Keep 1 in N' + label0: '' + label1: '' + label2: '' + label3: '' + label4: '' + labels: '["1","10","100","1000"]' + num_opts: '0' + option1: '1' + option2: '2' + option3: '3' + option4: '4' + options: '[1,10,100,1000]' + orient: Qt.QVBoxLayout + type: int + value: '1' + widget: combo_box + states: + bus_sink: false + bus_source: false + bus_structure: null + coordinate: [232, 268] + rotation: 0 + state: enabled +- name: ip_address + id: variable + parameters: + comment: '' + value: '"192.168.140.2"' + states: + bus_sink: false + bus_source: false + bus_structure: null + coordinate: [8, 148] + rotation: 0 + state: disabled +- name: rx_frequency + id: variable_qtgui_range + parameters: + comment: '' + gui_hint: 2,0,1,4 + label: ' Freq. (MHz):' + min_len: '200' + orient: Qt.Horizontal + rangeType: float + start: '50' + step: '.1' + stop: '6000' + value: '2412' + widget: counter_slider + states: + bus_sink: false + bus_source: false + bus_structure: null + coordinate: [400, 140] + rotation: 0 + state: enabled +- name: rx_usrp_antenna + id: variable_qtgui_chooser + parameters: + comment: '' + gui_hint: 0,1,1,1 + label: ' Antenna' + label0: '' + label1: '' + label2: '' + label3: '' + label4: '' + labels: '["TX/RX", "RX2"]' + num_opts: '0' + option1: '1' + option2: '2' + option3: '3' + option4: '4' + options: '["TX/RX", "RX2"]' + orient: Qt.QVBoxLayout + type: string + value: '"TX/RX"' + widget: combo_box + states: + bus_sink: false + bus_source: false + bus_structure: null + coordinate: [232, 140] + rotation: 0 + state: enabled +- name: rx_usrp_channel + id: variable + parameters: + comment: '' + value: '"A:0"' + states: + bus_sink: false + bus_source: false + bus_structure: null + coordinate: [8, 76] + rotation: 0 + state: enabled +- name: rx_usrp_gain + id: variable_qtgui_range + parameters: + comment: '' + gui_hint: 1,0,1,4 + label: ' Gain:' + min_len: '200' + orient: Qt.Horizontal + rangeType: float + start: '0' + step: '1' + stop: '34' + value: '30' + widget: counter_slider + states: + bus_sink: false + bus_source: false + bus_structure: null + coordinate: [400, 12] + rotation: 0 + state: enabled +- name: sample_rate + id: variable_qtgui_chooser + parameters: + comment: '' + gui_hint: 0,0,1,1 + label: Sample Rate + label0: '' + label1: '' + label2: '' + label3: '' + label4: '' + labels: '["1 MS/s", "5 MS/s", "10 MS/s", "20 MS/s"]' + num_opts: '0' + option1: '1' + option2: '2' + option3: '3' + option4: '4' + options: '[1e6, 5e6, 10e6, 20e6]' + orient: Qt.QVBoxLayout + type: real + value: 1e6 + widget: combo_box + states: + bus_sink: false + bus_source: false + bus_structure: null + coordinate: [232, 12] + rotation: 0 + state: enabled +- name: blocks_keep_one_in_n_0 + id: blocks_keep_one_in_n + parameters: + affinity: '' + alias: '' + comment: '' + maxoutbuf: '0' + minoutbuf: '0' + n: decimation + type: complex + vlen: '1' + states: + bus_sink: false + bus_source: false + bus_structure: null + coordinate: [616, 512] + rotation: 0 + state: enabled +- name: qtgui_freq_sink_x_0 + id: qtgui_freq_sink_x + parameters: + affinity: '' + alias: '' + alpha1: '1.0' + alpha10: '1.0' + alpha2: '1.0' + alpha3: '1.0' + alpha4: '1.0' + alpha5: '1.0' + alpha6: '1.0' + alpha7: '1.0' + alpha8: '1.0' + alpha9: '1.0' + autoscale: 'False' + average: '1.0' + axislabels: 'True' + bw: sample_rate + color1: '"blue"' + color10: '"dark blue"' + color2: '"red"' + color3: '"green"' + color4: '"black"' + color5: '"cyan"' + color6: '"magenta"' + color7: '"yellow"' + color8: '"dark red"' + color9: '"dark green"' + comment: '' + ctrlpanel: 'False' + fc: '0' + fftsize: '2048' + freqhalf: 'True' + grid: 'False' + gui_hint: 14,0,10,4 + label: Relative Gain + label1: '' + label10: '' + label2: '' + label3: '' + label4: '' + label5: '' + label6: '' + label7: '' + label8: '' + label9: '' + legend: 'True' + maxoutbuf: '0' + minoutbuf: '0' + name: '""' + nconnections: '1' + showports: 'True' + tr_chan: '0' + tr_level: '0.0' + tr_mode: qtgui.TRIG_MODE_FREE + tr_tag: '""' + type: complex + units: dB + update_time: '0.10' + width1: '1' + width10: '1' + width2: '1' + width3: '1' + width4: '1' + width5: '1' + width6: '1' + width7: '1' + width8: '1' + width9: '1' + wintype: firdes.WIN_BLACKMAN_hARRIS + ymax: '10' + ymin: '-140' + states: + bus_sink: false + bus_source: false + bus_structure: null + coordinate: [856, 492] + rotation: 0 + state: enabled +- name: qtgui_time_sink_x_0 + id: qtgui_time_sink_x + parameters: + affinity: '' + alias: '' + alpha1: '1.0' + alpha10: '1.0' + alpha2: '1.0' + alpha3: '1.0' + alpha4: '1.0' + alpha5: '1.0' + alpha6: '1.0' + alpha7: '1.0' + alpha8: '1.0' + alpha9: '1.0' + autoscale: 'False' + axislabels: 'True' + color1: blue + color10: dark blue + color2: red + color3: green + color4: black + color5: cyan + color6: magenta + color7: yellow + color8: dark red + color9: dark green + comment: '' + ctrlpanel: 'False' + entags: 'True' + grid: 'True' + gui_hint: 3,0,10,4 + label1: '' + label10: '' + label2: '' + label3: '' + label4: '' + label5: '' + label6: '' + label7: '' + label8: '' + label9: '' + legend: 'True' + marker1: '-1' + marker10: '-1' + marker2: '-1' + marker3: '-1' + marker4: '-1' + marker5: '-1' + marker6: '-1' + marker7: '-1' + marker8: '-1' + marker9: '-1' + name: '""' + nconnections: '1' + size: '100000' + srate: sample_rate/decimation + stemplot: 'False' + style1: '1' + style10: '1' + style2: '1' + style3: '1' + style4: '1' + style5: '1' + style6: '1' + style7: '1' + style8: '1' + style9: '1' + tr_chan: '0' + tr_delay: '0' + tr_level: '0.005' + tr_mode: qtgui.TRIG_MODE_FREE + tr_slope: qtgui.TRIG_SLOPE_POS + tr_tag: '""' + type: complex + update_time: '0.1' + width1: '1' + width10: '1' + width2: '1' + width3: '1' + width4: '1' + width5: '1' + width6: '1' + width7: '1' + width8: '1' + width9: '1' + ylabel: Amplitude + ymax: '1' + ymin: '-1' + yunit: '""' + states: + bus_sink: false + bus_source: false + bus_structure: null + coordinate: [856, 404] + rotation: 0 + state: enabled +- name: uhd_usrp_source_0_0 + id: uhd_usrp_source + parameters: + affinity: '' + alias: '' + ant0: rx_usrp_antenna + ant1: '' + ant10: '' + ant11: '' + ant12: '' + ant13: '' + ant14: '' + ant15: '' + ant16: '' + ant17: '' + ant18: '' + ant19: '' + ant2: '' + ant20: '' + ant21: '' + ant22: '' + ant23: '' + ant24: '' + ant25: '' + ant26: '' + ant27: '' + ant28: '' + ant29: '' + ant3: '' + ant30: '' + ant31: '' + ant4: '' + ant5: '' + ant6: '' + ant7: '' + ant8: '' + ant9: '' + bw0: '0' + bw1: '0' + bw10: '0' + bw11: '0' + bw12: '0' + bw13: '0' + bw14: '0' + bw15: '0' + bw16: '0' + bw17: '0' + bw18: '0' + bw19: '0' + bw2: '0' + bw20: '0' + bw21: '0' + bw22: '0' + bw23: '0' + bw24: '0' + bw25: '0' + bw26: '0' + bw27: '0' + bw28: '0' + bw29: '0' + bw3: '0' + bw30: '0' + bw31: '0' + bw4: '0' + bw5: '0' + bw6: '0' + bw7: '0' + bw8: '0' + bw9: '0' + center_freq0: rx_frequency*1e6 + center_freq1: '0' + center_freq10: '0' + center_freq11: '0' + center_freq12: '0' + center_freq13: '0' + center_freq14: '0' + center_freq15: '0' + center_freq16: '0' + center_freq17: '0' + center_freq18: '0' + center_freq19: '0' + center_freq2: '0' + center_freq20: '0' + center_freq21: '0' + center_freq22: '0' + center_freq23: '0' + center_freq24: '0' + center_freq25: '0' + center_freq26: '0' + center_freq27: '0' + center_freq28: '0' + center_freq29: '0' + center_freq3: '0' + center_freq30: '0' + center_freq31: '0' + center_freq4: '0' + center_freq5: '0' + center_freq6: '0' + center_freq7: '0' + center_freq8: '0' + center_freq9: '0' + clock_rate: '0.0' + clock_source0: '' + clock_source1: '' + clock_source2: '' + clock_source3: '' + clock_source4: '' + clock_source5: '' + clock_source6: '' + clock_source7: '' + comment: '' + dc_offs_enb0: '""' + dc_offs_enb1: '""' + dc_offs_enb10: '""' + dc_offs_enb11: '""' + dc_offs_enb12: '""' + dc_offs_enb13: '""' + dc_offs_enb14: '""' + dc_offs_enb15: '""' + dc_offs_enb16: '""' + dc_offs_enb17: '""' + dc_offs_enb18: '""' + dc_offs_enb19: '""' + dc_offs_enb2: '""' + dc_offs_enb20: '""' + dc_offs_enb21: '""' + dc_offs_enb22: '""' + dc_offs_enb23: '""' + dc_offs_enb24: '""' + dc_offs_enb25: '""' + dc_offs_enb26: '""' + dc_offs_enb27: '""' + dc_offs_enb28: '""' + dc_offs_enb29: '""' + dc_offs_enb3: '""' + dc_offs_enb30: '""' + dc_offs_enb31: '""' + dc_offs_enb4: '""' + dc_offs_enb5: '""' + dc_offs_enb6: '""' + dc_offs_enb7: '""' + dc_offs_enb8: '""' + dc_offs_enb9: '""' + dev_addr: '' + dev_args: '""' + gain0: rx_usrp_gain + gain1: '0' + gain10: '0' + gain11: '0' + gain12: '0' + gain13: '0' + gain14: '0' + gain15: '0' + gain16: '0' + gain17: '0' + gain18: '0' + gain19: '0' + gain2: '0' + gain20: '0' + gain21: '0' + gain22: '0' + gain23: '0' + gain24: '0' + gain25: '0' + gain26: '0' + gain27: '0' + gain28: '0' + gain29: '0' + gain3: '0' + gain30: '0' + gain31: '0' + gain4: '0' + gain5: '0' + gain6: '0' + gain7: '0' + gain8: '0' + gain9: '0' + iq_imbal_enb0: '""' + iq_imbal_enb1: '""' + iq_imbal_enb10: '""' + iq_imbal_enb11: '""' + iq_imbal_enb12: '""' + iq_imbal_enb13: '""' + iq_imbal_enb14: '""' + iq_imbal_enb15: '""' + iq_imbal_enb16: '""' + iq_imbal_enb17: '""' + iq_imbal_enb18: '""' + iq_imbal_enb19: '""' + iq_imbal_enb2: '""' + iq_imbal_enb20: '""' + iq_imbal_enb21: '""' + iq_imbal_enb22: '""' + iq_imbal_enb23: '""' + iq_imbal_enb24: '""' + iq_imbal_enb25: '""' + iq_imbal_enb26: '""' + iq_imbal_enb27: '""' + iq_imbal_enb28: '""' + iq_imbal_enb29: '""' + iq_imbal_enb3: '""' + iq_imbal_enb30: '""' + iq_imbal_enb31: '""' + iq_imbal_enb4: '""' + iq_imbal_enb5: '""' + iq_imbal_enb6: '""' + iq_imbal_enb7: '""' + iq_imbal_enb8: '""' + iq_imbal_enb9: '""' + lo_export0: 'False' + lo_export1: 'False' + lo_export10: 'False' + lo_export11: 'False' + lo_export12: 'False' + lo_export13: 'False' + lo_export14: 'False' + lo_export15: 'False' + lo_export16: 'False' + lo_export17: 'False' + lo_export18: 'False' + lo_export19: 'False' + lo_export2: 'False' + lo_export20: 'False' + lo_export21: 'False' + lo_export22: 'False' + lo_export23: 'False' + lo_export24: 'False' + lo_export25: 'False' + lo_export26: 'False' + lo_export27: 'False' + lo_export28: 'False' + lo_export29: 'False' + lo_export3: 'False' + lo_export30: 'False' + lo_export31: 'False' + lo_export4: 'False' + lo_export5: 'False' + lo_export6: 'False' + lo_export7: 'False' + lo_export8: 'False' + lo_export9: 'False' + lo_source0: internal + lo_source1: internal + lo_source10: internal + lo_source11: internal + lo_source12: internal + lo_source13: internal + lo_source14: internal + lo_source15: internal + lo_source16: internal + lo_source17: internal + lo_source18: internal + lo_source19: internal + lo_source2: internal + lo_source20: internal + lo_source21: internal + lo_source22: internal + lo_source23: internal + lo_source24: internal + lo_source25: internal + lo_source26: internal + lo_source27: internal + lo_source28: internal + lo_source29: internal + lo_source3: internal + lo_source30: internal + lo_source31: internal + lo_source4: internal + lo_source5: internal + lo_source6: internal + lo_source7: internal + lo_source8: internal + lo_source9: internal + maxoutbuf: '0' + minoutbuf: '0' + nchan: '1' + norm_gain0: 'False' + norm_gain1: 'False' + norm_gain10: 'False' + norm_gain11: 'False' + norm_gain12: 'False' + norm_gain13: 'False' + norm_gain14: 'False' + norm_gain15: 'False' + norm_gain16: 'False' + norm_gain17: 'False' + norm_gain18: 'False' + norm_gain19: 'False' + norm_gain2: 'False' + norm_gain20: 'False' + norm_gain21: 'False' + norm_gain22: 'False' + norm_gain23: 'False' + norm_gain24: 'False' + norm_gain25: 'False' + norm_gain26: 'False' + norm_gain27: 'False' + norm_gain28: 'False' + norm_gain29: 'False' + norm_gain3: 'False' + norm_gain30: 'False' + norm_gain31: 'False' + norm_gain4: 'False' + norm_gain5: 'False' + norm_gain6: 'False' + norm_gain7: 'False' + norm_gain8: 'False' + norm_gain9: 'False' + num_mboards: '1' + otw: '' + rx_agc0: Default + rx_agc1: Default + rx_agc10: Default + rx_agc11: Default + rx_agc12: Default + rx_agc13: Default + rx_agc14: Default + rx_agc15: Default + rx_agc16: Default + rx_agc17: Default + rx_agc18: Default + rx_agc19: Default + rx_agc2: Default + rx_agc20: Default + rx_agc21: Default + rx_agc22: Default + rx_agc23: Default + rx_agc24: Default + rx_agc25: Default + rx_agc26: Default + rx_agc27: Default + rx_agc28: Default + rx_agc29: Default + rx_agc3: Default + rx_agc30: Default + rx_agc31: Default + rx_agc4: Default + rx_agc5: Default + rx_agc6: Default + rx_agc7: Default + rx_agc8: Default + rx_agc9: Default + samp_rate: sample_rate + sd_spec0: rx_usrp_channel + sd_spec1: '' + sd_spec2: '' + sd_spec3: '' + sd_spec4: '' + sd_spec5: '' + sd_spec6: '' + sd_spec7: '' + show_lo_controls: 'False' + stream_args: '' + stream_chans: '[]' + sync: sync + time_source0: '' + time_source1: '' + time_source2: '' + time_source3: '' + time_source4: '' + time_source5: '' + time_source6: '' + time_source7: '' + type: fc32 + states: + bus_sink: false + bus_source: false + bus_structure: null + coordinate: [320, 468] + rotation: 0 + state: enabled + +connections: +- [blocks_keep_one_in_n_0, '0', qtgui_freq_sink_x_0, '0'] +- [blocks_keep_one_in_n_0, '0', qtgui_time_sink_x_0, '0'] +- [uhd_usrp_source_0_0, '0', blocks_keep_one_in_n_0, '0'] + +metadata: + file_format: 1 diff --git a/Flow Graph Library/Inspection Flow Graphs/time_sink_usrp_n2xx.py b/Flow Graph Library/Inspection Flow Graphs/time_sink_usrp_n2xx.py new file mode 100755 index 00000000..98bad616 --- /dev/null +++ b/Flow Graph Library/Inspection Flow Graphs/time_sink_usrp_n2xx.py @@ -0,0 +1,379 @@ +#!/usr/bin/env python3 +# -*- coding: utf-8 -*- + +# +# SPDX-License-Identifier: GPL-3.0 +# +# GNU Radio Python Flow Graph +# Title: Time Sink Usrp N2Xx +# GNU Radio version: 3.10.1.1 + +from packaging.version import Version as StrictVersion + +if __name__ == '__main__': + import ctypes + import sys + if sys.platform.startswith('linux'): + try: + x11 = ctypes.cdll.LoadLibrary('libX11.so') + x11.XInitThreads() + except: + print("Warning: failed to XInitThreads()") + +from PyQt5 import Qt +from PyQt5.QtCore import QObject, pyqtSlot +from gnuradio import qtgui +from gnuradio.filter import firdes +import sip +from gnuradio import blocks +from gnuradio import gr +from gnuradio.fft import window +import sys +import signal +from argparse import ArgumentParser +from gnuradio.eng_arg import eng_float, intx +from gnuradio import eng_notation +from gnuradio import uhd +import time +from gnuradio.qtgui import Range, RangeWidget +from PyQt5 import QtCore + + + +from gnuradio import qtgui + +class time_sink_usrp_n2xx(gr.top_block, Qt.QWidget): + + def __init__(self): + gr.top_block.__init__(self, "Time Sink Usrp N2Xx", catch_exceptions=True) + Qt.QWidget.__init__(self) + self.setWindowTitle("Time Sink Usrp N2Xx") + qtgui.util.check_set_qss() + try: + self.setWindowIcon(Qt.QIcon.fromTheme('gnuradio-grc')) + except: + pass + self.top_scroll_layout = Qt.QVBoxLayout() + self.setLayout(self.top_scroll_layout) + self.top_scroll = Qt.QScrollArea() + self.top_scroll.setFrameStyle(Qt.QFrame.NoFrame) + self.top_scroll_layout.addWidget(self.top_scroll) + self.top_scroll.setWidgetResizable(True) + self.top_widget = Qt.QWidget() + self.top_scroll.setWidget(self.top_widget) + self.top_layout = Qt.QVBoxLayout(self.top_widget) + self.top_grid_layout = Qt.QGridLayout() + self.top_layout.addLayout(self.top_grid_layout) + + self.settings = Qt.QSettings("GNU Radio", "time_sink_usrp_n2xx") + + try: + if StrictVersion(Qt.qVersion()) < StrictVersion("5.0.0"): + self.restoreGeometry(self.settings.value("geometry").toByteArray()) + else: + self.restoreGeometry(self.settings.value("geometry")) + except: + pass + + ################################################## + # Variables + ################################################## + self.sample_rate = sample_rate = 1e6 + self.rx_usrp_gain = rx_usrp_gain = 30 + self.rx_usrp_channel = rx_usrp_channel = "A:0" + self.rx_usrp_antenna = rx_usrp_antenna = "TX/RX" + self.rx_frequency = rx_frequency = 2412 + self.decimation = decimation = 1 + + ################################################## + # Blocks + ################################################## + # Create the options list + self._sample_rate_options = [1000000.0, 5000000.0, 10000000.0, 20000000.0] + # Create the labels list + self._sample_rate_labels = ['1 MS/s', '5 MS/s', '10 MS/s', '20 MS/s'] + # Create the combo box + self._sample_rate_tool_bar = Qt.QToolBar(self) + self._sample_rate_tool_bar.addWidget(Qt.QLabel("Sample Rate" + ": ")) + self._sample_rate_combo_box = Qt.QComboBox() + self._sample_rate_tool_bar.addWidget(self._sample_rate_combo_box) + for _label in self._sample_rate_labels: self._sample_rate_combo_box.addItem(_label) + self._sample_rate_callback = lambda i: Qt.QMetaObject.invokeMethod(self._sample_rate_combo_box, "setCurrentIndex", Qt.Q_ARG("int", self._sample_rate_options.index(i))) + self._sample_rate_callback(self.sample_rate) + self._sample_rate_combo_box.currentIndexChanged.connect( + lambda i: self.set_sample_rate(self._sample_rate_options[i])) + # Create the radio buttons + self.top_grid_layout.addWidget(self._sample_rate_tool_bar, 0, 0, 1, 1) + for r in range(0, 1): + self.top_grid_layout.setRowStretch(r, 1) + for c in range(0, 1): + self.top_grid_layout.setColumnStretch(c, 1) + self._rx_usrp_gain_range = Range(0, 34, 1, 30, 200) + self._rx_usrp_gain_win = RangeWidget(self._rx_usrp_gain_range, self.set_rx_usrp_gain, " Gain:", "counter_slider", float, QtCore.Qt.Horizontal) + self.top_grid_layout.addWidget(self._rx_usrp_gain_win, 1, 0, 1, 4) + for r in range(1, 2): + self.top_grid_layout.setRowStretch(r, 1) + for c in range(0, 4): + self.top_grid_layout.setColumnStretch(c, 1) + # Create the options list + self._rx_usrp_antenna_options = ['TX/RX', 'RX2'] + # Create the labels list + self._rx_usrp_antenna_labels = ['TX/RX', 'RX2'] + # Create the combo box + self._rx_usrp_antenna_tool_bar = Qt.QToolBar(self) + self._rx_usrp_antenna_tool_bar.addWidget(Qt.QLabel(" Antenna" + ": ")) + self._rx_usrp_antenna_combo_box = Qt.QComboBox() + self._rx_usrp_antenna_tool_bar.addWidget(self._rx_usrp_antenna_combo_box) + for _label in self._rx_usrp_antenna_labels: self._rx_usrp_antenna_combo_box.addItem(_label) + self._rx_usrp_antenna_callback = lambda i: Qt.QMetaObject.invokeMethod(self._rx_usrp_antenna_combo_box, "setCurrentIndex", Qt.Q_ARG("int", self._rx_usrp_antenna_options.index(i))) + self._rx_usrp_antenna_callback(self.rx_usrp_antenna) + self._rx_usrp_antenna_combo_box.currentIndexChanged.connect( + lambda i: self.set_rx_usrp_antenna(self._rx_usrp_antenna_options[i])) + # Create the radio buttons + self.top_grid_layout.addWidget(self._rx_usrp_antenna_tool_bar, 0, 1, 1, 1) + for r in range(0, 1): + self.top_grid_layout.setRowStretch(r, 1) + for c in range(1, 2): + self.top_grid_layout.setColumnStretch(c, 1) + self._rx_frequency_range = Range(50, 6000, .1, 2412, 200) + self._rx_frequency_win = RangeWidget(self._rx_frequency_range, self.set_rx_frequency, " Freq. (MHz):", "counter_slider", float, QtCore.Qt.Horizontal) + self.top_grid_layout.addWidget(self._rx_frequency_win, 2, 0, 1, 4) + for r in range(2, 3): + self.top_grid_layout.setRowStretch(r, 1) + for c in range(0, 4): + self.top_grid_layout.setColumnStretch(c, 1) + # Create the options list + self._decimation_options = [1, 10, 100, 1000] + # Create the labels list + self._decimation_labels = ['1', '10', '100', '1000'] + # Create the combo box + self._decimation_tool_bar = Qt.QToolBar(self) + self._decimation_tool_bar.addWidget(Qt.QLabel(" Keep 1 in N" + ": ")) + self._decimation_combo_box = Qt.QComboBox() + self._decimation_tool_bar.addWidget(self._decimation_combo_box) + for _label in self._decimation_labels: self._decimation_combo_box.addItem(_label) + self._decimation_callback = lambda i: Qt.QMetaObject.invokeMethod(self._decimation_combo_box, "setCurrentIndex", Qt.Q_ARG("int", self._decimation_options.index(i))) + self._decimation_callback(self.decimation) + self._decimation_combo_box.currentIndexChanged.connect( + lambda i: self.set_decimation(self._decimation_options[i])) + # Create the radio buttons + self.top_grid_layout.addWidget(self._decimation_tool_bar, 0, 2, 1, 1) + for r in range(0, 1): + self.top_grid_layout.setRowStretch(r, 1) + for c in range(2, 3): + self.top_grid_layout.setColumnStretch(c, 1) + self.uhd_usrp_source_0_0 = uhd.usrp_source( + ",".join(('', "")), + uhd.stream_args( + cpu_format="fc32", + args='', + channels=list(range(0,1)), + ), + ) + self.uhd_usrp_source_0_0.set_subdev_spec(rx_usrp_channel, 0) + self.uhd_usrp_source_0_0.set_samp_rate(sample_rate) + self.uhd_usrp_source_0_0.set_time_unknown_pps(uhd.time_spec(0)) + + self.uhd_usrp_source_0_0.set_center_freq(rx_frequency*1e6, 0) + self.uhd_usrp_source_0_0.set_antenna(rx_usrp_antenna, 0) + self.uhd_usrp_source_0_0.set_gain(rx_usrp_gain, 0) + self.qtgui_time_sink_x_0 = qtgui.time_sink_c( + 100000, #size + sample_rate/decimation, #samp_rate + "", #name + 1, #number of inputs + None # parent + ) + self.qtgui_time_sink_x_0.set_update_time(0.1) + self.qtgui_time_sink_x_0.set_y_axis(-1, 1) + + self.qtgui_time_sink_x_0.set_y_label('Amplitude', "") + + self.qtgui_time_sink_x_0.enable_tags(True) + self.qtgui_time_sink_x_0.set_trigger_mode(qtgui.TRIG_MODE_FREE, qtgui.TRIG_SLOPE_POS, 0.005, 0, 0, "") + self.qtgui_time_sink_x_0.enable_autoscale(False) + self.qtgui_time_sink_x_0.enable_grid(True) + self.qtgui_time_sink_x_0.enable_axis_labels(True) + self.qtgui_time_sink_x_0.enable_control_panel(False) + self.qtgui_time_sink_x_0.enable_stem_plot(False) + + + labels = ['', '', '', '', '', + '', '', '', '', ''] + widths = [1, 1, 1, 1, 1, + 1, 1, 1, 1, 1] + colors = ['blue', 'red', 'green', 'black', 'cyan', + 'magenta', 'yellow', 'dark red', 'dark green', 'dark blue'] + alphas = [1.0, 1.0, 1.0, 1.0, 1.0, + 1.0, 1.0, 1.0, 1.0, 1.0] + styles = [1, 1, 1, 1, 1, + 1, 1, 1, 1, 1] + markers = [-1, -1, -1, -1, -1, + -1, -1, -1, -1, -1] + + + for i in range(2): + if len(labels[i]) == 0: + if (i % 2 == 0): + self.qtgui_time_sink_x_0.set_line_label(i, "Re{{Data {0}}}".format(i/2)) + else: + self.qtgui_time_sink_x_0.set_line_label(i, "Im{{Data {0}}}".format(i/2)) + else: + self.qtgui_time_sink_x_0.set_line_label(i, labels[i]) + self.qtgui_time_sink_x_0.set_line_width(i, widths[i]) + self.qtgui_time_sink_x_0.set_line_color(i, colors[i]) + self.qtgui_time_sink_x_0.set_line_style(i, styles[i]) + self.qtgui_time_sink_x_0.set_line_marker(i, markers[i]) + self.qtgui_time_sink_x_0.set_line_alpha(i, alphas[i]) + + self._qtgui_time_sink_x_0_win = sip.wrapinstance(self.qtgui_time_sink_x_0.qwidget(), Qt.QWidget) + self.top_grid_layout.addWidget(self._qtgui_time_sink_x_0_win, 3, 0, 10, 4) + for r in range(3, 13): + self.top_grid_layout.setRowStretch(r, 1) + for c in range(0, 4): + self.top_grid_layout.setColumnStretch(c, 1) + self.qtgui_freq_sink_x_0 = qtgui.freq_sink_c( + 2048, #size + window.WIN_BLACKMAN_hARRIS, #wintype + 0, #fc + sample_rate, #bw + "", #name + 1, + None # parent + ) + self.qtgui_freq_sink_x_0.set_update_time(0.10) + self.qtgui_freq_sink_x_0.set_y_axis(-140, 10) + self.qtgui_freq_sink_x_0.set_y_label('Relative Gain', 'dB') + self.qtgui_freq_sink_x_0.set_trigger_mode(qtgui.TRIG_MODE_FREE, 0.0, 0, "") + self.qtgui_freq_sink_x_0.enable_autoscale(False) + self.qtgui_freq_sink_x_0.enable_grid(False) + self.qtgui_freq_sink_x_0.set_fft_average(1.0) + self.qtgui_freq_sink_x_0.enable_axis_labels(True) + self.qtgui_freq_sink_x_0.enable_control_panel(False) + self.qtgui_freq_sink_x_0.set_fft_window_normalized(False) + + + + labels = ['', '', '', '', '', + '', '', '', '', ''] + widths = [1, 1, 1, 1, 1, + 1, 1, 1, 1, 1] + colors = ["blue", "red", "green", "black", "cyan", + "magenta", "yellow", "dark red", "dark green", "dark blue"] + alphas = [1.0, 1.0, 1.0, 1.0, 1.0, + 1.0, 1.0, 1.0, 1.0, 1.0] + + for i in range(1): + if len(labels[i]) == 0: + self.qtgui_freq_sink_x_0.set_line_label(i, "Data {0}".format(i)) + else: + self.qtgui_freq_sink_x_0.set_line_label(i, labels[i]) + self.qtgui_freq_sink_x_0.set_line_width(i, widths[i]) + self.qtgui_freq_sink_x_0.set_line_color(i, colors[i]) + self.qtgui_freq_sink_x_0.set_line_alpha(i, alphas[i]) + + self._qtgui_freq_sink_x_0_win = sip.wrapinstance(self.qtgui_freq_sink_x_0.qwidget(), Qt.QWidget) + self.top_grid_layout.addWidget(self._qtgui_freq_sink_x_0_win, 14, 0, 10, 4) + for r in range(14, 24): + self.top_grid_layout.setRowStretch(r, 1) + for c in range(0, 4): + self.top_grid_layout.setColumnStretch(c, 1) + self.blocks_keep_one_in_n_0 = blocks.keep_one_in_n(gr.sizeof_gr_complex*1, decimation) + + + ################################################## + # Connections + ################################################## + self.connect((self.blocks_keep_one_in_n_0, 0), (self.qtgui_freq_sink_x_0, 0)) + self.connect((self.blocks_keep_one_in_n_0, 0), (self.qtgui_time_sink_x_0, 0)) + self.connect((self.uhd_usrp_source_0_0, 0), (self.blocks_keep_one_in_n_0, 0)) + + + def closeEvent(self, event): + self.settings = Qt.QSettings("GNU Radio", "time_sink_usrp_n2xx") + self.settings.setValue("geometry", self.saveGeometry()) + self.stop() + self.wait() + + event.accept() + + def get_sample_rate(self): + return self.sample_rate + + def set_sample_rate(self, sample_rate): + self.sample_rate = sample_rate + self._sample_rate_callback(self.sample_rate) + self.qtgui_freq_sink_x_0.set_frequency_range(0, self.sample_rate) + self.qtgui_time_sink_x_0.set_samp_rate(self.sample_rate/self.decimation) + self.uhd_usrp_source_0_0.set_samp_rate(self.sample_rate) + + def get_rx_usrp_gain(self): + return self.rx_usrp_gain + + def set_rx_usrp_gain(self, rx_usrp_gain): + self.rx_usrp_gain = rx_usrp_gain + self.uhd_usrp_source_0_0.set_gain(self.rx_usrp_gain, 0) + + def get_rx_usrp_channel(self): + return self.rx_usrp_channel + + def set_rx_usrp_channel(self, rx_usrp_channel): + self.rx_usrp_channel = rx_usrp_channel + + def get_rx_usrp_antenna(self): + return self.rx_usrp_antenna + + def set_rx_usrp_antenna(self, rx_usrp_antenna): + self.rx_usrp_antenna = rx_usrp_antenna + self._rx_usrp_antenna_callback(self.rx_usrp_antenna) + self.uhd_usrp_source_0_0.set_antenna(self.rx_usrp_antenna, 0) + + def get_rx_frequency(self): + return self.rx_frequency + + def set_rx_frequency(self, rx_frequency): + self.rx_frequency = rx_frequency + self.uhd_usrp_source_0_0.set_center_freq(self.rx_frequency*1e6, 0) + + def get_decimation(self): + return self.decimation + + def set_decimation(self, decimation): + self.decimation = decimation + self._decimation_callback(self.decimation) + self.blocks_keep_one_in_n_0.set_n(self.decimation) + self.qtgui_time_sink_x_0.set_samp_rate(self.sample_rate/self.decimation) + + + + +def main(top_block_cls=time_sink_usrp_n2xx, options=None): + + if StrictVersion("4.5.0") <= StrictVersion(Qt.qVersion()) < StrictVersion("5.0.0"): + style = gr.prefs().get_string('qtgui', 'style', 'raster') + Qt.QApplication.setGraphicsSystem(style) + qapp = Qt.QApplication(sys.argv) + + tb = top_block_cls() + + tb.start() + + tb.show() + + def sig_handler(sig=None, frame=None): + tb.stop() + tb.wait() + + Qt.QApplication.quit() + + signal.signal(signal.SIGINT, sig_handler) + signal.signal(signal.SIGTERM, sig_handler) + + timer = Qt.QTimer() + timer.start(500) + timer.timeout.connect(lambda: None) + + qapp.exec_() + +if __name__ == '__main__': + main() diff --git a/Flow Graph Library/Inspection Flow Graphs/waterfall_usrp2.grc b/Flow Graph Library/Inspection Flow Graphs/waterfall_usrp2.grc new file mode 100644 index 00000000..48ebc651 --- /dev/null +++ b/Flow Graph Library/Inspection Flow Graphs/waterfall_usrp2.grc @@ -0,0 +1,596 @@ +options: + parameters: + author: '' + category: Custom + cmake_opt: '' + comment: '' + copyright: '' + description: '' + gen_cmake: 'On' + gen_linking: dynamic + generate_options: qt_gui + hier_block_src_path: '.:' + id: waterfall_usrp2 + max_nouts: '0' + output_language: python + placement: (0,0) + qt_qss_theme: '' + realtime_scheduling: '' + run: 'True' + run_command: '{python} -u {filename}' + run_options: prompt + sizing_mode: fixed + thread_safe_setters: '' + title: '' + window_size: 1280, 1024 + states: + bus_sink: false + bus_source: false + bus_structure: null + coordinate: [10, 10] + rotation: 0 + state: enabled + +blocks: +- name: ip_address + id: variable + parameters: + comment: '' + value: '"192.168.140.2"' + states: + bus_sink: false + bus_source: false + bus_structure: null + coordinate: [8, 148] + rotation: 0 + state: disabled +- name: rx_frequency + id: variable_qtgui_range + parameters: + comment: '' + gui_hint: 2,0,1,4 + label: ' Freq. (MHz):' + min_len: '200' + orient: Qt.Horizontal + rangeType: float + start: '50' + step: '.1' + stop: '6000' + value: '2412' + widget: counter_slider + states: + bus_sink: false + bus_source: false + bus_structure: null + coordinate: [400, 140] + rotation: 0 + state: enabled +- name: rx_usrp_antenna + id: variable_qtgui_chooser + parameters: + comment: '' + gui_hint: 0,1,1,1 + label: ' Antenna' + label0: '' + label1: '' + label2: '' + label3: '' + label4: '' + labels: '["TX/RX", "RX2"]' + num_opts: '0' + option1: '1' + option2: '2' + option3: '3' + option4: '4' + options: '["TX/RX", "RX2"]' + orient: Qt.QVBoxLayout + type: string + value: '"TX/RX"' + widget: combo_box + states: + bus_sink: false + bus_source: false + bus_structure: null + coordinate: [232, 140] + rotation: 0 + state: enabled +- name: rx_usrp_channel + id: variable + parameters: + comment: '' + value: '"A:0"' + states: + bus_sink: false + bus_source: false + bus_structure: null + coordinate: [8, 76] + rotation: 0 + state: enabled +- name: rx_usrp_gain + id: variable_qtgui_range + parameters: + comment: '' + gui_hint: 1,0,1,4 + label: ' Gain:' + min_len: '200' + orient: Qt.Horizontal + rangeType: float + start: '0' + step: '1' + stop: '34' + value: '30' + widget: counter_slider + states: + bus_sink: false + bus_source: false + bus_structure: null + coordinate: [400, 12] + rotation: 0 + state: enabled +- name: sample_rate + id: variable_qtgui_chooser + parameters: + comment: '' + gui_hint: 0,0,1,1 + label: Sample Rate + label0: '' + label1: '' + label2: '' + label3: '' + label4: '' + labels: '["1 MS/s", "5 MS/s", "10 MS/s", "20 MS/s"]' + num_opts: '0' + option1: '1' + option2: '2' + option3: '3' + option4: '4' + options: '[1e6, 5e6, 10e6, 20e6]' + orient: Qt.QVBoxLayout + type: real + value: 1e6 + widget: combo_box + states: + bus_sink: false + bus_source: false + bus_structure: null + coordinate: [232, 12] + rotation: 0 + state: enabled +- name: qtgui_waterfall_sink_x_0 + id: qtgui_waterfall_sink_x + parameters: + affinity: '' + alias: '' + alpha1: '1.0' + alpha10: '1.0' + alpha2: '1.0' + alpha3: '1.0' + alpha4: '1.0' + alpha5: '1.0' + alpha6: '1.0' + alpha7: '1.0' + alpha8: '1.0' + alpha9: '1.0' + axislabels: 'True' + bw: sample_rate + color1: '0' + color10: '0' + color2: '0' + color3: '0' + color4: '0' + color5: '0' + color6: '0' + color7: '0' + color8: '0' + color9: '0' + comment: '' + fc: '0' + fftsize: '1024' + freqhalf: 'True' + grid: 'False' + gui_hint: 3,0,6,4 + int_max: '10' + int_min: '-140' + label1: '' + label10: '' + label2: '' + label3: '' + label4: '' + label5: '' + label6: '' + label7: '' + label8: '' + label9: '' + legend: 'True' + maxoutbuf: '0' + minoutbuf: '0' + name: '""' + nconnections: '1' + showports: 'True' + type: complex + update_time: '0.10' + wintype: firdes.WIN_BLACKMAN_hARRIS + states: + bus_sink: false + bus_source: false + bus_structure: null + coordinate: [712, 484] + rotation: 0 + state: enabled +- name: uhd_usrp_source_0_0 + id: uhd_usrp_source + parameters: + affinity: '' + alias: '' + ant0: rx_usrp_antenna + ant1: '' + ant10: '' + ant11: '' + ant12: '' + ant13: '' + ant14: '' + ant15: '' + ant16: '' + ant17: '' + ant18: '' + ant19: '' + ant2: '' + ant20: '' + ant21: '' + ant22: '' + ant23: '' + ant24: '' + ant25: '' + ant26: '' + ant27: '' + ant28: '' + ant29: '' + ant3: '' + ant30: '' + ant31: '' + ant4: '' + ant5: '' + ant6: '' + ant7: '' + ant8: '' + ant9: '' + bw0: '0' + bw1: '0' + bw10: '0' + bw11: '0' + bw12: '0' + bw13: '0' + bw14: '0' + bw15: '0' + bw16: '0' + bw17: '0' + bw18: '0' + bw19: '0' + bw2: '0' + bw20: '0' + bw21: '0' + bw22: '0' + bw23: '0' + bw24: '0' + bw25: '0' + bw26: '0' + bw27: '0' + bw28: '0' + bw29: '0' + bw3: '0' + bw30: '0' + bw31: '0' + bw4: '0' + bw5: '0' + bw6: '0' + bw7: '0' + bw8: '0' + bw9: '0' + center_freq0: rx_frequency*1e6 + center_freq1: '0' + center_freq10: '0' + center_freq11: '0' + center_freq12: '0' + center_freq13: '0' + center_freq14: '0' + center_freq15: '0' + center_freq16: '0' + center_freq17: '0' + center_freq18: '0' + center_freq19: '0' + center_freq2: '0' + center_freq20: '0' + center_freq21: '0' + center_freq22: '0' + center_freq23: '0' + center_freq24: '0' + center_freq25: '0' + center_freq26: '0' + center_freq27: '0' + center_freq28: '0' + center_freq29: '0' + center_freq3: '0' + center_freq30: '0' + center_freq31: '0' + center_freq4: '0' + center_freq5: '0' + center_freq6: '0' + center_freq7: '0' + center_freq8: '0' + center_freq9: '0' + clock_rate: '0.0' + clock_source0: '' + clock_source1: '' + clock_source2: '' + clock_source3: '' + clock_source4: '' + clock_source5: '' + clock_source6: '' + clock_source7: '' + comment: '' + dc_offs_enb0: '""' + dc_offs_enb1: '""' + dc_offs_enb10: '""' + dc_offs_enb11: '""' + dc_offs_enb12: '""' + dc_offs_enb13: '""' + dc_offs_enb14: '""' + dc_offs_enb15: '""' + dc_offs_enb16: '""' + dc_offs_enb17: '""' + dc_offs_enb18: '""' + dc_offs_enb19: '""' + dc_offs_enb2: '""' + dc_offs_enb20: '""' + dc_offs_enb21: '""' + dc_offs_enb22: '""' + dc_offs_enb23: '""' + dc_offs_enb24: '""' + dc_offs_enb25: '""' + dc_offs_enb26: '""' + dc_offs_enb27: '""' + dc_offs_enb28: '""' + dc_offs_enb29: '""' + dc_offs_enb3: '""' + dc_offs_enb30: '""' + dc_offs_enb31: '""' + dc_offs_enb4: '""' + dc_offs_enb5: '""' + dc_offs_enb6: '""' + dc_offs_enb7: '""' + dc_offs_enb8: '""' + dc_offs_enb9: '""' + dev_addr: '' + dev_args: '""' + gain0: rx_usrp_gain + gain1: '0' + gain10: '0' + gain11: '0' + gain12: '0' + gain13: '0' + gain14: '0' + gain15: '0' + gain16: '0' + gain17: '0' + gain18: '0' + gain19: '0' + gain2: '0' + gain20: '0' + gain21: '0' + gain22: '0' + gain23: '0' + gain24: '0' + gain25: '0' + gain26: '0' + gain27: '0' + gain28: '0' + gain29: '0' + gain3: '0' + gain30: '0' + gain31: '0' + gain4: '0' + gain5: '0' + gain6: '0' + gain7: '0' + gain8: '0' + gain9: '0' + iq_imbal_enb0: '""' + iq_imbal_enb1: '""' + iq_imbal_enb10: '""' + iq_imbal_enb11: '""' + iq_imbal_enb12: '""' + iq_imbal_enb13: '""' + iq_imbal_enb14: '""' + iq_imbal_enb15: '""' + iq_imbal_enb16: '""' + iq_imbal_enb17: '""' + iq_imbal_enb18: '""' + iq_imbal_enb19: '""' + iq_imbal_enb2: '""' + iq_imbal_enb20: '""' + iq_imbal_enb21: '""' + iq_imbal_enb22: '""' + iq_imbal_enb23: '""' + iq_imbal_enb24: '""' + iq_imbal_enb25: '""' + iq_imbal_enb26: '""' + iq_imbal_enb27: '""' + iq_imbal_enb28: '""' + iq_imbal_enb29: '""' + iq_imbal_enb3: '""' + iq_imbal_enb30: '""' + iq_imbal_enb31: '""' + iq_imbal_enb4: '""' + iq_imbal_enb5: '""' + iq_imbal_enb6: '""' + iq_imbal_enb7: '""' + iq_imbal_enb8: '""' + iq_imbal_enb9: '""' + lo_export0: 'False' + lo_export1: 'False' + lo_export10: 'False' + lo_export11: 'False' + lo_export12: 'False' + lo_export13: 'False' + lo_export14: 'False' + lo_export15: 'False' + lo_export16: 'False' + lo_export17: 'False' + lo_export18: 'False' + lo_export19: 'False' + lo_export2: 'False' + lo_export20: 'False' + lo_export21: 'False' + lo_export22: 'False' + lo_export23: 'False' + lo_export24: 'False' + lo_export25: 'False' + lo_export26: 'False' + lo_export27: 'False' + lo_export28: 'False' + lo_export29: 'False' + lo_export3: 'False' + lo_export30: 'False' + lo_export31: 'False' + lo_export4: 'False' + lo_export5: 'False' + lo_export6: 'False' + lo_export7: 'False' + lo_export8: 'False' + lo_export9: 'False' + lo_source0: internal + lo_source1: internal + lo_source10: internal + lo_source11: internal + lo_source12: internal + lo_source13: internal + lo_source14: internal + lo_source15: internal + lo_source16: internal + lo_source17: internal + lo_source18: internal + lo_source19: internal + lo_source2: internal + lo_source20: internal + lo_source21: internal + lo_source22: internal + lo_source23: internal + lo_source24: internal + lo_source25: internal + lo_source26: internal + lo_source27: internal + lo_source28: internal + lo_source29: internal + lo_source3: internal + lo_source30: internal + lo_source31: internal + lo_source4: internal + lo_source5: internal + lo_source6: internal + lo_source7: internal + lo_source8: internal + lo_source9: internal + maxoutbuf: '0' + minoutbuf: '0' + nchan: '1' + norm_gain0: 'False' + norm_gain1: 'False' + norm_gain10: 'False' + norm_gain11: 'False' + norm_gain12: 'False' + norm_gain13: 'False' + norm_gain14: 'False' + norm_gain15: 'False' + norm_gain16: 'False' + norm_gain17: 'False' + norm_gain18: 'False' + norm_gain19: 'False' + norm_gain2: 'False' + norm_gain20: 'False' + norm_gain21: 'False' + norm_gain22: 'False' + norm_gain23: 'False' + norm_gain24: 'False' + norm_gain25: 'False' + norm_gain26: 'False' + norm_gain27: 'False' + norm_gain28: 'False' + norm_gain29: 'False' + norm_gain3: 'False' + norm_gain30: 'False' + norm_gain31: 'False' + norm_gain4: 'False' + norm_gain5: 'False' + norm_gain6: 'False' + norm_gain7: 'False' + norm_gain8: 'False' + norm_gain9: 'False' + num_mboards: '1' + otw: '' + rx_agc0: Default + rx_agc1: Default + rx_agc10: Default + rx_agc11: Default + rx_agc12: Default + rx_agc13: Default + rx_agc14: Default + rx_agc15: Default + rx_agc16: Default + rx_agc17: Default + rx_agc18: Default + rx_agc19: Default + rx_agc2: Default + rx_agc20: Default + rx_agc21: Default + rx_agc22: Default + rx_agc23: Default + rx_agc24: Default + rx_agc25: Default + rx_agc26: Default + rx_agc27: Default + rx_agc28: Default + rx_agc29: Default + rx_agc3: Default + rx_agc30: Default + rx_agc31: Default + rx_agc4: Default + rx_agc5: Default + rx_agc6: Default + rx_agc7: Default + rx_agc8: Default + rx_agc9: Default + samp_rate: sample_rate + sd_spec0: rx_usrp_channel + sd_spec1: '' + sd_spec2: '' + sd_spec3: '' + sd_spec4: '' + sd_spec5: '' + sd_spec6: '' + sd_spec7: '' + show_lo_controls: 'False' + stream_args: '' + stream_chans: '[]' + sync: sync + time_source0: '' + time_source1: '' + time_source2: '' + time_source3: '' + time_source4: '' + time_source5: '' + time_source6: '' + time_source7: '' + type: fc32 + states: + bus_sink: false + bus_source: false + bus_structure: null + coordinate: [320, 468] + rotation: 0 + state: enabled + +connections: +- [uhd_usrp_source_0_0, '0', qtgui_waterfall_sink_x_0, '0'] + +metadata: + file_format: 1 diff --git a/Flow Graph Library/Inspection Flow Graphs/waterfall_usrp2.py b/Flow Graph Library/Inspection Flow Graphs/waterfall_usrp2.py new file mode 100755 index 00000000..f879ae31 --- /dev/null +++ b/Flow Graph Library/Inspection Flow Graphs/waterfall_usrp2.py @@ -0,0 +1,282 @@ +#!/usr/bin/env python3 +# -*- coding: utf-8 -*- + +# +# SPDX-License-Identifier: GPL-3.0 +# +# GNU Radio Python Flow Graph +# Title: Waterfall Usrp2 +# GNU Radio version: 3.10.1.1 + +from packaging.version import Version as StrictVersion + +if __name__ == '__main__': + import ctypes + import sys + if sys.platform.startswith('linux'): + try: + x11 = ctypes.cdll.LoadLibrary('libX11.so') + x11.XInitThreads() + except: + print("Warning: failed to XInitThreads()") + +from PyQt5 import Qt +from PyQt5.QtCore import QObject, pyqtSlot +from gnuradio import qtgui +from gnuradio.filter import firdes +import sip +from gnuradio import gr +from gnuradio.fft import window +import sys +import signal +from argparse import ArgumentParser +from gnuradio.eng_arg import eng_float, intx +from gnuradio import eng_notation +from gnuradio import uhd +import time +from gnuradio.qtgui import Range, RangeWidget +from PyQt5 import QtCore + + + +from gnuradio import qtgui + +class waterfall_usrp2(gr.top_block, Qt.QWidget): + + def __init__(self): + gr.top_block.__init__(self, "Waterfall Usrp2", catch_exceptions=True) + Qt.QWidget.__init__(self) + self.setWindowTitle("Waterfall Usrp2") + qtgui.util.check_set_qss() + try: + self.setWindowIcon(Qt.QIcon.fromTheme('gnuradio-grc')) + except: + pass + self.top_scroll_layout = Qt.QVBoxLayout() + self.setLayout(self.top_scroll_layout) + self.top_scroll = Qt.QScrollArea() + self.top_scroll.setFrameStyle(Qt.QFrame.NoFrame) + self.top_scroll_layout.addWidget(self.top_scroll) + self.top_scroll.setWidgetResizable(True) + self.top_widget = Qt.QWidget() + self.top_scroll.setWidget(self.top_widget) + self.top_layout = Qt.QVBoxLayout(self.top_widget) + self.top_grid_layout = Qt.QGridLayout() + self.top_layout.addLayout(self.top_grid_layout) + + self.settings = Qt.QSettings("GNU Radio", "waterfall_usrp2") + + try: + if StrictVersion(Qt.qVersion()) < StrictVersion("5.0.0"): + self.restoreGeometry(self.settings.value("geometry").toByteArray()) + else: + self.restoreGeometry(self.settings.value("geometry")) + except: + pass + + ################################################## + # Variables + ################################################## + self.sample_rate = sample_rate = 1e6 + self.rx_usrp_gain = rx_usrp_gain = 30 + self.rx_usrp_channel = rx_usrp_channel = "A:0" + self.rx_usrp_antenna = rx_usrp_antenna = "TX/RX" + self.rx_frequency = rx_frequency = 2412 + + ################################################## + # Blocks + ################################################## + # Create the options list + self._sample_rate_options = [1000000.0, 5000000.0, 10000000.0, 20000000.0] + # Create the labels list + self._sample_rate_labels = ['1 MS/s', '5 MS/s', '10 MS/s', '20 MS/s'] + # Create the combo box + self._sample_rate_tool_bar = Qt.QToolBar(self) + self._sample_rate_tool_bar.addWidget(Qt.QLabel("Sample Rate" + ": ")) + self._sample_rate_combo_box = Qt.QComboBox() + self._sample_rate_tool_bar.addWidget(self._sample_rate_combo_box) + for _label in self._sample_rate_labels: self._sample_rate_combo_box.addItem(_label) + self._sample_rate_callback = lambda i: Qt.QMetaObject.invokeMethod(self._sample_rate_combo_box, "setCurrentIndex", Qt.Q_ARG("int", self._sample_rate_options.index(i))) + self._sample_rate_callback(self.sample_rate) + self._sample_rate_combo_box.currentIndexChanged.connect( + lambda i: self.set_sample_rate(self._sample_rate_options[i])) + # Create the radio buttons + self.top_grid_layout.addWidget(self._sample_rate_tool_bar, 0, 0, 1, 1) + for r in range(0, 1): + self.top_grid_layout.setRowStretch(r, 1) + for c in range(0, 1): + self.top_grid_layout.setColumnStretch(c, 1) + self._rx_usrp_gain_range = Range(0, 34, 1, 30, 200) + self._rx_usrp_gain_win = RangeWidget(self._rx_usrp_gain_range, self.set_rx_usrp_gain, " Gain:", "counter_slider", float, QtCore.Qt.Horizontal) + self.top_grid_layout.addWidget(self._rx_usrp_gain_win, 1, 0, 1, 4) + for r in range(1, 2): + self.top_grid_layout.setRowStretch(r, 1) + for c in range(0, 4): + self.top_grid_layout.setColumnStretch(c, 1) + # Create the options list + self._rx_usrp_antenna_options = ['TX/RX', 'RX2'] + # Create the labels list + self._rx_usrp_antenna_labels = ['TX/RX', 'RX2'] + # Create the combo box + self._rx_usrp_antenna_tool_bar = Qt.QToolBar(self) + self._rx_usrp_antenna_tool_bar.addWidget(Qt.QLabel(" Antenna" + ": ")) + self._rx_usrp_antenna_combo_box = Qt.QComboBox() + self._rx_usrp_antenna_tool_bar.addWidget(self._rx_usrp_antenna_combo_box) + for _label in self._rx_usrp_antenna_labels: self._rx_usrp_antenna_combo_box.addItem(_label) + self._rx_usrp_antenna_callback = lambda i: Qt.QMetaObject.invokeMethod(self._rx_usrp_antenna_combo_box, "setCurrentIndex", Qt.Q_ARG("int", self._rx_usrp_antenna_options.index(i))) + self._rx_usrp_antenna_callback(self.rx_usrp_antenna) + self._rx_usrp_antenna_combo_box.currentIndexChanged.connect( + lambda i: self.set_rx_usrp_antenna(self._rx_usrp_antenna_options[i])) + # Create the radio buttons + self.top_grid_layout.addWidget(self._rx_usrp_antenna_tool_bar, 0, 1, 1, 1) + for r in range(0, 1): + self.top_grid_layout.setRowStretch(r, 1) + for c in range(1, 2): + self.top_grid_layout.setColumnStretch(c, 1) + self._rx_frequency_range = Range(50, 6000, .1, 2412, 200) + self._rx_frequency_win = RangeWidget(self._rx_frequency_range, self.set_rx_frequency, " Freq. (MHz):", "counter_slider", float, QtCore.Qt.Horizontal) + self.top_grid_layout.addWidget(self._rx_frequency_win, 2, 0, 1, 4) + for r in range(2, 3): + self.top_grid_layout.setRowStretch(r, 1) + for c in range(0, 4): + self.top_grid_layout.setColumnStretch(c, 1) + self.uhd_usrp_source_0_0 = uhd.usrp_source( + ",".join(('', "")), + uhd.stream_args( + cpu_format="fc32", + args='', + channels=list(range(0,1)), + ), + ) + self.uhd_usrp_source_0_0.set_subdev_spec(rx_usrp_channel, 0) + self.uhd_usrp_source_0_0.set_samp_rate(sample_rate) + self.uhd_usrp_source_0_0.set_time_unknown_pps(uhd.time_spec(0)) + + self.uhd_usrp_source_0_0.set_center_freq(rx_frequency*1e6, 0) + self.uhd_usrp_source_0_0.set_antenna(rx_usrp_antenna, 0) + self.uhd_usrp_source_0_0.set_gain(rx_usrp_gain, 0) + self.qtgui_waterfall_sink_x_0 = qtgui.waterfall_sink_c( + 1024, #size + window.WIN_BLACKMAN_hARRIS, #wintype + 0, #fc + sample_rate, #bw + "", #name + 1, #number of inputs + None # parent + ) + self.qtgui_waterfall_sink_x_0.set_update_time(0.10) + self.qtgui_waterfall_sink_x_0.enable_grid(False) + self.qtgui_waterfall_sink_x_0.enable_axis_labels(True) + + + + labels = ['', '', '', '', '', + '', '', '', '', ''] + colors = [0, 0, 0, 0, 0, + 0, 0, 0, 0, 0] + alphas = [1.0, 1.0, 1.0, 1.0, 1.0, + 1.0, 1.0, 1.0, 1.0, 1.0] + + for i in range(1): + if len(labels[i]) == 0: + self.qtgui_waterfall_sink_x_0.set_line_label(i, "Data {0}".format(i)) + else: + self.qtgui_waterfall_sink_x_0.set_line_label(i, labels[i]) + self.qtgui_waterfall_sink_x_0.set_color_map(i, colors[i]) + self.qtgui_waterfall_sink_x_0.set_line_alpha(i, alphas[i]) + + self.qtgui_waterfall_sink_x_0.set_intensity_range(-140, 10) + + self._qtgui_waterfall_sink_x_0_win = sip.wrapinstance(self.qtgui_waterfall_sink_x_0.qwidget(), Qt.QWidget) + + self.top_grid_layout.addWidget(self._qtgui_waterfall_sink_x_0_win, 3, 0, 6, 4) + for r in range(3, 9): + self.top_grid_layout.setRowStretch(r, 1) + for c in range(0, 4): + self.top_grid_layout.setColumnStretch(c, 1) + + + ################################################## + # Connections + ################################################## + self.connect((self.uhd_usrp_source_0_0, 0), (self.qtgui_waterfall_sink_x_0, 0)) + + + def closeEvent(self, event): + self.settings = Qt.QSettings("GNU Radio", "waterfall_usrp2") + self.settings.setValue("geometry", self.saveGeometry()) + self.stop() + self.wait() + + event.accept() + + def get_sample_rate(self): + return self.sample_rate + + def set_sample_rate(self, sample_rate): + self.sample_rate = sample_rate + self._sample_rate_callback(self.sample_rate) + self.qtgui_waterfall_sink_x_0.set_frequency_range(0, self.sample_rate) + self.uhd_usrp_source_0_0.set_samp_rate(self.sample_rate) + + def get_rx_usrp_gain(self): + return self.rx_usrp_gain + + def set_rx_usrp_gain(self, rx_usrp_gain): + self.rx_usrp_gain = rx_usrp_gain + self.uhd_usrp_source_0_0.set_gain(self.rx_usrp_gain, 0) + + def get_rx_usrp_channel(self): + return self.rx_usrp_channel + + def set_rx_usrp_channel(self, rx_usrp_channel): + self.rx_usrp_channel = rx_usrp_channel + + def get_rx_usrp_antenna(self): + return self.rx_usrp_antenna + + def set_rx_usrp_antenna(self, rx_usrp_antenna): + self.rx_usrp_antenna = rx_usrp_antenna + self._rx_usrp_antenna_callback(self.rx_usrp_antenna) + self.uhd_usrp_source_0_0.set_antenna(self.rx_usrp_antenna, 0) + + def get_rx_frequency(self): + return self.rx_frequency + + def set_rx_frequency(self, rx_frequency): + self.rx_frequency = rx_frequency + self.uhd_usrp_source_0_0.set_center_freq(self.rx_frequency*1e6, 0) + + + + +def main(top_block_cls=waterfall_usrp2, options=None): + + if StrictVersion("4.5.0") <= StrictVersion(Qt.qVersion()) < StrictVersion("5.0.0"): + style = gr.prefs().get_string('qtgui', 'style', 'raster') + Qt.QApplication.setGraphicsSystem(style) + qapp = Qt.QApplication(sys.argv) + + tb = top_block_cls() + + tb.start() + + tb.show() + + def sig_handler(sig=None, frame=None): + tb.stop() + tb.wait() + + Qt.QApplication.quit() + + signal.signal(signal.SIGINT, sig_handler) + signal.signal(signal.SIGTERM, sig_handler) + + timer = Qt.QTimer() + timer.start(500) + timer.timeout.connect(lambda: None) + + qapp.exec_() + +if __name__ == '__main__': + main() diff --git a/Flow Graph Library/Inspection Flow Graphs/waterfall_usrp_n2xx.grc b/Flow Graph Library/Inspection Flow Graphs/waterfall_usrp_n2xx.grc new file mode 100644 index 00000000..9e32bc3b --- /dev/null +++ b/Flow Graph Library/Inspection Flow Graphs/waterfall_usrp_n2xx.grc @@ -0,0 +1,596 @@ +options: + parameters: + author: '' + category: Custom + cmake_opt: '' + comment: '' + copyright: '' + description: '' + gen_cmake: 'On' + gen_linking: dynamic + generate_options: qt_gui + hier_block_src_path: '.:' + id: waterfall_usrp_n2xx + max_nouts: '0' + output_language: python + placement: (0,0) + qt_qss_theme: '' + realtime_scheduling: '' + run: 'True' + run_command: '{python} -u {filename}' + run_options: prompt + sizing_mode: fixed + thread_safe_setters: '' + title: '' + window_size: 1280, 1024 + states: + bus_sink: false + bus_source: false + bus_structure: null + coordinate: [10, 10] + rotation: 0 + state: enabled + +blocks: +- name: ip_address + id: variable + parameters: + comment: '' + value: '"192.168.140.2"' + states: + bus_sink: false + bus_source: false + bus_structure: null + coordinate: [8, 148] + rotation: 0 + state: disabled +- name: rx_frequency + id: variable_qtgui_range + parameters: + comment: '' + gui_hint: 2,0,1,4 + label: ' Freq. (MHz):' + min_len: '200' + orient: Qt.Horizontal + rangeType: float + start: '50' + step: '.1' + stop: '6000' + value: '2412' + widget: counter_slider + states: + bus_sink: false + bus_source: false + bus_structure: null + coordinate: [400, 140] + rotation: 0 + state: enabled +- name: rx_usrp_antenna + id: variable_qtgui_chooser + parameters: + comment: '' + gui_hint: 0,1,1,1 + label: ' Antenna' + label0: '' + label1: '' + label2: '' + label3: '' + label4: '' + labels: '["TX/RX", "RX2"]' + num_opts: '0' + option1: '1' + option2: '2' + option3: '3' + option4: '4' + options: '["TX/RX", "RX2"]' + orient: Qt.QVBoxLayout + type: string + value: '"TX/RX"' + widget: combo_box + states: + bus_sink: false + bus_source: false + bus_structure: null + coordinate: [232, 140] + rotation: 0 + state: enabled +- name: rx_usrp_channel + id: variable + parameters: + comment: '' + value: '"A:0"' + states: + bus_sink: false + bus_source: false + bus_structure: null + coordinate: [8, 76] + rotation: 0 + state: enabled +- name: rx_usrp_gain + id: variable_qtgui_range + parameters: + comment: '' + gui_hint: 1,0,1,4 + label: ' Gain:' + min_len: '200' + orient: Qt.Horizontal + rangeType: float + start: '0' + step: '1' + stop: '34' + value: '30' + widget: counter_slider + states: + bus_sink: false + bus_source: false + bus_structure: null + coordinate: [400, 12] + rotation: 0 + state: enabled +- name: sample_rate + id: variable_qtgui_chooser + parameters: + comment: '' + gui_hint: 0,0,1,1 + label: Sample Rate + label0: '' + label1: '' + label2: '' + label3: '' + label4: '' + labels: '["1 MS/s", "5 MS/s", "10 MS/s", "20 MS/s"]' + num_opts: '0' + option1: '1' + option2: '2' + option3: '3' + option4: '4' + options: '[1e6, 5e6, 10e6, 20e6]' + orient: Qt.QVBoxLayout + type: real + value: 1e6 + widget: combo_box + states: + bus_sink: false + bus_source: false + bus_structure: null + coordinate: [232, 12] + rotation: 0 + state: enabled +- name: qtgui_waterfall_sink_x_0 + id: qtgui_waterfall_sink_x + parameters: + affinity: '' + alias: '' + alpha1: '1.0' + alpha10: '1.0' + alpha2: '1.0' + alpha3: '1.0' + alpha4: '1.0' + alpha5: '1.0' + alpha6: '1.0' + alpha7: '1.0' + alpha8: '1.0' + alpha9: '1.0' + axislabels: 'True' + bw: sample_rate + color1: '0' + color10: '0' + color2: '0' + color3: '0' + color4: '0' + color5: '0' + color6: '0' + color7: '0' + color8: '0' + color9: '0' + comment: '' + fc: '0' + fftsize: '1024' + freqhalf: 'True' + grid: 'False' + gui_hint: 3,0,6,4 + int_max: '10' + int_min: '-140' + label1: '' + label10: '' + label2: '' + label3: '' + label4: '' + label5: '' + label6: '' + label7: '' + label8: '' + label9: '' + legend: 'True' + maxoutbuf: '0' + minoutbuf: '0' + name: '""' + nconnections: '1' + showports: 'True' + type: complex + update_time: '0.10' + wintype: firdes.WIN_BLACKMAN_hARRIS + states: + bus_sink: false + bus_source: false + bus_structure: null + coordinate: [712, 484] + rotation: 0 + state: enabled +- name: uhd_usrp_source_0_0 + id: uhd_usrp_source + parameters: + affinity: '' + alias: '' + ant0: rx_usrp_antenna + ant1: '' + ant10: '' + ant11: '' + ant12: '' + ant13: '' + ant14: '' + ant15: '' + ant16: '' + ant17: '' + ant18: '' + ant19: '' + ant2: '' + ant20: '' + ant21: '' + ant22: '' + ant23: '' + ant24: '' + ant25: '' + ant26: '' + ant27: '' + ant28: '' + ant29: '' + ant3: '' + ant30: '' + ant31: '' + ant4: '' + ant5: '' + ant6: '' + ant7: '' + ant8: '' + ant9: '' + bw0: '0' + bw1: '0' + bw10: '0' + bw11: '0' + bw12: '0' + bw13: '0' + bw14: '0' + bw15: '0' + bw16: '0' + bw17: '0' + bw18: '0' + bw19: '0' + bw2: '0' + bw20: '0' + bw21: '0' + bw22: '0' + bw23: '0' + bw24: '0' + bw25: '0' + bw26: '0' + bw27: '0' + bw28: '0' + bw29: '0' + bw3: '0' + bw30: '0' + bw31: '0' + bw4: '0' + bw5: '0' + bw6: '0' + bw7: '0' + bw8: '0' + bw9: '0' + center_freq0: rx_frequency*1e6 + center_freq1: '0' + center_freq10: '0' + center_freq11: '0' + center_freq12: '0' + center_freq13: '0' + center_freq14: '0' + center_freq15: '0' + center_freq16: '0' + center_freq17: '0' + center_freq18: '0' + center_freq19: '0' + center_freq2: '0' + center_freq20: '0' + center_freq21: '0' + center_freq22: '0' + center_freq23: '0' + center_freq24: '0' + center_freq25: '0' + center_freq26: '0' + center_freq27: '0' + center_freq28: '0' + center_freq29: '0' + center_freq3: '0' + center_freq30: '0' + center_freq31: '0' + center_freq4: '0' + center_freq5: '0' + center_freq6: '0' + center_freq7: '0' + center_freq8: '0' + center_freq9: '0' + clock_rate: '0.0' + clock_source0: '' + clock_source1: '' + clock_source2: '' + clock_source3: '' + clock_source4: '' + clock_source5: '' + clock_source6: '' + clock_source7: '' + comment: '' + dc_offs_enb0: '""' + dc_offs_enb1: '""' + dc_offs_enb10: '""' + dc_offs_enb11: '""' + dc_offs_enb12: '""' + dc_offs_enb13: '""' + dc_offs_enb14: '""' + dc_offs_enb15: '""' + dc_offs_enb16: '""' + dc_offs_enb17: '""' + dc_offs_enb18: '""' + dc_offs_enb19: '""' + dc_offs_enb2: '""' + dc_offs_enb20: '""' + dc_offs_enb21: '""' + dc_offs_enb22: '""' + dc_offs_enb23: '""' + dc_offs_enb24: '""' + dc_offs_enb25: '""' + dc_offs_enb26: '""' + dc_offs_enb27: '""' + dc_offs_enb28: '""' + dc_offs_enb29: '""' + dc_offs_enb3: '""' + dc_offs_enb30: '""' + dc_offs_enb31: '""' + dc_offs_enb4: '""' + dc_offs_enb5: '""' + dc_offs_enb6: '""' + dc_offs_enb7: '""' + dc_offs_enb8: '""' + dc_offs_enb9: '""' + dev_addr: '' + dev_args: '""' + gain0: rx_usrp_gain + gain1: '0' + gain10: '0' + gain11: '0' + gain12: '0' + gain13: '0' + gain14: '0' + gain15: '0' + gain16: '0' + gain17: '0' + gain18: '0' + gain19: '0' + gain2: '0' + gain20: '0' + gain21: '0' + gain22: '0' + gain23: '0' + gain24: '0' + gain25: '0' + gain26: '0' + gain27: '0' + gain28: '0' + gain29: '0' + gain3: '0' + gain30: '0' + gain31: '0' + gain4: '0' + gain5: '0' + gain6: '0' + gain7: '0' + gain8: '0' + gain9: '0' + iq_imbal_enb0: '""' + iq_imbal_enb1: '""' + iq_imbal_enb10: '""' + iq_imbal_enb11: '""' + iq_imbal_enb12: '""' + iq_imbal_enb13: '""' + iq_imbal_enb14: '""' + iq_imbal_enb15: '""' + iq_imbal_enb16: '""' + iq_imbal_enb17: '""' + iq_imbal_enb18: '""' + iq_imbal_enb19: '""' + iq_imbal_enb2: '""' + iq_imbal_enb20: '""' + iq_imbal_enb21: '""' + iq_imbal_enb22: '""' + iq_imbal_enb23: '""' + iq_imbal_enb24: '""' + iq_imbal_enb25: '""' + iq_imbal_enb26: '""' + iq_imbal_enb27: '""' + iq_imbal_enb28: '""' + iq_imbal_enb29: '""' + iq_imbal_enb3: '""' + iq_imbal_enb30: '""' + iq_imbal_enb31: '""' + iq_imbal_enb4: '""' + iq_imbal_enb5: '""' + iq_imbal_enb6: '""' + iq_imbal_enb7: '""' + iq_imbal_enb8: '""' + iq_imbal_enb9: '""' + lo_export0: 'False' + lo_export1: 'False' + lo_export10: 'False' + lo_export11: 'False' + lo_export12: 'False' + lo_export13: 'False' + lo_export14: 'False' + lo_export15: 'False' + lo_export16: 'False' + lo_export17: 'False' + lo_export18: 'False' + lo_export19: 'False' + lo_export2: 'False' + lo_export20: 'False' + lo_export21: 'False' + lo_export22: 'False' + lo_export23: 'False' + lo_export24: 'False' + lo_export25: 'False' + lo_export26: 'False' + lo_export27: 'False' + lo_export28: 'False' + lo_export29: 'False' + lo_export3: 'False' + lo_export30: 'False' + lo_export31: 'False' + lo_export4: 'False' + lo_export5: 'False' + lo_export6: 'False' + lo_export7: 'False' + lo_export8: 'False' + lo_export9: 'False' + lo_source0: internal + lo_source1: internal + lo_source10: internal + lo_source11: internal + lo_source12: internal + lo_source13: internal + lo_source14: internal + lo_source15: internal + lo_source16: internal + lo_source17: internal + lo_source18: internal + lo_source19: internal + lo_source2: internal + lo_source20: internal + lo_source21: internal + lo_source22: internal + lo_source23: internal + lo_source24: internal + lo_source25: internal + lo_source26: internal + lo_source27: internal + lo_source28: internal + lo_source29: internal + lo_source3: internal + lo_source30: internal + lo_source31: internal + lo_source4: internal + lo_source5: internal + lo_source6: internal + lo_source7: internal + lo_source8: internal + lo_source9: internal + maxoutbuf: '0' + minoutbuf: '0' + nchan: '1' + norm_gain0: 'False' + norm_gain1: 'False' + norm_gain10: 'False' + norm_gain11: 'False' + norm_gain12: 'False' + norm_gain13: 'False' + norm_gain14: 'False' + norm_gain15: 'False' + norm_gain16: 'False' + norm_gain17: 'False' + norm_gain18: 'False' + norm_gain19: 'False' + norm_gain2: 'False' + norm_gain20: 'False' + norm_gain21: 'False' + norm_gain22: 'False' + norm_gain23: 'False' + norm_gain24: 'False' + norm_gain25: 'False' + norm_gain26: 'False' + norm_gain27: 'False' + norm_gain28: 'False' + norm_gain29: 'False' + norm_gain3: 'False' + norm_gain30: 'False' + norm_gain31: 'False' + norm_gain4: 'False' + norm_gain5: 'False' + norm_gain6: 'False' + norm_gain7: 'False' + norm_gain8: 'False' + norm_gain9: 'False' + num_mboards: '1' + otw: '' + rx_agc0: Default + rx_agc1: Default + rx_agc10: Default + rx_agc11: Default + rx_agc12: Default + rx_agc13: Default + rx_agc14: Default + rx_agc15: Default + rx_agc16: Default + rx_agc17: Default + rx_agc18: Default + rx_agc19: Default + rx_agc2: Default + rx_agc20: Default + rx_agc21: Default + rx_agc22: Default + rx_agc23: Default + rx_agc24: Default + rx_agc25: Default + rx_agc26: Default + rx_agc27: Default + rx_agc28: Default + rx_agc29: Default + rx_agc3: Default + rx_agc30: Default + rx_agc31: Default + rx_agc4: Default + rx_agc5: Default + rx_agc6: Default + rx_agc7: Default + rx_agc8: Default + rx_agc9: Default + samp_rate: sample_rate + sd_spec0: rx_usrp_channel + sd_spec1: '' + sd_spec2: '' + sd_spec3: '' + sd_spec4: '' + sd_spec5: '' + sd_spec6: '' + sd_spec7: '' + show_lo_controls: 'False' + stream_args: '' + stream_chans: '[]' + sync: sync + time_source0: '' + time_source1: '' + time_source2: '' + time_source3: '' + time_source4: '' + time_source5: '' + time_source6: '' + time_source7: '' + type: fc32 + states: + bus_sink: false + bus_source: false + bus_structure: null + coordinate: [320, 468] + rotation: 0 + state: enabled + +connections: +- [uhd_usrp_source_0_0, '0', qtgui_waterfall_sink_x_0, '0'] + +metadata: + file_format: 1 diff --git a/Flow Graph Library/Inspection Flow Graphs/waterfall_usrp_n2xx.py b/Flow Graph Library/Inspection Flow Graphs/waterfall_usrp_n2xx.py new file mode 100755 index 00000000..4d053e95 --- /dev/null +++ b/Flow Graph Library/Inspection Flow Graphs/waterfall_usrp_n2xx.py @@ -0,0 +1,282 @@ +#!/usr/bin/env python3 +# -*- coding: utf-8 -*- + +# +# SPDX-License-Identifier: GPL-3.0 +# +# GNU Radio Python Flow Graph +# Title: Waterfall Usrp N2Xx +# GNU Radio version: 3.10.1.1 + +from packaging.version import Version as StrictVersion + +if __name__ == '__main__': + import ctypes + import sys + if sys.platform.startswith('linux'): + try: + x11 = ctypes.cdll.LoadLibrary('libX11.so') + x11.XInitThreads() + except: + print("Warning: failed to XInitThreads()") + +from PyQt5 import Qt +from PyQt5.QtCore import QObject, pyqtSlot +from gnuradio import qtgui +from gnuradio.filter import firdes +import sip +from gnuradio import gr +from gnuradio.fft import window +import sys +import signal +from argparse import ArgumentParser +from gnuradio.eng_arg import eng_float, intx +from gnuradio import eng_notation +from gnuradio import uhd +import time +from gnuradio.qtgui import Range, RangeWidget +from PyQt5 import QtCore + + + +from gnuradio import qtgui + +class waterfall_usrp_n2xx(gr.top_block, Qt.QWidget): + + def __init__(self): + gr.top_block.__init__(self, "Waterfall Usrp N2Xx", catch_exceptions=True) + Qt.QWidget.__init__(self) + self.setWindowTitle("Waterfall Usrp N2Xx") + qtgui.util.check_set_qss() + try: + self.setWindowIcon(Qt.QIcon.fromTheme('gnuradio-grc')) + except: + pass + self.top_scroll_layout = Qt.QVBoxLayout() + self.setLayout(self.top_scroll_layout) + self.top_scroll = Qt.QScrollArea() + self.top_scroll.setFrameStyle(Qt.QFrame.NoFrame) + self.top_scroll_layout.addWidget(self.top_scroll) + self.top_scroll.setWidgetResizable(True) + self.top_widget = Qt.QWidget() + self.top_scroll.setWidget(self.top_widget) + self.top_layout = Qt.QVBoxLayout(self.top_widget) + self.top_grid_layout = Qt.QGridLayout() + self.top_layout.addLayout(self.top_grid_layout) + + self.settings = Qt.QSettings("GNU Radio", "waterfall_usrp_n2xx") + + try: + if StrictVersion(Qt.qVersion()) < StrictVersion("5.0.0"): + self.restoreGeometry(self.settings.value("geometry").toByteArray()) + else: + self.restoreGeometry(self.settings.value("geometry")) + except: + pass + + ################################################## + # Variables + ################################################## + self.sample_rate = sample_rate = 1e6 + self.rx_usrp_gain = rx_usrp_gain = 30 + self.rx_usrp_channel = rx_usrp_channel = "A:0" + self.rx_usrp_antenna = rx_usrp_antenna = "TX/RX" + self.rx_frequency = rx_frequency = 2412 + + ################################################## + # Blocks + ################################################## + # Create the options list + self._sample_rate_options = [1000000.0, 5000000.0, 10000000.0, 20000000.0] + # Create the labels list + self._sample_rate_labels = ['1 MS/s', '5 MS/s', '10 MS/s', '20 MS/s'] + # Create the combo box + self._sample_rate_tool_bar = Qt.QToolBar(self) + self._sample_rate_tool_bar.addWidget(Qt.QLabel("Sample Rate" + ": ")) + self._sample_rate_combo_box = Qt.QComboBox() + self._sample_rate_tool_bar.addWidget(self._sample_rate_combo_box) + for _label in self._sample_rate_labels: self._sample_rate_combo_box.addItem(_label) + self._sample_rate_callback = lambda i: Qt.QMetaObject.invokeMethod(self._sample_rate_combo_box, "setCurrentIndex", Qt.Q_ARG("int", self._sample_rate_options.index(i))) + self._sample_rate_callback(self.sample_rate) + self._sample_rate_combo_box.currentIndexChanged.connect( + lambda i: self.set_sample_rate(self._sample_rate_options[i])) + # Create the radio buttons + self.top_grid_layout.addWidget(self._sample_rate_tool_bar, 0, 0, 1, 1) + for r in range(0, 1): + self.top_grid_layout.setRowStretch(r, 1) + for c in range(0, 1): + self.top_grid_layout.setColumnStretch(c, 1) + self._rx_usrp_gain_range = Range(0, 34, 1, 30, 200) + self._rx_usrp_gain_win = RangeWidget(self._rx_usrp_gain_range, self.set_rx_usrp_gain, " Gain:", "counter_slider", float, QtCore.Qt.Horizontal) + self.top_grid_layout.addWidget(self._rx_usrp_gain_win, 1, 0, 1, 4) + for r in range(1, 2): + self.top_grid_layout.setRowStretch(r, 1) + for c in range(0, 4): + self.top_grid_layout.setColumnStretch(c, 1) + # Create the options list + self._rx_usrp_antenna_options = ['TX/RX', 'RX2'] + # Create the labels list + self._rx_usrp_antenna_labels = ['TX/RX', 'RX2'] + # Create the combo box + self._rx_usrp_antenna_tool_bar = Qt.QToolBar(self) + self._rx_usrp_antenna_tool_bar.addWidget(Qt.QLabel(" Antenna" + ": ")) + self._rx_usrp_antenna_combo_box = Qt.QComboBox() + self._rx_usrp_antenna_tool_bar.addWidget(self._rx_usrp_antenna_combo_box) + for _label in self._rx_usrp_antenna_labels: self._rx_usrp_antenna_combo_box.addItem(_label) + self._rx_usrp_antenna_callback = lambda i: Qt.QMetaObject.invokeMethod(self._rx_usrp_antenna_combo_box, "setCurrentIndex", Qt.Q_ARG("int", self._rx_usrp_antenna_options.index(i))) + self._rx_usrp_antenna_callback(self.rx_usrp_antenna) + self._rx_usrp_antenna_combo_box.currentIndexChanged.connect( + lambda i: self.set_rx_usrp_antenna(self._rx_usrp_antenna_options[i])) + # Create the radio buttons + self.top_grid_layout.addWidget(self._rx_usrp_antenna_tool_bar, 0, 1, 1, 1) + for r in range(0, 1): + self.top_grid_layout.setRowStretch(r, 1) + for c in range(1, 2): + self.top_grid_layout.setColumnStretch(c, 1) + self._rx_frequency_range = Range(50, 6000, .1, 2412, 200) + self._rx_frequency_win = RangeWidget(self._rx_frequency_range, self.set_rx_frequency, " Freq. (MHz):", "counter_slider", float, QtCore.Qt.Horizontal) + self.top_grid_layout.addWidget(self._rx_frequency_win, 2, 0, 1, 4) + for r in range(2, 3): + self.top_grid_layout.setRowStretch(r, 1) + for c in range(0, 4): + self.top_grid_layout.setColumnStretch(c, 1) + self.uhd_usrp_source_0_0 = uhd.usrp_source( + ",".join(('', "")), + uhd.stream_args( + cpu_format="fc32", + args='', + channels=list(range(0,1)), + ), + ) + self.uhd_usrp_source_0_0.set_subdev_spec(rx_usrp_channel, 0) + self.uhd_usrp_source_0_0.set_samp_rate(sample_rate) + self.uhd_usrp_source_0_0.set_time_unknown_pps(uhd.time_spec(0)) + + self.uhd_usrp_source_0_0.set_center_freq(rx_frequency*1e6, 0) + self.uhd_usrp_source_0_0.set_antenna(rx_usrp_antenna, 0) + self.uhd_usrp_source_0_0.set_gain(rx_usrp_gain, 0) + self.qtgui_waterfall_sink_x_0 = qtgui.waterfall_sink_c( + 1024, #size + window.WIN_BLACKMAN_hARRIS, #wintype + 0, #fc + sample_rate, #bw + "", #name + 1, #number of inputs + None # parent + ) + self.qtgui_waterfall_sink_x_0.set_update_time(0.10) + self.qtgui_waterfall_sink_x_0.enable_grid(False) + self.qtgui_waterfall_sink_x_0.enable_axis_labels(True) + + + + labels = ['', '', '', '', '', + '', '', '', '', ''] + colors = [0, 0, 0, 0, 0, + 0, 0, 0, 0, 0] + alphas = [1.0, 1.0, 1.0, 1.0, 1.0, + 1.0, 1.0, 1.0, 1.0, 1.0] + + for i in range(1): + if len(labels[i]) == 0: + self.qtgui_waterfall_sink_x_0.set_line_label(i, "Data {0}".format(i)) + else: + self.qtgui_waterfall_sink_x_0.set_line_label(i, labels[i]) + self.qtgui_waterfall_sink_x_0.set_color_map(i, colors[i]) + self.qtgui_waterfall_sink_x_0.set_line_alpha(i, alphas[i]) + + self.qtgui_waterfall_sink_x_0.set_intensity_range(-140, 10) + + self._qtgui_waterfall_sink_x_0_win = sip.wrapinstance(self.qtgui_waterfall_sink_x_0.qwidget(), Qt.QWidget) + + self.top_grid_layout.addWidget(self._qtgui_waterfall_sink_x_0_win, 3, 0, 6, 4) + for r in range(3, 9): + self.top_grid_layout.setRowStretch(r, 1) + for c in range(0, 4): + self.top_grid_layout.setColumnStretch(c, 1) + + + ################################################## + # Connections + ################################################## + self.connect((self.uhd_usrp_source_0_0, 0), (self.qtgui_waterfall_sink_x_0, 0)) + + + def closeEvent(self, event): + self.settings = Qt.QSettings("GNU Radio", "waterfall_usrp_n2xx") + self.settings.setValue("geometry", self.saveGeometry()) + self.stop() + self.wait() + + event.accept() + + def get_sample_rate(self): + return self.sample_rate + + def set_sample_rate(self, sample_rate): + self.sample_rate = sample_rate + self._sample_rate_callback(self.sample_rate) + self.qtgui_waterfall_sink_x_0.set_frequency_range(0, self.sample_rate) + self.uhd_usrp_source_0_0.set_samp_rate(self.sample_rate) + + def get_rx_usrp_gain(self): + return self.rx_usrp_gain + + def set_rx_usrp_gain(self, rx_usrp_gain): + self.rx_usrp_gain = rx_usrp_gain + self.uhd_usrp_source_0_0.set_gain(self.rx_usrp_gain, 0) + + def get_rx_usrp_channel(self): + return self.rx_usrp_channel + + def set_rx_usrp_channel(self, rx_usrp_channel): + self.rx_usrp_channel = rx_usrp_channel + + def get_rx_usrp_antenna(self): + return self.rx_usrp_antenna + + def set_rx_usrp_antenna(self, rx_usrp_antenna): + self.rx_usrp_antenna = rx_usrp_antenna + self._rx_usrp_antenna_callback(self.rx_usrp_antenna) + self.uhd_usrp_source_0_0.set_antenna(self.rx_usrp_antenna, 0) + + def get_rx_frequency(self): + return self.rx_frequency + + def set_rx_frequency(self, rx_frequency): + self.rx_frequency = rx_frequency + self.uhd_usrp_source_0_0.set_center_freq(self.rx_frequency*1e6, 0) + + + + +def main(top_block_cls=waterfall_usrp_n2xx, options=None): + + if StrictVersion("4.5.0") <= StrictVersion(Qt.qVersion()) < StrictVersion("5.0.0"): + style = gr.prefs().get_string('qtgui', 'style', 'raster') + Qt.QApplication.setGraphicsSystem(style) + qapp = Qt.QApplication(sys.argv) + + tb = top_block_cls() + + tb.start() + + tb.show() + + def sig_handler(sig=None, frame=None): + tb.stop() + tb.wait() + + Qt.QApplication.quit() + + signal.signal(signal.SIGINT, sig_handler) + signal.signal(signal.SIGTERM, sig_handler) + + timer = Qt.QTimer() + timer.start(500) + timer.timeout.connect(lambda: None) + + qapp.exec_() + +if __name__ == '__main__': + main() diff --git a/Flow Graph Library/TSI Flow Graphs/wideband_usrp2.grc b/Flow Graph Library/TSI Flow Graphs/wideband_usrp2.grc new file mode 100644 index 00000000..52910dd9 --- /dev/null +++ b/Flow Graph Library/TSI Flow Graphs/wideband_usrp2.grc @@ -0,0 +1,815 @@ +options: + parameters: + author: '' + category: Custom + cmake_opt: '' + comment: '' + copyright: '' + description: '' + gen_cmake: 'On' + gen_linking: dynamic + generate_options: no_gui + hier_block_src_path: '.:' + id: wideband_usrp2 + max_nouts: '0' + output_language: python + placement: (0,0) + qt_qss_theme: '' + realtime_scheduling: '' + run: 'True' + run_command: '{python} -u {filename}' + run_options: prompt + sizing_mode: fixed + thread_safe_setters: '' + title: '' + window_size: '' + states: + bus_sink: false + bus_source: false + bus_structure: null + coordinate: [8, 20] + rotation: 0 + state: enabled + +blocks: +- name: antenna + id: variable + parameters: + comment: '' + value: '"TX/RX"' + states: + bus_sink: false + bus_source: false + bus_structure: null + coordinate: [688, 20] + rotation: 0 + state: enabled +- name: channel + id: variable + parameters: + comment: '' + value: '"A:0"' + states: + bus_sink: false + bus_source: false + bus_structure: null + coordinate: [608, 20] + rotation: 0 + state: enabled +- name: fft_size + id: variable + parameters: + comment: '' + value: 512*1 + states: + bus_sink: false + bus_source: false + bus_structure: null + coordinate: [456, 20] + rotation: 0 + state: enabled +- name: gain + id: variable + parameters: + comment: '' + value: '30' + states: + bus_sink: false + bus_source: false + bus_structure: null + coordinate: [536, 20] + rotation: 0 + state: enabled +- name: ip_address + id: variable + parameters: + comment: '' + value: '"192.168.10.2"' + states: + bus_sink: false + bus_source: false + bus_structure: null + coordinate: [776, 20] + rotation: 0 + state: enabled +- name: rx_freq + id: variable_qtgui_range + parameters: + comment: '' + gui_hint: '' + label: rx_freq + min_len: '200' + orient: Qt.Horizontal + rangeType: float + start: 2400e6 + step: 1e6 + stop: 2500e6 + value: 2425.e6 + widget: counter_slider + states: + bus_sink: false + bus_source: false + bus_structure: null + coordinate: [896, 108] + rotation: 0 + state: disabled +- name: rx_freq + id: variable + parameters: + comment: '' + value: 1200e6 + states: + bus_sink: false + bus_source: false + bus_structure: null + coordinate: [376, 20] + rotation: 0 + state: enabled +- name: sample_rate + id: variable + parameters: + comment: '' + value: '20000000' + states: + bus_sink: false + bus_source: false + bus_structure: null + coordinate: [184, 20] + rotation: 0 + state: enabled +- name: serial + id: variable + parameters: + comment: '' + value: '"False"' + states: + bus_sink: false + bus_source: false + bus_structure: null + coordinate: [904, 20] + rotation: 0 + state: enabled +- name: threshold + id: variable_qtgui_range + parameters: + comment: '' + gui_hint: '' + label: Threshold + min_len: '200' + orient: Qt.Horizontal + rangeType: float + start: '-120' + step: '1' + stop: '50' + value: '-50' + widget: counter_slider + states: + bus_sink: false + bus_source: false + bus_structure: null + coordinate: [1040, 108] + rotation: 0 + state: disabled +- name: threshold + id: variable + parameters: + comment: '' + value: '-70' + states: + bus_sink: false + bus_source: false + bus_structure: null + coordinate: [288, 20] + rotation: 0 + state: enabled +- name: ainfosec_wideband_detector1_0 + id: ainfosec_wideband_detector1 + parameters: + address: '"tcp://127.0.0.1:5060"' + affinity: '' + alias: '' + comment: '' + fft_size: fft_size + rx_freq: rx_freq + sample_rate: sample_rate + states: + bus_sink: false + bus_source: false + bus_structure: null + coordinate: [413, 462] + rotation: 0 + state: true +- name: analog_pwr_squelch_xx_0 + id: analog_pwr_squelch_xx + parameters: + affinity: '' + alias: '' + alpha: 1e-4 + comment: '' + gate: 'True' + maxoutbuf: '0' + minoutbuf: '0' + ramp: '0' + threshold: '-10' + type: complex + states: + bus_sink: false + bus_source: false + bus_structure: null + coordinate: [288, 176] + rotation: 0 + state: enabled +- name: blocks_complex_to_mag_squared_0 + id: blocks_complex_to_mag_squared + parameters: + affinity: '' + alias: '' + comment: '' + maxoutbuf: '0' + minoutbuf: '0' + vlen: '1' + states: + bus_sink: false + bus_source: false + bus_structure: null + coordinate: [664, 352] + rotation: 0 + state: enabled +- name: blocks_moving_average_xx_0 + id: blocks_moving_average_xx + parameters: + affinity: '' + alias: '' + comment: '' + length: '10' + max_iter: '4000' + maxoutbuf: '0' + minoutbuf: '0' + scale: '10' + type: float + vlen: '1' + states: + bus_sink: false + bus_source: false + bus_structure: null + coordinate: [864, 332] + rotation: 0 + state: disabled +- name: blocks_nlog10_ff_0 + id: blocks_nlog10_ff + parameters: + affinity: '' + alias: '' + comment: '' + k: '0' + maxoutbuf: '0' + minoutbuf: '0' + n: '10' + vlen: '1' + states: + bus_sink: false + bus_source: false + bus_structure: null + coordinate: [272, 476] + rotation: 0 + state: enabled +- name: blocks_stream_to_vector_1 + id: blocks_stream_to_vector + parameters: + affinity: '' + alias: '' + comment: '' + maxoutbuf: '0' + minoutbuf: '0' + num_items: fft_size + type: complex + vlen: '1' + states: + bus_sink: false + bus_source: false + bus_structure: null + coordinate: [72, 348] + rotation: 0 + state: enabled +- name: blocks_vector_to_stream_0 + id: blocks_vector_to_stream + parameters: + affinity: '' + alias: '' + comment: '' + maxoutbuf: '0' + minoutbuf: '0' + num_items: fft_size + type: complex + vlen: '1' + states: + bus_sink: false + bus_source: false + bus_structure: null + coordinate: [480, 348] + rotation: 0 + state: enabled +- name: fft_vxx_0 + id: fft_vxx + parameters: + affinity: '' + alias: '' + comment: '' + fft_size: fft_size + forward: 'True' + maxoutbuf: '0' + minoutbuf: '0' + nthreads: '1' + shift: 'True' + type: complex + window: window.blackmanharris(fft_size) + states: + bus_sink: false + bus_source: false + bus_structure: null + coordinate: [248, 320] + rotation: 0 + state: enabled +- name: qtgui_time_sink_x_0 + id: qtgui_time_sink_x + parameters: + affinity: '' + alias: '' + alpha1: '1.0' + alpha10: '1.0' + alpha2: '1.0' + alpha3: '1.0' + alpha4: '1.0' + alpha5: '1.0' + alpha6: '1.0' + alpha7: '1.0' + alpha8: '1.0' + alpha9: '1.0' + autoscale: 'False' + axislabels: 'True' + color1: blue + color10: dark blue + color2: red + color3: green + color4: black + color5: cyan + color6: magenta + color7: yellow + color8: dark red + color9: dark green + comment: '' + ctrlpanel: 'False' + entags: 'True' + grid: 'False' + gui_hint: '' + label1: '' + label10: '' + label2: '' + label3: '' + label4: '' + label5: '' + label6: '' + label7: '' + label8: '' + label9: '' + legend: 'True' + marker1: '-1' + marker10: '-1' + marker2: '-1' + marker3: '-1' + marker4: '-1' + marker5: '-1' + marker6: '-1' + marker7: '-1' + marker8: '-1' + marker9: '-1' + name: '""' + nconnections: '1' + size: fft_size + srate: '1' + stemplot: 'False' + style1: '1' + style10: '1' + style2: '1' + style3: '1' + style4: '1' + style5: '1' + style6: '1' + style7: '1' + style8: '1' + style9: '1' + tr_chan: '0' + tr_delay: '0' + tr_level: '0.0' + tr_mode: qtgui.TRIG_MODE_FREE + tr_slope: qtgui.TRIG_SLOPE_POS + tr_tag: '""' + type: float + update_time: '0.10' + width1: '1' + width10: '1' + width2: '1' + width3: '1' + width4: '1' + width5: '1' + width6: '1' + width7: '1' + width8: '1' + width9: '1' + ylabel: Amplitude + ymax: '1' + ymin: '-1' + yunit: '""' + states: + bus_sink: false + bus_source: false + bus_structure: null + coordinate: [408, 564] + rotation: 0 + state: disabled +- name: uhd_usrp_source_0 + id: uhd_usrp_source + parameters: + affinity: '' + alias: '' + ant0: antenna + ant1: '' + ant10: '' + ant11: '' + ant12: '' + ant13: '' + ant14: '' + ant15: '' + ant16: '' + ant17: '' + ant18: '' + ant19: '' + ant2: '' + ant20: '' + ant21: '' + ant22: '' + ant23: '' + ant24: '' + ant25: '' + ant26: '' + ant27: '' + ant28: '' + ant29: '' + ant3: '' + ant30: '' + ant31: '' + ant4: '' + ant5: '' + ant6: '' + ant7: '' + ant8: '' + ant9: '' + bw0: '0' + bw1: '0' + bw10: '0' + bw11: '0' + bw12: '0' + bw13: '0' + bw14: '0' + bw15: '0' + bw16: '0' + bw17: '0' + bw18: '0' + bw19: '0' + bw2: '0' + bw20: '0' + bw21: '0' + bw22: '0' + bw23: '0' + bw24: '0' + bw25: '0' + bw26: '0' + bw27: '0' + bw28: '0' + bw29: '0' + bw3: '0' + bw30: '0' + bw31: '0' + bw4: '0' + bw5: '0' + bw6: '0' + bw7: '0' + bw8: '0' + bw9: '0' + center_freq0: rx_freq + center_freq1: '0' + center_freq10: '0' + center_freq11: '0' + center_freq12: '0' + center_freq13: '0' + center_freq14: '0' + center_freq15: '0' + center_freq16: '0' + center_freq17: '0' + center_freq18: '0' + center_freq19: '0' + center_freq2: '0' + center_freq20: '0' + center_freq21: '0' + center_freq22: '0' + center_freq23: '0' + center_freq24: '0' + center_freq25: '0' + center_freq26: '0' + center_freq27: '0' + center_freq28: '0' + center_freq29: '0' + center_freq3: '0' + center_freq30: '0' + center_freq31: '0' + center_freq4: '0' + center_freq5: '0' + center_freq6: '0' + center_freq7: '0' + center_freq8: '0' + center_freq9: '0' + clock_rate: '0.0' + clock_source0: '' + clock_source1: '' + clock_source2: '' + clock_source3: '' + clock_source4: '' + clock_source5: '' + clock_source6: '' + clock_source7: '' + comment: '' + dc_offs_enb0: '""' + dc_offs_enb1: '""' + dc_offs_enb10: '""' + dc_offs_enb11: '""' + dc_offs_enb12: '""' + dc_offs_enb13: '""' + dc_offs_enb14: '""' + dc_offs_enb15: '""' + dc_offs_enb16: '""' + dc_offs_enb17: '""' + dc_offs_enb18: '""' + dc_offs_enb19: '""' + dc_offs_enb2: '""' + dc_offs_enb20: '""' + dc_offs_enb21: '""' + dc_offs_enb22: '""' + dc_offs_enb23: '""' + dc_offs_enb24: '""' + dc_offs_enb25: '""' + dc_offs_enb26: '""' + dc_offs_enb27: '""' + dc_offs_enb28: '""' + dc_offs_enb29: '""' + dc_offs_enb3: '""' + dc_offs_enb30: '""' + dc_offs_enb31: '""' + dc_offs_enb4: '""' + dc_offs_enb5: '""' + dc_offs_enb6: '""' + dc_offs_enb7: '""' + dc_offs_enb8: '""' + dc_offs_enb9: '""' + dev_addr: '"addr="+ip_address' + dev_args: '""' + gain0: gain + gain1: '0' + gain10: '0' + gain11: '0' + gain12: '0' + gain13: '0' + gain14: '0' + gain15: '0' + gain16: '0' + gain17: '0' + gain18: '0' + gain19: '0' + gain2: '0' + gain20: '0' + gain21: '0' + gain22: '0' + gain23: '0' + gain24: '0' + gain25: '0' + gain26: '0' + gain27: '0' + gain28: '0' + gain29: '0' + gain3: '0' + gain30: '0' + gain31: '0' + gain4: '0' + gain5: '0' + gain6: '0' + gain7: '0' + gain8: '0' + gain9: '0' + iq_imbal_enb0: '""' + iq_imbal_enb1: '""' + iq_imbal_enb10: '""' + iq_imbal_enb11: '""' + iq_imbal_enb12: '""' + iq_imbal_enb13: '""' + iq_imbal_enb14: '""' + iq_imbal_enb15: '""' + iq_imbal_enb16: '""' + iq_imbal_enb17: '""' + iq_imbal_enb18: '""' + iq_imbal_enb19: '""' + iq_imbal_enb2: '""' + iq_imbal_enb20: '""' + iq_imbal_enb21: '""' + iq_imbal_enb22: '""' + iq_imbal_enb23: '""' + iq_imbal_enb24: '""' + iq_imbal_enb25: '""' + iq_imbal_enb26: '""' + iq_imbal_enb27: '""' + iq_imbal_enb28: '""' + iq_imbal_enb29: '""' + iq_imbal_enb3: '""' + iq_imbal_enb30: '""' + iq_imbal_enb31: '""' + iq_imbal_enb4: '""' + iq_imbal_enb5: '""' + iq_imbal_enb6: '""' + iq_imbal_enb7: '""' + iq_imbal_enb8: '""' + iq_imbal_enb9: '""' + lo_export0: 'False' + lo_export1: 'False' + lo_export10: 'False' + lo_export11: 'False' + lo_export12: 'False' + lo_export13: 'False' + lo_export14: 'False' + lo_export15: 'False' + lo_export16: 'False' + lo_export17: 'False' + lo_export18: 'False' + lo_export19: 'False' + lo_export2: 'False' + lo_export20: 'False' + lo_export21: 'False' + lo_export22: 'False' + lo_export23: 'False' + lo_export24: 'False' + lo_export25: 'False' + lo_export26: 'False' + lo_export27: 'False' + lo_export28: 'False' + lo_export29: 'False' + lo_export3: 'False' + lo_export30: 'False' + lo_export31: 'False' + lo_export4: 'False' + lo_export5: 'False' + lo_export6: 'False' + lo_export7: 'False' + lo_export8: 'False' + lo_export9: 'False' + lo_source0: internal + lo_source1: internal + lo_source10: internal + lo_source11: internal + lo_source12: internal + lo_source13: internal + lo_source14: internal + lo_source15: internal + lo_source16: internal + lo_source17: internal + lo_source18: internal + lo_source19: internal + lo_source2: internal + lo_source20: internal + lo_source21: internal + lo_source22: internal + lo_source23: internal + lo_source24: internal + lo_source25: internal + lo_source26: internal + lo_source27: internal + lo_source28: internal + lo_source29: internal + lo_source3: internal + lo_source30: internal + lo_source31: internal + lo_source4: internal + lo_source5: internal + lo_source6: internal + lo_source7: internal + lo_source8: internal + lo_source9: internal + maxoutbuf: '0' + minoutbuf: '0' + nchan: '1' + norm_gain0: 'False' + norm_gain1: 'False' + norm_gain10: 'False' + norm_gain11: 'False' + norm_gain12: 'False' + norm_gain13: 'False' + norm_gain14: 'False' + norm_gain15: 'False' + norm_gain16: 'False' + norm_gain17: 'False' + norm_gain18: 'False' + norm_gain19: 'False' + norm_gain2: 'False' + norm_gain20: 'False' + norm_gain21: 'False' + norm_gain22: 'False' + norm_gain23: 'False' + norm_gain24: 'False' + norm_gain25: 'False' + norm_gain26: 'False' + norm_gain27: 'False' + norm_gain28: 'False' + norm_gain29: 'False' + norm_gain3: 'False' + norm_gain30: 'False' + norm_gain31: 'False' + norm_gain4: 'False' + norm_gain5: 'False' + norm_gain6: 'False' + norm_gain7: 'False' + norm_gain8: 'False' + norm_gain9: 'False' + num_mboards: '1' + otw: '' + rx_agc0: Default + rx_agc1: Default + rx_agc10: Default + rx_agc11: Default + rx_agc12: Default + rx_agc13: Default + rx_agc14: Default + rx_agc15: Default + rx_agc16: Default + rx_agc17: Default + rx_agc18: Default + rx_agc19: Default + rx_agc2: Default + rx_agc20: Default + rx_agc21: Default + rx_agc22: Default + rx_agc23: Default + rx_agc24: Default + rx_agc25: Default + rx_agc26: Default + rx_agc27: Default + rx_agc28: Default + rx_agc29: Default + rx_agc3: Default + rx_agc30: Default + rx_agc31: Default + rx_agc4: Default + rx_agc5: Default + rx_agc6: Default + rx_agc7: Default + rx_agc8: Default + rx_agc9: Default + samp_rate: sample_rate + sd_spec0: channel + sd_spec1: '' + sd_spec2: '' + sd_spec3: '' + sd_spec4: '' + sd_spec5: '' + sd_spec6: '' + sd_spec7: '' + show_lo_controls: 'False' + stream_args: '' + stream_chans: '[]' + sync: sync + time_source0: '' + time_source1: '' + time_source2: '' + time_source3: '' + time_source4: '' + time_source5: '' + time_source6: '' + time_source7: '' + type: fc32 + states: + bus_sink: false + bus_source: false + bus_structure: null + coordinate: [56, 160] + rotation: 0 + state: enabled + +connections: +- [analog_pwr_squelch_xx_0, '0', blocks_stream_to_vector_1, '0'] +- [blocks_complex_to_mag_squared_0, '0', blocks_moving_average_xx_0, '0'] +- [blocks_complex_to_mag_squared_0, '0', blocks_nlog10_ff_0, '0'] +- [blocks_moving_average_xx_0, '0', blocks_nlog10_ff_0, '0'] +- [blocks_nlog10_ff_0, '0', ainfosec_wideband_detector1_0, '0'] +- [blocks_nlog10_ff_0, '0', qtgui_time_sink_x_0, '0'] +- [blocks_stream_to_vector_1, '0', fft_vxx_0, '0'] +- [blocks_vector_to_stream_0, '0', blocks_complex_to_mag_squared_0, '0'] +- [fft_vxx_0, '0', blocks_vector_to_stream_0, '0'] +- [uhd_usrp_source_0, '0', analog_pwr_squelch_xx_0, '0'] + +metadata: + file_format: 1 diff --git a/Flow Graph Library/TSI Flow Graphs/wideband_usrp2.py b/Flow Graph Library/TSI Flow Graphs/wideband_usrp2.py new file mode 100755 index 00000000..42204a3f --- /dev/null +++ b/Flow Graph Library/TSI Flow Graphs/wideband_usrp2.py @@ -0,0 +1,173 @@ +#!/usr/bin/env python3 +# -*- coding: utf-8 -*- + +# +# SPDX-License-Identifier: GPL-3.0 +# +# GNU Radio Python Flow Graph +# Title: Wideband Usrp2 +# GNU Radio version: 3.10.1.1 + +from gnuradio import analog +from gnuradio import blocks +from gnuradio import fft +from gnuradio.fft import window +from gnuradio import gr +from gnuradio.filter import firdes +import sys +import signal +from argparse import ArgumentParser +from gnuradio.eng_arg import eng_float, intx +from gnuradio import eng_notation +from gnuradio import uhd +import time +import gnuradio.ainfosec as ainfosec + + + + +class wideband_usrp2(gr.top_block): + + def __init__(self): + gr.top_block.__init__(self, "Wideband Usrp2", catch_exceptions=True) + + ################################################## + # Variables + ################################################## + self.threshold = threshold = -70 + self.serial = serial = "False" + self.sample_rate = sample_rate = 20000000 + self.rx_freq = rx_freq = 1200e6 + self.ip_address = ip_address = "192.168.10.2" + self.gain = gain = 30 + self.fft_size = fft_size = 512*1 + self.channel = channel = "A:0" + self.antenna = antenna = "TX/RX" + + ################################################## + # Blocks + ################################################## + self.uhd_usrp_source_0 = uhd.usrp_source( + ",".join(("addr="+ip_address, "")), + uhd.stream_args( + cpu_format="fc32", + args='', + channels=list(range(0,1)), + ), + ) + self.uhd_usrp_source_0.set_subdev_spec(channel, 0) + self.uhd_usrp_source_0.set_samp_rate(sample_rate) + self.uhd_usrp_source_0.set_time_unknown_pps(uhd.time_spec(0)) + + self.uhd_usrp_source_0.set_center_freq(rx_freq, 0) + self.uhd_usrp_source_0.set_antenna(antenna, 0) + self.uhd_usrp_source_0.set_gain(gain, 0) + self.fft_vxx_0 = fft.fft_vcc(fft_size, True, window.blackmanharris(fft_size), True, 1) + self.blocks_vector_to_stream_0 = blocks.vector_to_stream(gr.sizeof_gr_complex*1, fft_size) + self.blocks_stream_to_vector_1 = blocks.stream_to_vector(gr.sizeof_gr_complex*1, fft_size) + self.blocks_nlog10_ff_0 = blocks.nlog10_ff(10, 1, 0) + self.blocks_complex_to_mag_squared_0 = blocks.complex_to_mag_squared(1) + self.analog_pwr_squelch_xx_0 = analog.pwr_squelch_cc(-10, 1e-4, 0, True) + self.ainfosec_wideband_detector1_0 = ainfosec.wideband_detector1("tcp://127.0.0.1:5060",rx_freq,fft_size,sample_rate) + + + ################################################## + # Connections + ################################################## + self.connect((self.analog_pwr_squelch_xx_0, 0), (self.blocks_stream_to_vector_1, 0)) + self.connect((self.blocks_complex_to_mag_squared_0, 0), (self.blocks_nlog10_ff_0, 0)) + self.connect((self.blocks_nlog10_ff_0, 0), (self.ainfosec_wideband_detector1_0, 0)) + self.connect((self.blocks_stream_to_vector_1, 0), (self.fft_vxx_0, 0)) + self.connect((self.blocks_vector_to_stream_0, 0), (self.blocks_complex_to_mag_squared_0, 0)) + self.connect((self.fft_vxx_0, 0), (self.blocks_vector_to_stream_0, 0)) + self.connect((self.uhd_usrp_source_0, 0), (self.analog_pwr_squelch_xx_0, 0)) + + + def get_threshold(self): + return self.threshold + + def set_threshold(self, threshold): + self.threshold = threshold + + def get_serial(self): + return self.serial + + def set_serial(self, serial): + self.serial = serial + + def get_sample_rate(self): + return self.sample_rate + + def set_sample_rate(self, sample_rate): + self.sample_rate = sample_rate + self.ainfosec_wideband_detector1_0.set_sample_rate(self.sample_rate) + self.uhd_usrp_source_0.set_samp_rate(self.sample_rate) + + def get_rx_freq(self): + return self.rx_freq + + def set_rx_freq(self, rx_freq): + self.rx_freq = rx_freq + self.ainfosec_wideband_detector1_0.set_rx_freq(self.rx_freq) + self.uhd_usrp_source_0.set_center_freq(self.rx_freq, 0) + + def get_ip_address(self): + return self.ip_address + + def set_ip_address(self, ip_address): + self.ip_address = ip_address + + def get_gain(self): + return self.gain + + def set_gain(self, gain): + self.gain = gain + self.uhd_usrp_source_0.set_gain(self.gain, 0) + + def get_fft_size(self): + return self.fft_size + + def set_fft_size(self, fft_size): + self.fft_size = fft_size + self.ainfosec_wideband_detector1_0.set_fft_size(self.fft_size) + + def get_channel(self): + return self.channel + + def set_channel(self, channel): + self.channel = channel + + def get_antenna(self): + return self.antenna + + def set_antenna(self, antenna): + self.antenna = antenna + self.uhd_usrp_source_0.set_antenna(self.antenna, 0) + + + + +def main(top_block_cls=wideband_usrp2, options=None): + tb = top_block_cls() + + def sig_handler(sig=None, frame=None): + tb.stop() + tb.wait() + + sys.exit(0) + + signal.signal(signal.SIGINT, sig_handler) + signal.signal(signal.SIGTERM, sig_handler) + + tb.start() + + try: + input('Press Enter to quit: ') + except EOFError: + pass + tb.stop() + tb.wait() + + +if __name__ == '__main__': + main() diff --git a/Flow Graph Library/TSI Flow Graphs/wideband_usrp_n2xx.grc b/Flow Graph Library/TSI Flow Graphs/wideband_usrp_n2xx.grc new file mode 100644 index 00000000..758f48b4 --- /dev/null +++ b/Flow Graph Library/TSI Flow Graphs/wideband_usrp_n2xx.grc @@ -0,0 +1,815 @@ +options: + parameters: + author: '' + category: Custom + cmake_opt: '' + comment: '' + copyright: '' + description: '' + gen_cmake: 'On' + gen_linking: dynamic + generate_options: no_gui + hier_block_src_path: '.:' + id: wideband_usrp_n2xx + max_nouts: '0' + output_language: python + placement: (0,0) + qt_qss_theme: '' + realtime_scheduling: '' + run: 'True' + run_command: '{python} -u {filename}' + run_options: prompt + sizing_mode: fixed + thread_safe_setters: '' + title: '' + window_size: '' + states: + bus_sink: false + bus_source: false + bus_structure: null + coordinate: [8, 20] + rotation: 0 + state: enabled + +blocks: +- name: antenna + id: variable + parameters: + comment: '' + value: '"TX/RX"' + states: + bus_sink: false + bus_source: false + bus_structure: null + coordinate: [688, 20] + rotation: 0 + state: enabled +- name: channel + id: variable + parameters: + comment: '' + value: '"A:0"' + states: + bus_sink: false + bus_source: false + bus_structure: null + coordinate: [608, 20] + rotation: 0 + state: enabled +- name: fft_size + id: variable + parameters: + comment: '' + value: 512*1 + states: + bus_sink: false + bus_source: false + bus_structure: null + coordinate: [456, 20] + rotation: 0 + state: enabled +- name: gain + id: variable + parameters: + comment: '' + value: '30' + states: + bus_sink: false + bus_source: false + bus_structure: null + coordinate: [536, 20] + rotation: 0 + state: enabled +- name: ip_address + id: variable + parameters: + comment: '' + value: '"192.168.10.2"' + states: + bus_sink: false + bus_source: false + bus_structure: null + coordinate: [776, 20] + rotation: 0 + state: enabled +- name: rx_freq + id: variable_qtgui_range + parameters: + comment: '' + gui_hint: '' + label: rx_freq + min_len: '200' + orient: Qt.Horizontal + rangeType: float + start: 2400e6 + step: 1e6 + stop: 2500e6 + value: 2425.e6 + widget: counter_slider + states: + bus_sink: false + bus_source: false + bus_structure: null + coordinate: [896, 108] + rotation: 0 + state: disabled +- name: rx_freq + id: variable + parameters: + comment: '' + value: 1200e6 + states: + bus_sink: false + bus_source: false + bus_structure: null + coordinate: [376, 20] + rotation: 0 + state: enabled +- name: sample_rate + id: variable + parameters: + comment: '' + value: '20000000' + states: + bus_sink: false + bus_source: false + bus_structure: null + coordinate: [184, 20] + rotation: 0 + state: enabled +- name: serial + id: variable + parameters: + comment: '' + value: '"False"' + states: + bus_sink: false + bus_source: false + bus_structure: null + coordinate: [904, 20] + rotation: 0 + state: enabled +- name: threshold + id: variable_qtgui_range + parameters: + comment: '' + gui_hint: '' + label: Threshold + min_len: '200' + orient: Qt.Horizontal + rangeType: float + start: '-120' + step: '1' + stop: '50' + value: '-50' + widget: counter_slider + states: + bus_sink: false + bus_source: false + bus_structure: null + coordinate: [1040, 108] + rotation: 0 + state: disabled +- name: threshold + id: variable + parameters: + comment: '' + value: '-70' + states: + bus_sink: false + bus_source: false + bus_structure: null + coordinate: [288, 20] + rotation: 0 + state: enabled +- name: ainfosec_wideband_detector1_0 + id: ainfosec_wideband_detector1 + parameters: + address: '"tcp://127.0.0.1:5060"' + affinity: '' + alias: '' + comment: '' + fft_size: fft_size + rx_freq: rx_freq + sample_rate: sample_rate + states: + bus_sink: false + bus_source: false + bus_structure: null + coordinate: [413, 462] + rotation: 0 + state: true +- name: analog_pwr_squelch_xx_0 + id: analog_pwr_squelch_xx + parameters: + affinity: '' + alias: '' + alpha: 1e-4 + comment: '' + gate: 'True' + maxoutbuf: '0' + minoutbuf: '0' + ramp: '0' + threshold: '-10' + type: complex + states: + bus_sink: false + bus_source: false + bus_structure: null + coordinate: [288, 176] + rotation: 0 + state: enabled +- name: blocks_complex_to_mag_squared_0 + id: blocks_complex_to_mag_squared + parameters: + affinity: '' + alias: '' + comment: '' + maxoutbuf: '0' + minoutbuf: '0' + vlen: '1' + states: + bus_sink: false + bus_source: false + bus_structure: null + coordinate: [664, 352] + rotation: 0 + state: enabled +- name: blocks_moving_average_xx_0 + id: blocks_moving_average_xx + parameters: + affinity: '' + alias: '' + comment: '' + length: '10' + max_iter: '4000' + maxoutbuf: '0' + minoutbuf: '0' + scale: '10' + type: float + vlen: '1' + states: + bus_sink: false + bus_source: false + bus_structure: null + coordinate: [864, 332] + rotation: 0 + state: disabled +- name: blocks_nlog10_ff_0 + id: blocks_nlog10_ff + parameters: + affinity: '' + alias: '' + comment: '' + k: '0' + maxoutbuf: '0' + minoutbuf: '0' + n: '10' + vlen: '1' + states: + bus_sink: false + bus_source: false + bus_structure: null + coordinate: [272, 476] + rotation: 0 + state: enabled +- name: blocks_stream_to_vector_1 + id: blocks_stream_to_vector + parameters: + affinity: '' + alias: '' + comment: '' + maxoutbuf: '0' + minoutbuf: '0' + num_items: fft_size + type: complex + vlen: '1' + states: + bus_sink: false + bus_source: false + bus_structure: null + coordinate: [72, 348] + rotation: 0 + state: enabled +- name: blocks_vector_to_stream_0 + id: blocks_vector_to_stream + parameters: + affinity: '' + alias: '' + comment: '' + maxoutbuf: '0' + minoutbuf: '0' + num_items: fft_size + type: complex + vlen: '1' + states: + bus_sink: false + bus_source: false + bus_structure: null + coordinate: [480, 348] + rotation: 0 + state: enabled +- name: fft_vxx_0 + id: fft_vxx + parameters: + affinity: '' + alias: '' + comment: '' + fft_size: fft_size + forward: 'True' + maxoutbuf: '0' + minoutbuf: '0' + nthreads: '1' + shift: 'True' + type: complex + window: window.blackmanharris(fft_size) + states: + bus_sink: false + bus_source: false + bus_structure: null + coordinate: [248, 320] + rotation: 0 + state: enabled +- name: qtgui_time_sink_x_0 + id: qtgui_time_sink_x + parameters: + affinity: '' + alias: '' + alpha1: '1.0' + alpha10: '1.0' + alpha2: '1.0' + alpha3: '1.0' + alpha4: '1.0' + alpha5: '1.0' + alpha6: '1.0' + alpha7: '1.0' + alpha8: '1.0' + alpha9: '1.0' + autoscale: 'False' + axislabels: 'True' + color1: blue + color10: dark blue + color2: red + color3: green + color4: black + color5: cyan + color6: magenta + color7: yellow + color8: dark red + color9: dark green + comment: '' + ctrlpanel: 'False' + entags: 'True' + grid: 'False' + gui_hint: '' + label1: '' + label10: '' + label2: '' + label3: '' + label4: '' + label5: '' + label6: '' + label7: '' + label8: '' + label9: '' + legend: 'True' + marker1: '-1' + marker10: '-1' + marker2: '-1' + marker3: '-1' + marker4: '-1' + marker5: '-1' + marker6: '-1' + marker7: '-1' + marker8: '-1' + marker9: '-1' + name: '""' + nconnections: '1' + size: fft_size + srate: '1' + stemplot: 'False' + style1: '1' + style10: '1' + style2: '1' + style3: '1' + style4: '1' + style5: '1' + style6: '1' + style7: '1' + style8: '1' + style9: '1' + tr_chan: '0' + tr_delay: '0' + tr_level: '0.0' + tr_mode: qtgui.TRIG_MODE_FREE + tr_slope: qtgui.TRIG_SLOPE_POS + tr_tag: '""' + type: float + update_time: '0.10' + width1: '1' + width10: '1' + width2: '1' + width3: '1' + width4: '1' + width5: '1' + width6: '1' + width7: '1' + width8: '1' + width9: '1' + ylabel: Amplitude + ymax: '1' + ymin: '-1' + yunit: '""' + states: + bus_sink: false + bus_source: false + bus_structure: null + coordinate: [408, 564] + rotation: 0 + state: disabled +- name: uhd_usrp_source_0 + id: uhd_usrp_source + parameters: + affinity: '' + alias: '' + ant0: antenna + ant1: '' + ant10: '' + ant11: '' + ant12: '' + ant13: '' + ant14: '' + ant15: '' + ant16: '' + ant17: '' + ant18: '' + ant19: '' + ant2: '' + ant20: '' + ant21: '' + ant22: '' + ant23: '' + ant24: '' + ant25: '' + ant26: '' + ant27: '' + ant28: '' + ant29: '' + ant3: '' + ant30: '' + ant31: '' + ant4: '' + ant5: '' + ant6: '' + ant7: '' + ant8: '' + ant9: '' + bw0: '0' + bw1: '0' + bw10: '0' + bw11: '0' + bw12: '0' + bw13: '0' + bw14: '0' + bw15: '0' + bw16: '0' + bw17: '0' + bw18: '0' + bw19: '0' + bw2: '0' + bw20: '0' + bw21: '0' + bw22: '0' + bw23: '0' + bw24: '0' + bw25: '0' + bw26: '0' + bw27: '0' + bw28: '0' + bw29: '0' + bw3: '0' + bw30: '0' + bw31: '0' + bw4: '0' + bw5: '0' + bw6: '0' + bw7: '0' + bw8: '0' + bw9: '0' + center_freq0: rx_freq + center_freq1: '0' + center_freq10: '0' + center_freq11: '0' + center_freq12: '0' + center_freq13: '0' + center_freq14: '0' + center_freq15: '0' + center_freq16: '0' + center_freq17: '0' + center_freq18: '0' + center_freq19: '0' + center_freq2: '0' + center_freq20: '0' + center_freq21: '0' + center_freq22: '0' + center_freq23: '0' + center_freq24: '0' + center_freq25: '0' + center_freq26: '0' + center_freq27: '0' + center_freq28: '0' + center_freq29: '0' + center_freq3: '0' + center_freq30: '0' + center_freq31: '0' + center_freq4: '0' + center_freq5: '0' + center_freq6: '0' + center_freq7: '0' + center_freq8: '0' + center_freq9: '0' + clock_rate: '0.0' + clock_source0: '' + clock_source1: '' + clock_source2: '' + clock_source3: '' + clock_source4: '' + clock_source5: '' + clock_source6: '' + clock_source7: '' + comment: '' + dc_offs_enb0: '""' + dc_offs_enb1: '""' + dc_offs_enb10: '""' + dc_offs_enb11: '""' + dc_offs_enb12: '""' + dc_offs_enb13: '""' + dc_offs_enb14: '""' + dc_offs_enb15: '""' + dc_offs_enb16: '""' + dc_offs_enb17: '""' + dc_offs_enb18: '""' + dc_offs_enb19: '""' + dc_offs_enb2: '""' + dc_offs_enb20: '""' + dc_offs_enb21: '""' + dc_offs_enb22: '""' + dc_offs_enb23: '""' + dc_offs_enb24: '""' + dc_offs_enb25: '""' + dc_offs_enb26: '""' + dc_offs_enb27: '""' + dc_offs_enb28: '""' + dc_offs_enb29: '""' + dc_offs_enb3: '""' + dc_offs_enb30: '""' + dc_offs_enb31: '""' + dc_offs_enb4: '""' + dc_offs_enb5: '""' + dc_offs_enb6: '""' + dc_offs_enb7: '""' + dc_offs_enb8: '""' + dc_offs_enb9: '""' + dev_addr: '"addr="+ip_address' + dev_args: '""' + gain0: gain + gain1: '0' + gain10: '0' + gain11: '0' + gain12: '0' + gain13: '0' + gain14: '0' + gain15: '0' + gain16: '0' + gain17: '0' + gain18: '0' + gain19: '0' + gain2: '0' + gain20: '0' + gain21: '0' + gain22: '0' + gain23: '0' + gain24: '0' + gain25: '0' + gain26: '0' + gain27: '0' + gain28: '0' + gain29: '0' + gain3: '0' + gain30: '0' + gain31: '0' + gain4: '0' + gain5: '0' + gain6: '0' + gain7: '0' + gain8: '0' + gain9: '0' + iq_imbal_enb0: '""' + iq_imbal_enb1: '""' + iq_imbal_enb10: '""' + iq_imbal_enb11: '""' + iq_imbal_enb12: '""' + iq_imbal_enb13: '""' + iq_imbal_enb14: '""' + iq_imbal_enb15: '""' + iq_imbal_enb16: '""' + iq_imbal_enb17: '""' + iq_imbal_enb18: '""' + iq_imbal_enb19: '""' + iq_imbal_enb2: '""' + iq_imbal_enb20: '""' + iq_imbal_enb21: '""' + iq_imbal_enb22: '""' + iq_imbal_enb23: '""' + iq_imbal_enb24: '""' + iq_imbal_enb25: '""' + iq_imbal_enb26: '""' + iq_imbal_enb27: '""' + iq_imbal_enb28: '""' + iq_imbal_enb29: '""' + iq_imbal_enb3: '""' + iq_imbal_enb30: '""' + iq_imbal_enb31: '""' + iq_imbal_enb4: '""' + iq_imbal_enb5: '""' + iq_imbal_enb6: '""' + iq_imbal_enb7: '""' + iq_imbal_enb8: '""' + iq_imbal_enb9: '""' + lo_export0: 'False' + lo_export1: 'False' + lo_export10: 'False' + lo_export11: 'False' + lo_export12: 'False' + lo_export13: 'False' + lo_export14: 'False' + lo_export15: 'False' + lo_export16: 'False' + lo_export17: 'False' + lo_export18: 'False' + lo_export19: 'False' + lo_export2: 'False' + lo_export20: 'False' + lo_export21: 'False' + lo_export22: 'False' + lo_export23: 'False' + lo_export24: 'False' + lo_export25: 'False' + lo_export26: 'False' + lo_export27: 'False' + lo_export28: 'False' + lo_export29: 'False' + lo_export3: 'False' + lo_export30: 'False' + lo_export31: 'False' + lo_export4: 'False' + lo_export5: 'False' + lo_export6: 'False' + lo_export7: 'False' + lo_export8: 'False' + lo_export9: 'False' + lo_source0: internal + lo_source1: internal + lo_source10: internal + lo_source11: internal + lo_source12: internal + lo_source13: internal + lo_source14: internal + lo_source15: internal + lo_source16: internal + lo_source17: internal + lo_source18: internal + lo_source19: internal + lo_source2: internal + lo_source20: internal + lo_source21: internal + lo_source22: internal + lo_source23: internal + lo_source24: internal + lo_source25: internal + lo_source26: internal + lo_source27: internal + lo_source28: internal + lo_source29: internal + lo_source3: internal + lo_source30: internal + lo_source31: internal + lo_source4: internal + lo_source5: internal + lo_source6: internal + lo_source7: internal + lo_source8: internal + lo_source9: internal + maxoutbuf: '0' + minoutbuf: '0' + nchan: '1' + norm_gain0: 'False' + norm_gain1: 'False' + norm_gain10: 'False' + norm_gain11: 'False' + norm_gain12: 'False' + norm_gain13: 'False' + norm_gain14: 'False' + norm_gain15: 'False' + norm_gain16: 'False' + norm_gain17: 'False' + norm_gain18: 'False' + norm_gain19: 'False' + norm_gain2: 'False' + norm_gain20: 'False' + norm_gain21: 'False' + norm_gain22: 'False' + norm_gain23: 'False' + norm_gain24: 'False' + norm_gain25: 'False' + norm_gain26: 'False' + norm_gain27: 'False' + norm_gain28: 'False' + norm_gain29: 'False' + norm_gain3: 'False' + norm_gain30: 'False' + norm_gain31: 'False' + norm_gain4: 'False' + norm_gain5: 'False' + norm_gain6: 'False' + norm_gain7: 'False' + norm_gain8: 'False' + norm_gain9: 'False' + num_mboards: '1' + otw: '' + rx_agc0: Default + rx_agc1: Default + rx_agc10: Default + rx_agc11: Default + rx_agc12: Default + rx_agc13: Default + rx_agc14: Default + rx_agc15: Default + rx_agc16: Default + rx_agc17: Default + rx_agc18: Default + rx_agc19: Default + rx_agc2: Default + rx_agc20: Default + rx_agc21: Default + rx_agc22: Default + rx_agc23: Default + rx_agc24: Default + rx_agc25: Default + rx_agc26: Default + rx_agc27: Default + rx_agc28: Default + rx_agc29: Default + rx_agc3: Default + rx_agc30: Default + rx_agc31: Default + rx_agc4: Default + rx_agc5: Default + rx_agc6: Default + rx_agc7: Default + rx_agc8: Default + rx_agc9: Default + samp_rate: sample_rate + sd_spec0: channel + sd_spec1: '' + sd_spec2: '' + sd_spec3: '' + sd_spec4: '' + sd_spec5: '' + sd_spec6: '' + sd_spec7: '' + show_lo_controls: 'False' + stream_args: '' + stream_chans: '[]' + sync: sync + time_source0: '' + time_source1: '' + time_source2: '' + time_source3: '' + time_source4: '' + time_source5: '' + time_source6: '' + time_source7: '' + type: fc32 + states: + bus_sink: false + bus_source: false + bus_structure: null + coordinate: [56, 160] + rotation: 0 + state: enabled + +connections: +- [analog_pwr_squelch_xx_0, '0', blocks_stream_to_vector_1, '0'] +- [blocks_complex_to_mag_squared_0, '0', blocks_moving_average_xx_0, '0'] +- [blocks_complex_to_mag_squared_0, '0', blocks_nlog10_ff_0, '0'] +- [blocks_moving_average_xx_0, '0', blocks_nlog10_ff_0, '0'] +- [blocks_nlog10_ff_0, '0', ainfosec_wideband_detector1_0, '0'] +- [blocks_nlog10_ff_0, '0', qtgui_time_sink_x_0, '0'] +- [blocks_stream_to_vector_1, '0', fft_vxx_0, '0'] +- [blocks_vector_to_stream_0, '0', blocks_complex_to_mag_squared_0, '0'] +- [fft_vxx_0, '0', blocks_vector_to_stream_0, '0'] +- [uhd_usrp_source_0, '0', analog_pwr_squelch_xx_0, '0'] + +metadata: + file_format: 1 diff --git a/Flow Graph Library/TSI Flow Graphs/wideband_usrp_n2xx.py b/Flow Graph Library/TSI Flow Graphs/wideband_usrp_n2xx.py new file mode 100755 index 00000000..bf56e0fc --- /dev/null +++ b/Flow Graph Library/TSI Flow Graphs/wideband_usrp_n2xx.py @@ -0,0 +1,173 @@ +#!/usr/bin/env python3 +# -*- coding: utf-8 -*- + +# +# SPDX-License-Identifier: GPL-3.0 +# +# GNU Radio Python Flow Graph +# Title: Wideband Usrp N2Xx +# GNU Radio version: 3.10.1.1 + +from gnuradio import analog +from gnuradio import blocks +from gnuradio import fft +from gnuradio.fft import window +from gnuradio import gr +from gnuradio.filter import firdes +import sys +import signal +from argparse import ArgumentParser +from gnuradio.eng_arg import eng_float, intx +from gnuradio import eng_notation +from gnuradio import uhd +import time +import gnuradio.ainfosec as ainfosec + + + + +class wideband_usrp_n2xx(gr.top_block): + + def __init__(self): + gr.top_block.__init__(self, "Wideband Usrp N2Xx", catch_exceptions=True) + + ################################################## + # Variables + ################################################## + self.threshold = threshold = -70 + self.serial = serial = "False" + self.sample_rate = sample_rate = 20000000 + self.rx_freq = rx_freq = 1200e6 + self.ip_address = ip_address = "192.168.10.2" + self.gain = gain = 30 + self.fft_size = fft_size = 512*1 + self.channel = channel = "A:0" + self.antenna = antenna = "TX/RX" + + ################################################## + # Blocks + ################################################## + self.uhd_usrp_source_0 = uhd.usrp_source( + ",".join(("addr="+ip_address, "")), + uhd.stream_args( + cpu_format="fc32", + args='', + channels=list(range(0,1)), + ), + ) + self.uhd_usrp_source_0.set_subdev_spec(channel, 0) + self.uhd_usrp_source_0.set_samp_rate(sample_rate) + self.uhd_usrp_source_0.set_time_unknown_pps(uhd.time_spec(0)) + + self.uhd_usrp_source_0.set_center_freq(rx_freq, 0) + self.uhd_usrp_source_0.set_antenna(antenna, 0) + self.uhd_usrp_source_0.set_gain(gain, 0) + self.fft_vxx_0 = fft.fft_vcc(fft_size, True, window.blackmanharris(fft_size), True, 1) + self.blocks_vector_to_stream_0 = blocks.vector_to_stream(gr.sizeof_gr_complex*1, fft_size) + self.blocks_stream_to_vector_1 = blocks.stream_to_vector(gr.sizeof_gr_complex*1, fft_size) + self.blocks_nlog10_ff_0 = blocks.nlog10_ff(10, 1, 0) + self.blocks_complex_to_mag_squared_0 = blocks.complex_to_mag_squared(1) + self.analog_pwr_squelch_xx_0 = analog.pwr_squelch_cc(-10, 1e-4, 0, True) + self.ainfosec_wideband_detector1_0 = ainfosec.wideband_detector1("tcp://127.0.0.1:5060",rx_freq,fft_size,sample_rate) + + + ################################################## + # Connections + ################################################## + self.connect((self.analog_pwr_squelch_xx_0, 0), (self.blocks_stream_to_vector_1, 0)) + self.connect((self.blocks_complex_to_mag_squared_0, 0), (self.blocks_nlog10_ff_0, 0)) + self.connect((self.blocks_nlog10_ff_0, 0), (self.ainfosec_wideband_detector1_0, 0)) + self.connect((self.blocks_stream_to_vector_1, 0), (self.fft_vxx_0, 0)) + self.connect((self.blocks_vector_to_stream_0, 0), (self.blocks_complex_to_mag_squared_0, 0)) + self.connect((self.fft_vxx_0, 0), (self.blocks_vector_to_stream_0, 0)) + self.connect((self.uhd_usrp_source_0, 0), (self.analog_pwr_squelch_xx_0, 0)) + + + def get_threshold(self): + return self.threshold + + def set_threshold(self, threshold): + self.threshold = threshold + + def get_serial(self): + return self.serial + + def set_serial(self, serial): + self.serial = serial + + def get_sample_rate(self): + return self.sample_rate + + def set_sample_rate(self, sample_rate): + self.sample_rate = sample_rate + self.ainfosec_wideband_detector1_0.set_sample_rate(self.sample_rate) + self.uhd_usrp_source_0.set_samp_rate(self.sample_rate) + + def get_rx_freq(self): + return self.rx_freq + + def set_rx_freq(self, rx_freq): + self.rx_freq = rx_freq + self.ainfosec_wideband_detector1_0.set_rx_freq(self.rx_freq) + self.uhd_usrp_source_0.set_center_freq(self.rx_freq, 0) + + def get_ip_address(self): + return self.ip_address + + def set_ip_address(self, ip_address): + self.ip_address = ip_address + + def get_gain(self): + return self.gain + + def set_gain(self, gain): + self.gain = gain + self.uhd_usrp_source_0.set_gain(self.gain, 0) + + def get_fft_size(self): + return self.fft_size + + def set_fft_size(self, fft_size): + self.fft_size = fft_size + self.ainfosec_wideband_detector1_0.set_fft_size(self.fft_size) + + def get_channel(self): + return self.channel + + def set_channel(self, channel): + self.channel = channel + + def get_antenna(self): + return self.antenna + + def set_antenna(self, antenna): + self.antenna = antenna + self.uhd_usrp_source_0.set_antenna(self.antenna, 0) + + + + +def main(top_block_cls=wideband_usrp_n2xx, options=None): + tb = top_block_cls() + + def sig_handler(sig=None, frame=None): + tb.stop() + tb.wait() + + sys.exit(0) + + signal.signal(signal.SIGINT, sig_handler) + signal.signal(signal.SIGTERM, sig_handler) + + tb.start() + + try: + input('Press Enter to quit: ') + except EOFError: + pass + tb.stop() + tb.wait() + + +if __name__ == '__main__': + main() diff --git a/Icons/USRP2.png b/Icons/USRP2.png new file mode 100644 index 0000000000000000000000000000000000000000..8d2d314b99a6d6f8595e139f072bfe26ad333bf4 GIT binary patch literal 26044 zcmeHvd7O=9|NnKiIkT^3FpL>yvMU+c2HBHP_7IAQBs?i1^7Kf{?@`&3l1jUjrD#K& zEsaRo4F+R&WA^PV-}n1-o% zPri{pZhJzSYx1;|(=GD{k63l?jyuO~tek%(>P&X_;LnSk`+q!pu(bHM;)7}99?mG8 zSYBLF+Hvpnh|C9yJ1=-G5H(<6R7_Tgz;+1guMbaj<43s~jewB_;X)91W#Hh<)~ zC$>%gczyBk*wKxb^;n#yG z_WrP{qIhLtm%zSFPCxv{g>Q4aZ%<60wPnWX!ucy7di>I!k&kr#a%b(N(s?gz@9^`y z6{mak>Rk{u@!Lx$T}@tgjNG;(An&)>qh~t5)BnB4-R`}G-*lbx^Y+lR7L%RpY%_lx z@Kee|K5x%EfAi%_<)*DWReDkSs-2^=&P`giVcdk+m5$dlD&9NNb#K{}jP_sW)!Os@ zlDJR&=lb-tUAiIU&7-4Qe*H=Rs8?4k?%SjPyvOo86})sh?9LA-y*n;5ZP4PM^Trgl zFDP(K47hdtFB`l6p#TD+&{Hdd! zm#(}p<;78>Z6BpPQ1sRK;Q_CwebDFBr!Sl=y;wT*HRoq*`?Y8?cj}Nv>jPIGpY?Q~ z+|&v6$6T6Fd7@QpWOi}ft_%AgdGnW92fM~kdU00crg^WXJeD$l<*0rqUapvXc;BEq z7hdVyVr%S+mp4y{N?CH(i({f~t7h)$dq;Zb!?t-}hs31xN{G+f8dA|^_Nhe_WOLa#_=McMm?e?5>gVpG8f1 zeDtkHI-kDhp(UMWy}$JxzoVaSylLvxJKsnQ>EQ3$IBV+13x|C$BkZeJnjEf`*LC~& z!jF<8e|UR+MD+01)1vF$<7%5UY~sPN)F1ACzxJm-p-tA;yU+i`J3DjYgKPtC{pkFf zTTc4bo49oK!iV0dFFcuUk?s!dCTtAW2c8duy)A(z2ly|_0>9?2l(IH zbK%V=gENxsPmEcAU~`A>KRGgc@XVKw^lx-xsX6?qT|GB{F?>(MSt}n7nfde!!i28@IlB|E`SDCmXfx zT@*jg6GX)J8CaFbf!hC7x&ISRWG{x-V4FQo4+)=&lksCOjr0ATw?>6pv zZ>?whEL(1`mtWDXBDw9mYfVd2cb+^q`Q79X7rpvu(5a*MjB2sK^w=8%8k-WVDbphc zXGI_Uu*ahK^u(O;M=q`3_Ey{1oZmk4NZZ@ijA&pQ_1>fr15dYD<-4d)Wd6%XZ$F;? zv)?n_XRo?%!LzylKHBB$2iA|C;Gg^XHx2#FO?KQDzUX*TzoepR5|6_=O&I&WI~HgtzC@z9~-s>eyqK|CJJW|B`P1*xl#eCuc7?GNjdr z5nuSMY`L*r%R1dxwt6LW_r0aRDJ(9ajzw_NC3*NqURg*(Q4#a#AHD*yr z@^d3+ym>1B!0zu;KQ38(cKD(0V+TI^?89>(wvU`qH|t~rzZYKr?)cR2S`8anx3X?> zNYHRo?;A6R?V5Ji2V+-lC^83^#$`0PyZgNLYqu3Vy8Dasdk4JI@#lM|+~Xg$=IJgg zU;nB8oMM$1k+iqz;QTeCH_f=bEOyl43vI)HE!b)sr3N3KIr81WDJKu8ygs+p&G>X! z*879T&v-8X=chtrvdZEo1x^^V;tli4%%2NecOTv4&UY3)UG)6d-~ZM%WBjOY|7@K6 z#L_-z_O57`*1ewEylle4PP4!LanKK`i6xU~-*Ur~jW-2-8T8nqI||38Kh5e*&C;B$Zxu^7tijDg=9%^!^&amT2ecoI5oNY%=$BScU417LuesFwJo013G z#sgMVCR;_=?#Bs^GUsu9|r!bab8_Vz^1H! zFP`#UP$z4x7n+TWF536$+#LhkHTQY!{mH+My`}KUUDNu9jNd+Ux20>st78l2);Y2I z=(7*r759kW!v4pCR(vw)rInxGda6#XHEZh5m>G0;(z`cSF}!$R}kYWCiD z+n-E1vwWw!m9zMCaQIuFm){f}twzSSkL-nGf%TCdw-5D2dcybqXO)UmxA*EkbdJf? zZOk|8&|Q;i5U4?*27wv`Y7nSFpay{&1ZohdLE!&01Wf-I_K?>a8yjn>sHiZzTrN{+ zXsFrgbc#%i#p0%H=GNR?cedH=W|<$G%_e<@ZlBYq-A9$Wrj32gl`^U3%@yQd*Urky zN@=Ig+8(`?k&#|nhr{75hoavR5@NDi^F_~wtK&=sWtBlOt-(G&xbjQw}KW5PgiupU~zX9DeWI*4R-8Z(MYk{&fb^fS#Ru#y5-|D3OgRs+?HOF;krmOjwu6<>IVFT|NvICkDX{ zI(`^C^hrJh52HiZq=C)}pwfgGHy);XuXN zH2i1|L=<93Ct3sGZ>U>4DtXtwFRSLAp*P~bq5M-RC45J&b%MPFFPNB)U$ zu;^SGsS+0Rk1AxRW}ER3UNMBA1OehgfgM`DLBq3w&1SX*1_maiUdq{!mX=nbb^qt< zUj^MfW?27@y}EZ=65#I_Ot+17iOvXaI)?*1wXlu3=X9d$yrP|EdvbAx7xBxekqRzq z;MfJeZaoRmgOWEwIoC7f^5<*+)70A9bPyl3t zV@c8GQ>pk#5>z~Z(;EE4W@-)z3T%zNVbkHGC-V&1f0i2o`)4$&&)~j28^*+RXM_kL ztfRrkzCtv)-ib+QcVdy1oyq0Y%OQxRAI#*F4+VM3iW{CZ>dlTtZ=Y7EsmUrObYoBB zwy0^V$ki0mPW!6LffX7wMz0*gsTTXZ%gJ1V!ZRj1v}9yKgQWzjWy!(mU+5rM%f?M% zU{GLW&u&S7c~kvQk#1_#s8R6fA$Kef2@PpPMRbx!L(WN_4}gJ$2x{66Nl*XNP1OT~nDzUM zb^7G7{d#omv@9gZzX8ocxZ*$tPq9gIN#kuigOX*!%L>er@UU>{$LU2c``B?{6}mlZ zI~OXci%g1Q&`=aF=tW6fH5%9>j*AW{dzz@5ELD;L5~XS?-3i!4hS7E{9ci>+j)mqm z=*fn%7%H6{1KmbaPXaEkBd1eeTJy%!Pki@XYMIgg`~3Iz8vUjz_YLnku-|Q){QP|J zEjR`>obyoAO$|EXK_fZ{8drP{h!~8D{P8qHslu#*rabOVGDOl2MtDJ)bct%T9AV@| z8tJ&`H5w$>93n=zsa?x6WC!{2Q7tVU2kV02;$ z@}z;l6F3ZEtE9+{lI?#DE z#Pf0-|E_`411^j(mI4zVPZ%ULii)`xXuIT5t7y}P89+#r(CX4v!wm<#?n9n{LXiZ8 z01zY(quwYDDOGblfNT-IDu4mMVP)jgcF) z0+7(@8Oa+QJnvIJJ~ohgC84aN_bR<1i6FB~0HvTRalcSjTBgd%%2i;Xzw))?JrFj0 zaj`ZAimIk!I7)}vDj)EI&_k;!aT6s4qhAab zGM6eXD^>fG53AJkX=Ia+08e71s}4&A^{R83dJrTCmb8m$s&nV0qBd=AuGp|)gDS5m zufh*HES)X{kkeVIoH(QZw(oOQkW-*)#U-kSt-7hY_>SV~gIQKm zp{^7ZDIY{&mC7&3 zSNVoTsT0SKsmQwZmEFfj;YLVo@hT!bm|4VxigdJd*)e(F8+&Q16siRsg2;Uh<`mAz z3JCC3H@0l5f`WrEolS_!bQlzbK%;jap?z=~h7ME={i;4&fQFi?FhD(^s?Evr&OkIb% za4rRH`Y=rBr8TnIJhi6{bVXh@Li(5^K~=z*pd&Eh=*H6`9B3J=vw!ocVi&m@uS zAr_Fz$}2JTohl+c%o9oMoTv6diUt67Co~_wQb!3dy8Ee zUuMu?(=ga4iuHw{bKj=z7*F}O1Z&qz)q;*YE{Sx)Wo)EWSc#>=jLn1X{Nq2JQ1g_T z(IDek=^>C=VU&$L5VIyQz)z|U&swjUDOyV+_*YLk1}AbuQI#eZ8GAVR$?=aP$D=QO zAkd6(`oVUt>pUztFdLm_s|pJZ!x~qn;@Y-XM~L_yUaA!ZSnK-tM(aJwV?AgCk^v%Qz%n0rznqq2H;hJ78D2s5;JcftdggX zFi<*#LSF<-;n5JY2vw5E&oeWZ4`bjxJpwF!rQ=#Cp(Z2b=tkMltvp@uu>^!tE@cvA zE?vrkC5wZA#@rI83JnWVr!E{;3%}fm{o;~JN@}l4lrMseFK6&R3ADWZ=K?PCUj(8o zAVI!3EXLb#dZ`xMYCEvA!A=oCuVj?D&hq49k)eR~=-<2Vkcy9wQBhHma2NFahtElD zOb%>(&6_455-i}OqxyJNieucR^bA#2?!X3RQKh97DmXY$UCA$0G1xdG!b3$T&QAcH z5o=Zjg+=PZ#SCoRF4>&zcALt=-a+u}cCOJ5RbK8?_3KBe@X!zm5FEf%J~rk8Y|0#5 ze{AsCIeBs-@$fwE!wXxpi``t`_fDlx{cTDDG9VOZ`etbW++>#DrGd~Emy zI9Zj+F*XW&Q&0dlRYs7wj0+09@`6p?8Wa>%Ewk zwQ2>cj7wRnw768oHEck&5>1?C5n-WvZDu3tVis~=U%P4~v^u(t=#TXjyn{_1k6xY} znm3I%NTEcjI<=z&Owyq0EgL+Xr@3iol>>W5U_hYye)kS68z-@^)KlHNb_M7K3O_Yc zoqF_9iHV5n3b#tn&Q<|IKB^LdVlr7(Y)pL&c(L-ufcapc@#7YihZC0uT@0jmVh?8{ zJ;E}EmrLbbUT7AGu1(d0?s7_`3kQTTi3HssqC)JLSI!(2n$SR1T7#)h=nAjosG!QD zD##fPhXa+x2b&lF*lq9&r3?f3D49v~>oRJn8UPw?9MP+G=zfD!o~z3gXN$Jx()qLM z|Gcmg8*2l#_3Ll3K38Cgw5o&2KdGO7KBOj3xJPv|-G(;1sYUY^?wq~*G%uDY&KSI? zP^VK;!RMfAN%iXDI4nm+!xk|V5iXXA;aG|cr!-TQYjvQ*VwYYEJUAH6b2DN&``oYU z;0F(?LBqN!^OaDQnr>CK+B~QVag?%4 zm6hXG6&Jo$C7HjdtmOBU&3RE_wO09=XI0V3%_{%G_cBd1&N=`@rUz^I#*E68nbM8S2@r|(dTj2+6 z=gp8uZye72yq91#E9GuXjPDTPFd|Z ziGoKo@FE}1WL@Fa<+A_nNM}%r3`Ub-B#q`>9BwIKRGzBec(4lhZ;sQ&8I_iEMFo@< zVvSeIr?Mk<`}WFNQml&dN>!x0On|_nX0I$G(yz*h08|T*^_GN($y+IzX%W9 zu-;-*4hh7-7M9`dyajSySZDp!k`*tAF3Kea4n+Rh)bp~p@N239i1cCo#sE1nctp*L zQ(0ElC4O62W=M8Uw#v)TSAM<`7}z3JT3(_Gj~oT13CCvrf`~f2_+Yu=%+h+XoBS8c z3wUvYCGv7U((cm<9#MJx3W@8kLj8}csFuytZ=b)fDuQB_Pk0OEFxga?V}pwB&_SKv zxkQ!uL@5>C2F^QGW>&VxNd&$p4mjmGk65J^8qIGgy5uuJTwSP5sss9DmW-m z4IVNSAlv1{)c3Z&svhJO6&2#_?W1e~5m@6Y@fafjS>;u5VYp$ltVQC3GWq-$paWcB zP85iMWCR1?KnY$?si@|+sXbq&DcivXDl9TuHS9f6S^Ywl#h$2+r<_vf-g{OB1Y1?3 z+m|X^a6R?w;a}CTVM7=JA`TlDP6GZib9l2wWu=HHf=eiGXzf$?dojGS(S#PDxc}_j@5#5`ua_qg)SpA zTdiI5mRc}>4m>ugk3QOaYp6R(ie> z=k2RfxN3EkMikBKUR&~2yDt5EK&tc*2;SgS;)$FcYnrhbAW)6U9D z+@T7zSXS_8plP$Fkj485to!Jfi$s?RGonoGKX4596nxsqWy7fw8pf!&*m@Euya$m- z;N*jFzPilH&MKWV?ZMXH|M=r+k2LmrQ+1~o2;`(=WMkNfCMAj?%ygL!2;eBtVbX9n zXLndcn6%)_ostLR;n=ik4|)|FgT{4Gk|*y!<-0vL($=vdlt0j_#EM()8=ByicmZmOk`PB=W(Dumu5X;9GvuFFF0 z;dMAFojCF7Hz-=nHP`AucOO5v`=YPi*I8caHWioQP7A;ziMf0Y2Bl7`E#O>GaPUQ} z$rxKFzmCs4TKr;wzZ!4}Qqaza`!;NrHoT7Wsc=;KI4eDV2-)xf~{+J;H zV`IX*Z+@>3AHF+76OJST6oZTY8n~fI-$@09WLHk?8%~IDVBc`yr8DmCQ8rl|Xm{WV zp#yi3PCVP;cL7~+%Voir+Ay#%11mMX;P0nUW*c`Aw}rVZ1a3T*w&!2D(xsxJJg^LF zKb|$YEmof*oN&(Lu|>Y!YAwpUocHVL3l}nh7tHx%suuJkzZ~3u@#KM4r!N)QkDe_y zl{(Gga5&5YD4H~^U0Uog`($Nbc?@UhPd&n^09gDXv5g--m*9sw`Qgh@emI)f`xvy$ z*>A|E9`34K_>G)pe(-ie)(hrF-JoI45BaNpP`xfVq`6-5Ym?Y!bETuCD}D%uXEFtD zzrdiMN{fmX!m0CRWo1{u#3--!ouA>z^@OvJ&NAWq*#Y5*ir(erl@We^R{jqsIhmQ4 z*Q2ippXv-G@Bg-B!W*Lc0l~p-%gf3_@QZYn%I!U*o`E%*dWFdy9p-7#1f-1#aKwxXw(=L zO;E9-K@&?vF)CsQl-^+%*kza9|D2h7cNZkYFGchG&yL)^b7#(+Ip=-n%*?%a_wnPw zgZj&Dy=(~~@~{DYhQfIY9N`iXd@e02Uqy)cm3M}}I(O)V1%9(;&zutV)?~lAi)Kys zo4hazBp2S%OcUjVB#Qe{)a?TzpnKb1==7`|=^X{(s>9e_? zewy1tUy-cTedu2m(>ONvZrkuiUFWX5`0^{`&L@nEw)Hi5<*z@r_M3Csn#OByugw_O zIJeqv!?^RO4=mD884$WRr{e2v$qVyNdj^klKPH>CwPIpq^o+Q+x)ondSFKltp3a&2 zf%4;DB1RO%_RJnR&?%_N=H#gzj%{uFWkGtk@QH)o>p#3}THoUB2cDbZ)p+OH{#!>~ zym6r_u}bZ|B)Xm9`q9_VRtYX1kKdB^Vpvu|;@YdH5LLv}_6 zby-#ZLR+`c=!;t?-#syFhyKU;ZNr}1)kSYmYR0wLa&YFV@>aRB9*2HDFnhwW#3{4q zwt2~FSz+kVJ#Culqi=nkzP|dCH(!2qO8#b?(!F{4seLnV#N2GNyj)h@q1T`iyKkDT z`5|q1$msWrSFRhlOMGnXv6bsbURZp&dDDnbT)!L=cq~rY+BfZP_$u9pUU{1DlrtAE z9{ce(q59~QZ*-b9E23t7xGG^wM$-$vr++&dI{NqzCl~$Fu3b>yF6j$nC--SQXZ@6z ziteLVVvqj z`#0T2>ej_gS~%mkwbL%0*)u#ka^97nuK(U;Z|c~bD2+>jRN;SkQJntGX4~JnxpVuc zYp>nxI(B4ev&}`d+2S+Rif_65M)x@BFRfOP_S`iYjd$ zv~vHsd!75%6ngBOpH>u+GC%f;L*wq3b`^Mhk&x^-xZ|KU)7H0N)^^IBBW<+VlK|!zP^2j0fU!zc=_n{#a#zfi)zkZ+hF%q;n(3O z4iq-st66#emDrQmY7k@IbYQn*uubnK|w0P@8 zr=YuA;va4NyoF#+*ox0K4FA1(^VltS+H~HlXp!E0)PbLCw&~yToYCaYf)zGVuf4W; zdhaoweHMN4CxWEHopI! zong}>F65RWDt#M(un z)rH@_`Q5$k!(ub$obNh(Q|iPAi-pTeoY$>ex;8P|Ei%PR^|AA@OEac*ca`+sH7E8p z@#3&i_M1;+-u`yc$MRm2HM>(wBKPLay0w1)@+}|80#dJ?6}{NqZPSsi{;j8uADw!u zlW+X;ta*-mZ6~zJk*B*R-WBHWLQ75CO9$0F7Tpiyo z?B0dQtGx%E**>ZBhS}ebZz8^-Sahq~)e)U4XHVPPa->9ZV|TyFON&2NH9L~@>AVE* z?Mr5V=%Ec;nUZu?D0Z*@}ooSRFg;^KF4)g8C@5U1~V+ZNlm|glyh`iLU8!YV}5TDbZB+q(zU17g-w4oWLW8r?neg4_^(V!NU@pw z(Z;sLdm`U$l{0YK1Sj40DC-_yOt-ziqoa4vO=(MBY&`$Sh}}mXIvjKhOe|QMQZ)RP zt%Fh@?z*C=oEto;tYfgXLzjeQOWu0$#d`yqy>V#p@%ha>zGzo`XK+O8w&(6F=^#q% zws=Q+V9G~}=GZ4qXy+P}ckqyQ=?s1AOQD}8w4eUc8)rTma=mB7xK-D6>ANp1{a{`D zOE0Ot2E`8Bpzr*ZU1-g+!yeNXRC_L4xlq%4XX5du$1>vI^55xFGNSR_!pJGT1Rn_R zZu$0N%B6Pm{fk>fx<5Zm`r`87i#yxzv+>;h;cNOy593aXyQO${urBR9x%$gXPVx6C zo&KZm@Xpb<+VA-6v1S|+x5U?O%LBN851px~J76dE^SP-xvU_sy?KtS*h=y)0`p2SYW z(=g;|_3j&){o)`S>{R;$Z57z~+Otu|MsQe~8vmuKC* zdp9#9Bcm`mIaz)0-aRd}tB<1d&D5T*sP)NqsnahX6`77&&JsP%Re%If-RP6(^3ON6lnC^2cQE6YpqgX)2dagSuQTl z!)$D9@GAja;!NVue%yLfNnJurp!2#+XH#8mvP|Xm$?|2;C;Q_I%+9s-(F!mOr_CCD zO{Gq&D^+XMSwJLCmG^W!@+Qx7m$T8Fi|*XHf&*44c>^~Q|gEHV|FV_VBk zlte#R3*Mv}otC7fJ^11EG2W1qg4bVv-8L*NY;a>ApBWAg4(*9R zAY{h!;6sN31EYfaATV>4lQFAjZt_M7Kpp0RAa^lKHLwdl zFWe^3T*f@l%kX7f=iJF;Enklo=nZ;OtwBOG1U3^;g1#DbwcFOd`lpGZNWg;b+o@Bh zC|6gP@wQT1SH4T5*=$HbF;~K!urbSWfC5O2F0Q7QIF!*pQz4f#j(AEd6xJo+&#uv4 zj%Eb#vG%l{BM|dE3Dh83i8*Kq0}G==qp89*2Wz-w0J5Hdm~B5uyA#5`3&1!18)rmO zux8DgkTz{v&2n~j86gsh?2P(2^iYT;mctmK$w(S=j$?{D@vY#@i(?J@gXYFUnlk~0 zH54k=2TIbZhBJn{#!9|TE%J(XhpM6IqOum$JE;LIt797K`E ztm3ik-;EwYXlSU_=+UFQ1_m~N+sVl}3>J6%x+P0IcocZP&{StK)0CrR(M!y6@DL;3Fb24xE?FGDyc8mDgq(Md zj@nvWAgZi8tb-hF17$34)bOVS)g_ExBf+4PufvX@2tR2VpT`nCEb&g7D5hEBkZk+v~L4!tldwWe&C=?-JG>?p#dMM(YDk&}@nU5Zk z;Fc|kl@)BvID!OpNSm6NE;%sa#3_D^AT!FS0@?!2plukKSYa~l@iIONP=?PlYp_?& z1|%4=96hw0cEg1u=8*(kY1$Oo5EJtBgM>kzMK z9W6#MO+-*Rh9=D#Ka7n`1fq>p6piDZfh_aHtca_ogj7`$c%H+$F)GIlcJRju2>n|T zBY?;6om#eRIn&wMIb19j+wqu~cgg$B&PMpmMX1BfSiT+&2LSPsDrM!oI}8^l!_YFD zs(8)3F$gHt##O)t8|l0toNEc-CB_|Z3zOrc2Su^Zx`T;tqt#ZE%E}6&g>{6h*rFkL;NG0ibK@0^1nwR#LZK zSED6WKnOf$!L2W7M4hZJY{9Ns+xkCIo+X1p@YffAUteDbiA3xI5A8U02&8}rg+f>_ zthiCaIgB8Ju{>esX9UEYAR~MnkrV)gjGMcuvv_Ut8F8rMxa$z!5+RLjg_- zu2tpb#8xJwK46VG_*C4e5Nk2P=!S(I38{i)-QsGcB)}f zudJwK_amr_(!k4@)X?(Bi%kONIp|VPAp9Cg4H5%)t^zO)4(2=$G=ha>Sy?kPX)Q+_ zj#UFVgrSaPump1G6nr4j*498YQ-=OiIb*c(ZE>oE#s&l4J!5TQ%4(6u^kF^9GaHOOq9H^GIe}RFXHU%NJl=BC6v5NR-M7I$hzk^e`h6%Ebg;d=ZIMObL@nC18Mo zI6B%JyHrjbz$^|$UW5?<(;E+SrwVPIaXv#dPiQZq$g`f?d`YhXNBuJSjLhl;x`8o2fTH z|MADT{Y-QHpA8ZN;cb9v0Q9oa#X2)Nj*ePc31BLd(8C-Ps1v}nV8DlYc6N3|VK1j6 z*94q_mKoIfL{*_8ck)!^%#T}0*jN{0-?RrQDJ&+Ac6uUKB@;VaIZ3;Ijwpg&f&Li4 z=171UbSEf)s6m@35MT_mhnpTD(oKB}2)qOakd%}lyiuflnWM`A%@c$el$Vu};-W%2 zLtsBF0UpLYiwvwml&Brt8P}Aw`)P5d;t>03HC|ag@P(9Vtv{r~~ar86kaE#tdP;2uNjVJ}E2JL3GuSkt2H(om>GuS`lYg zXQE0^AR?JNIk;mBQ5D=LFZqTNsT^PRnCxM8z?21}vA)FHg3nlaF!4bn+D_GQs(1pZ z4m0&Q5mmy#QNdJKRSA!`unrEh;R(9%3M*JCoiMQs4xCC03ybb0C0%*v+_`fE~bEv~c)kIZPL~PVL(xYcPLbNSlIub(#Zwu;V2{$J2oiG>(unB=` ziC9AHgomSgZ7D3+4urtm zZ>r;WO)P3q2NHpA^Kel|!|~v6PBC92X+)}YFvmlZ!BmCl3ali=vvogGR+vF-1dc>2 zbRsqqh$h|`D$PDnw@#-gdAa#iuN6#b9vTAIn@J&#!N^CFnv*D5OTc zxc=a@RZ5DBVPIfeZe2q;8LUOP(ZOj@p@7W|Q^0Fs{(*Dw&CiR!p1Uw_+qP}zp^}YI z+Ub*hG)RnTSH?yZKk5v6xarD2MPvdUQP#jHb?XW{A}z62KO#irOtdy0-~wCVVFIJ1 zF)~c{vFVZN6~hR}1n($dL|Rc2kpR6wP7G3CQVx$oq+&Y?7zhA4=7WR~cMn(M=8jVw zkPK@FZUnHsx7Lfk=EY4*Nl7VzZ+XI6$n3(NS?_ch81uMg#v4nVwuJbK38DkXqcu#! z4i1j6si~mvU7!nEPMyP^p#WzSWqEngjg*v?M~)od08xUE_Km|C@=u)plo;bcqAKxy z3OJv4kyuGQ$+hz*h>J}=k;@uE1QipxqdUpFf1YSX9z@~;@6L?w(q{0%)+aXVnZ4*B zmWxEN_2dA>b^=NOtW&nIg@!1iH?~m5)-(n@$}_(~9t_3l#u~TUT=MjCJf)qDOX{l)5DxCrhwyI4ipgu zOc_$xB6E^73XY!mg`}jWk|MZ=c)o22>DI9c84x~(cs33&0~o?d&$%xY61#@pXv4;nQatC{ugMEmqv;d|f zYa+Mv2FKBPz6B42fEh?tbB2#k6WQQ!kjb5^hcm&#ygV*^0p-FIT* zSvmzFP-9S6r&3^F7w%wzjMkZv3Qnbo5rJ@STgC z?w-#5@(U?0DTf`Dg82FQk`{r@`0nW$qW}|637U#y2&c#5;zIhA8Ev9bq8Gp>L`s}p zTq(iuMe_V>zhC=s_ntjl03UoK`Hw{j+Qg@Zh%xNlySLEI&9Pro-+;~@-kt$)&(O@) zRu&+Uh+L&oTPJvKgnMB@WrY&-35ctQ8+BF(izXp3Qt39Bbwxn{?-xZcCPRk}CpkGe z1imRxz&VlwYl%I8NE5h;Kv_ZLwQk)CwyJWF%_U0MHQCEyQvjsW1TqMoHNJ{~12+;F z9f(q1UOtKW=4;R?CnJWx`WP{2i%|*9vuhj#uw>Bn4l<@ z_~L|wgfwXXuMol+*6>t@oqzRJ%ndl>!6zYnXK-Yy@02MNRP5p^CEav$B1Hr(vm9>y~H1c7rfV|w% zjf@{V8m1%-+^@imC)|a@jSh<#(1E1b02$CHj173c25(%eK^E68D4=>3a6?!HUoWbg zaB89!!Hp*~52q_cnoU_4Dfae`Fl{NY+>o7T=<@fI@tNSJPsDe}DU+pdjzotwWmI+dBm)6!PXUqJyMTvA0Abb%ZUc z*v3W(qa1#fK}iFc5FwZlao2~_qr%aJRKupw7Vg$@>VaK3SfV8o8SDfx3x^1%Q<{Sd zjiwTIO6*kx0^7THU*d@OFjCVmKd=uZ5!;)6P;#&cbzww$I(yU2hpM8YEHx!{HAKmm z@N){B7V2U_Tm2g!PeM#X{XS+W{BTu`$Ej1N@}Oa|Sz|%x&Yi{Z%^Rn-ZQC{h@&fJU z@<6dv(!y3MZ4My2$Yi!KL=EsHA2u4GSqcwIDPaa7eeW)j$bd{6;}ZqE8%Llqd3yQM zJU-G7X&C}*myqP<=0ODgv5RypP?n%OP$K~nA>uLGY96Ge9Y1sCmqoF$vDZQUV}8<3 z|HTi^tbehG`c>EMSJG5@SnweE z_v`N;I&^5?y?gg?v3%;JppA6_!m?+bYT1OpYHr=SwTrj6n|DA!P!Rm?rWw3aXbz8D z{9#&b1RD@Jk_JPbE*nS?o37wl9T15TX8yY=bPnIe;3J{Jf&#j&#!ZOSR;Iag`}XFa z4jx>3{`~m@5PK$s@Zi@1fiL_IpUv$Rz;zb7YONl(v+{%YgKlORz4yM(6_U}hP%sWI&J-b0ovk+1px~J z76dE^SP-xvU_rowfCYj70s{F(HV5JRC=c-e2>379W3j=4fCT{y0u}@;2v`uXAYehj zf`A193j!7dEC^T-upnSTz=D7U0Sf{a1S|+x5O`7qe3B}L1Q-1nf%0K}2ld(i!uX~C E2kJcBtN;K2 literal 0 HcmV?d00001 diff --git a/Installer/installer b/Installer/installer index bd50fac2..5ac97824 100755 --- a/Installer/installer +++ b/Installer/installer @@ -853,7 +853,8 @@ rm zulu-repo_1.0.0-2_all.deb wget -qO - 'https://openhab.jfrog.io/artifactory/api/gpg/key/public' | sudo apt-key add - sudo apt-get install -y apt-transport-https echo 'deb https://openhab.jfrog.io/artifactory/openhab-linuxpkg stable main' | sudo tee /etc/apt/sources.list.d/openhab.list -sudo apt-get update && sudo apt-get install -y openhab +sudo apt-get update +sudo apt-get install -y openhab ########## Verify ########## ls /usr/bin/openhab-cli """,True,None)) diff --git a/Logs/event.log b/Logs/event.log index 5654e7a3..c15ff388 100644 --- a/Logs/event.log +++ b/Logs/event.log @@ -1,65 +1,65 @@ -09/10/2022 11:05:30 PM - dashboard: Port Initialized to tcp://127.0.0.1:5051 -09/10/2022 11:05:30 PM - dashboard: Initialized Schema: /home/user/FISSURE/YAML/dashboard.yaml -09/10/2022 11:05:30 PM - dashboard: Port Initialized to tcp://127.0.0.1:5057 -09/10/2022 11:05:30 PM - dashboard: Initialized Schema: /home/user/FISSURE/YAML/dashboard.yaml -09/10/2022 11:05:30 PM - dashboard: Port Connected to tcp://127.0.0.1:5055 -09/10/2022 11:05:30 PM - dashboard: Initialized Schema: /home/user/FISSURE/YAML/dashboard.yaml -09/10/2022 11:05:30 PM - dashboard: Port Connected to tcp://127.0.0.1:5059 -09/10/2022 11:05:30 PM - dashboard: Port Connected to tcp://127.0.0.1:5060 -09/10/2022 11:05:30 PM - dashboard: Port Connected to tcp://127.0.0.1:5065 -09/10/2022 11:05:30 PM - dashboard: Port Connected to tcp://127.0.0.1:5061 -09/10/2022 11:05:30 PM - dashboard: Port Connected to tcp://127.0.0.1:5063 -09/10/2022 11:05:31 PM - hiprfisr: End of HIPRFISR Initialization -09/10/2022 11:05:31 PM - hiprfisr: Port Connected to tcp://127.0.0.1:5051 -09/10/2022 11:05:31 PM - hiprfisr: Initialized Schema: /home/user/FISSURE/YAML/hiprfisr.yaml -09/10/2022 11:05:31 PM - hiprfisr: Port Initialized to tcp://127.0.0.1:5052 -09/10/2022 11:05:31 PM - hiprfisr: Initialized Schema: /home/user/FISSURE/YAML/tsi.yaml -09/10/2022 11:05:31 PM - hiprfisr: Port Initialized to tcp://127.0.0.1:5053 -09/10/2022 11:05:31 PM - hiprfisr: Initialized Schema: /home/user/FISSURE/YAML/fge.yaml -09/10/2022 11:05:31 PM - hiprfisr: Port Initialized to tcp://127.0.0.1:5054 -09/10/2022 11:05:31 PM - hiprfisr: Initialized Schema: /home/user/FISSURE/YAML/hiprfisr.yaml -09/10/2022 11:05:31 PM - hiprfisr: Port Initialized to tcp://127.0.0.1:5055 -09/10/2022 11:05:31 PM - hiprfisr: Initialized Schema: /home/user/FISSURE/YAML/hiprfisr.yaml -09/10/2022 11:05:31 PM - hiprfisr: Port Connected to tcp://127.0.0.1:5057 -09/10/2022 11:05:31 PM - hiprfisr: Initialized Schema: /home/user/FISSURE/YAML/hiprfisr.yaml -09/10/2022 11:05:31 PM - hiprfisr: Port Connected to tcp://127.0.0.1:5059 -09/10/2022 11:05:31 PM - hiprfisr: Port Connected to tcp://127.0.0.1:5060 -09/10/2022 11:05:31 PM - hiprfisr: Port Connected to tcp://127.0.0.1:5065 -09/10/2022 11:05:31 PM - hiprfisr: Port Connected to tcp://127.0.0.1:5061 -09/10/2022 11:05:31 PM - hiprfisr: Port Connected to tcp://127.0.0.1:5063 -09/10/2022 11:05:31 PM - hiprfisr: Start of Main Event Loop -09/10/2022 11:05:32 PM - fge: Port Connected to tcp://127.0.0.1:5053 -09/10/2022 11:05:32 PM - tsi: Port Connected to tcp://localhost:5052 -09/10/2022 11:05:32 PM - fge: Initialized Schema: /home/user/FISSURE/YAML/fge.yaml -09/10/2022 11:05:32 PM - tsi: Initialized Schema: /home/user/FISSURE/YAML/tsi.yaml -09/10/2022 11:05:32 PM - fge: Port Initialized to tcp://127.0.0.1:5061 -09/10/2022 11:05:32 PM - tsi: Port Initialized to tcp://*:5059 -09/10/2022 11:05:32 PM - tsi: Initialized Schema: /home/user/FISSURE/YAML/tsi.yaml -09/10/2022 11:05:32 PM - fge: Initialized Schema: /home/user/FISSURE/YAML/fge.yaml -09/10/2022 11:05:32 PM - tsi: Port Connected to tcp://127.0.0.1:5055 -09/10/2022 11:05:32 PM - fge: Port Connected to tcp://127.0.0.1:5055 -09/10/2022 11:05:32 PM - tsi: Initialized Schema: /home/user/FISSURE/YAML/tsi.yaml -09/10/2022 11:05:32 PM - tsi: Port Connected to tcp://127.0.0.1:5057 -09/10/2022 11:05:32 PM - fge: Initialized Schema: /home/user/FISSURE/YAML/fge.yaml -09/10/2022 11:05:32 PM - fge: Port Connected to tcp://127.0.0.1:5057 -09/10/2022 11:05:32 PM - pd: Port Connected to tcp://127.0.0.1:5054 -09/10/2022 11:05:32 PM - pd: Initialized Schema: /home/user/FISSURE/YAML/pd.yaml -09/10/2022 11:05:32 PM - pd: Port Initialized to tcp://127.0.0.1:5063 -09/10/2022 11:05:32 PM - pd: Initialized Schema: /home/user/FISSURE/YAML/pd.yaml -09/10/2022 11:05:32 PM - pd: Port Connected to tcp://127.0.0.1:5055 -09/10/2022 11:05:32 PM - pd: Initialized Schema: /home/user/FISSURE/YAML/pd.yaml -09/10/2022 11:05:32 PM - pd: Port Connected to tcp://127.0.0.1:5057 -09/10/2022 11:05:32 PM - hiprfisr: Sending message: HIPRFISR: Connected TSI -09/10/2022 11:05:32 PM - hiprfisr: Sending message: HIPRFISR: Connected FGE -09/10/2022 11:05:32 PM - hiprfisr: Sending message: HIPRFISR: Connected PD -09/10/2022 11:05:33 PM - dashboard: Received message: HIPRFISR: Connected TSI -09/10/2022 11:05:33 PM - dashboard: Received message: HIPRFISR: Connected FGE -09/10/2022 11:05:33 PM - dashboard: Received message: HIPRFISR: Connected PD -09/10/2022 11:11:36 PM - dashboard: Sending message: Dashboard: Set Process SOIs [False, None, None, None] -09/10/2022 11:11:36 PM - dashboard: Sending message: Dashboard: SOI Selection Mode 0 -09/10/2022 11:11:36 PM - hiprfisr: Received message: Dashboard: Set Process SOIs [False, None, None, None] -09/10/2022 11:11:36 PM - hiprfisr: Executing Callback: setProcessSOIs with parameters [False, None, None, None] -09/10/2022 11:11:36 PM - hiprfisr: Received message: Dashboard: SOI Selection Mode 0 -09/10/2022 11:11:36 PM - hiprfisr: Executing Callback: setSOI_SelectionMode with parameters 0 -09/10/2022 11:11:39 PM - dashboard: Sending message: Dashboard: Stop TSI Detector $Parameters -09/10/2022 11:11:39 PM - dashboard: Sending message: Dashboard: Stop PD $Parameters +09/18/2022 10:04:25 PM - dashboard: Port Initialized to tcp://127.0.0.1:5051 +09/18/2022 10:04:25 PM - dashboard: Initialized Schema: /home/user/FISSURE/YAML/dashboard.yaml +09/18/2022 10:04:25 PM - dashboard: Port Initialized to tcp://127.0.0.1:5057 +09/18/2022 10:04:25 PM - dashboard: Initialized Schema: /home/user/FISSURE/YAML/dashboard.yaml +09/18/2022 10:04:25 PM - dashboard: Port Connected to tcp://127.0.0.1:5055 +09/18/2022 10:04:25 PM - dashboard: Initialized Schema: /home/user/FISSURE/YAML/dashboard.yaml +09/18/2022 10:04:25 PM - dashboard: Port Connected to tcp://127.0.0.1:5059 +09/18/2022 10:04:25 PM - dashboard: Port Connected to tcp://127.0.0.1:5060 +09/18/2022 10:04:25 PM - dashboard: Port Connected to tcp://127.0.0.1:5065 +09/18/2022 10:04:25 PM - dashboard: Port Connected to tcp://127.0.0.1:5061 +09/18/2022 10:04:25 PM - dashboard: Port Connected to tcp://127.0.0.1:5063 +09/18/2022 10:04:26 PM - hiprfisr: End of HIPRFISR Initialization +09/18/2022 10:04:26 PM - hiprfisr: Port Connected to tcp://127.0.0.1:5051 +09/18/2022 10:04:26 PM - hiprfisr: Initialized Schema: /home/user/FISSURE/YAML/hiprfisr.yaml +09/18/2022 10:04:26 PM - hiprfisr: Port Initialized to tcp://127.0.0.1:5052 +09/18/2022 10:04:26 PM - hiprfisr: Initialized Schema: /home/user/FISSURE/YAML/tsi.yaml +09/18/2022 10:04:26 PM - hiprfisr: Port Initialized to tcp://127.0.0.1:5053 +09/18/2022 10:04:26 PM - hiprfisr: Initialized Schema: /home/user/FISSURE/YAML/fge.yaml +09/18/2022 10:04:26 PM - hiprfisr: Port Initialized to tcp://127.0.0.1:5054 +09/18/2022 10:04:26 PM - hiprfisr: Initialized Schema: /home/user/FISSURE/YAML/hiprfisr.yaml +09/18/2022 10:04:26 PM - hiprfisr: Port Initialized to tcp://127.0.0.1:5055 +09/18/2022 10:04:26 PM - hiprfisr: Initialized Schema: /home/user/FISSURE/YAML/hiprfisr.yaml +09/18/2022 10:04:26 PM - hiprfisr: Port Connected to tcp://127.0.0.1:5057 +09/18/2022 10:04:26 PM - hiprfisr: Initialized Schema: /home/user/FISSURE/YAML/hiprfisr.yaml +09/18/2022 10:04:26 PM - hiprfisr: Port Connected to tcp://127.0.0.1:5059 +09/18/2022 10:04:26 PM - hiprfisr: Port Connected to tcp://127.0.0.1:5060 +09/18/2022 10:04:26 PM - hiprfisr: Port Connected to tcp://127.0.0.1:5065 +09/18/2022 10:04:26 PM - hiprfisr: Port Connected to tcp://127.0.0.1:5061 +09/18/2022 10:04:26 PM - hiprfisr: Port Connected to tcp://127.0.0.1:5063 +09/18/2022 10:04:26 PM - hiprfisr: Start of Main Event Loop +09/18/2022 10:04:26 PM - tsi: Port Connected to tcp://localhost:5052 +09/18/2022 10:04:26 PM - tsi: Initialized Schema: /home/user/FISSURE/YAML/tsi.yaml +09/18/2022 10:04:26 PM - tsi: Port Initialized to tcp://*:5059 +09/18/2022 10:04:26 PM - fge: Port Connected to tcp://127.0.0.1:5053 +09/18/2022 10:04:26 PM - tsi: Initialized Schema: /home/user/FISSURE/YAML/tsi.yaml +09/18/2022 10:04:26 PM - tsi: Port Connected to tcp://127.0.0.1:5055 +09/18/2022 10:04:26 PM - fge: Initialized Schema: /home/user/FISSURE/YAML/fge.yaml +09/18/2022 10:04:26 PM - tsi: Initialized Schema: /home/user/FISSURE/YAML/tsi.yaml +09/18/2022 10:04:26 PM - tsi: Port Connected to tcp://127.0.0.1:5057 +09/18/2022 10:04:26 PM - fge: Port Initialized to tcp://127.0.0.1:5061 +09/18/2022 10:04:26 PM - fge: Initialized Schema: /home/user/FISSURE/YAML/fge.yaml +09/18/2022 10:04:26 PM - fge: Port Connected to tcp://127.0.0.1:5055 +09/18/2022 10:04:26 PM - fge: Initialized Schema: /home/user/FISSURE/YAML/fge.yaml +09/18/2022 10:04:26 PM - fge: Port Connected to tcp://127.0.0.1:5057 +09/18/2022 10:04:27 PM - pd: Port Connected to tcp://127.0.0.1:5054 +09/18/2022 10:04:27 PM - pd: Initialized Schema: /home/user/FISSURE/YAML/pd.yaml +09/18/2022 10:04:27 PM - pd: Port Initialized to tcp://127.0.0.1:5063 +09/18/2022 10:04:27 PM - pd: Initialized Schema: /home/user/FISSURE/YAML/pd.yaml +09/18/2022 10:04:27 PM - pd: Port Connected to tcp://127.0.0.1:5055 +09/18/2022 10:04:27 PM - pd: Initialized Schema: /home/user/FISSURE/YAML/pd.yaml +09/18/2022 10:04:27 PM - pd: Port Connected to tcp://127.0.0.1:5057 +09/18/2022 10:04:27 PM - hiprfisr: Sending message: HIPRFISR: Connected TSI +09/18/2022 10:04:27 PM - hiprfisr: Sending message: HIPRFISR: Connected FGE +09/18/2022 10:04:27 PM - hiprfisr: Sending message: HIPRFISR: Connected PD +09/18/2022 10:04:28 PM - dashboard: Received message: HIPRFISR: Connected TSI +09/18/2022 10:04:28 PM - dashboard: Received message: HIPRFISR: Connected FGE +09/18/2022 10:04:28 PM - dashboard: Received message: HIPRFISR: Connected PD +09/18/2022 10:04:59 PM - dashboard: Sending message: Dashboard: Set Process SOIs [False, None, None, None] +09/18/2022 10:04:59 PM - dashboard: Sending message: Dashboard: SOI Selection Mode 0 +09/18/2022 10:04:59 PM - hiprfisr: Received message: Dashboard: Set Process SOIs [False, None, None, None] +09/18/2022 10:04:59 PM - hiprfisr: Executing Callback: setProcessSOIs with parameters [False, None, None, None] +09/18/2022 10:04:59 PM - hiprfisr: Received message: Dashboard: SOI Selection Mode 0 +09/18/2022 10:04:59 PM - hiprfisr: Executing Callback: setSOI_SelectionMode with parameters 0 +09/18/2022 10:05:19 PM - dashboard: Sending message: Dashboard: Stop TSI Detector $Parameters +09/18/2022 10:05:19 PM - dashboard: Sending message: Dashboard: Stop PD $Parameters diff --git a/UI/dashboard.ui b/UI/dashboard.ui index 335b7d89..5c0afcc8 100644 --- a/UI/dashboard.ui +++ b/UI/dashboard.ui @@ -1631,6 +1631,16 @@ QTabBar::tab:!selected { wideband_plutosdr.py + + + wideband_usrp2.py + + + + + wideband_usrp_n2xx.py + + Simulator @@ -6169,6 +6179,16 @@ p, li { white-space: pre-wrap; } PlutoSDR + + + USRP2 + + + + + USRP N2xx + + @@ -13634,6 +13654,16 @@ p, li { white-space: pre-wrap; } PlutoSDR + + + USRP2 + + + + + USRP N2xx + + @@ -15837,6 +15867,8 @@ p, li { white-space: pre-wrap; } + + @@ -26249,6 +26281,16 @@ p, li { white-space: pre-wrap; } PlutoSDR + + + USRP2 + + + + + USRP N2xx + + diff --git a/UI/hardware_select.ui b/UI/hardware_select.ui index f6cf29d9..755e2886 100644 --- a/UI/hardware_select.ui +++ b/UI/hardware_select.ui @@ -9,7 +9,7 @@ 0 0 - 950 + 965 115 @@ -44,7 +44,7 @@ - 870 + 885 40 65 27 @@ -124,6 +124,16 @@ PlutoSDR + + + USRP2 + + + + + USRP N2xx + + @@ -131,7 +141,7 @@ - 805 + 815 40 65 27 @@ -255,7 +265,7 @@ p, li { white-space: pre-wrap; } 7 37 - 935 + 950 33 @@ -317,7 +327,7 @@ p, li { white-space: pre-wrap; } - 325 + 333 80 99 27 @@ -330,7 +340,7 @@ p, li { white-space: pre-wrap; } - 525 + 533 80 99 27 @@ -346,7 +356,7 @@ p, li { white-space: pre-wrap; } - 425 + 433 80 99 27 @@ -364,28 +374,113 @@ p, li { white-space: pre-wrap; } 705 40 - 95 + 105 27 - CBX + CBX-120 + + + + + SBX-120 + + + + + UBX-160 + + + + + WBX-120 + + + + + TwinRX + + + + + XCVR2450 + + + + + DBSRX2 + + + + + SBX-40 + + + + + UBX-40 + + + + + WBX-40 + + + + + CBX-40 + + + + + LFRX + + + + + LFTX + + + + + BasicRX + + + + + BasicTX + + + + + TVRX2 + + + + + RFX400 + + + + + RFX900 - SBX + RFX1200 - UBX + RFX1800 - WBX + RFX2400 @@ -414,7 +509,7 @@ p, li { white-space: pre-wrap; } - 780 + 795 80 155 27 diff --git a/YAML/fissure_config.yaml b/YAML/fissure_config.yaml index ed274fe7..1f1fd23f 100644 --- a/YAML/fissure_config.yaml +++ b/YAML/fissure_config.yaml @@ -18,31 +18,31 @@ fft_sample_rate: 1e6 fft_size: 4096 fge_hiprfisr_dealer_port: 5053 fge_pub_port: 5061 -hardware_archive: 802.11x Adapter -hardware_attack: 802.11x Adapter -hardware_daughterboard_archive: CBX -hardware_daughterboard_attack: CBX -hardware_daughterboard_iq: CBX -hardware_daughterboard_pd: CBX -hardware_daughterboard_tsi: CBX -hardware_interface_archive: wlx8416f90800f6 -hardware_interface_attack: wlx8416f90800f6 -hardware_interface_iq: wlx8416f90800f6 -hardware_interface_pd: wlx8416f90800f6 -hardware_interface_tsi: wlx8416f90800f6 +hardware_archive: '' +hardware_attack: '' +hardware_daughterboard_archive: '' +hardware_daughterboard_attack: '' +hardware_daughterboard_iq: '' +hardware_daughterboard_pd: '' +hardware_daughterboard_tsi: '' +hardware_interface_archive: '' +hardware_interface_attack: '' +hardware_interface_iq: '' +hardware_interface_pd: '' +hardware_interface_tsi: '' hardware_ip_archive: '' hardware_ip_attack: '' hardware_ip_iq: '' hardware_ip_pd: '' hardware_ip_tsi: '' -hardware_iq: 802.11x Adapter -hardware_pd: 802.11x Adapter +hardware_iq: '' +hardware_pd: '' hardware_serial_archive: '' hardware_serial_attack: '' hardware_serial_iq: '' hardware_serial_pd: '' hardware_serial_tsi: '' -hardware_tsi: 802.11x Adapter +hardware_tsi: '' heartbeat_interval: 5 hiprfisr_pub_port: 5055 morse_code_amplitude_threshold: 0.5 diff --git a/YAML/library.yaml b/YAML/library.yaml index 5d0df904..13118a9c 100644 --- a/YAML/library.yaml +++ b/YAML/library.yaml @@ -307,6 +307,18 @@ Inspection Flow Graphs: - time_sink_bladerf.py - time_sink_1_10_100_bladerf.py - waterfall_bladerf.py + USRP2: + - instantaneous_frequency_usrp2.py + - signal_envelope_usrp2.py + - time_sink_usrp2.py + - time_sink_1_10_100_usrp2.py + - waterfall_usrp2.py + USRP N2xx: + - instantaneous_frequency_usrp_n2xx.py + - signal_envelope_usrp_n2xx.py + - time_sink_usrp_n2xx.py + - time_sink_1_10_100_usrp_n2xx.py + - waterfall_usrp_n2xx.py Protocols: 802.11x: Attacks: diff --git a/dashboard.py b/dashboard.py index aa52f336..9d617cfe 100755 --- a/dashboard.py +++ b/dashboard.py @@ -6323,6 +6323,10 @@ def _slotIQ_RecordClicked(self, called_from_thread=False): fname = "iq_recorder" # Should never be called elif self.dashboard_settings_dictionary['hardware_iq'] == "PlutoSDR": fname = "iq_recorder_plutosdr" + elif self.dashboard_settings_dictionary['hardware_iq'] == "USRP2": + fname = "iq_recorder_usrp2" + elif self.dashboard_settings_dictionary['hardware_iq'] == "USRP N2xx": + fname = "iq_recorder_usrp_n2xx" # LimeSDR Channel if self.dashboard_settings_dictionary['hardware_iq'] == "LimeSDR": @@ -11599,14 +11603,16 @@ def findX310(self, widget_ip, widget_serial, widget_daughterboard, widget_probin output = str(proc.communicate()[0].decode()) widget_probing_label.setVisible(False) - if "CBX" in output: + if "CBX-120" in output: widget_daughterboard.setCurrentIndex(0) - elif "SBX" in output: + elif "SBX-120" in output: widget_daughterboard.setCurrentIndex(1) - elif "UBX" in output: + elif "UBX-160" in output: widget_daughterboard.setCurrentIndex(2) - elif "WBX" in output: + elif "WBX-120" in output: widget_daughterboard.setCurrentIndex(3) + elif "TwinRX" in output: + widget_daughterboard.setCurrentIndex(4) except: widget_probing_label.setVisible(False) @@ -11809,7 +11815,169 @@ def findPlutoSDR(self, widget_ip): widget_ip.setAlignment(QtCore.Qt.AlignCenter) except: widget_ip.setText("") - widget_ip.setAlignment(QtCore.Qt.AlignCenter) + widget_ip.setAlignment(QtCore.Qt.AlignCenter) + + def findUSRP2(self, widget_ip, widget_serial, widget_daughterboard, widget_probing_label): + """ Parses the results of 'uhd_find_devices' and sets the USRP2 IP and serial for two edit boxes. + """ + # Get the Text + proc = subprocess.Popen("uhd_find_devices &", shell=True, stdout=subprocess.PIPE, ) + output = proc.communicate()[0].decode() + + # Get the Variables and Values + device_index = -1 + device_dict = {} + record_values = False + for line in output.splitlines(): + if len(line.strip()) == 0: + record_values = False + if record_values == True: + get_var = line.split(':')[0].strip(' ') + get_val = line.split(':')[1].strip(' ') + device_dict[device_index].append((get_var,get_val)) + if "Device Address" in line: + device_index = device_index + 1 + device_dict.update({device_index:[]}) + record_values = True + + # Find USRP2 + for n in range(0,len(device_dict)): + for nn in device_dict[n]: + if 'usrp2' in nn: + # Update Dashboard + for m in device_dict[n]: + if m[0] == 'addr': + widget_ip.setText(m[1]) + widget_ip.setAlignment(QtCore.Qt.AlignCenter) + if m[0] == 'serial': + widget_serial.setText(m[1]) + widget_serial.setAlignment(QtCore.Qt.AlignCenter) + + # Find Daughterboard + try: + # Probe + get_ip = str(widget_ip.toPlainText()) + widget_probing_label.setVisible(True) + QtWidgets.QApplication.processEvents() + proc = subprocess.Popen('uhd_usrp_probe --args="addr=' + get_ip + '" &', shell=True, stdout=subprocess.PIPE, ) + output = str(proc.communicate()[0].decode()) + widget_probing_label.setVisible(False) + + if "XCVR2450" in output: + widget_daughterboard.setCurrentIndex(5) + elif "DBSRX" in output: + widget_daughterboard.setCurrentIndex(6) + elif "SBX-40" in output: + widget_daughterboard.setCurrentIndex(7) + elif "UBX-40" in output: + widget_daughterboard.setCurrentIndex(8) + elif "WBX-40" in output: + widget_daughterboard.setCurrentIndex(9) + elif "CBX-40" in output: + widget_daughterboard.setCurrentIndex(10) + elif "LFRX" in output: + widget_daughterboard.setCurrentIndex(11) + elif "LFTX" in output: + widget_daughterboard.setCurrentIndex(12) + elif "BasicRX" in output: + widget_daughterboard.setCurrentIndex(13) + elif "BasicTX" in output: + widget_daughterboard.setCurrentIndex(14) + elif "TVRX2" in output: + widget_daughterboard.setCurrentIndex(15) + elif "RFX400" in output: + widget_daughterboard.setCurrentIndex(16) + elif "RFX900" in output: + widget_daughterboard.setCurrentIndex(17) + elif "RFX1200" in output: + widget_daughterboard.setCurrentIndex(18) + elif "RFX1800" in output: + widget_daughterboard.setCurrentIndex(19) + elif "RFX2400" in output: + widget_daughterboard.setCurrentIndex(20) + except: + widget_probing_label.setVisible(False) + + def findUSRP_N2xx(self, widget_ip, widget_serial, widget_daughterboard, widget_probing_label): + """ Parses the results of 'uhd_find_devices' and sets the USRP N2xx IP and serial for two edit boxes. + """ + # Get the Text + proc = subprocess.Popen("uhd_find_devices &", shell=True, stdout=subprocess.PIPE, ) + output = proc.communicate()[0].decode() + + # Get the Variables and Values + device_index = -1 + device_dict = {} + record_values = False + for line in output.splitlines(): + if len(line.strip()) == 0: + record_values = False + if record_values == True: + get_var = line.split(':')[0].strip(' ') + get_val = line.split(':')[1].strip(' ') + device_dict[device_index].append((get_var,get_val)) + if "Device Address" in line: + device_index = device_index + 1 + device_dict.update({device_index:[]}) + record_values = True + + # Find USRP N2xx + for n in range(0,len(device_dict)): + for nn in device_dict[n]: + if 'usrp2' in nn: + # Update Dashboard + for m in device_dict[n]: + if m[0] == 'addr': + widget_ip.setText(m[1]) + widget_ip.setAlignment(QtCore.Qt.AlignCenter) + if m[0] == 'serial': + widget_serial.setText(m[1]) + widget_serial.setAlignment(QtCore.Qt.AlignCenter) + + # Find Daughterboard + try: + # Probe + get_ip = str(widget_ip.toPlainText()) + widget_probing_label.setVisible(True) + QtWidgets.QApplication.processEvents() + proc = subprocess.Popen('uhd_usrp_probe --args="addr=' + get_ip + '" &', shell=True, stdout=subprocess.PIPE, ) + output = str(proc.communicate()[0].decode()) + widget_probing_label.setVisible(False) + + if "XCVR2450" in output: + widget_daughterboard.setCurrentIndex(5) + elif "DBSRX" in output: + widget_daughterboard.setCurrentIndex(6) + elif "SBX-40" in output: + widget_daughterboard.setCurrentIndex(7) + elif "UBX-40" in output: + widget_daughterboard.setCurrentIndex(8) + elif "WBX-40" in output: + widget_daughterboard.setCurrentIndex(9) + elif "CBX-40" in output: + widget_daughterboard.setCurrentIndex(10) + elif "LFRX" in output: + widget_daughterboard.setCurrentIndex(11) + elif "LFTX" in output: + widget_daughterboard.setCurrentIndex(12) + elif "BasicRX" in output: + widget_daughterboard.setCurrentIndex(13) + elif "BasicTX" in output: + widget_daughterboard.setCurrentIndex(14) + elif "TVRX2" in output: + widget_daughterboard.setCurrentIndex(15) + elif "RFX400" in output: + widget_daughterboard.setCurrentIndex(16) + elif "RFX900" in output: + widget_daughterboard.setCurrentIndex(17) + elif "RFX1200" in output: + widget_daughterboard.setCurrentIndex(18) + elif "RFX1800" in output: + widget_daughterboard.setCurrentIndex(19) + elif "RFX2400" in output: + widget_daughterboard.setCurrentIndex(20) + except: + widget_probing_label.setVisible(False) def _slotLibraryBrowseRemoveDemodFG_Clicked(self): """ Removes selected demodulation flow graph from the library. @@ -12099,6 +12267,10 @@ def _slotIQ_InspectionHardwareChanged(self): self.stackedWidget_iq_inspection.setCurrentIndex(9) elif get_hardware == "PlutoSDR": self.stackedWidget_iq_inspection.setCurrentIndex(10) + elif get_hardware == "USRP2": + self.stackedWidget_iq_inspection.setCurrentIndex(11) + elif get_hardware == "USRP N2xx": + self.stackedWidget_iq_inspection.setCurrentIndex(12) # Enable Frame self.frame_iq_inspection_fg.setEnabled(True) @@ -12336,18 +12508,21 @@ def configureTSI_Hardware(self): self.label_top_tsi_picture.setPixmap(QtGui.QPixmap(os.path.dirname(os.path.realpath(__file__)) + "/Icons/USRP_X310.png")) # Tuning Widget Limits - if self.dashboard_settings_dictionary['hardware_daughterboard_tsi'] == "CBX": + if self.dashboard_settings_dictionary['hardware_daughterboard_tsi'] == "CBX-120": self.tuning_matplotlib_widget.freq_start_limit = 1200 self.tuning_matplotlib_widget.freq_end_limit = 6000 - elif self.dashboard_settings_dictionary['hardware_daughterboard_tsi'] == "SBX": + elif self.dashboard_settings_dictionary['hardware_daughterboard_tsi'] == "SBX-120": self.tuning_matplotlib_widget.freq_start_limit = 400 self.tuning_matplotlib_widget.freq_end_limit = 4400 - elif self.dashboard_settings_dictionary['hardware_daughterboard_tsi'] == "UBX": + elif self.dashboard_settings_dictionary['hardware_daughterboard_tsi'] == "UBX-160": self.tuning_matplotlib_widget.freq_start_limit = 10 self.tuning_matplotlib_widget.freq_end_limit = 6000 - elif self.dashboard_settings_dictionary['hardware_daughterboard_tsi'] == "WBX": + elif self.dashboard_settings_dictionary['hardware_daughterboard_tsi'] == "WBX-120": self.tuning_matplotlib_widget.freq_start_limit = 25 self.tuning_matplotlib_widget.freq_end_limit = 2200 + elif self.dashboard_settings_dictionary['hardware_daughterboard_tsi'] == "TwinRX": + self.tuning_matplotlib_widget.freq_start_limit = 10 + self.tuning_matplotlib_widget.freq_end_limit = 6000 elif self.dashboard_settings_dictionary['hardware_tsi'] == "USRP B210": self.comboBox_tsi_detector.setCurrentIndex(1) @@ -12419,7 +12594,115 @@ def configureTSI_Hardware(self): # Tuning Widget Limits self.tuning_matplotlib_widget.freq_start_limit = 325 - self.tuning_matplotlib_widget.freq_end_limit = 3800 + self.tuning_matplotlib_widget.freq_end_limit = 3800 + + elif self.dashboard_settings_dictionary['hardware_tsi'] == "USRP2": + self.comboBox_tsi_detector.setCurrentIndex(8) + self.label_top_tsi_picture.setPixmap(QtGui.QPixmap(os.path.dirname(os.path.realpath(__file__)) + "/Icons/USRP2.png")) + + # Tuning Widget Limits + if self.dashboard_settings_dictionary['hardware_daughterboard_tsi'] == "XCVR2450": + self.tuning_matplotlib_widget.freq_start_limit = 2400 + self.tuning_matplotlib_widget.freq_end_limit = 6000 + elif self.dashboard_settings_dictionary['hardware_daughterboard_tsi'] == "DBSRX": + self.tuning_matplotlib_widget.freq_start_limit = 800 + self.tuning_matplotlib_widget.freq_end_limit = 2300 + elif self.dashboard_settings_dictionary['hardware_daughterboard_tsi'] == "SBX-40": + self.tuning_matplotlib_widget.freq_start_limit = 400 + self.tuning_matplotlib_widget.freq_end_limit = 4400 + elif self.dashboard_settings_dictionary['hardware_daughterboard_tsi'] == "UBX-40": + self.tuning_matplotlib_widget.freq_start_limit = 10 + self.tuning_matplotlib_widget.freq_end_limit = 6000 + elif self.dashboard_settings_dictionary['hardware_daughterboard_tsi'] == "WBX-40": + self.tuning_matplotlib_widget.freq_start_limit = 50 + self.tuning_matplotlib_widget.freq_end_limit = 2200 + elif self.dashboard_settings_dictionary['hardware_daughterboard_tsi'] == "CBX-40": + self.tuning_matplotlib_widget.freq_start_limit = 1200 + self.tuning_matplotlib_widget.freq_end_limit = 6000 + elif self.dashboard_settings_dictionary['hardware_daughterboard_tsi'] == "LFRX": + self.tuning_matplotlib_widget.freq_start_limit = 0 + self.tuning_matplotlib_widget.freq_end_limit = 30 + elif self.dashboard_settings_dictionary['hardware_daughterboard_tsi'] == "LFTX": + self.tuning_matplotlib_widget.freq_start_limit = 0 + self.tuning_matplotlib_widget.freq_end_limit = 30 + elif self.dashboard_settings_dictionary['hardware_daughterboard_tsi'] == "BasicRX": + self.tuning_matplotlib_widget.freq_start_limit = 1 + self.tuning_matplotlib_widget.freq_end_limit = 250 + elif self.dashboard_settings_dictionary['hardware_daughterboard_tsi'] == "BasicTX": + self.tuning_matplotlib_widget.freq_start_limit = 1 + self.tuning_matplotlib_widget.freq_end_limit = 250 + elif self.dashboard_settings_dictionary['hardware_daughterboard_tsi'] == "TVRX2": + self.tuning_matplotlib_widget.freq_start_limit = 50 + self.tuning_matplotlib_widget.freq_end_limit = 860 + elif self.dashboard_settings_dictionary['hardware_daughterboard_tsi'] == "RFX400": + self.tuning_matplotlib_widget.freq_start_limit = 400 + self.tuning_matplotlib_widget.freq_end_limit = 500 + elif self.dashboard_settings_dictionary['hardware_daughterboard_tsi'] == "RFX900": + self.tuning_matplotlib_widget.freq_start_limit = 750 + self.tuning_matplotlib_widget.freq_end_limit = 1050 + elif self.dashboard_settings_dictionary['hardware_daughterboard_tsi'] == "RFX1200": + self.tuning_matplotlib_widget.freq_start_limit = 1150 + self.tuning_matplotlib_widget.freq_end_limit = 1450 + elif self.dashboard_settings_dictionary['hardware_daughterboard_tsi'] == "RFX1800": + self.tuning_matplotlib_widget.freq_start_limit = 1500 + self.tuning_matplotlib_widget.freq_end_limit = 2100 + elif self.dashboard_settings_dictionary['hardware_daughterboard_tsi'] == "RFX2400": + self.tuning_matplotlib_widget.freq_start_limit = 2300 + self.tuning_matplotlib_widget.freq_end_limit = 2900 + + elif self.dashboard_settings_dictionary['hardware_tsi'] == "USRP N2xx": + self.comboBox_tsi_detector.setCurrentIndex(9) + self.label_top_tsi_picture.setPixmap(QtGui.QPixmap(os.path.dirname(os.path.realpath(__file__)) + "/Icons/USRP_N2xx.png")) + + # Tuning Widget Limits + if self.dashboard_settings_dictionary['hardware_daughterboard_tsi'] == "XCVR2450": + self.tuning_matplotlib_widget.freq_start_limit = 2400 + self.tuning_matplotlib_widget.freq_end_limit = 6000 + elif self.dashboard_settings_dictionary['hardware_daughterboard_tsi'] == "DBSRX": + self.tuning_matplotlib_widget.freq_start_limit = 800 + self.tuning_matplotlib_widget.freq_end_limit = 2300 + elif self.dashboard_settings_dictionary['hardware_daughterboard_tsi'] == "SBX-40": + self.tuning_matplotlib_widget.freq_start_limit = 400 + self.tuning_matplotlib_widget.freq_end_limit = 4400 + elif self.dashboard_settings_dictionary['hardware_daughterboard_tsi'] == "UBX-40": + self.tuning_matplotlib_widget.freq_start_limit = 10 + self.tuning_matplotlib_widget.freq_end_limit = 6000 + elif self.dashboard_settings_dictionary['hardware_daughterboard_tsi'] == "WBX-40": + self.tuning_matplotlib_widget.freq_start_limit = 50 + self.tuning_matplotlib_widget.freq_end_limit = 2200 + elif self.dashboard_settings_dictionary['hardware_daughterboard_tsi'] == "CBX-40": + self.tuning_matplotlib_widget.freq_start_limit = 1200 + self.tuning_matplotlib_widget.freq_end_limit = 6000 + elif self.dashboard_settings_dictionary['hardware_daughterboard_tsi'] == "LFRX": + self.tuning_matplotlib_widget.freq_start_limit = 0 + self.tuning_matplotlib_widget.freq_end_limit = 30 + elif self.dashboard_settings_dictionary['hardware_daughterboard_tsi'] == "LFTX": + self.tuning_matplotlib_widget.freq_start_limit = 0 + self.tuning_matplotlib_widget.freq_end_limit = 30 + elif self.dashboard_settings_dictionary['hardware_daughterboard_tsi'] == "BasicRX": + self.tuning_matplotlib_widget.freq_start_limit = 1 + self.tuning_matplotlib_widget.freq_end_limit = 250 + elif self.dashboard_settings_dictionary['hardware_daughterboard_tsi'] == "BasicTX": + self.tuning_matplotlib_widget.freq_start_limit = 1 + self.tuning_matplotlib_widget.freq_end_limit = 250 + elif self.dashboard_settings_dictionary['hardware_daughterboard_tsi'] == "TVRX2": + self.tuning_matplotlib_widget.freq_start_limit = 50 + self.tuning_matplotlib_widget.freq_end_limit = 860 + elif self.dashboard_settings_dictionary['hardware_daughterboard_tsi'] == "RFX400": + self.tuning_matplotlib_widget.freq_start_limit = 400 + self.tuning_matplotlib_widget.freq_end_limit = 500 + elif self.dashboard_settings_dictionary['hardware_daughterboard_tsi'] == "RFX900": + self.tuning_matplotlib_widget.freq_start_limit = 750 + self.tuning_matplotlib_widget.freq_end_limit = 1050 + elif self.dashboard_settings_dictionary['hardware_daughterboard_tsi'] == "RFX1200": + self.tuning_matplotlib_widget.freq_start_limit = 1150 + self.tuning_matplotlib_widget.freq_end_limit = 1450 + elif self.dashboard_settings_dictionary['hardware_daughterboard_tsi'] == "RFX1800": + self.tuning_matplotlib_widget.freq_start_limit = 1500 + self.tuning_matplotlib_widget.freq_end_limit = 2100 + elif self.dashboard_settings_dictionary['hardware_daughterboard_tsi'] == "RFX2400": + self.tuning_matplotlib_widget.freq_start_limit = 2300 + self.tuning_matplotlib_widget.freq_end_limit = 2900 # Hardware Button Tooltip if len(self.dashboard_settings_dictionary['hardware_tsi']) > 0: @@ -12464,6 +12747,12 @@ def configurePD_Hardware(self): elif self.dashboard_settings_dictionary['hardware_pd'] == "PlutoSDR": self.label_top_pd_picture.setPixmap(QtGui.QPixmap(os.path.dirname(os.path.realpath(__file__)) + "/Icons/PlutoSDR.png")) self.comboBox_pd_demod_hardware.setCurrentIndex(9) + elif self.dashboard_settings_dictionary['hardware_pd'] == "USRP2": + self.label_top_pd_picture.setPixmap(QtGui.QPixmap(os.path.dirname(os.path.realpath(__file__)) + "/Icons/USRP2.png")) + self.comboBox_pd_demod_hardware.setCurrentIndex(10) + elif self.dashboard_settings_dictionary['hardware_pd'] == "USRP N2xx": + self.label_top_pd_picture.setPixmap(QtGui.QPixmap(os.path.dirname(os.path.realpath(__file__)) + "/Icons/USRP_N2xx.png")) + self.comboBox_pd_demod_hardware.setCurrentIndex(11) # Hardware Button Tooltip if len(self.dashboard_settings_dictionary['hardware_pd']) > 0: @@ -12507,6 +12796,12 @@ def configureAttackHardware(self): elif self.dashboard_settings_dictionary['hardware_attack'] == "PlutoSDR": self.comboBox_attack_hardware.setCurrentIndex(10) self.label_top_attack_picture.setPixmap(QtGui.QPixmap(os.path.dirname(os.path.realpath(__file__)) + "/Icons/PlutoSDR.png")) + elif self.dashboard_settings_dictionary['hardware_attack'] == "USRP2": + self.comboBox_attack_hardware.setCurrentIndex(11) + self.label_top_attack_picture.setPixmap(QtGui.QPixmap(os.path.dirname(os.path.realpath(__file__)) + "/Icons/USRP2.png")) + elif self.dashboard_settings_dictionary['hardware_attack'] == "USRP N2xx": + self.comboBox_attack_hardware.setCurrentIndex(12) + self.label_top_attack_picture.setPixmap(QtGui.QPixmap(os.path.dirname(os.path.realpath(__file__)) + "/Icons/USRP_N2xx.png")) # Hardware Button Tooltip if len(self.dashboard_settings_dictionary['hardware_attack']) > 0: @@ -12817,7 +13112,117 @@ def configureIQ_Hardware(self): self.tableWidget_iq_playback.horizontalHeader().setStretchLastSection(True) self._slotIQ_InspectionHardwareChanged() - self.frame_iq_record.setEnabled(True) + self.frame_iq_record.setEnabled(True) + + elif self.dashboard_settings_dictionary['hardware_iq'] == "USRP2": + self.label_top_iq_picture.setPixmap(QtGui.QPixmap(os.path.dirname(os.path.realpath(__file__)) + "/Icons/USRP2.png")) + + # IQ Record + comboBox_channel = QtWidgets.QComboBox(self) + comboBox_channel.addItem("A:0") + comboBox_channel.addItem("B:0") + comboBox_channel.addItem("A:AB") + comboBox_channel.addItem("A:BA") + comboBox_channel.addItem("A:A") + comboBox_channel.addItem("A:B") + comboBox_channel.addItem("B:AB") + comboBox_channel.addItem("B:BA") + comboBox_channel.addItem("B:A") + comboBox_channel.addItem("B:B") + self.tableWidget_iq_record.setCellWidget(0,2,comboBox_channel) + comboBox_antenna = QtWidgets.QComboBox(self) + comboBox_antenna.addItem("J1") + comboBox_antenna.addItem("J2") + self.tableWidget_iq_record.setCellWidget(0,3,comboBox_antenna) + gain_item = QtWidgets.QTableWidgetItem("30") + gain_item.setTextAlignment(QtCore.Qt.AlignCenter) + self.tableWidget_iq_record.setItem(0,4,gain_item) + comboBox_antenna = self.tableWidget_iq_record.cellWidget(0,3) + self.tableWidget_iq_record.resizeColumnsToContents() + self.tableWidget_iq_record.horizontalHeader().setStretchLastSection(False) # Needs to toggle in PyQt5 + self.tableWidget_iq_record.horizontalHeader().setStretchLastSection(True) + + # IQ Playback + comboBox_playback_channel = QtWidgets.QComboBox(self) + comboBox_playback_channel.addItem("A:0") + comboBox_playback_channel.addItem("B:0") + comboBox_playback_channel.addItem("A:AB") + comboBox_playback_channel.addItem("A:BA") + comboBox_playback_channel.addItem("A:A") + comboBox_playback_channel.addItem("A:B") + comboBox_playback_channel.addItem("B:AB") + comboBox_playback_channel.addItem("B:BA") + comboBox_playback_channel.addItem("B:A") + comboBox_playback_channel.addItem("B:B") + self.tableWidget_iq_playback.setCellWidget(0,1,comboBox_playback_channel) + comboBox_playback_antenna = QtWidgets.QComboBox(self) + comboBox_playback_antenna.addItem("J1") + comboBox_playback_antenna.addItem("J2") + self.tableWidget_iq_playback.setCellWidget(0,2,comboBox_playback_antenna) + playback_gain_item = QtWidgets.QTableWidgetItem("30") + playback_gain_item.setTextAlignment(QtCore.Qt.AlignCenter) + self.tableWidget_iq_playback.setItem(0,3,playback_gain_item) + self.tableWidget_iq_playback.resizeColumnsToContents() + self.tableWidget_iq_playback.horizontalHeader().setStretchLastSection(False) + self.tableWidget_iq_playback.horizontalHeader().setStretchLastSection(True) + + self._slotIQ_InspectionHardwareChanged() + self.frame_iq_record.setEnabled(True) + + elif self.dashboard_settings_dictionary['hardware_iq'] == "USRP N2xx": + self.label_top_iq_picture.setPixmap(QtGui.QPixmap(os.path.dirname(os.path.realpath(__file__)) + "/Icons/USRP_N2xx.png")) + + # IQ Record + comboBox_channel = QtWidgets.QComboBox(self) + comboBox_channel.addItem("A:0") + comboBox_channel.addItem("B:0") + comboBox_channel.addItem("A:AB") + comboBox_channel.addItem("A:BA") + comboBox_channel.addItem("A:A") + comboBox_channel.addItem("A:B") + comboBox_channel.addItem("B:AB") + comboBox_channel.addItem("B:BA") + comboBox_channel.addItem("B:A") + comboBox_channel.addItem("B:B") + self.tableWidget_iq_record.setCellWidget(0,2,comboBox_channel) + comboBox_antenna = QtWidgets.QComboBox(self) + comboBox_antenna.addItem("J1") + comboBox_antenna.addItem("J2") + self.tableWidget_iq_record.setCellWidget(0,3,comboBox_antenna) + gain_item = QtWidgets.QTableWidgetItem("30") + gain_item.setTextAlignment(QtCore.Qt.AlignCenter) + self.tableWidget_iq_record.setItem(0,4,gain_item) + comboBox_antenna = self.tableWidget_iq_record.cellWidget(0,3) + self.tableWidget_iq_record.resizeColumnsToContents() + self.tableWidget_iq_record.horizontalHeader().setStretchLastSection(False) # Needs to toggle in PyQt5 + self.tableWidget_iq_record.horizontalHeader().setStretchLastSection(True) + + # IQ Playback + comboBox_playback_channel = QtWidgets.QComboBox(self) + comboBox_playback_channel.addItem("A:0") + comboBox_playback_channel.addItem("B:0") + comboBox_playback_channel.addItem("A:AB") + comboBox_playback_channel.addItem("A:BA") + comboBox_playback_channel.addItem("A:A") + comboBox_playback_channel.addItem("A:B") + comboBox_playback_channel.addItem("B:AB") + comboBox_playback_channel.addItem("B:BA") + comboBox_playback_channel.addItem("B:A") + comboBox_playback_channel.addItem("B:B") + self.tableWidget_iq_playback.setCellWidget(0,1,comboBox_playback_channel) + comboBox_playback_antenna = QtWidgets.QComboBox(self) + comboBox_playback_antenna.addItem("J1") + comboBox_playback_antenna.addItem("J2") + self.tableWidget_iq_playback.setCellWidget(0,2,comboBox_playback_antenna) + playback_gain_item = QtWidgets.QTableWidgetItem("30") + playback_gain_item.setTextAlignment(QtCore.Qt.AlignCenter) + self.tableWidget_iq_playback.setItem(0,3,playback_gain_item) + self.tableWidget_iq_playback.resizeColumnsToContents() + self.tableWidget_iq_playback.horizontalHeader().setStretchLastSection(False) + self.tableWidget_iq_playback.horizontalHeader().setStretchLastSection(True) + + self._slotIQ_InspectionHardwareChanged() + self.frame_iq_record.setEnabled(True) # Enable Playback and Recording self.pushButton_iq_playback.setEnabled(True) @@ -12859,6 +13264,10 @@ def configureArchiveHardware(self): self.label_top_archive_picture.setPixmap(QtGui.QPixmap(os.path.dirname(os.path.realpath(__file__)) + "/Icons/Open_Sniffer.png")) elif self.dashboard_settings_dictionary['hardware_archive'] == "PlutoSDR": self.label_top_archive_picture.setPixmap(QtGui.QPixmap(os.path.dirname(os.path.realpath(__file__)) + "/Icons/PlutoSDR.png")) + elif self.dashboard_settings_dictionary['hardware_archive'] == "USRP2": + self.label_top_archive_picture.setPixmap(QtGui.QPixmap(os.path.dirname(os.path.realpath(__file__)) + "/Icons/USRP2.png")) + elif self.dashboard_settings_dictionary['hardware_archive'] == "USRP N2xx": + self.label_top_archive_picture.setPixmap(QtGui.QPixmap(os.path.dirname(os.path.realpath(__file__)) + "/Icons/USRP_N2xx.png")) # Adjust Existing Channel ComboBoxes and Gain in Replay Tab for n in range(0, self.tableWidget_archive_replay.rowCount()): @@ -12910,7 +13319,35 @@ def configureArchiveHardware(self): get_combobox.addItem("") gain_item = QtWidgets.QTableWidgetItem("64") gain_item.setTextAlignment(QtCore.Qt.AlignCenter) - self.tableWidget_archive_replay.setItem(n,7,gain_item) + self.tableWidget_archive_replay.setItem(n,7,gain_item) + elif self.dashboard_settings_dictionary['hardware_archive'] == "USRP2": + get_combobox.addItem("A:0") + get_combobox.addItem("B:0") + get_combobox.addItem("A:AB") + get_combobox.addItem("A:BA") + get_combobox.addItem("A:A") + get_combobox.addItem("A:B") + get_combobox.addItem("B:AB") + get_combobox.addItem("B:BA") + get_combobox.addItem("B:A") + get_combobox.addItem("B:B") + gain_item = QtWidgets.QTableWidgetItem("30") + gain_item.setTextAlignment(QtCore.Qt.AlignCenter) + self.tableWidget_archive_replay.setItem(n,7,gain_item) + elif self.dashboard_settings_dictionary['hardware_archive'] == "USRP N2xx": + get_combobox.addItem("A:0") + get_combobox.addItem("B:0") + get_combobox.addItem("A:AB") + get_combobox.addItem("A:BA") + get_combobox.addItem("A:A") + get_combobox.addItem("A:B") + get_combobox.addItem("B:AB") + get_combobox.addItem("B:BA") + get_combobox.addItem("B:A") + get_combobox.addItem("B:B") + gain_item = QtWidgets.QTableWidgetItem("30") + gain_item.setTextAlignment(QtCore.Qt.AlignCenter) + self.tableWidget_archive_replay.setItem(n,7,gain_item) else: get_combobox.addItem("") @@ -15387,7 +15824,17 @@ def _slotIQ_PlaybackClicked(self): if get_repeat == "No": fname = "iq_playback_single_plutosdr" else: - fname = "iq_playback_plutosdr" + fname = "iq_playback_plutosdr" + elif self.dashboard_settings_dictionary['hardware_iq'] == "USRP2": + if get_repeat == "No": + fname = "iq_playback_single_usrp2" + else: + fname = "iq_playback_usrp2" + elif self.dashboard_settings_dictionary['hardware_iq'] == "USRP N2xx": + if get_repeat == "No": + fname = "iq_playback_single_usrp_n2xx" + else: + fname = "iq_playback_usrp_n2xx" # LimeSDR Channel if self.dashboard_settings_dictionary['hardware_iq'] == "LimeSDR": @@ -17425,7 +17872,29 @@ def _slotArchiveReplayAddClicked(self): elif self.dashboard_settings_dictionary['hardware_archive'] == "Open Sniffer": new_combobox1.addItem("") elif self.dashboard_settings_dictionary['hardware_archive'] == "PlutoSDR": - new_combobox1.addItem("") + new_combobox1.addItem("") + elif self.dashboard_settings_dictionary['hardware_archive'] == "USRP2": + new_combobox1.addItem("A:0") + new_combobox1.addItem("B:0") + new_combobox1.addItem("A:AB") + new_combobox1.addItem("A:BA") + new_combobox1.addItem("A:A") + new_combobox1.addItem("A:B") + new_combobox1.addItem("B:AB") + new_combobox1.addItem("B:BA") + new_combobox1.addItem("B:A") + new_combobox1.addItem("B:B") + elif self.dashboard_settings_dictionary['hardware_archive'] == "USRP N2xx": + new_combobox1.addItem("A:0") + new_combobox1.addItem("B:0") + new_combobox1.addItem("A:AB") + new_combobox1.addItem("A:BA") + new_combobox1.addItem("A:A") + new_combobox1.addItem("A:B") + new_combobox1.addItem("B:AB") + new_combobox1.addItem("B:BA") + new_combobox1.addItem("B:A") + new_combobox1.addItem("B:B") else: new_combobox1.addItem("") new_combobox1.setFixedSize(67,24) @@ -17454,7 +17923,11 @@ def _slotArchiveReplayAddClicked(self): elif self.dashboard_settings_dictionary['hardware_archive'] == "Open Sniffer": gain_item = QtWidgets.QTableWidgetItem("") elif self.dashboard_settings_dictionary['hardware_archive'] == "PlutoSDR": - gain_item = QtWidgets.QTableWidgetItem("64") + gain_item = QtWidgets.QTableWidgetItem("64") + elif self.dashboard_settings_dictionary['hardware_archive'] == "USRP2": + gain_item = QtWidgets.QTableWidgetItem("30") + elif self.dashboard_settings_dictionary['hardware_archive'] == "USRP N2xx": + gain_item = QtWidgets.QTableWidgetItem("30") else: gain_item = QtWidgets.QTableWidgetItem("") gain_item.setTextAlignment(QtCore.Qt.AlignCenter) @@ -17536,7 +18009,29 @@ def _slotArchiveReplayAddClicked(self): elif self.dashboard_settings_dictionary['hardware_archive'] == "Open Sniffer": new_combobox1.addItem("") elif self.dashboard_settings_dictionary['hardware_archive'] == "PlutoSDR": - new_combobox1.addItem("") + new_combobox1.addItem("") + elif self.dashboard_settings_dictionary['hardware_archive'] == "USRP2": + new_combobox1.addItem("A:0") + new_combobox1.addItem("B:0") + new_combobox1.addItem("A:AB") + new_combobox1.addItem("A:BA") + new_combobox1.addItem("A:A") + new_combobox1.addItem("A:B") + new_combobox1.addItem("B:AB") + new_combobox1.addItem("B:BA") + new_combobox1.addItem("B:A") + new_combobox1.addItem("B:B") + elif self.dashboard_settings_dictionary['hardware_archive'] == "USRP N2xx": + new_combobox1.addItem("A:0") + new_combobox1.addItem("B:0") + new_combobox1.addItem("A:AB") + new_combobox1.addItem("A:BA") + new_combobox1.addItem("A:A") + new_combobox1.addItem("A:B") + new_combobox1.addItem("B:AB") + new_combobox1.addItem("B:BA") + new_combobox1.addItem("B:A") + new_combobox1.addItem("B:B") else: new_combobox1.addItem("") new_combobox1.setFixedSize(67,24) @@ -17565,7 +18060,11 @@ def _slotArchiveReplayAddClicked(self): elif self.dashboard_settings_dictionary['hardware_archive'] == "Open Sniffer": gain_item = QtWidgets.QTableWidgetItem("") elif self.dashboard_settings_dictionary['hardware_archive'] == "PlutoSDR": - gain_item = QtWidgets.QTableWidgetItem("") + gain_item = QtWidgets.QTableWidgetItem("") + elif self.dashboard_settings_dictionary['hardware_archive'] == "USRP2": + gain_item = QtWidgets.QTableWidgetItem("30") + elif self.dashboard_settings_dictionary['hardware_archive'] == "USRP N2xx": + gain_item = QtWidgets.QTableWidgetItem("30") else: gain_item = QtWidgets.QTableWidgetItem("") gain_item.setTextAlignment(QtCore.Qt.AlignCenter) @@ -17785,6 +18284,10 @@ def _slotArchiveReplayStartClicked(self): flow_graph = "" # Error elif self.dashboard_settings_dictionary['hardware_archive'] == "PlutoSDR": flow_graph = "archive_replay_plutosdr" + elif self.dashboard_settings_dictionary['hardware_archive'] == "USRP2": + flow_graph = "archive_replay_usrp2" + elif self.dashboard_settings_dictionary['hardware_archive'] == "USRP N2xx": + flow_graph = "archive_replay_usrp_n2xx" # Send "Start Archive Playlist" Message to the HIPRFISR if len(flow_graph) > 0: @@ -18118,18 +18621,21 @@ def checkFrequencyBounds(self, get_frequency, get_hardware, get_daughterboard): elif get_hardware == "USRP X310": # Frequency Limits - if get_daughterboard == "CBX": + if get_daughterboard == "CBX-120": if (get_frequency >= 1200) and (get_frequency <= 6000): return True - elif get_daughterboard == "SBX": + elif get_daughterboard == "SBX-120": if (get_frequency >= 400) and (get_frequency <= 4400): return True - elif get_daughterboard == "UBX": + elif get_daughterboard == "UBX-160": if (get_frequency >= 10) and (get_frequency <= 6000): return True - elif get_daughterboard == "WBX": + elif get_daughterboard == "WBX-120": if (get_frequency >= 25) and (get_frequency <= 2200): return True + elif get_daughterboard == "TwinRX": + if (get_frequency >= 10) and (get_frequency <= 6000): + return True elif get_hardware == "USRP B210": # Frequency Limits @@ -18174,7 +18680,109 @@ def checkFrequencyBounds(self, get_frequency, get_hardware, get_daughterboard): elif get_hardware == "PlutoSDR": # Frequency Limits if (get_frequency >= 325) and (get_frequency <= 3800): - return True + return True + + elif get_hardware == "USRP2": + # Frequency Limits + if get_daughterboard == "XCVR2450": + if (get_frequency >= 2400) and (get_frequency <= 6000): + return True + elif get_daughterboard == "DBSRX": + if (get_frequency >= 800) and (get_frequency <= 2300): + return True + elif get_daughterboard == "SBX-40": + if (get_frequency >= 400) and (get_frequency <= 4400): + return True + elif get_daughterboard == "UBX-40": + if (get_frequency >= 10) and (get_frequency <= 6000): + return True + elif get_daughterboard == "WBX-40": + if (get_frequency >= 50) and (get_frequency <= 2200): + return True + elif get_daughterboard == "CBX-40": + if (get_frequency >= 1200) and (get_frequency <= 6000): + return True + elif get_daughterboard == "LFRX": + if (get_frequency >= 0) and (get_frequency <= 30): + return True + elif get_daughterboard == "LFTX": + if (get_frequency >= 0) and (get_frequency <= 30): + return True + elif get_daughterboard == "BasicRX": + if (get_frequency >= 1) and (get_frequency <= 250): + return True + elif get_daughterboard == "BasicTX": + if (get_frequency >= 1) and (get_frequency <= 250): + return True + elif get_daughterboard == "TVRX2": + if (get_frequency >= 50) and (get_frequency <= 860): + return True + elif get_daughterboard == "RFX400": + if (get_frequency >= 400) and (get_frequency <= 500): + return True + elif get_daughterboard == "RFX900": + if (get_frequency >= 750) and (get_frequency <= 1050): + return True + elif get_daughterboard == "RFX1200": + if (get_frequency >= 1150) and (get_frequency <= 1450): + return True + elif get_daughterboard == "RFX1800": + if (get_frequency >= 1500) and (get_frequency <= 2100): + return True + elif get_daughterboard == "RFX2400": + if (get_frequency >= 2300) and (get_frequency <= 2900): + return True + + elif get_hardware == "USRP N2xx": + # Frequency Limits + if get_daughterboard == "XCVR2450": + if (get_frequency >= 2400) and (get_frequency <= 6000): + return True + elif get_daughterboard == "DBSRX": + if (get_frequency >= 800) and (get_frequency <= 2300): + return True + elif get_daughterboard == "SBX-40": + if (get_frequency >= 400) and (get_frequency <= 4400): + return True + elif get_daughterboard == "UBX-40": + if (get_frequency >= 10) and (get_frequency <= 6000): + return True + elif get_daughterboard == "WBX-40": + if (get_frequency >= 50) and (get_frequency <= 2200): + return True + elif get_daughterboard == "CBX-40": + if (get_frequency >= 1200) and (get_frequency <= 6000): + return True + elif get_daughterboard == "LFRX": + if (get_frequency >= 0) and (get_frequency <= 30): + return True + elif get_daughterboard == "LFTX": + if (get_frequency >= 0) and (get_frequency <= 30): + return True + elif get_daughterboard == "BasicRX": + if (get_frequency >= 1) and (get_frequency <= 250): + return True + elif get_daughterboard == "BasicTX": + if (get_frequency >= 1) and (get_frequency <= 250): + return True + elif get_daughterboard == "TVRX2": + if (get_frequency >= 50) and (get_frequency <= 860): + return True + elif get_daughterboard == "RFX400": + if (get_frequency >= 400) and (get_frequency <= 500): + return True + elif get_daughterboard == "RFX900": + if (get_frequency >= 750) and (get_frequency <= 1050): + return True + elif get_daughterboard == "RFX1200": + if (get_frequency >= 1150) and (get_frequency <= 1450): + return True + elif get_daughterboard == "RFX1800": + if (get_frequency >= 1500) and (get_frequency <= 2100): + return True + elif get_daughterboard == "RFX2400": + if (get_frequency >= 2300) and (get_frequency <= 2900): + return True # Not in Bounds return False @@ -19285,7 +19893,7 @@ def _slotTSI_AdvancedSettingsClicked(self): """ Displays the advanced settings for the currently selected TSI detector. """ # Switch to Advanced Settings - fg_detectors = ['wideband_x310.py','wideband_b210.py','wideband_hackrf.py','wideband_b205mini.py','wideband_rtl2832u.py','wideband_limesdr.py','wideband_bladerf.py','wideband_plutosdr.py'] + fg_detectors = ['wideband_x310.py','wideband_b210.py','wideband_hackrf.py','wideband_b205mini.py','wideband_rtl2832u.py','wideband_limesdr.py','wideband_bladerf.py','wideband_plutosdr.py','wideband_usrp2.py','wideband_usrp_n2xx.py'] # Flow Graph Detectors if str(self.comboBox_tsi_detector.currentText()) in fg_detectors: @@ -19430,6 +20038,56 @@ def _slotTSI_DetectorChanged(self): self.comboBox_tsi_detector_fg_antenna.setCurrentIndex(0) self.stackedWidget_tsi_detector.setCurrentIndex(0) + elif get_detector == 'wideband_usrp2.py': + self.textEdit_tsi_detector_fg_sample_rate.setPlainText("20e6") + self.spinBox_tsi_detector_fg_threshold.setValue(-70) + self.comboBox_tsi_detector_fg_fft_size.setCurrentIndex(1) + self.spinBox_tsi_detector_fg_gain.setMaximum(35) + self.spinBox_tsi_detector_fg_gain.setMinimum(0) + self.spinBox_tsi_detector_fg_gain.setValue(30) + self.comboBox_tsi_detector_fg_channel.clear() + self.comboBox_tsi_detector_fg_channel.addItem("A:0") + self.comboBox_tsi_detector_fg_channel.addItem("B:0") + self.comboBox_tsi_detector_fg_channel.addItem("A:AB") + self.comboBox_tsi_detector_fg_channel.addItem("A:BA") + self.comboBox_tsi_detector_fg_channel.addItem("A:A") + self.comboBox_tsi_detector_fg_channel.addItem("A:B") + self.comboBox_tsi_detector_fg_channel.addItem("B:AB") + self.comboBox_tsi_detector_fg_channel.addItem("B:BA") + self.comboBox_tsi_detector_fg_channel.addItem("B:A") + self.comboBox_tsi_detector_fg_channel.addItem("B:B") + self.comboBox_tsi_detector_fg_channel.setCurrentIndex(0) + self.comboBox_tsi_detector_fg_antenna.clear() + self.comboBox_tsi_detector_fg_antenna.addItem("J1") + self.comboBox_tsi_detector_fg_antenna.addItem("J2") + self.comboBox_tsi_detector_fg_antenna.setCurrentIndex(0) + self.stackedWidget_tsi_detector.setCurrentIndex(0) + + elif get_detector == 'wideband_usrp_n2xx.py': + self.textEdit_tsi_detector_fg_sample_rate.setPlainText("20e6") + self.spinBox_tsi_detector_fg_threshold.setValue(-70) + self.comboBox_tsi_detector_fg_fft_size.setCurrentIndex(1) + self.spinBox_tsi_detector_fg_gain.setMaximum(35) + self.spinBox_tsi_detector_fg_gain.setMinimum(0) + self.spinBox_tsi_detector_fg_gain.setValue(30) + self.comboBox_tsi_detector_fg_channel.clear() + self.comboBox_tsi_detector_fg_channel.addItem("A:0") + self.comboBox_tsi_detector_fg_channel.addItem("B:0") + self.comboBox_tsi_detector_fg_channel.addItem("A:AB") + self.comboBox_tsi_detector_fg_channel.addItem("A:BA") + self.comboBox_tsi_detector_fg_channel.addItem("A:A") + self.comboBox_tsi_detector_fg_channel.addItem("A:B") + self.comboBox_tsi_detector_fg_channel.addItem("B:AB") + self.comboBox_tsi_detector_fg_channel.addItem("B:BA") + self.comboBox_tsi_detector_fg_channel.addItem("B:A") + self.comboBox_tsi_detector_fg_channel.addItem("B:B") + self.comboBox_tsi_detector_fg_channel.setCurrentIndex(0) + self.comboBox_tsi_detector_fg_antenna.clear() + self.comboBox_tsi_detector_fg_antenna.addItem("J1") + self.comboBox_tsi_detector_fg_antenna.addItem("J2") + self.comboBox_tsi_detector_fg_antenna.setCurrentIndex(0) + self.stackedWidget_tsi_detector.setCurrentIndex(0) + elif get_detector == 'Simulator': self.stackedWidget_tsi_detector.setCurrentIndex(2) @@ -21045,7 +21703,7 @@ def __init__(self, parent, mode, hardware, ip, serial, interface, daughterboard) self.setupUi(self) # Prevent Resizing/Maximizing - self.setFixedSize(950, 115) + self.setFixedSize(965, 115) # Do SIGNAL/Slots Connections self._connectSlots() @@ -21077,22 +21735,60 @@ def __init__(self, parent, mode, hardware, ip, serial, interface, daughterboard) self.comboBox_hardware.setCurrentIndex(9) elif hardware == "PlutoSDR": self.comboBox_hardware.setCurrentIndex(10) + elif hardware == "USRP2": + self.comboBox_hardware.setCurrentIndex(11) + elif hardware == "USRP N2xx": + self.comboBox_hardware.setCurrentIndex(12) self.textEdit_ip.setPlainText(ip) self.textEdit_ip.setAlignment(QtCore.Qt.AlignCenter) self.textEdit_serial.setPlainText(serial) self.textEdit_serial.setAlignment(QtCore.Qt.AlignCenter) self.textEdit_interface.setPlainText(interface) - self.textEdit_interface.setAlignment(QtCore.Qt.AlignCenter) - - if "CBX" in daughterboard: + self.textEdit_interface.setAlignment(QtCore.Qt.AlignCenter) + + if "CBX-120" in daughterboard: self.comboBox_daughterboard.setCurrentIndex(0) - elif "SBX" in daughterboard: + elif "SBX-120" in daughterboard: self.comboBox_daughterboard.setCurrentIndex(1) - elif "UBX" in daughterboard: + elif "UBX-160" in daughterboard: self.comboBox_daughterboard.setCurrentIndex(2) - elif "WBX" in daughterboard: - self.comboBox_daughterboard.setCurrentIndex(3) + elif "WBX-120" in daughterboard: + self.comboBox_daughterboard.setCurrentIndex(3) + elif "TwinRX" in daughterboard: + self.comboBox_daughterboard.setCurrentIndex(4) + elif "XCVR2450" in daughterboard: + self.comboBox_daughterboard.setCurrentIndex(5) + elif "DBSRX" in daughterboard: + self.comboBox_daughterboard.setCurrentIndex(6) + elif "SBX-40" in daughterboard: + self.comboBox_daughterboard.setCurrentIndex(7) + elif "UBX-40" in daughterboard: + self.comboBox_daughterboard.setCurrentIndex(8) + elif "WBX-40" in daughterboard: + self.comboBox_daughterboard.setCurrentIndex(9) + elif "CBX-40" in daughterboard: + self.comboBox_daughterboard.setCurrentIndex(10) + elif "LFRX" in daughterboard: + self.comboBox_daughterboard.setCurrentIndex(11) + elif "LFTX" in daughterboard: + self.comboBox_daughterboard.setCurrentIndex(12) + elif "BasicRX" in daughterboard: + self.comboBox_daughterboard.setCurrentIndex(13) + elif "BasicTX" in daughterboard: + self.comboBox_daughterboard.setCurrentIndex(14) + elif "TVRX2" in daughterboard: + self.comboBox_daughterboard.setCurrentIndex(15) + elif "RFX400" in daughterboard: + self.comboBox_daughterboard.setCurrentIndex(16) + elif "RFX900" in daughterboard: + self.comboBox_daughterboard.setCurrentIndex(17) + elif "RFX1200" in daughterboard: + self.comboBox_daughterboard.setCurrentIndex(18) + elif "RFX1800" in daughterboard: + self.comboBox_daughterboard.setCurrentIndex(19) + elif "RFX2400" in daughterboard: + self.comboBox_daughterboard.setCurrentIndex(20) def _connectSlots(self): """ Contains the connect functions for all the signals and slots @@ -21181,7 +21877,11 @@ def _slotGuessClicked(self): elif str(self.comboBox_hardware.currentText()) == "Open Sniffer": pass elif str(self.comboBox_hardware.currentText()) == "PlutoSDR": - self.parent.findPlutoSDR(self.textEdit_ip) + self.parent.findPlutoSDR(self.textEdit_ip) + elif str(self.comboBox_hardware.currentText()) == "USRP2": + self.parent.findUSRP2(self.textEdit_ip, self.textEdit_serial, self.comboBox_daughterboard, self.label_probe) + elif str(self.comboBox_hardware.currentText()) == "USRP N2xx": + self.parent.findUSRP_N2xx(self.textEdit_ip, self.textEdit_serial, self.comboBox_daughterboard, self.label_probe) def _slotProbeClicked(self): """ Opens a message box and copies the results of "uhd_usrp_probe xxx.xxx.xxx.xxx" @@ -21277,9 +21977,39 @@ def _slotProbeClicked(self): proc=subprocess.Popen('iio_info -n pluto.local &', shell=True, stdout=subprocess.PIPE, ) output=proc.communicate()[0].decode() self.label_probe.setVisible(False) + except: + self.label_probe.setVisible(False) + output = "Error" + + elif str(self.comboBox_hardware.currentText()) == "USRP2": + # Get IP Address + get_ip = str(self.textEdit_ip.toPlainText()) + + # Probe + try: + self.label_probe.setVisible(True) + QtWidgets.QApplication.processEvents() + proc = subprocess.Popen('uhd_usrp_probe --args="addr=' + get_ip + '" &', shell=True, stdout=subprocess.PIPE, ) + output = proc.communicate()[0].decode() + self.label_probe.setVisible(False) except: self.label_probe.setVisible(False) output = "Error" + + elif str(self.comboBox_hardware.currentText()) == "USRP N2xx": + # Get IP Address + get_ip = str(self.textEdit_ip.toPlainText()) + + # Probe + try: + self.label_probe.setVisible(True) + QtWidgets.QApplication.processEvents() + proc = subprocess.Popen('uhd_usrp_probe --args="addr=' + get_ip + '" &', shell=True, stdout=subprocess.PIPE, ) + output = proc.communicate()[0].decode() + self.label_probe.setVisible(False) + except: + self.label_probe.setVisible(False) + output = "Error" # Create a Dialog Window msgBox = MyMessageBox(my_text = output, height = 600, width = 900) @@ -21373,7 +22103,21 @@ def _slotHardwareChanged(self): self.pushButton_guess.setVisible(True) self.pushButton_probe_usrp.setVisible(True) self.textEdit_interface.setVisible(False) - self.comboBox_daughterboard.setVisible(False) + self.comboBox_daughterboard.setVisible(False) + elif str(self.comboBox_hardware.currentText()) == "USRP2": + self.textEdit_ip.setVisible(True) + self.textEdit_serial.setVisible(True) + self.pushButton_guess.setVisible(True) + self.pushButton_probe_usrp.setVisible(True) + self.textEdit_interface.setVisible(False) + self.comboBox_daughterboard.setVisible(True) + elif str(self.comboBox_hardware.currentText()) == "USRP N2xx": + self.textEdit_ip.setVisible(True) + self.textEdit_serial.setVisible(True) + self.pushButton_guess.setVisible(True) + self.pushButton_probe_usrp.setVisible(True) + self.textEdit_interface.setVisible(False) + self.comboBox_daughterboard.setVisible(True) def _slotApplyToAllClicked(self): """ Save the current radio settings to all components. diff --git a/protocol_discovery.py b/protocol_discovery.py index 7d22ff9b..29811f16 100644 --- a/protocol_discovery.py +++ b/protocol_discovery.py @@ -264,7 +264,7 @@ def startPD(self): # Start Processing Bits self.gr_processing = threading.Event() self.gr_srv = threading.Thread(target = self.grRcvThread, args=(self.gr_processing, self.pd_bit_sub_listener,)); - self.gr_srv.setDaemon(True) + self.gr_srv.daemon = True self.gr_srv.start() def stopPD(self): diff --git a/tsi_component.py b/tsi_component.py index 2d8a18f7..983e32c4 100644 --- a/tsi_component.py +++ b/tsi_component.py @@ -279,7 +279,7 @@ def startTSI_Detector(self, detector, variable_names, variable_values): print("TSI: Starting TSI Detector...") # Make a New Wideband Thread - if detector in ["wideband_x310.py","wideband_b210.py","wideband_hackrf.py","wideband_b205mini.py","wideband_rtl2832u.py","wideband_limesdr.py","wideband_bladerf.py","wideband_plutosdr.py","Simulator","IQ File"]: + if detector in ["wideband_x310.py","wideband_b210.py","wideband_hackrf.py","wideband_b205mini.py","wideband_rtl2832u.py","wideband_limesdr.py","wideband_bladerf.py","wideband_plutosdr.py","wideband_usrp2.py","wideband_usrp_n2xx.py","Simulator","IQ File"]: if detector == "wideband_x310.py": flow_graph_filename = "wideband_x310.py" elif detector == "wideband_b210.py": @@ -296,6 +296,10 @@ def startTSI_Detector(self, detector, variable_names, variable_values): flow_graph_filename = "wideband_bladerf.py" elif detector == "wideband_plutosdr.py": flow_graph_filename = "wideband_plutosdr.py" + elif detector == "wideband_usrp2.py": + flow_graph_filename = "wideband_usrp2.py" + elif detector == "wideband_usrp_n2xx.py": + flow_graph_filename = "wideband_usrp_n2xx.py" elif detector == "IQ File": flow_graph_filename = "iq_file.py"