diff options
author | sara <sara.halter@gmx.ch> | 2021-11-11 20:05:40 +0100 |
---|---|---|
committer | sara <sara.halter@gmx.ch> | 2021-11-11 20:05:40 +0100 |
commit | 1e873c7ec474b1af4082aafcd33c0ba7a9fd3d51 (patch) | |
tree | 98e592e42f27ec2a6bd1db689fc1b4196b4c7573 | |
parent | FIR/Fading implementiert (diff) | |
parent | Create ZMQ test (diff) | |
download | Fading-1e873c7ec474b1af4082aafcd33c0ba7a9fd3d51.tar.gz Fading-1e873c7ec474b1af4082aafcd33c0ba7a9fd3d51.zip |
Merge remote-tracking branch 'origin/master'
-rw-r--r-- | doc/thesis/figures/screenshots/BPSK_2021-11-10_15-49-16.png (renamed from simulation/QAM_Fading/BPSK_2021-11-10_15-49-16.png) | bin | 89114 -> 89114 bytes | |||
-rw-r--r-- | doc/thesis/figures/screenshots/QAM16_Simulation.png (renamed from simulation/QAM/QAM16_Simulation.png) | bin | 75755 -> 75755 bytes | |||
-rw-r--r-- | doc/thesis/figures/screenshots/QPSK_Hardware.png (renamed from hardware/QAM/QPSK_Hardware.png) | bin | 83957 -> 83957 bytes | |||
-rw-r--r-- | doc/thesis/figures/screenshots/qpsk_nogui.pdf (renamed from simulation/QPSK/qpsk_nogui.pdf) | bin | 26645 -> 26645 bytes | |||
-rw-r--r-- | hardware/QAM/qam.grc | 2 | ||||
-rwxr-xr-x | hardware/QAM/qpks.py | 1001 | ||||
-rw-r--r-- | notebooks/Fading.ipynb | 108 | ||||
-rw-r--r-- | references/books/WsComm_LectureNotes_2021.pdf | bin | 0 -> 17635797 bytes | |||
-rw-r--r-- | references/fundamentals/1993-10.pdf | bin | 0 -> 627296 bytes | |||
-rw-r--r-- | references/fundamentals/An_overview_of_OFDM_and_related_techniques_towards_development_of_future_wireless_multimedia_communications.pdf | bin | 0 -> 346998 bytes | |||
-rw-r--r-- | simulation/QAM/lena512color.tiff | bin | 0 -> 786572 bytes | |||
-rw-r--r-- | simulation/QAM/qam.grc | 765 | ||||
-rwxr-xr-x | simulation/QAM/qam.py | 6 | ||||
-rw-r--r-- | simulation/QAM/qam_nogui.grc | 1208 | ||||
-rwxr-xr-x | simulation/QAM/qam_nogui.py | 238 | ||||
-rwxr-xr-x | simulation/QPSK/qpks.py | 644 | ||||
-rwxr-xr-x | src/gui.py (renamed from src/sketch.py) | 52 | ||||
l--------- | src/qam.py | 1 | ||||
-rw-r--r-- | tests/dearpygui/test.py (renamed from src/Test_Plots/test.py) | 0 | ||||
-rw-r--r-- | tests/dearpygui/test10.py (renamed from src/Test_Plots/test10.py) | 0 | ||||
-rw-r--r-- | tests/dearpygui/test1_updating_series_data.py (renamed from src/Test_Plots/test1_updating_series_data.py) | 0 | ||||
-rw-r--r-- | tests/dearpygui/test2_axis_limis.py (renamed from src/Test_Plots/test2_axis_limis.py) | 0 | ||||
-rw-r--r-- | tests/dearpygui/test3_custom_axis_labels.py (renamed from src/Test_Plots/test3_custom_axis_labels.py) | 0 | ||||
-rw-r--r-- | tests/dearpygui/test4_multiple_y_axes.py (renamed from src/Test_Plots/test4_multiple_y_axes.py) | 0 | ||||
-rw-r--r-- | tests/dearpygui/test5_annotations.py (renamed from src/Test_Plots/test5_annotations.py) | 0 | ||||
-rw-r--r-- | tests/dearpygui/test6_drag_points_and_lines.py (renamed from src/Test_Plots/test6_drag_points_and_lines.py) | 0 | ||||
-rw-r--r-- | tests/dearpygui/test7_querying.py (renamed from src/Test_Plots/test7_querying.py) | 0 | ||||
-rw-r--r-- | tests/dearpygui/test8_custom_context_menus.py (renamed from src/Test_Plots/test8_custom_context_menus.py) | 0 | ||||
-rw-r--r-- | tests/dearpygui/test9_colors_and_styles.py (renamed from src/Test_Plots/test9_colors_and_styles.py) | 0 | ||||
-rw-r--r-- | tests/zmq/lena512color.tiff | bin | 0 -> 786572 bytes | |||
-rw-r--r-- | tests/zmq/server.py | 4 | ||||
-rw-r--r-- | tests/zmq/zmqtest.grc | 112 | ||||
-rwxr-xr-x | tests/zmq/zmqtest.py | 85 |
33 files changed, 1818 insertions, 2408 deletions
diff --git a/simulation/QAM_Fading/BPSK_2021-11-10_15-49-16.png b/doc/thesis/figures/screenshots/BPSK_2021-11-10_15-49-16.png Binary files differindex 6ae117d..6ae117d 100644 --- a/simulation/QAM_Fading/BPSK_2021-11-10_15-49-16.png +++ b/doc/thesis/figures/screenshots/BPSK_2021-11-10_15-49-16.png diff --git a/simulation/QAM/QAM16_Simulation.png b/doc/thesis/figures/screenshots/QAM16_Simulation.png Binary files differindex 1342db4..1342db4 100644 --- a/simulation/QAM/QAM16_Simulation.png +++ b/doc/thesis/figures/screenshots/QAM16_Simulation.png diff --git a/hardware/QAM/QPSK_Hardware.png b/doc/thesis/figures/screenshots/QPSK_Hardware.png Binary files differindex 062d95e..062d95e 100644 --- a/hardware/QAM/QPSK_Hardware.png +++ b/doc/thesis/figures/screenshots/QPSK_Hardware.png diff --git a/simulation/QPSK/qpsk_nogui.pdf b/doc/thesis/figures/screenshots/qpsk_nogui.pdf Binary files differindex 0b0077e..0b0077e 100644 --- a/simulation/QPSK/qpsk_nogui.pdf +++ b/doc/thesis/figures/screenshots/qpsk_nogui.pdf diff --git a/hardware/QAM/qam.grc b/hardware/QAM/qam.grc index 4c53ba6..e14f1fe 100644 --- a/hardware/QAM/qam.grc +++ b/hardware/QAM/qam.grc @@ -42,7 +42,7 @@ blocks: rot_sym: '4' soft_dec_lut: None sym_map: '[0, 1, 3, 2]' - type: bpsk + type: 16qam states: bus_sink: false bus_source: false diff --git a/hardware/QAM/qpks.py b/hardware/QAM/qpks.py deleted file mode 100755 index f89ac12..0000000 --- a/hardware/QAM/qpks.py +++ /dev/null @@ -1,1001 +0,0 @@ -#!/usr/bin/env python3 -# -*- coding: utf-8 -*- - -# -# SPDX-License-Identifier: GPL-3.0 -# -# GNU Radio Python Flow Graph -# Title: QPSK Hardware Simultion -# Author: Pross Naoki, Halter Sara Cinzia -# GNU Radio version: 3.8.2.0 - -from distutils.version import 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 gnuradio import qtgui -from gnuradio.filter import firdes -import sip -from gnuradio import blocks -import pmt -from gnuradio import digital -from gnuradio import gr -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 gnuradio import qtgui - -class qpks(gr.top_block, Qt.QWidget): - - def __init__(self): - gr.top_block.__init__(self, "QPSK Hardware Simultion") - Qt.QWidget.__init__(self) - self.setWindowTitle("QPSK Hardware Simultion") - 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", "qpks") - - 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.sps = sps = 4 - self.nfilts = nfilts = 32 - self.excess_bw = excess_bw = .35 - self.timing_loop_bw = timing_loop_bw = 2 * 3.141592653589793 / 100 - self.samp_rate = samp_rate = .4e6 - self.rrc_taps = rrc_taps = firdes.root_raised_cosine(nfilts, nfilts, 1.0/float(sps), excess_bw, 45*nfilts) - self.qpsk_const = qpsk_const = digital.constellation_rect([0.707+0.707j, -0.707+0.707j, -0.707-0.707j, 0.707-0.707j], [0, 1, 3, 2], - 4, 2, 2, 1, 1).base() - self.phase_bw = phase_bw = 2 * 3.141592653589793 / 100 - self.eq_ntaps = eq_ntaps = 15 - self.eq_mod = eq_mod = 2 - self.eq_gain = eq_gain = .01 - - ################################################## - # Blocks - ################################################## - self.params = Qt.QTabWidget() - self.params_widget_0 = Qt.QWidget() - self.params_layout_0 = Qt.QBoxLayout(Qt.QBoxLayout.TopToBottom, self.params_widget_0) - self.params_grid_layout_0 = Qt.QGridLayout() - self.params_layout_0.addLayout(self.params_grid_layout_0) - self.params.addTab(self.params_widget_0, 'Channel') - self.params_widget_1 = Qt.QWidget() - self.params_layout_1 = Qt.QBoxLayout(Qt.QBoxLayout.TopToBottom, self.params_widget_1) - self.params_grid_layout_1 = Qt.QGridLayout() - self.params_layout_1.addLayout(self.params_grid_layout_1) - self.params.addTab(self.params_widget_1, 'Receiver') - self.top_grid_layout.addWidget(self.params) - self.plots = Qt.QTabWidget() - self.plots_widget_0 = Qt.QWidget() - self.plots_layout_0 = Qt.QBoxLayout(Qt.QBoxLayout.TopToBottom, self.plots_widget_0) - self.plots_grid_layout_0 = Qt.QGridLayout() - self.plots_layout_0.addLayout(self.plots_grid_layout_0) - self.plots.addTab(self.plots_widget_0, 'Constellations') - self.plots_widget_1 = Qt.QWidget() - self.plots_layout_1 = Qt.QBoxLayout(Qt.QBoxLayout.TopToBottom, self.plots_widget_1) - self.plots_grid_layout_1 = Qt.QGridLayout() - self.plots_layout_1.addLayout(self.plots_grid_layout_1) - self.plots.addTab(self.plots_widget_1, 'Frequency') - self.plots_widget_2 = Qt.QWidget() - self.plots_layout_2 = Qt.QBoxLayout(Qt.QBoxLayout.TopToBottom, self.plots_widget_2) - self.plots_grid_layout_2 = Qt.QGridLayout() - self.plots_layout_2.addLayout(self.plots_grid_layout_2) - self.plots.addTab(self.plots_widget_2, 'Time') - self.plots_widget_3 = Qt.QWidget() - self.plots_layout_3 = Qt.QBoxLayout(Qt.QBoxLayout.TopToBottom, self.plots_widget_3) - self.plots_grid_layout_3 = Qt.QGridLayout() - self.plots_layout_3.addLayout(self.plots_grid_layout_3) - self.plots.addTab(self.plots_widget_3, 'Bits') - self.top_grid_layout.addWidget(self.plots) - self._phase_bw_range = Range(0, 1, .01, 2 * 3.141592653589793 / 100, 200) - self._phase_bw_win = RangeWidget(self._phase_bw_range, self.set_phase_bw, 'Phase Bandwidth', "counter_slider", float) - self.params_grid_layout_1.addWidget(self._phase_bw_win, 1, 0, 1, 1) - for r in range(1, 2): - self.params_grid_layout_1.setRowStretch(r, 1) - for c in range(0, 1): - self.params_grid_layout_1.setColumnStretch(c, 1) - self._eq_gain_range = Range(0, .1, .001, .01, 200) - self._eq_gain_win = RangeWidget(self._eq_gain_range, self.set_eq_gain, 'Equalizer Rate', "counter_slider", float) - self.params_grid_layout_1.addWidget(self._eq_gain_win, 0, 0, 1, 1) - for r in range(0, 1): - self.params_grid_layout_1.setRowStretch(r, 1) - for c in range(0, 1): - self.params_grid_layout_1.setColumnStretch(c, 1) - self.uhd_usrp_source_0 = uhd.usrp_source( - ",".join(("serial=309AF6A ", "")), - uhd.stream_args( - cpu_format="fc32", - args='', - channels=list(range(0,1)), - ), - ) - self.uhd_usrp_source_0.set_clock_source('external', 0) - self.uhd_usrp_source_0.set_center_freq(2.4e9, 0) - self.uhd_usrp_source_0.set_rx_agc(False, 0) - self.uhd_usrp_source_0.set_normalized_gain(0.6, 0) - self.uhd_usrp_source_0.set_antenna('RX2', 0) - self.uhd_usrp_source_0.set_samp_rate(samp_rate) - self.uhd_usrp_source_0.set_time_unknown_pps(uhd.time_spec()) - self.uhd_usrp_sink_0 = uhd.usrp_sink( - ",".join(("serial=309AF59 ", "")), - uhd.stream_args( - cpu_format="fc32", - args='', - channels=list(range(0,1)), - ), - '', - ) - self.uhd_usrp_sink_0.set_clock_source('external', 0) - self.uhd_usrp_sink_0.set_center_freq(2.4e9, 0) - self.uhd_usrp_sink_0.set_normalized_gain(0.35, 0) - self.uhd_usrp_sink_0.set_antenna('TX/RX', 0) - self.uhd_usrp_sink_0.set_samp_rate(samp_rate) - self.uhd_usrp_sink_0.set_time_unknown_pps(uhd.time_spec()) - self.qtgui_time_sink_x_2_0_0 = qtgui.time_sink_c( - 1024, #size - samp_rate, #samp_rate - "Received (RX)", #name - 1 #number of inputs - ) - self.qtgui_time_sink_x_2_0_0.set_update_time(0.10) - self.qtgui_time_sink_x_2_0_0.set_y_axis(-1, 1) - - self.qtgui_time_sink_x_2_0_0.set_y_label('Amplitude', "") - - self.qtgui_time_sink_x_2_0_0.enable_tags(False) - self.qtgui_time_sink_x_2_0_0.set_trigger_mode(qtgui.TRIG_MODE_FREE, qtgui.TRIG_SLOPE_POS, 0.0, 0, 0, "") - self.qtgui_time_sink_x_2_0_0.enable_autoscale(True) - self.qtgui_time_sink_x_2_0_0.enable_grid(False) - self.qtgui_time_sink_x_2_0_0.enable_axis_labels(True) - self.qtgui_time_sink_x_2_0_0.enable_control_panel(False) - self.qtgui_time_sink_x_2_0_0.enable_stem_plot(False) - - - labels = ['Signal 1', 'Signal 2', 'Signal 3', 'Signal 4', 'Signal 5', - 'Signal 6', 'Signal 7', 'Signal 8', 'Signal 9', 'Signal 10'] - 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_2_0_0.set_line_label(i, "Re{{Data {0}}}".format(i/2)) - else: - self.qtgui_time_sink_x_2_0_0.set_line_label(i, "Im{{Data {0}}}".format(i/2)) - else: - self.qtgui_time_sink_x_2_0_0.set_line_label(i, labels[i]) - self.qtgui_time_sink_x_2_0_0.set_line_width(i, widths[i]) - self.qtgui_time_sink_x_2_0_0.set_line_color(i, colors[i]) - self.qtgui_time_sink_x_2_0_0.set_line_style(i, styles[i]) - self.qtgui_time_sink_x_2_0_0.set_line_marker(i, markers[i]) - self.qtgui_time_sink_x_2_0_0.set_line_alpha(i, alphas[i]) - - self._qtgui_time_sink_x_2_0_0_win = sip.wrapinstance(self.qtgui_time_sink_x_2_0_0.pyqwidget(), Qt.QWidget) - self.plots_grid_layout_2.addWidget(self._qtgui_time_sink_x_2_0_0_win, 1, 0, 1, 1) - for r in range(1, 2): - self.plots_grid_layout_2.setRowStretch(r, 1) - for c in range(0, 1): - self.plots_grid_layout_2.setColumnStretch(c, 1) - self.qtgui_time_sink_x_2 = qtgui.time_sink_c( - 1024, #size - samp_rate, #samp_rate - "Modulated (TX)", #name - 1 #number of inputs - ) - self.qtgui_time_sink_x_2.set_update_time(0.10) - self.qtgui_time_sink_x_2.set_y_axis(-1, 1) - - self.qtgui_time_sink_x_2.set_y_label('Amplitude', "") - - self.qtgui_time_sink_x_2.enable_tags(False) - self.qtgui_time_sink_x_2.set_trigger_mode(qtgui.TRIG_MODE_FREE, qtgui.TRIG_SLOPE_POS, 0.0, 0, 0, "") - self.qtgui_time_sink_x_2.enable_autoscale(True) - self.qtgui_time_sink_x_2.enable_grid(False) - self.qtgui_time_sink_x_2.enable_axis_labels(True) - self.qtgui_time_sink_x_2.enable_control_panel(False) - self.qtgui_time_sink_x_2.enable_stem_plot(False) - - - labels = ['Signal 1', 'Signal 2', 'Signal 3', 'Signal 4', 'Signal 5', - 'Signal 6', 'Signal 7', 'Signal 8', 'Signal 9', 'Signal 10'] - 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_2.set_line_label(i, "Re{{Data {0}}}".format(i/2)) - else: - self.qtgui_time_sink_x_2.set_line_label(i, "Im{{Data {0}}}".format(i/2)) - else: - self.qtgui_time_sink_x_2.set_line_label(i, labels[i]) - self.qtgui_time_sink_x_2.set_line_width(i, widths[i]) - self.qtgui_time_sink_x_2.set_line_color(i, colors[i]) - self.qtgui_time_sink_x_2.set_line_style(i, styles[i]) - self.qtgui_time_sink_x_2.set_line_marker(i, markers[i]) - self.qtgui_time_sink_x_2.set_line_alpha(i, alphas[i]) - - self._qtgui_time_sink_x_2_win = sip.wrapinstance(self.qtgui_time_sink_x_2.pyqwidget(), Qt.QWidget) - self.plots_grid_layout_2.addWidget(self._qtgui_time_sink_x_2_win, 0, 0, 1, 1) - for r in range(0, 1): - self.plots_grid_layout_2.setRowStretch(r, 1) - for c in range(0, 1): - self.plots_grid_layout_2.setColumnStretch(c, 1) - self.qtgui_freq_sink_x_1_0_1_0 = qtgui.freq_sink_c( - 1024, #size - firdes.WIN_BLACKMAN_hARRIS, #wintype - 0, #fc - samp_rate, #bw - "Locked", #name - 1 - ) - self.qtgui_freq_sink_x_1_0_1_0.set_update_time(0.10) - self.qtgui_freq_sink_x_1_0_1_0.set_y_axis(-140, 10) - self.qtgui_freq_sink_x_1_0_1_0.set_y_label('Relative Gain', 'dB') - self.qtgui_freq_sink_x_1_0_1_0.set_trigger_mode(qtgui.TRIG_MODE_FREE, 0.0, 0, "") - self.qtgui_freq_sink_x_1_0_1_0.enable_autoscale(False) - self.qtgui_freq_sink_x_1_0_1_0.enable_grid(False) - self.qtgui_freq_sink_x_1_0_1_0.set_fft_average(1.0) - self.qtgui_freq_sink_x_1_0_1_0.enable_axis_labels(True) - self.qtgui_freq_sink_x_1_0_1_0.enable_control_panel(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_1_0_1_0.set_line_label(i, "Data {0}".format(i)) - else: - self.qtgui_freq_sink_x_1_0_1_0.set_line_label(i, labels[i]) - self.qtgui_freq_sink_x_1_0_1_0.set_line_width(i, widths[i]) - self.qtgui_freq_sink_x_1_0_1_0.set_line_color(i, colors[i]) - self.qtgui_freq_sink_x_1_0_1_0.set_line_alpha(i, alphas[i]) - - self._qtgui_freq_sink_x_1_0_1_0_win = sip.wrapinstance(self.qtgui_freq_sink_x_1_0_1_0.pyqwidget(), Qt.QWidget) - self.plots_grid_layout_1.addWidget(self._qtgui_freq_sink_x_1_0_1_0_win, 1, 2, 1, 1) - for r in range(1, 2): - self.plots_grid_layout_1.setRowStretch(r, 1) - for c in range(2, 3): - self.plots_grid_layout_1.setColumnStretch(c, 1) - self.qtgui_freq_sink_x_1_0_1 = qtgui.freq_sink_c( - 1024, #size - firdes.WIN_BLACKMAN_hARRIS, #wintype - 0, #fc - samp_rate, #bw - "Equalized", #name - 1 - ) - self.qtgui_freq_sink_x_1_0_1.set_update_time(0.10) - self.qtgui_freq_sink_x_1_0_1.set_y_axis(-140, 10) - self.qtgui_freq_sink_x_1_0_1.set_y_label('Relative Gain', 'dB') - self.qtgui_freq_sink_x_1_0_1.set_trigger_mode(qtgui.TRIG_MODE_FREE, 0.0, 0, "") - self.qtgui_freq_sink_x_1_0_1.enable_autoscale(False) - self.qtgui_freq_sink_x_1_0_1.enable_grid(False) - self.qtgui_freq_sink_x_1_0_1.set_fft_average(1.0) - self.qtgui_freq_sink_x_1_0_1.enable_axis_labels(True) - self.qtgui_freq_sink_x_1_0_1.enable_control_panel(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_1_0_1.set_line_label(i, "Data {0}".format(i)) - else: - self.qtgui_freq_sink_x_1_0_1.set_line_label(i, labels[i]) - self.qtgui_freq_sink_x_1_0_1.set_line_width(i, widths[i]) - self.qtgui_freq_sink_x_1_0_1.set_line_color(i, colors[i]) - self.qtgui_freq_sink_x_1_0_1.set_line_alpha(i, alphas[i]) - - self._qtgui_freq_sink_x_1_0_1_win = sip.wrapinstance(self.qtgui_freq_sink_x_1_0_1.pyqwidget(), Qt.QWidget) - self.plots_grid_layout_1.addWidget(self._qtgui_freq_sink_x_1_0_1_win, 1, 1, 1, 1) - for r in range(1, 2): - self.plots_grid_layout_1.setRowStretch(r, 1) - for c in range(1, 2): - self.plots_grid_layout_1.setColumnStretch(c, 1) - self.qtgui_freq_sink_x_1_0_0 = qtgui.freq_sink_c( - 1024, #size - firdes.WIN_BLACKMAN_hARRIS, #wintype - 0, #fc - samp_rate, #bw - "Received", #name - 1 - ) - self.qtgui_freq_sink_x_1_0_0.set_update_time(0.10) - self.qtgui_freq_sink_x_1_0_0.set_y_axis(-140, 10) - self.qtgui_freq_sink_x_1_0_0.set_y_label('Relative Gain', 'dB') - self.qtgui_freq_sink_x_1_0_0.set_trigger_mode(qtgui.TRIG_MODE_FREE, 0.0, 0, "") - self.qtgui_freq_sink_x_1_0_0.enable_autoscale(False) - self.qtgui_freq_sink_x_1_0_0.enable_grid(False) - self.qtgui_freq_sink_x_1_0_0.set_fft_average(1.0) - self.qtgui_freq_sink_x_1_0_0.enable_axis_labels(True) - self.qtgui_freq_sink_x_1_0_0.enable_control_panel(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_1_0_0.set_line_label(i, "Data {0}".format(i)) - else: - self.qtgui_freq_sink_x_1_0_0.set_line_label(i, labels[i]) - self.qtgui_freq_sink_x_1_0_0.set_line_width(i, widths[i]) - self.qtgui_freq_sink_x_1_0_0.set_line_color(i, colors[i]) - self.qtgui_freq_sink_x_1_0_0.set_line_alpha(i, alphas[i]) - - self._qtgui_freq_sink_x_1_0_0_win = sip.wrapinstance(self.qtgui_freq_sink_x_1_0_0.pyqwidget(), Qt.QWidget) - self.plots_grid_layout_1.addWidget(self._qtgui_freq_sink_x_1_0_0_win, 0, 1, 1, 1) - for r in range(0, 1): - self.plots_grid_layout_1.setRowStretch(r, 1) - for c in range(1, 2): - self.plots_grid_layout_1.setColumnStretch(c, 1) - self.qtgui_freq_sink_x_1_0 = qtgui.freq_sink_c( - 1024, #size - firdes.WIN_BLACKMAN_hARRIS, #wintype - 0, #fc - samp_rate, #bw - "Synchronized and filtered", #name - 1 - ) - self.qtgui_freq_sink_x_1_0.set_update_time(0.10) - self.qtgui_freq_sink_x_1_0.set_y_axis(-140, 10) - self.qtgui_freq_sink_x_1_0.set_y_label('Relative Gain', 'dB') - self.qtgui_freq_sink_x_1_0.set_trigger_mode(qtgui.TRIG_MODE_FREE, 0.0, 0, "") - self.qtgui_freq_sink_x_1_0.enable_autoscale(False) - self.qtgui_freq_sink_x_1_0.enable_grid(False) - self.qtgui_freq_sink_x_1_0.set_fft_average(1.0) - self.qtgui_freq_sink_x_1_0.enable_axis_labels(True) - self.qtgui_freq_sink_x_1_0.enable_control_panel(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_1_0.set_line_label(i, "Data {0}".format(i)) - else: - self.qtgui_freq_sink_x_1_0.set_line_label(i, labels[i]) - self.qtgui_freq_sink_x_1_0.set_line_width(i, widths[i]) - self.qtgui_freq_sink_x_1_0.set_line_color(i, colors[i]) - self.qtgui_freq_sink_x_1_0.set_line_alpha(i, alphas[i]) - - self._qtgui_freq_sink_x_1_0_win = sip.wrapinstance(self.qtgui_freq_sink_x_1_0.pyqwidget(), Qt.QWidget) - self.plots_grid_layout_1.addWidget(self._qtgui_freq_sink_x_1_0_win, 0, 2, 1, 1) - for r in range(0, 1): - self.plots_grid_layout_1.setRowStretch(r, 1) - for c in range(2, 3): - self.plots_grid_layout_1.setColumnStretch(c, 1) - self.qtgui_freq_sink_x_1 = qtgui.freq_sink_c( - 1024, #size - firdes.WIN_BLACKMAN_hARRIS, #wintype - 0, #fc - samp_rate, #bw - "Modulated (TX)", #name - 1 - ) - self.qtgui_freq_sink_x_1.set_update_time(0.10) - self.qtgui_freq_sink_x_1.set_y_axis(-140, 10) - self.qtgui_freq_sink_x_1.set_y_label('Relative Gain', 'dB') - self.qtgui_freq_sink_x_1.set_trigger_mode(qtgui.TRIG_MODE_FREE, 0.0, 0, "") - self.qtgui_freq_sink_x_1.enable_autoscale(False) - self.qtgui_freq_sink_x_1.enable_grid(False) - self.qtgui_freq_sink_x_1.set_fft_average(1.0) - self.qtgui_freq_sink_x_1.enable_axis_labels(True) - self.qtgui_freq_sink_x_1.enable_control_panel(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_1.set_line_label(i, "Data {0}".format(i)) - else: - self.qtgui_freq_sink_x_1.set_line_label(i, labels[i]) - self.qtgui_freq_sink_x_1.set_line_width(i, widths[i]) - self.qtgui_freq_sink_x_1.set_line_color(i, colors[i]) - self.qtgui_freq_sink_x_1.set_line_alpha(i, alphas[i]) - - self._qtgui_freq_sink_x_1_win = sip.wrapinstance(self.qtgui_freq_sink_x_1.pyqwidget(), Qt.QWidget) - self.plots_grid_layout_1.addWidget(self._qtgui_freq_sink_x_1_win, 0, 0, 1, 1) - for r in range(0, 1): - self.plots_grid_layout_1.setRowStretch(r, 1) - for c in range(0, 1): - self.plots_grid_layout_1.setColumnStretch(c, 1) - self.qtgui_eye_sink_x_1 = qtgui.eye_sink_c( - 1024, #size - samp_rate, #samp_rate - "", #name - 1 #number of inputs - ) - self.qtgui_eye_sink_x_1.set_update_time(0.10) - self.qtgui_eye_sink_x_1.set_samp_per_symbol(sps) - self.qtgui_eye_sink_x_1.set_y_axis(-1, 1) - - self.qtgui_eye_sink_x_1.set_y_label('Amplitude', "") - - self.qtgui_eye_sink_x_1.enable_tags(True) - self.qtgui_eye_sink_x_1.set_trigger_mode(qtgui.TRIG_MODE_FREE, qtgui.TRIG_SLOPE_POS, 0.0, 0, 0, "") - self.qtgui_eye_sink_x_1.enable_autoscale(False) - self.qtgui_eye_sink_x_1.enable_grid(False) - self.qtgui_eye_sink_x_1.enable_axis_labels(True) - self.qtgui_eye_sink_x_1.enable_control_panel(False) - - - labels = ['Signal 1', 'Signal 2', 'Signal 3', 'Signal 4', 'Signal 5', - 'Signal 6', 'Signal 7', 'Signal 8', 'Signal 9', 'Signal 10'] - widths = [1, 1, 1, 1, 1, - 1, 1, 1, 1, 1] - colors = ['blue', 'blue', 'blue', 'blue', 'blue', - 'blue', 'blue', 'blue', 'blue', '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_eye_sink_x_1.set_line_label(i, "Eye [Re{{Data {0}}}]".format(round(i/2))) - else: - self.qtgui_eye_sink_x_1.set_line_label(i, "Eye [Im{{Data {0}}}]".format(round((i-1)/2))) - else: - self.qtgui_eye_sink_x_1.set_line_label(i, labels[i]) - self.qtgui_eye_sink_x_1.set_line_width(i, widths[i]) - self.qtgui_eye_sink_x_1.set_line_color(i, colors[i]) - self.qtgui_eye_sink_x_1.set_line_style(i, styles[i]) - self.qtgui_eye_sink_x_1.set_line_marker(i, markers[i]) - self.qtgui_eye_sink_x_1.set_line_alpha(i, alphas[i]) - - self._qtgui_eye_sink_x_1_win = sip.wrapinstance(self.qtgui_eye_sink_x_1.pyqwidget(), Qt.QWidget) - self.plots_grid_layout_3.addWidget(self._qtgui_eye_sink_x_1_win, 1, 0, 1, 1) - for r in range(1, 2): - self.plots_grid_layout_3.setRowStretch(r, 1) - for c in range(0, 1): - self.plots_grid_layout_3.setColumnStretch(c, 1) - self.qtgui_eye_sink_x_0 = qtgui.eye_sink_c( - 1024, #size - samp_rate, #samp_rate - "", #name - 1 #number of inputs - ) - self.qtgui_eye_sink_x_0.set_update_time(0.10) - self.qtgui_eye_sink_x_0.set_samp_per_symbol(sps) - self.qtgui_eye_sink_x_0.set_y_axis(-1, 1) - - self.qtgui_eye_sink_x_0.set_y_label('Amplitude', "") - - self.qtgui_eye_sink_x_0.enable_tags(True) - self.qtgui_eye_sink_x_0.set_trigger_mode(qtgui.TRIG_MODE_FREE, qtgui.TRIG_SLOPE_POS, 0.0, 0, 0, "") - self.qtgui_eye_sink_x_0.enable_autoscale(False) - self.qtgui_eye_sink_x_0.enable_grid(False) - self.qtgui_eye_sink_x_0.enable_axis_labels(True) - self.qtgui_eye_sink_x_0.enable_control_panel(False) - - - labels = ['Signal 1', 'Signal 2', 'Signal 3', 'Signal 4', 'Signal 5', - 'Signal 6', 'Signal 7', 'Signal 8', 'Signal 9', 'Signal 10'] - widths = [1, 1, 1, 1, 1, - 1, 1, 1, 1, 1] - colors = ['blue', 'blue', 'blue', 'blue', 'blue', - 'blue', 'blue', 'blue', 'blue', '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_eye_sink_x_0.set_line_label(i, "Eye [Re{{Data {0}}}]".format(round(i/2))) - else: - self.qtgui_eye_sink_x_0.set_line_label(i, "Eye [Im{{Data {0}}}]".format(round((i-1)/2))) - else: - self.qtgui_eye_sink_x_0.set_line_label(i, labels[i]) - self.qtgui_eye_sink_x_0.set_line_width(i, widths[i]) - self.qtgui_eye_sink_x_0.set_line_color(i, colors[i]) - self.qtgui_eye_sink_x_0.set_line_style(i, styles[i]) - self.qtgui_eye_sink_x_0.set_line_marker(i, markers[i]) - self.qtgui_eye_sink_x_0.set_line_alpha(i, alphas[i]) - - self._qtgui_eye_sink_x_0_win = sip.wrapinstance(self.qtgui_eye_sink_x_0.pyqwidget(), Qt.QWidget) - self.top_grid_layout.addWidget(self._qtgui_eye_sink_x_0_win) - self.qtgui_const_sink_x_2 = qtgui.const_sink_c( - 1024, #size - "Locked", #name - 1 #number of inputs - ) - self.qtgui_const_sink_x_2.set_update_time(0.10) - self.qtgui_const_sink_x_2.set_y_axis(-2, 2) - self.qtgui_const_sink_x_2.set_x_axis(-2, 2) - self.qtgui_const_sink_x_2.set_trigger_mode(qtgui.TRIG_MODE_FREE, qtgui.TRIG_SLOPE_POS, 0.0, 0, "") - self.qtgui_const_sink_x_2.enable_autoscale(False) - self.qtgui_const_sink_x_2.enable_grid(False) - self.qtgui_const_sink_x_2.enable_axis_labels(True) - - - labels = ['', '', '', '', '', - '', '', '', '', ''] - widths = [1, 1, 1, 1, 1, - 1, 1, 1, 1, 1] - colors = ["blue", "red", "red", "red", "red", - "red", "red", "red", "red", "red"] - styles = [0, 0, 0, 0, 0, - 0, 0, 0, 0, 0] - markers = [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_const_sink_x_2.set_line_label(i, "Data {0}".format(i)) - else: - self.qtgui_const_sink_x_2.set_line_label(i, labels[i]) - self.qtgui_const_sink_x_2.set_line_width(i, widths[i]) - self.qtgui_const_sink_x_2.set_line_color(i, colors[i]) - self.qtgui_const_sink_x_2.set_line_style(i, styles[i]) - self.qtgui_const_sink_x_2.set_line_marker(i, markers[i]) - self.qtgui_const_sink_x_2.set_line_alpha(i, alphas[i]) - - self._qtgui_const_sink_x_2_win = sip.wrapinstance(self.qtgui_const_sink_x_2.pyqwidget(), Qt.QWidget) - self.plots_grid_layout_0.addWidget(self._qtgui_const_sink_x_2_win, 1, 2, 1, 1) - for r in range(1, 2): - self.plots_grid_layout_0.setRowStretch(r, 1) - for c in range(2, 3): - self.plots_grid_layout_0.setColumnStretch(c, 1) - self.qtgui_const_sink_x_1_0 = qtgui.const_sink_c( - 1024, #size - "Equalized", #name - 1 #number of inputs - ) - self.qtgui_const_sink_x_1_0.set_update_time(0.10) - self.qtgui_const_sink_x_1_0.set_y_axis(-2, 2) - self.qtgui_const_sink_x_1_0.set_x_axis(-2, 2) - self.qtgui_const_sink_x_1_0.set_trigger_mode(qtgui.TRIG_MODE_FREE, qtgui.TRIG_SLOPE_POS, 0.0, 0, "") - self.qtgui_const_sink_x_1_0.enable_autoscale(False) - self.qtgui_const_sink_x_1_0.enable_grid(False) - self.qtgui_const_sink_x_1_0.enable_axis_labels(True) - - - labels = ['', '', '', '', '', - '', '', '', '', ''] - widths = [1, 1, 1, 1, 1, - 1, 1, 1, 1, 1] - colors = ["blue", "red", "red", "red", "red", - "red", "red", "red", "red", "red"] - styles = [0, 0, 0, 0, 0, - 0, 0, 0, 0, 0] - markers = [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_const_sink_x_1_0.set_line_label(i, "Data {0}".format(i)) - else: - self.qtgui_const_sink_x_1_0.set_line_label(i, labels[i]) - self.qtgui_const_sink_x_1_0.set_line_width(i, widths[i]) - self.qtgui_const_sink_x_1_0.set_line_color(i, colors[i]) - self.qtgui_const_sink_x_1_0.set_line_style(i, styles[i]) - self.qtgui_const_sink_x_1_0.set_line_marker(i, markers[i]) - self.qtgui_const_sink_x_1_0.set_line_alpha(i, alphas[i]) - - self._qtgui_const_sink_x_1_0_win = sip.wrapinstance(self.qtgui_const_sink_x_1_0.pyqwidget(), Qt.QWidget) - self.plots_grid_layout_0.addWidget(self._qtgui_const_sink_x_1_0_win, 1, 1, 1, 1) - for r in range(1, 2): - self.plots_grid_layout_0.setRowStretch(r, 1) - for c in range(1, 2): - self.plots_grid_layout_0.setColumnStretch(c, 1) - self.qtgui_const_sink_x_0_0_0 = qtgui.const_sink_c( - 2048, #size - "Received", #name - 1 #number of inputs - ) - self.qtgui_const_sink_x_0_0_0.set_update_time(0.10) - self.qtgui_const_sink_x_0_0_0.set_y_axis(-2, 2) - self.qtgui_const_sink_x_0_0_0.set_x_axis(-2, 2) - self.qtgui_const_sink_x_0_0_0.set_trigger_mode(qtgui.TRIG_MODE_FREE, qtgui.TRIG_SLOPE_POS, 0.0, 0, "") - self.qtgui_const_sink_x_0_0_0.enable_autoscale(True) - self.qtgui_const_sink_x_0_0_0.enable_grid(False) - self.qtgui_const_sink_x_0_0_0.enable_axis_labels(True) - - - labels = ['', '', '', '', '', - '', '', '', '', ''] - widths = [1, 1, 1, 1, 1, - 1, 1, 1, 1, 1] - colors = ["blue", "red", "red", "red", "red", - "red", "red", "red", "red", "red"] - styles = [0, 0, 0, 0, 0, - 0, 0, 0, 0, 0] - markers = [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_const_sink_x_0_0_0.set_line_label(i, "Data {0}".format(i)) - else: - self.qtgui_const_sink_x_0_0_0.set_line_label(i, labels[i]) - self.qtgui_const_sink_x_0_0_0.set_line_width(i, widths[i]) - self.qtgui_const_sink_x_0_0_0.set_line_color(i, colors[i]) - self.qtgui_const_sink_x_0_0_0.set_line_style(i, styles[i]) - self.qtgui_const_sink_x_0_0_0.set_line_marker(i, markers[i]) - self.qtgui_const_sink_x_0_0_0.set_line_alpha(i, alphas[i]) - - self._qtgui_const_sink_x_0_0_0_win = sip.wrapinstance(self.qtgui_const_sink_x_0_0_0.pyqwidget(), Qt.QWidget) - self.plots_grid_layout_0.addWidget(self._qtgui_const_sink_x_0_0_0_win, 0, 1, 1, 1) - for r in range(0, 1): - self.plots_grid_layout_0.setRowStretch(r, 1) - for c in range(1, 2): - self.plots_grid_layout_0.setColumnStretch(c, 1) - self.qtgui_const_sink_x_0_0 = qtgui.const_sink_c( - 2048, #size - "Synchronized and filtered", #name - 1 #number of inputs - ) - self.qtgui_const_sink_x_0_0.set_update_time(0.10) - self.qtgui_const_sink_x_0_0.set_y_axis(-2, 2) - self.qtgui_const_sink_x_0_0.set_x_axis(-2, 2) - self.qtgui_const_sink_x_0_0.set_trigger_mode(qtgui.TRIG_MODE_FREE, qtgui.TRIG_SLOPE_POS, 0.0, 0, "") - self.qtgui_const_sink_x_0_0.enable_autoscale(True) - self.qtgui_const_sink_x_0_0.enable_grid(False) - self.qtgui_const_sink_x_0_0.enable_axis_labels(True) - - - labels = ['', '', '', '', '', - '', '', '', '', ''] - widths = [1, 1, 1, 1, 1, - 1, 1, 1, 1, 1] - colors = ["blue", "red", "red", "red", "red", - "red", "red", "red", "red", "red"] - styles = [0, 0, 0, 0, 0, - 0, 0, 0, 0, 0] - markers = [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_const_sink_x_0_0.set_line_label(i, "Data {0}".format(i)) - else: - self.qtgui_const_sink_x_0_0.set_line_label(i, labels[i]) - self.qtgui_const_sink_x_0_0.set_line_width(i, widths[i]) - self.qtgui_const_sink_x_0_0.set_line_color(i, colors[i]) - self.qtgui_const_sink_x_0_0.set_line_style(i, styles[i]) - self.qtgui_const_sink_x_0_0.set_line_marker(i, markers[i]) - self.qtgui_const_sink_x_0_0.set_line_alpha(i, alphas[i]) - - self._qtgui_const_sink_x_0_0_win = sip.wrapinstance(self.qtgui_const_sink_x_0_0.pyqwidget(), Qt.QWidget) - self.plots_grid_layout_0.addWidget(self._qtgui_const_sink_x_0_0_win, 0, 2, 1, 1) - for r in range(0, 1): - self.plots_grid_layout_0.setRowStretch(r, 1) - for c in range(2, 3): - self.plots_grid_layout_0.setColumnStretch(c, 1) - self.qtgui_const_sink_x_0 = qtgui.const_sink_c( - 1024, #size - "Sent (with ISI)", #name - 1 #number of inputs - ) - self.qtgui_const_sink_x_0.set_update_time(0.10) - self.qtgui_const_sink_x_0.set_y_axis(-2, 2) - self.qtgui_const_sink_x_0.set_x_axis(-2, 2) - self.qtgui_const_sink_x_0.set_trigger_mode(qtgui.TRIG_MODE_FREE, qtgui.TRIG_SLOPE_POS, 0.0, 0, "") - self.qtgui_const_sink_x_0.enable_autoscale(False) - self.qtgui_const_sink_x_0.enable_grid(False) - self.qtgui_const_sink_x_0.enable_axis_labels(True) - - - labels = ['', '', '', '', '', - '', '', '', '', ''] - widths = [1, 1, 1, 1, 1, - 1, 1, 1, 1, 1] - colors = ["blue", "red", "red", "red", "red", - "red", "red", "red", "red", "red"] - styles = [0, 0, 0, 0, 0, - 0, 0, 0, 0, 0] - markers = [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_const_sink_x_0.set_line_label(i, "Data {0}".format(i)) - else: - self.qtgui_const_sink_x_0.set_line_label(i, labels[i]) - self.qtgui_const_sink_x_0.set_line_width(i, widths[i]) - self.qtgui_const_sink_x_0.set_line_color(i, colors[i]) - self.qtgui_const_sink_x_0.set_line_style(i, styles[i]) - self.qtgui_const_sink_x_0.set_line_marker(i, markers[i]) - self.qtgui_const_sink_x_0.set_line_alpha(i, alphas[i]) - - self._qtgui_const_sink_x_0_win = sip.wrapinstance(self.qtgui_const_sink_x_0.pyqwidget(), Qt.QWidget) - self.plots_grid_layout_0.addWidget(self._qtgui_const_sink_x_0_win, 0, 0, 1, 1) - for r in range(0, 1): - self.plots_grid_layout_0.setRowStretch(r, 1) - for c in range(0, 1): - self.plots_grid_layout_0.setColumnStretch(c, 1) - self.digital_pfb_clock_sync_xxx_0 = digital.pfb_clock_sync_ccf(sps, timing_loop_bw, rrc_taps, nfilts, nfilts/2, 1.5, int(sps / 2)) - self.digital_map_bb_0 = digital.map_bb([0, 1, 3, 2]) - self.digital_diff_decoder_bb_0 = digital.diff_decoder_bb(4) - self.digital_costas_loop_cc_0 = digital.costas_loop_cc(phase_bw, 4, False) - self.digital_constellation_modulator_0 = digital.generic_mod( - constellation=qpsk_const, - differential=True, - samples_per_symbol=sps, - pre_diff_code=True, - excess_bw=excess_bw, - verbose=False, - log=False) - self.digital_constellation_decoder_cb_0 = digital.constellation_decoder_cb(qpsk_const) - self.digital_cma_equalizer_cc_0 = digital.cma_equalizer_cc(eq_ntaps, eq_mod, eq_gain, int(sps / 2)) - self.blocks_null_sink_0 = blocks.null_sink(gr.sizeof_char*1) - self.blocks_file_source_0 = blocks.file_source(gr.sizeof_char*1, '/home/god/Documents/Fading/hardware/QPSK/lena512color.tiff', True, 0, 0) - self.blocks_file_source_0.set_begin_tag(pmt.PMT_NIL) - - - - ################################################## - # Connections - ################################################## - self.connect((self.blocks_file_source_0, 0), (self.digital_constellation_modulator_0, 0)) - self.connect((self.digital_cma_equalizer_cc_0, 0), (self.digital_costas_loop_cc_0, 0)) - self.connect((self.digital_cma_equalizer_cc_0, 0), (self.qtgui_const_sink_x_1_0, 0)) - self.connect((self.digital_cma_equalizer_cc_0, 0), (self.qtgui_freq_sink_x_1_0_1, 0)) - self.connect((self.digital_constellation_decoder_cb_0, 0), (self.digital_diff_decoder_bb_0, 0)) - self.connect((self.digital_constellation_modulator_0, 0), (self.qtgui_const_sink_x_0, 0)) - self.connect((self.digital_constellation_modulator_0, 0), (self.qtgui_freq_sink_x_1, 0)) - self.connect((self.digital_constellation_modulator_0, 0), (self.qtgui_time_sink_x_2, 0)) - self.connect((self.digital_constellation_modulator_0, 0), (self.uhd_usrp_sink_0, 0)) - self.connect((self.digital_costas_loop_cc_0, 0), (self.digital_constellation_decoder_cb_0, 0)) - self.connect((self.digital_costas_loop_cc_0, 0), (self.qtgui_const_sink_x_2, 0)) - self.connect((self.digital_costas_loop_cc_0, 0), (self.qtgui_eye_sink_x_1, 0)) - self.connect((self.digital_costas_loop_cc_0, 0), (self.qtgui_freq_sink_x_1_0_1_0, 0)) - self.connect((self.digital_costas_loop_cc_0, 0), (self.qtgui_time_sink_x_2_0_0, 0)) - self.connect((self.digital_diff_decoder_bb_0, 0), (self.digital_map_bb_0, 0)) - self.connect((self.digital_map_bb_0, 0), (self.blocks_null_sink_0, 0)) - self.connect((self.digital_pfb_clock_sync_xxx_0, 0), (self.digital_cma_equalizer_cc_0, 0)) - self.connect((self.digital_pfb_clock_sync_xxx_0, 0), (self.qtgui_const_sink_x_0_0, 0)) - self.connect((self.digital_pfb_clock_sync_xxx_0, 0), (self.qtgui_freq_sink_x_1_0, 0)) - self.connect((self.uhd_usrp_source_0, 0), (self.digital_pfb_clock_sync_xxx_0, 0)) - self.connect((self.uhd_usrp_source_0, 0), (self.qtgui_const_sink_x_0_0_0, 0)) - self.connect((self.uhd_usrp_source_0, 0), (self.qtgui_freq_sink_x_1_0_0, 0)) - - - def closeEvent(self, event): - self.settings = Qt.QSettings("GNU Radio", "qpks") - self.settings.setValue("geometry", self.saveGeometry()) - event.accept() - - def get_sps(self): - return self.sps - - def set_sps(self, sps): - self.sps = sps - self.set_rrc_taps(firdes.root_raised_cosine(self.nfilts, self.nfilts, 1.0/float(self.sps), self.excess_bw, 45*self.nfilts)) - self.qtgui_eye_sink_x_0.set_samp_per_symbol(self.sps) - self.qtgui_eye_sink_x_1.set_samp_per_symbol(self.sps) - - def get_nfilts(self): - return self.nfilts - - def set_nfilts(self, nfilts): - self.nfilts = nfilts - self.set_rrc_taps(firdes.root_raised_cosine(self.nfilts, self.nfilts, 1.0/float(self.sps), self.excess_bw, 45*self.nfilts)) - - def get_excess_bw(self): - return self.excess_bw - - def set_excess_bw(self, excess_bw): - self.excess_bw = excess_bw - self.set_rrc_taps(firdes.root_raised_cosine(self.nfilts, self.nfilts, 1.0/float(self.sps), self.excess_bw, 45*self.nfilts)) - - def get_timing_loop_bw(self): - return self.timing_loop_bw - - def set_timing_loop_bw(self, timing_loop_bw): - self.timing_loop_bw = timing_loop_bw - self.digital_pfb_clock_sync_xxx_0.set_loop_bandwidth(self.timing_loop_bw) - - def get_samp_rate(self): - return self.samp_rate - - def set_samp_rate(self, samp_rate): - self.samp_rate = samp_rate - self.qtgui_eye_sink_x_0.set_samp_rate(self.samp_rate) - self.qtgui_eye_sink_x_1.set_samp_rate(self.samp_rate) - self.qtgui_freq_sink_x_1.set_frequency_range(0, self.samp_rate) - self.qtgui_freq_sink_x_1_0.set_frequency_range(0, self.samp_rate) - self.qtgui_freq_sink_x_1_0_0.set_frequency_range(0, self.samp_rate) - self.qtgui_freq_sink_x_1_0_1.set_frequency_range(0, self.samp_rate) - self.qtgui_freq_sink_x_1_0_1_0.set_frequency_range(0, self.samp_rate) - self.qtgui_time_sink_x_2.set_samp_rate(self.samp_rate) - self.qtgui_time_sink_x_2_0_0.set_samp_rate(self.samp_rate) - self.uhd_usrp_sink_0.set_samp_rate(self.samp_rate) - self.uhd_usrp_source_0.set_samp_rate(self.samp_rate) - - def get_rrc_taps(self): - return self.rrc_taps - - def set_rrc_taps(self, rrc_taps): - self.rrc_taps = rrc_taps - self.digital_pfb_clock_sync_xxx_0.update_taps(self.rrc_taps) - - def get_qpsk_const(self): - return self.qpsk_const - - def set_qpsk_const(self, qpsk_const): - self.qpsk_const = qpsk_const - - def get_phase_bw(self): - return self.phase_bw - - def set_phase_bw(self, phase_bw): - self.phase_bw = phase_bw - self.digital_costas_loop_cc_0.set_loop_bandwidth(self.phase_bw) - - def get_eq_ntaps(self): - return self.eq_ntaps - - def set_eq_ntaps(self, eq_ntaps): - self.eq_ntaps = eq_ntaps - - def get_eq_mod(self): - return self.eq_mod - - def set_eq_mod(self, eq_mod): - self.eq_mod = eq_mod - self.digital_cma_equalizer_cc_0.set_modulus(self.eq_mod) - - def get_eq_gain(self): - return self.eq_gain - - def set_eq_gain(self, eq_gain): - self.eq_gain = eq_gain - self.digital_cma_equalizer_cc_0.set_gain(self.eq_gain) - - - - - -def main(top_block_cls=qpks, options=None): - if gr.enable_realtime_scheduling() != gr.RT_OK: - print("Error: failed to enable real-time scheduling.") - - 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): - 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) - - def quitting(): - tb.stop() - tb.wait() - - qapp.aboutToQuit.connect(quitting) - qapp.exec_() - -if __name__ == '__main__': - main() diff --git a/notebooks/Fading.ipynb b/notebooks/Fading.ipynb new file mode 100644 index 0000000..e320893 --- /dev/null +++ b/notebooks/Fading.ipynb @@ -0,0 +1,108 @@ +{ + "cells": [ + { + "cell_type": "code", + "execution_count": 1, + "id": "e19197ba", + "metadata": {}, + "outputs": [], + "source": [ + "import numpy as np\n", + "\n", + "import matplotlib.pyplot as plt\n", + "import matplotlib.image as mpimg" + ] + }, + { + "cell_type": "markdown", + "id": "ea1a7a45", + "metadata": {}, + "source": [ + "# Simple 2 tap fading" + ] + }, + { + "cell_type": "code", + "execution_count": 2, + "id": "4465dcd9", + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "<matplotlib.collections.PathCollection at 0x7f16d0427e20>" + ] + }, + "execution_count": 2, + "metadata": {}, + "output_type": "execute_result" + }, + { + "data": { + "image/png": "iVBORw0KGgoAAAANSUhEUgAAAXwAAAD4CAYAAADvsV2wAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjMuNCwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy8QVMy6AAAACXBIWXMAAAsTAAALEwEAmpwYAAAccUlEQVR4nO3df2wc5Z0G8OfxsqgbrqpBhB9ZEoJQZEQuIm4tCMo/wLU10CtxUyhQUFF1ImrV/gGHLBkRFaioiGSdWrXiirgKXStyEH5uw4XWtIBEL3fhcGoHkytWAy1J1qikTUwL3jaO870/vJus1zOzs7uzO7+ejxTF3hnvvrM788w7777zvjQziIhI8nWFXQAREekMBb6ISEoo8EVEUkKBLyKSEgp8EZGUOCXsAng588wzbeXKlWEXQ0QkNnbv3v1HM1vqtCzSgb9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BcDGAm0le3JniBW4IwEtmtgrAS+Xf3VxpZmvj1qfZ5+d1DYBV5X+bAPywo4UMUAP756/Kn+daM/t2RwsZvH8HcLXH8sR8vhUK/ACY2W/MrN6MyZcC2Gdm75jZUQBPANjQ/tK1xQYAPy7//GMAA+EVpW38fF4bAPzE5u0C0E3y3E4XNCBJ2j99MbNXARz2WCVJny8ABX4n5QEcqPr9YPmxODrbzN4DgPL/Z7msZwBeJLmb5KaOlS4Yfj6vJH2mfrflcpJ7SP6M5OrOFC00Sfp8AWjGK99I/hLAOQ6L7jGzn/p5CofHItsn1mt7G3ia9WY2RfIsAL8g+Va5VhUHfj6vWH2mdfjZll9jfpyWD0leC6CA+eaOpErS5wtAge+bmX26xac4CGB51e/nAZhq8Tnbxmt7Sf6B5Llm9l75Evd9l+eYKv//PsnnMN9sEJfA9/N5xeozraPutpjZn6t+foHkv5I808ziOshYPUn6fAGoSaeTXgewiuQFJE8FcBOA7SGXqVnbAdxW/vk2AIuucEieRvLjlZ8BfBbzX27HhZ/PazuAr5R7c6wD8EGlqSuG6m4vyXNIsvzzpZjPjz91vKSdk6TPF4Bq+IEg+QUAPwCwFMAOkuNm1k9yGYAfmdm1ZnaM5DcBjADIAHjUzPaGWOxWbAHwJMl/ArAfwA0AUL29AM4G8Fw5H04B8B9m9vOQytswt8+L5NfKyx8G8AKAawHsAzAD4KthlbdVPrf3egBfJ3kMQAnATRbjW/VJPg7gCgBnkjwI4F4AWSB5n2+FhlYQEUkJNemIiKSEAl9EJCUU+CIiKaHAFxFJCQW+iEhKKPBFRFJCgS8ikhL/D1oH6FTHpNFEAAAAAElFTkSuQmCC\n", + "text/plain": [ + "<Figure size 432x288 with 1 Axes>" + ] + }, + "metadata": { + "needs_background": "light" + }, + "output_type": "display_data" + } + ], + "source": [ + "nsamples = 200\n", + "samp_rate = 32e3\n", + "\n", + "# QPSK modulation\n", + "samp_per_sym = 4\n", + "symbol_map = {\n", + " 0: 1 + 1j,\n", + " 1: -1 + 1j,\n", + " 2: -1 - 1j,\n", + " 3: 1 - 1j,\n", + "}\n", + "\n", + "# generate random data for testing\n", + "data = np.random.randint(low=0, high=4, size=nsamples)\n", + "\n", + "# modulate and add AWGN\n", + "noise = np.random.normal(0, .03, size=nsamples) + 1j * np.random.normal(0, .03, size=nsamples)\n", + "sig = np.array(list(map(lambda v: symbol_map[v], data))) + noise\n", + "\n", + "# add 2 tap frequency selective channel\n", + "delay = np.zeros(5 * samp_per_sym)\n", + "one = np.array([1])\n", + "taps = np.concatenate([one, delay, .2 * one])\n", + "\n", + "# apply channel\n", + "sig_fading = np.convolve(sig, taps)\n", + "\n", + "# plot figure\n", + "fig = plt.figure()\n", + "plt.scatter(sig_fading.real, sig_fading.imag)" + ] + } + ], + "metadata": { + "kernelspec": { + "display_name": "Python 3 (ipykernel)", + "language": "python", + "name": "python3" + }, + "language_info": { + "codemirror_mode": { + "name": "ipython", + "version": 3 + }, + "file_extension": ".py", + "mimetype": "text/x-python", + "name": "python", + "nbconvert_exporter": "python", + "pygments_lexer": "ipython3", + "version": "3.9.2" + } + }, + "nbformat": 4, + "nbformat_minor": 5 +} diff --git a/references/books/WsComm_LectureNotes_2021.pdf b/references/books/WsComm_LectureNotes_2021.pdf Binary files differnew file mode 100644 index 0000000..12b4af6 --- /dev/null +++ b/references/books/WsComm_LectureNotes_2021.pdf diff --git a/references/fundamentals/1993-10.pdf b/references/fundamentals/1993-10.pdf Binary files differnew file mode 100644 index 0000000..4e77426 --- /dev/null +++ b/references/fundamentals/1993-10.pdf diff --git a/references/fundamentals/An_overview_of_OFDM_and_related_techniques_towards_development_of_future_wireless_multimedia_communications.pdf b/references/fundamentals/An_overview_of_OFDM_and_related_techniques_towards_development_of_future_wireless_multimedia_communications.pdf Binary files differnew file mode 100644 index 0000000..250770d --- /dev/null +++ b/references/fundamentals/An_overview_of_OFDM_and_related_techniques_towards_development_of_future_wireless_multimedia_communications.pdf diff --git a/simulation/QAM/lena512color.tiff b/simulation/QAM/lena512color.tiff Binary files differnew file mode 100644 index 0000000..ffe5c83 --- /dev/null +++ b/simulation/QAM/lena512color.tiff diff --git a/simulation/QAM/qam.grc b/simulation/QAM/qam.grc index d74a8fb..e1d0277 100644 --- a/simulation/QAM/qam.grc +++ b/simulation/QAM/qam.grc @@ -8,9 +8,9 @@ options: description: '' gen_cmake: 'On' gen_linking: dynamic - generate_options: qt_gui + generate_options: no_gui hier_block_src_path: '.:' - id: qam + id: qam_nogui max_nouts: '0' output_language: python placement: (0,0) @@ -54,7 +54,7 @@ blocks: rot_sym: '4' soft_dec_lut: None sym_map: '[0, 1, 3, 2]' - type: 8psk + type: 16qam states: bus_sink: false bus_source: false @@ -63,24 +63,15 @@ blocks: rotation: 0 state: true - name: eq_gain - id: variable_qtgui_range + id: variable parameters: comment: '' - gui_hint: 'params@1: 0,0,1,1' - label: Equalizer Rate - min_len: '200' - orient: Qt.Horizontal - rangeType: float - start: '0' - step: '.001' - stop: '.1' - value: '.01' - widget: counter_slider + value: 10e-3 states: bus_sink: false bus_source: false bus_structure: null - coordinate: [1336, 460.0] + coordinate: [1336, 212.0] rotation: 0 state: true - name: eq_mod @@ -120,24 +111,15 @@ blocks: rotation: 0 state: true - name: freq_offset - id: variable_qtgui_range + id: variable parameters: comment: '' - gui_hint: 'params@0: 1,0,1,1' - label: Frequency Offset - min_len: '200' - orient: Qt.Horizontal - rangeType: float - start: -100e-3 - step: 1e-3 - stop: 100e-3 value: '0' - widget: counter_slider states: bus_sink: false bus_source: false bus_structure: null - coordinate: [640, 460.0] + coordinate: [736, 180.0] rotation: 0 state: true - name: nfilts @@ -153,45 +135,27 @@ blocks: rotation: 0 state: true - name: noise_volt - id: variable_qtgui_range + id: variable parameters: comment: '' - gui_hint: 'params@0: 0,0,1,1' - label: Noise Voltage - min_len: '200' - orient: Qt.Horizontal - rangeType: float - start: '0' - step: '0.01' - stop: '1' - value: '0.0001' - widget: counter_slider + value: 100e-6 states: bus_sink: false bus_source: false bus_structure: null - coordinate: [504, 460.0] + coordinate: [640, 180.0] rotation: 0 state: true - name: phase_bw - id: variable_qtgui_range + id: variable parameters: comment: '' - gui_hint: 'params@1: 1,0,1,1' - label: Phase Bandwidth - min_len: '200' - orient: Qt.Horizontal - rangeType: float - start: '0' - step: '.01' - stop: '1' value: 2 * 3.141592653589793 / 100 - widget: counter_slider states: bus_sink: false bus_source: false bus_structure: null - coordinate: [1640, 428.0] + coordinate: [1640, 188.0] rotation: 0 state: true - name: qam_const @@ -212,7 +176,7 @@ blocks: bus_sink: false bus_source: false bus_structure: null - coordinate: [224, 444.0] + coordinate: [224, 436.0] rotation: 0 state: true - name: rrc_taps @@ -252,45 +216,27 @@ blocks: rotation: 0 state: true - name: time_offset - id: variable_qtgui_range + id: variable parameters: comment: '' - gui_hint: 'params@0: 0,1,1,1' - label: Timing Offset - min_len: '200' - orient: Qt.Horizontal - rangeType: float - start: '0.999' - step: '0.0001' - stop: '1.001' - value: '1.0' - widget: counter_slider + value: '1' states: bus_sink: false bus_source: false bus_structure: null - coordinate: [504, 604.0] + coordinate: [736, 252.0] rotation: 0 state: true - name: timing_loop_bw - id: variable_qtgui_range + id: variable parameters: comment: '' - gui_hint: 'params@0: 1,1,1,1' - label: Time Bandwidth - min_len: '200' - orient: Qt.Horizontal - rangeType: float - start: '0' - step: 10e-3 - stop: 200e-3 value: 2 * 3.141592653589793 / 100 - widget: counter_slider states: bus_sink: false bus_source: false bus_structure: null - coordinate: [1008, 548.0] + coordinate: [1000, 228.0] rotation: 0 state: true - name: analog_random_source_x_0 @@ -330,40 +276,21 @@ blocks: coordinate: [2272, 276.0] rotation: 0 state: true -- name: blocks_char_to_float_0_0 - id: blocks_char_to_float - parameters: - affinity: '' - alias: '' - comment: '' - maxoutbuf: '0' - minoutbuf: '0' - scale: '1' - vlen: '1' - states: - bus_sink: false - bus_source: false - bus_structure: null - coordinate: [408, 840.0] - rotation: 0 - state: true -- name: blocks_delay_0 - id: blocks_delay +- name: blocks_null_sink_0 + id: blocks_null_sink parameters: affinity: '' alias: '' + bus_structure_sink: '[[0,],]' comment: '' - delay: '50' - maxoutbuf: '0' - minoutbuf: '0' - num_ports: '1' + num_inputs: '1' type: float vlen: '1' states: bus_sink: false bus_source: false bus_structure: null - coordinate: [2264, 844.0] + coordinate: [2488, 280.0] rotation: 0 state: true - name: blocks_throttle_0 @@ -401,22 +328,6 @@ blocks: coordinate: [2192, 436.0] rotation: 0 state: true -- name: blocks_unpack_k_bits_bb_0_0 - id: blocks_unpack_k_bits_bb - parameters: - affinity: '' - alias: '' - comment: '' - k: '2' - maxoutbuf: '0' - minoutbuf: '0' - states: - bus_sink: false - bus_source: false - bus_structure: null - coordinate: [232, 840.0] - rotation: 0 - state: true - name: channels_channel_model_0 id: channels_channel_model parameters: @@ -449,7 +360,7 @@ blocks: modulus: eq_mod mu: eq_gain num_taps: eq_ntaps - sps: '2' + sps: sps states: bus_sink: false bus_source: false @@ -556,7 +467,7 @@ blocks: max_dev: '1.5' maxoutbuf: '0' minoutbuf: '0' - osps: '2' + osps: sps sps: sps * 1.001 taps: rrc_taps type: ccf @@ -567,642 +478,20 @@ blocks: coordinate: [1000, 308.0] rotation: 0 state: true -- name: params - id: qtgui_tab_widget - parameters: - alias: '' - comment: '' - gui_hint: '' - label0: Channel - label1: Receiver - label10: Tab 10 - label11: Tab 11 - label12: Tab 12 - label13: Tab 13 - label14: Tab 14 - label15: Tab 15 - label16: Tab 16 - label17: Tab 17 - label18: Tab 18 - label19: Tab 19 - label2: Tab 2 - label3: Tab 3 - label4: Tab 4 - label5: Tab 5 - label6: Tab 6 - label7: Tab 7 - label8: Tab 8 - label9: Tab 9 - num_tabs: '2' - states: - bus_sink: false - bus_source: false - bus_structure: null - coordinate: [296, 12.0] - rotation: 0 - state: true -- name: plots - id: qtgui_tab_widget - parameters: - alias: '' - comment: '' - gui_hint: '' - label0: Constellations - label1: Frequency - label10: Tab 10 - label11: Tab 11 - label12: Tab 12 - label13: Tab 13 - label14: Tab 14 - label15: Tab 15 - label16: Tab 16 - label17: Tab 17 - label18: Tab 18 - label19: Tab 19 - label2: Time - label3: Tab 3 - label4: Tab 4 - label5: Tab 5 - label6: Tab 6 - label7: Tab 7 - label8: Tab 8 - label9: Tab 9 - num_tabs: '3' - states: - bus_sink: false - bus_source: false - bus_structure: null - coordinate: [448, 12.0] - rotation: 0 - state: true -- name: qtgui_const_sink_x_0 - id: qtgui_const_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: '"red"' - color2: '"red"' - color3: '"red"' - color4: '"red"' - color5: '"red"' - color6: '"red"' - color7: '"red"' - color8: '"red"' - color9: '"red"' - comment: '' - grid: 'False' - gui_hint: 'plots@0: 0,0,1,1' - label1: '' - label10: '' - label2: '' - label3: '' - label4: '' - label5: '' - label6: '' - label7: '' - label8: '' - label9: '' - legend: 'True' - marker1: '0' - marker10: '0' - marker2: '0' - marker3: '0' - marker4: '0' - marker5: '0' - marker6: '0' - marker7: '0' - marker8: '0' - marker9: '0' - name: '"Channel"' - nconnections: '1' - size: '2048' - style1: '0' - style10: '0' - style2: '0' - style3: '0' - style4: '0' - style5: '0' - style6: '0' - style7: '0' - style8: '0' - style9: '0' - tr_chan: '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' - xmax: '2' - xmin: '-2' - ymax: '2' - ymin: '-2' - states: - bus_sink: false - bus_source: false - bus_structure: null - coordinate: [836.0, 128] - rotation: 90 - state: enabled -- name: qtgui_const_sink_x_0_0 - id: qtgui_const_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: '"red"' - color2: '"red"' - color3: '"red"' - color4: '"red"' - color5: '"red"' - color6: '"red"' - color7: '"red"' - color8: '"red"' - color9: '"red"' - comment: '' - grid: 'False' - gui_hint: 'plots@0: 0,1,1,1' - label1: '' - label10: '' - label2: '' - label3: '' - label4: '' - label5: '' - label6: '' - label7: '' - label8: '' - label9: '' - legend: 'True' - marker1: '0' - marker10: '0' - marker2: '0' - marker3: '0' - marker4: '0' - marker5: '0' - marker6: '0' - marker7: '0' - marker8: '0' - marker9: '0' - name: '"Synchronized"' - nconnections: '1' - size: '2048' - style1: '0' - style10: '0' - style2: '0' - style3: '0' - style4: '0' - style5: '0' - style6: '0' - style7: '0' - style8: '0' - style9: '0' - tr_chan: '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' - xmax: '2' - xmin: '-2' - ymax: '2' - ymin: '-2' - states: - bus_sink: false - bus_source: false - bus_structure: null - coordinate: [1228.0, 88] - rotation: 90 - state: enabled -- name: qtgui_const_sink_x_1 - id: qtgui_const_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: '"red"' - color2: '"red"' - color3: '"red"' - color4: '"red"' - color5: '"red"' - color6: '"red"' - color7: '"red"' - color8: '"red"' - color9: '"red"' - comment: '' - grid: 'False' - gui_hint: 'plots@0: 1,0,1,1' - label1: '' - label10: '' - label2: '' - label3: '' - label4: '' - label5: '' - label6: '' - label7: '' - label8: '' - label9: '' - legend: 'True' - marker1: '0' - marker10: '0' - marker2: '0' - marker3: '0' - marker4: '0' - marker5: '0' - marker6: '0' - marker7: '0' - marker8: '0' - marker9: '0' - name: '"Equalized"' - nconnections: '1' - size: '1024' - style1: '0' - style10: '0' - style2: '0' - style3: '0' - style4: '0' - style5: '0' - style6: '0' - style7: '0' - style8: '0' - style9: '0' - tr_chan: '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' - xmax: '2' - xmin: '-2' - ymax: '2' - ymin: '-2' - states: - bus_sink: false - bus_source: false - bus_structure: null - coordinate: [1524.0, 88] - rotation: 90 - state: true -- name: qtgui_const_sink_x_2 - id: qtgui_const_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: '"red"' - color2: '"red"' - color3: '"red"' - color4: '"red"' - color5: '"red"' - color6: '"red"' - color7: '"red"' - color8: '"red"' - color9: '"red"' - comment: '' - grid: 'False' - gui_hint: 'plots@0: 1,1,1,1' - label1: '' - label10: '' - label2: '' - label3: '' - label4: '' - label5: '' - label6: '' - label7: '' - label8: '' - label9: '' - legend: 'True' - marker1: '0' - marker10: '0' - marker2: '0' - marker3: '0' - marker4: '0' - marker5: '0' - marker6: '0' - marker7: '0' - marker8: '0' - marker9: '0' - name: '"Locked"' - nconnections: '1' - size: '1024' - style1: '0' - style10: '0' - style2: '0' - style3: '0' - style4: '0' - style5: '0' - style6: '0' - style7: '0' - style8: '0' - style9: '0' - tr_chan: '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' - xmax: '2' - xmin: '-2' - ymax: '2' - ymin: '-2' - states: - bus_sink: false - bus_source: false - bus_structure: null - coordinate: [1860.0, 64] - rotation: 90 - state: true -- 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: samp_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: '1024' - freqhalf: 'True' - grid: 'False' - gui_hint: 'plots@1: 0,0,1,1' - label: Relative Gain - label1: '' - label10: '''''' - label2: '''''' - label3: '''''' - label4: '''''' - label5: '''''' - label6: '''''' - label7: '''''' - label8: '''''' - label9: '''''' - legend: 'True' - maxoutbuf: '0' - minoutbuf: '0' - name: '"Channel"' - nconnections: '1' - showports: 'False' - 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.0, 472] - rotation: 270 - state: true -- 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: 'plots@2: 0,0,1,1' - label1: Received - label10: Signal 10 - label2: Sent - label3: Signal 3 - label4: Signal 4 - label5: Signal 5 - label6: Signal 6 - label7: Signal 7 - label8: Signal 8 - label9: Signal 9 - legend: 'True' - marker1: '-1' - marker10: '-1' - marker2: '-1' - marker3: '-1' - marker4: '-1' - marker5: '-1' - marker6: '-1' - marker7: '-1' - marker8: '-1' - marker9: '-1' - name: '"Decoded"' - nconnections: '2' - size: '1024' - srate: samp_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: 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: [2504, 268.0] - rotation: 0 - state: true connections: -- [analog_random_source_x_0, '0', blocks_unpack_k_bits_bb_0_0, '0'] - [analog_random_source_x_0, '0', digital_constellation_modulator_0, '0'] -- [blocks_char_to_float_0, '0', qtgui_time_sink_x_0, '0'] -- [blocks_char_to_float_0_0, '0', blocks_delay_0, '0'] -- [blocks_delay_0, '0', qtgui_time_sink_x_0, '1'] +- [blocks_char_to_float_0, '0', blocks_null_sink_0, '0'] - [blocks_throttle_0, '0', channels_channel_model_0, '0'] - [blocks_unpack_k_bits_bb_0, '0', blocks_char_to_float_0, '0'] -- [blocks_unpack_k_bits_bb_0_0, '0', blocks_char_to_float_0_0, '0'] - [channels_channel_model_0, '0', digital_pfb_clock_sync_xxx_0, '0'] -- [channels_channel_model_0, '0', qtgui_const_sink_x_0, '0'] -- [channels_channel_model_0, '0', qtgui_freq_sink_x_0, '0'] - [digital_cma_equalizer_cc_0, '0', digital_costas_loop_cc_0, '0'] -- [digital_cma_equalizer_cc_0, '0', qtgui_const_sink_x_1, '0'] - [digital_constellation_decoder_cb_0, '0', digital_diff_decoder_bb_0, '0'] - [digital_constellation_modulator_0, '0', blocks_throttle_0, '0'] - [digital_costas_loop_cc_0, '0', digital_constellation_decoder_cb_0, '0'] -- [digital_costas_loop_cc_0, '0', qtgui_const_sink_x_2, '0'] - [digital_diff_decoder_bb_0, '0', digital_map_bb_0, '0'] - [digital_map_bb_0, '0', blocks_unpack_k_bits_bb_0, '0'] - [digital_pfb_clock_sync_xxx_0, '0', digital_cma_equalizer_cc_0, '0'] -- [digital_pfb_clock_sync_xxx_0, '0', qtgui_const_sink_x_0_0, '0'] metadata: file_format: 1 diff --git a/simulation/QAM/qam.py b/simulation/QAM/qam.py index 8977787..d64a687 100755 --- a/simulation/QAM/qam.py +++ b/simulation/QAM/qam.py @@ -90,7 +90,7 @@ class qam(gr.top_block, Qt.QWidget): self.eq_ntaps = eq_ntaps = 15 self.eq_mod = eq_mod = 1 self.eq_gain = eq_gain = .01 - self.const = const = digital.constellation_8psk().base() + self.const = const = digital.constellation_16qam().base() self.chn_taps = chn_taps = [1.0 + 0.0j, ] ################################################## @@ -438,7 +438,7 @@ class qam(gr.top_block, Qt.QWidget): self.plots_grid_layout_0.setRowStretch(r, 1) for c in range(0, 1): self.plots_grid_layout_0.setColumnStretch(c, 1) - self.digital_pfb_clock_sync_xxx_0 = digital.pfb_clock_sync_ccf(sps * 1.001, timing_loop_bw, rrc_taps, nfilts, nfilts/2, 1.5, 2) + self.digital_pfb_clock_sync_xxx_0 = digital.pfb_clock_sync_ccf(sps * 1.001, timing_loop_bw, rrc_taps, nfilts, nfilts/2, 1.5, sps) self.digital_map_bb_0 = digital.map_bb([0, 1, 3, 2]) self.digital_diff_decoder_bb_0 = digital.diff_decoder_bb(4) self.digital_costas_loop_cc_0 = digital.costas_loop_cc(phase_bw, 4, False) @@ -451,7 +451,7 @@ class qam(gr.top_block, Qt.QWidget): verbose=False, log=False) self.digital_constellation_decoder_cb_0 = digital.constellation_decoder_cb(const) - self.digital_cma_equalizer_cc_0 = digital.cma_equalizer_cc(eq_ntaps, eq_mod, eq_gain, 2) + self.digital_cma_equalizer_cc_0 = digital.cma_equalizer_cc(eq_ntaps, eq_mod, eq_gain, sps) self.channels_channel_model_0 = channels.channel_model( noise_voltage=noise_volt, frequency_offset=freq_offset, diff --git a/simulation/QAM/qam_nogui.grc b/simulation/QAM/qam_nogui.grc new file mode 100644 index 0000000..1264e80 --- /dev/null +++ b/simulation/QAM/qam_nogui.grc @@ -0,0 +1,1208 @@ +options: + parameters: + author: Pross Naoki, Halter Sara Cinzia + category: '[GRC Hier Blocks]' + cmake_opt: '' + comment: '' + copyright: '' + description: '' + gen_cmake: 'On' + gen_linking: dynamic + generate_options: qt_gui + hier_block_src_path: '.:' + id: qam + max_nouts: '0' + output_language: python + placement: (0,0) + qt_qss_theme: '' + realtime_scheduling: '1' + run: 'True' + run_command: '{python} -u {filename}' + run_options: prompt + sizing_mode: fixed + thread_safe_setters: '' + title: QAM + window_size: '' + states: + bus_sink: false + bus_source: false + bus_structure: null + coordinate: [8, 8] + rotation: 0 + state: enabled + +blocks: +- name: chn_taps + id: variable + parameters: + comment: '' + value: '[1.0 + 0.0j, ]' + states: + bus_sink: false + bus_source: false + bus_structure: null + coordinate: [640, 252.0] + rotation: 0 + state: true +- name: const + id: variable_constellation + parameters: + comment: '' + const_points: '[-1-1j, -1+1j, 1+1j, 1-1j]' + dims: '1' + precision: '8' + rot_sym: '4' + soft_dec_lut: None + sym_map: '[0, 1, 3, 2]' + type: 16qam + states: + bus_sink: false + bus_source: false + bus_structure: null + coordinate: [224, 604.0] + rotation: 0 + state: true +- name: eq_gain + id: variable_qtgui_range + parameters: + comment: '' + gui_hint: 'params@1: 0,0,1,1' + label: Equalizer Rate + min_len: '200' + orient: Qt.Horizontal + rangeType: float + start: '0' + step: '.001' + stop: '.1' + value: '.01' + widget: counter_slider + states: + bus_sink: false + bus_source: false + bus_structure: null + coordinate: [1336, 460.0] + rotation: 0 + state: true +- name: eq_mod + id: variable + parameters: + comment: '' + value: '1' + states: + bus_sink: false + bus_source: false + bus_structure: null + coordinate: [1336, 388.0] + rotation: 0 + state: true +- name: eq_ntaps + id: variable + parameters: + comment: '' + value: '15' + states: + bus_sink: false + bus_source: false + bus_structure: null + coordinate: [1416, 388.0] + rotation: 0 + state: true +- name: excess_bw + id: variable + parameters: + comment: '' + value: 350e-3 + states: + bus_sink: false + bus_source: false + bus_structure: null + coordinate: [320, 268.0] + rotation: 0 + state: true +- name: freq_offset + id: variable_qtgui_range + parameters: + comment: '' + gui_hint: 'params@0: 1,0,1,1' + label: Frequency Offset + min_len: '200' + orient: Qt.Horizontal + rangeType: float + start: -100e-3 + step: 1e-3 + stop: 100e-3 + value: '0' + widget: counter_slider + states: + bus_sink: false + bus_source: false + bus_structure: null + coordinate: [640, 460.0] + rotation: 0 + state: true +- name: nfilts + id: variable + parameters: + comment: '' + value: '32' + states: + bus_sink: false + bus_source: false + bus_structure: null + coordinate: [1008, 476.0] + rotation: 0 + state: true +- name: noise_volt + id: variable_qtgui_range + parameters: + comment: '' + gui_hint: 'params@0: 0,0,1,1' + label: Noise Voltage + min_len: '200' + orient: Qt.Horizontal + rangeType: float + start: '0' + step: '0.01' + stop: '1' + value: '0.0001' + widget: counter_slider + states: + bus_sink: false + bus_source: false + bus_structure: null + coordinate: [504, 460.0] + rotation: 0 + state: true +- name: phase_bw + id: variable_qtgui_range + parameters: + comment: '' + gui_hint: 'params@1: 1,0,1,1' + label: Phase Bandwidth + min_len: '200' + orient: Qt.Horizontal + rangeType: float + start: '0' + step: '.01' + stop: '1' + value: 2 * 3.141592653589793 / 100 + widget: counter_slider + states: + bus_sink: false + bus_source: false + bus_structure: null + coordinate: [1640, 428.0] + rotation: 0 + state: true +- name: qam_const + id: variable_constellation_rect + parameters: + comment: '' + const_points: '[(-3-3j), (-1-3j), (1-3j), (3-3j), (-3-1j), (-1-1j), (1-1j), (3-1j), + (-3+1j), (-1+1j), (1+1j), (3+1j), (-3+3j), (-1+3j), (1+3j), (3+3j)]' + imag_sect: '1' + precision: '4' + real_sect: '1' + rot_sym: '4' + soft_dec_lut: None + sym_map: '[0, 4, 12, 8, 1, 5, 13, 9, 3, 7, 15, 11, 2, 6, 14, 10]' + w_imag_sect: '1' + w_real_sect: '1' + states: + bus_sink: false + bus_source: false + bus_structure: null + coordinate: [224, 436.0] + rotation: 0 + state: true +- name: rrc_taps + id: variable + parameters: + comment: '' + value: firdes.root_raised_cosine(nfilts, nfilts, 1.0/float(sps), excess_bw, 45*nfilts) + states: + bus_sink: false + bus_source: false + bus_structure: null + coordinate: [1080, 476.0] + rotation: 0 + state: true +- name: samp_rate + id: variable + parameters: + comment: '' + value: '32000' + states: + bus_sink: false + bus_source: false + bus_structure: null + coordinate: [192, 12.0] + rotation: 0 + state: enabled +- name: sps + id: variable + parameters: + comment: '' + value: '4' + states: + bus_sink: false + bus_source: false + bus_structure: null + coordinate: [224, 268.0] + rotation: 0 + state: true +- name: time_offset + id: variable_qtgui_range + parameters: + comment: '' + gui_hint: 'params@0: 0,1,1,1' + label: Timing Offset + min_len: '200' + orient: Qt.Horizontal + rangeType: float + start: '0.999' + step: '0.0001' + stop: '1.001' + value: '1.0' + widget: counter_slider + states: + bus_sink: false + bus_source: false + bus_structure: null + coordinate: [504, 604.0] + rotation: 0 + state: true +- name: timing_loop_bw + id: variable_qtgui_range + parameters: + comment: '' + gui_hint: 'params@0: 1,1,1,1' + label: Time Bandwidth + min_len: '200' + orient: Qt.Horizontal + rangeType: float + start: '0' + step: 10e-3 + stop: 200e-3 + value: 2 * 3.141592653589793 / 100 + widget: counter_slider + states: + bus_sink: false + bus_source: false + bus_structure: null + coordinate: [1008, 548.0] + rotation: 0 + state: true +- name: analog_random_source_x_0 + id: analog_random_source_x + parameters: + affinity: '' + alias: '' + comment: '' + max: '256' + maxoutbuf: '0' + min: '0' + minoutbuf: '0' + num_samps: '1000' + repeat: 'True' + type: byte + states: + bus_sink: false + bus_source: false + bus_structure: null + coordinate: [32, 332.0] + rotation: 0 + state: enabled +- name: blocks_char_to_float_0 + id: blocks_char_to_float + parameters: + affinity: '' + alias: '' + comment: '' + maxoutbuf: '0' + minoutbuf: '0' + scale: '1' + vlen: '1' + states: + bus_sink: false + bus_source: false + bus_structure: null + coordinate: [2272, 276.0] + rotation: 0 + state: true +- name: blocks_char_to_float_0_0 + id: blocks_char_to_float + parameters: + affinity: '' + alias: '' + comment: '' + maxoutbuf: '0' + minoutbuf: '0' + scale: '1' + vlen: '1' + states: + bus_sink: false + bus_source: false + bus_structure: null + coordinate: [408, 840.0] + rotation: 0 + state: true +- name: blocks_delay_0 + id: blocks_delay + parameters: + affinity: '' + alias: '' + comment: '' + delay: '50' + maxoutbuf: '0' + minoutbuf: '0' + num_ports: '1' + type: float + vlen: '1' + states: + bus_sink: false + bus_source: false + bus_structure: null + coordinate: [2264, 844.0] + rotation: 0 + state: true +- name: blocks_throttle_0 + id: blocks_throttle + parameters: + affinity: '' + alias: '' + comment: '' + ignoretag: 'True' + maxoutbuf: '0' + minoutbuf: '0' + samples_per_second: samp_rate + type: complex + vlen: '1' + states: + bus_sink: false + bus_source: false + bus_structure: null + coordinate: [464, 356.0] + rotation: 0 + state: enabled +- name: blocks_unpack_k_bits_bb_0 + id: blocks_unpack_k_bits_bb + parameters: + affinity: '' + alias: '' + comment: '' + k: '2' + maxoutbuf: '0' + minoutbuf: '0' + states: + bus_sink: false + bus_source: false + bus_structure: null + coordinate: [2192, 436.0] + rotation: 0 + state: true +- name: blocks_unpack_k_bits_bb_0_0 + id: blocks_unpack_k_bits_bb + parameters: + affinity: '' + alias: '' + comment: '' + k: '2' + maxoutbuf: '0' + minoutbuf: '0' + states: + bus_sink: false + bus_source: false + bus_structure: null + coordinate: [232, 840.0] + rotation: 0 + state: true +- name: channels_channel_model_0 + id: channels_channel_model + parameters: + affinity: '' + alias: '' + block_tags: 'False' + comment: '' + epsilon: time_offset + freq_offset: freq_offset + maxoutbuf: '0' + minoutbuf: '0' + noise_voltage: noise_volt + seed: '0' + taps: chn_taps + states: + bus_sink: false + bus_source: false + bus_structure: null + coordinate: [640, 316.0] + rotation: 0 + state: enabled +- name: digital_cma_equalizer_cc_0 + id: digital_cma_equalizer_cc + parameters: + affinity: '' + alias: '' + comment: '' + maxoutbuf: '0' + minoutbuf: '0' + modulus: eq_mod + mu: eq_gain + num_taps: eq_ntaps + sps: sps + states: + bus_sink: false + bus_source: false + bus_structure: null + coordinate: [1336, 284.0] + rotation: 0 + state: true +- name: digital_constellation_decoder_cb_0 + id: digital_constellation_decoder_cb + parameters: + affinity: '' + alias: '' + comment: '' + constellation: const + maxoutbuf: '0' + minoutbuf: '0' + states: + bus_sink: false + bus_source: false + bus_structure: null + coordinate: [1976, 276.0] + rotation: 0 + state: true +- name: digital_constellation_modulator_0 + id: digital_constellation_modulator + parameters: + affinity: '' + alias: '' + comment: '' + constellation: const + differential: 'True' + excess_bw: excess_bw + log: 'False' + maxoutbuf: '0' + minoutbuf: '0' + samples_per_symbol: sps + verbose: 'False' + states: + bus_sink: false + bus_source: false + bus_structure: null + coordinate: [224, 332.0] + rotation: 0 + state: enabled +- name: digital_costas_loop_cc_0 + id: digital_costas_loop_cc + parameters: + affinity: '' + alias: '' + comment: '' + maxoutbuf: '0' + minoutbuf: '0' + order: '4' + use_snr: 'False' + w: phase_bw + states: + bus_sink: false + bus_source: false + bus_structure: null + coordinate: [1640, 280.0] + rotation: 0 + state: true +- name: digital_diff_decoder_bb_0 + id: digital_diff_decoder_bb + parameters: + affinity: '' + alias: '' + comment: '' + maxoutbuf: '0' + minoutbuf: '0' + modulus: '4' + states: + bus_sink: false + bus_source: false + bus_structure: null + coordinate: [1976, 348.0] + rotation: 180 + state: true +- name: digital_map_bb_0 + id: digital_map_bb + parameters: + affinity: '' + alias: '' + comment: '' + map: '[0, 1, 3, 2]' + maxoutbuf: '0' + minoutbuf: '0' + states: + bus_sink: false + bus_source: false + bus_structure: null + coordinate: [1984, 436.0] + rotation: 0 + state: true +- name: digital_pfb_clock_sync_xxx_0 + id: digital_pfb_clock_sync_xxx + parameters: + affinity: '' + alias: '' + comment: '' + filter_size: nfilts + init_phase: nfilts/2 + loop_bw: timing_loop_bw + max_dev: '1.5' + maxoutbuf: '0' + minoutbuf: '0' + osps: sps + sps: sps * 1.001 + taps: rrc_taps + type: ccf + states: + bus_sink: false + bus_source: false + bus_structure: null + coordinate: [1000, 308.0] + rotation: 0 + state: true +- name: params + id: qtgui_tab_widget + parameters: + alias: '' + comment: '' + gui_hint: '' + label0: Channel + label1: Receiver + label10: Tab 10 + label11: Tab 11 + label12: Tab 12 + label13: Tab 13 + label14: Tab 14 + label15: Tab 15 + label16: Tab 16 + label17: Tab 17 + label18: Tab 18 + label19: Tab 19 + label2: Tab 2 + label3: Tab 3 + label4: Tab 4 + label5: Tab 5 + label6: Tab 6 + label7: Tab 7 + label8: Tab 8 + label9: Tab 9 + num_tabs: '2' + states: + bus_sink: false + bus_source: false + bus_structure: null + coordinate: [296, 12.0] + rotation: 0 + state: true +- name: plots + id: qtgui_tab_widget + parameters: + alias: '' + comment: '' + gui_hint: '' + label0: Constellations + label1: Frequency + label10: Tab 10 + label11: Tab 11 + label12: Tab 12 + label13: Tab 13 + label14: Tab 14 + label15: Tab 15 + label16: Tab 16 + label17: Tab 17 + label18: Tab 18 + label19: Tab 19 + label2: Time + label3: Tab 3 + label4: Tab 4 + label5: Tab 5 + label6: Tab 6 + label7: Tab 7 + label8: Tab 8 + label9: Tab 9 + num_tabs: '3' + states: + bus_sink: false + bus_source: false + bus_structure: null + coordinate: [448, 12.0] + rotation: 0 + state: true +- name: qtgui_const_sink_x_0 + id: qtgui_const_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: '"red"' + color2: '"red"' + color3: '"red"' + color4: '"red"' + color5: '"red"' + color6: '"red"' + color7: '"red"' + color8: '"red"' + color9: '"red"' + comment: '' + grid: 'False' + gui_hint: 'plots@0: 0,0,1,1' + label1: '' + label10: '' + label2: '' + label3: '' + label4: '' + label5: '' + label6: '' + label7: '' + label8: '' + label9: '' + legend: 'True' + marker1: '0' + marker10: '0' + marker2: '0' + marker3: '0' + marker4: '0' + marker5: '0' + marker6: '0' + marker7: '0' + marker8: '0' + marker9: '0' + name: '"Channel"' + nconnections: '1' + size: '2048' + style1: '0' + style10: '0' + style2: '0' + style3: '0' + style4: '0' + style5: '0' + style6: '0' + style7: '0' + style8: '0' + style9: '0' + tr_chan: '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' + xmax: '2' + xmin: '-2' + ymax: '2' + ymin: '-2' + states: + bus_sink: false + bus_source: false + bus_structure: null + coordinate: [836.0, 128] + rotation: 90 + state: enabled +- name: qtgui_const_sink_x_0_0 + id: qtgui_const_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: '"red"' + color2: '"red"' + color3: '"red"' + color4: '"red"' + color5: '"red"' + color6: '"red"' + color7: '"red"' + color8: '"red"' + color9: '"red"' + comment: '' + grid: 'False' + gui_hint: 'plots@0: 0,1,1,1' + label1: '' + label10: '' + label2: '' + label3: '' + label4: '' + label5: '' + label6: '' + label7: '' + label8: '' + label9: '' + legend: 'True' + marker1: '0' + marker10: '0' + marker2: '0' + marker3: '0' + marker4: '0' + marker5: '0' + marker6: '0' + marker7: '0' + marker8: '0' + marker9: '0' + name: '"Synchronized"' + nconnections: '1' + size: '2048' + style1: '0' + style10: '0' + style2: '0' + style3: '0' + style4: '0' + style5: '0' + style6: '0' + style7: '0' + style8: '0' + style9: '0' + tr_chan: '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' + xmax: '2' + xmin: '-2' + ymax: '2' + ymin: '-2' + states: + bus_sink: false + bus_source: false + bus_structure: null + coordinate: [1228.0, 88] + rotation: 90 + state: enabled +- name: qtgui_const_sink_x_1 + id: qtgui_const_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: '"red"' + color2: '"red"' + color3: '"red"' + color4: '"red"' + color5: '"red"' + color6: '"red"' + color7: '"red"' + color8: '"red"' + color9: '"red"' + comment: '' + grid: 'False' + gui_hint: 'plots@0: 1,0,1,1' + label1: '' + label10: '' + label2: '' + label3: '' + label4: '' + label5: '' + label6: '' + label7: '' + label8: '' + label9: '' + legend: 'True' + marker1: '0' + marker10: '0' + marker2: '0' + marker3: '0' + marker4: '0' + marker5: '0' + marker6: '0' + marker7: '0' + marker8: '0' + marker9: '0' + name: '"Equalized"' + nconnections: '1' + size: '1024' + style1: '0' + style10: '0' + style2: '0' + style3: '0' + style4: '0' + style5: '0' + style6: '0' + style7: '0' + style8: '0' + style9: '0' + tr_chan: '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' + xmax: '2' + xmin: '-2' + ymax: '2' + ymin: '-2' + states: + bus_sink: false + bus_source: false + bus_structure: null + coordinate: [1524.0, 88] + rotation: 90 + state: true +- name: qtgui_const_sink_x_2 + id: qtgui_const_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: '"red"' + color2: '"red"' + color3: '"red"' + color4: '"red"' + color5: '"red"' + color6: '"red"' + color7: '"red"' + color8: '"red"' + color9: '"red"' + comment: '' + grid: 'False' + gui_hint: 'plots@0: 1,1,1,1' + label1: '' + label10: '' + label2: '' + label3: '' + label4: '' + label5: '' + label6: '' + label7: '' + label8: '' + label9: '' + legend: 'True' + marker1: '0' + marker10: '0' + marker2: '0' + marker3: '0' + marker4: '0' + marker5: '0' + marker6: '0' + marker7: '0' + marker8: '0' + marker9: '0' + name: '"Locked"' + nconnections: '1' + size: '1024' + style1: '0' + style10: '0' + style2: '0' + style3: '0' + style4: '0' + style5: '0' + style6: '0' + style7: '0' + style8: '0' + style9: '0' + tr_chan: '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' + xmax: '2' + xmin: '-2' + ymax: '2' + ymin: '-2' + states: + bus_sink: false + bus_source: false + bus_structure: null + coordinate: [1860.0, 64] + rotation: 90 + state: true +- 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: samp_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: '1024' + freqhalf: 'True' + grid: 'False' + gui_hint: 'plots@1: 0,0,1,1' + label: Relative Gain + label1: '' + label10: '''''' + label2: '''''' + label3: '''''' + label4: '''''' + label5: '''''' + label6: '''''' + label7: '''''' + label8: '''''' + label9: '''''' + legend: 'True' + maxoutbuf: '0' + minoutbuf: '0' + name: '"Channel"' + nconnections: '1' + showports: 'False' + 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.0, 472] + rotation: 270 + state: true +- 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: 'plots@2: 0,0,1,1' + label1: Received + label10: Signal 10 + label2: Sent + label3: Signal 3 + label4: Signal 4 + label5: Signal 5 + label6: Signal 6 + label7: Signal 7 + label8: Signal 8 + label9: Signal 9 + legend: 'True' + marker1: '-1' + marker10: '-1' + marker2: '-1' + marker3: '-1' + marker4: '-1' + marker5: '-1' + marker6: '-1' + marker7: '-1' + marker8: '-1' + marker9: '-1' + name: '"Decoded"' + nconnections: '2' + size: '1024' + srate: samp_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: 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: [2504, 268.0] + rotation: 0 + state: true + +connections: +- [analog_random_source_x_0, '0', blocks_unpack_k_bits_bb_0_0, '0'] +- [analog_random_source_x_0, '0', digital_constellation_modulator_0, '0'] +- [blocks_char_to_float_0, '0', qtgui_time_sink_x_0, '0'] +- [blocks_char_to_float_0_0, '0', blocks_delay_0, '0'] +- [blocks_delay_0, '0', qtgui_time_sink_x_0, '1'] +- [blocks_throttle_0, '0', channels_channel_model_0, '0'] +- [blocks_unpack_k_bits_bb_0, '0', blocks_char_to_float_0, '0'] +- [blocks_unpack_k_bits_bb_0_0, '0', blocks_char_to_float_0_0, '0'] +- [channels_channel_model_0, '0', digital_pfb_clock_sync_xxx_0, '0'] +- [channels_channel_model_0, '0', qtgui_const_sink_x_0, '0'] +- [channels_channel_model_0, '0', qtgui_freq_sink_x_0, '0'] +- [digital_cma_equalizer_cc_0, '0', digital_costas_loop_cc_0, '0'] +- [digital_cma_equalizer_cc_0, '0', qtgui_const_sink_x_1, '0'] +- [digital_constellation_decoder_cb_0, '0', digital_diff_decoder_bb_0, '0'] +- [digital_constellation_modulator_0, '0', blocks_throttle_0, '0'] +- [digital_costas_loop_cc_0, '0', digital_constellation_decoder_cb_0, '0'] +- [digital_costas_loop_cc_0, '0', qtgui_const_sink_x_2, '0'] +- [digital_diff_decoder_bb_0, '0', digital_map_bb_0, '0'] +- [digital_map_bb_0, '0', blocks_unpack_k_bits_bb_0, '0'] +- [digital_pfb_clock_sync_xxx_0, '0', digital_cma_equalizer_cc_0, '0'] +- [digital_pfb_clock_sync_xxx_0, '0', qtgui_const_sink_x_0_0, '0'] + +metadata: + file_format: 1 diff --git a/simulation/QAM/qam_nogui.py b/simulation/QAM/qam_nogui.py new file mode 100755 index 0000000..67ee236 --- /dev/null +++ b/simulation/QAM/qam_nogui.py @@ -0,0 +1,238 @@ +#!/usr/bin/env python3 +# -*- coding: utf-8 -*- + +# +# SPDX-License-Identifier: GPL-3.0 +# +# GNU Radio Python Flow Graph +# Title: QAM +# Author: Pross Naoki, Halter Sara Cinzia +# GNU Radio version: 3.8.2.0 + +from gnuradio import blocks +import numpy +from gnuradio import channels +from gnuradio.filter import firdes +from gnuradio import digital +from gnuradio import gr +import sys +import signal +from argparse import ArgumentParser +from gnuradio.eng_arg import eng_float, intx +from gnuradio import eng_notation + + +class qam_nogui(gr.top_block): + + def __init__(self): + gr.top_block.__init__(self, "QAM") + + ################################################## + # Variables + ################################################## + self.sps = sps = 4 + self.nfilts = nfilts = 32 + self.excess_bw = excess_bw = 350e-3 + self.timing_loop_bw = timing_loop_bw = 2 * 3.141592653589793 / 100 + self.time_offset = time_offset = 1 + self.samp_rate = samp_rate = 32000 + self.rrc_taps = rrc_taps = firdes.root_raised_cosine(nfilts, nfilts, 1.0/float(sps), excess_bw, 45*nfilts) + self.qam_const = qam_const = digital.constellation_rect([(-3-3j), (-1-3j), (1-3j), (3-3j), (-3-1j), (-1-1j), (1-1j), (3-1j), (-3+1j), (-1+1j), (1+1j), (3+1j), (-3+3j), (-1+3j), (1+3j), (3+3j)], [0, 4, 12, 8, 1, 5, 13, 9, 3, 7, 15, 11, 2, 6, 14, 10], + 4, 1, 1, 1, 1).base() + self.phase_bw = phase_bw = 2 * 3.141592653589793 / 100 + self.noise_volt = noise_volt = 100e-6 + self.freq_offset = freq_offset = 0 + self.eq_ntaps = eq_ntaps = 15 + self.eq_mod = eq_mod = 1 + self.eq_gain = eq_gain = 10e-3 + self.const = const = digital.constellation_16qam().base() + self.chn_taps = chn_taps = [1.0 + 0.0j, ] + + ################################################## + # Blocks + ################################################## + self.digital_pfb_clock_sync_xxx_0 = digital.pfb_clock_sync_ccf(sps * 1.001, timing_loop_bw, rrc_taps, nfilts, nfilts/2, 1.5, sps) + self.digital_map_bb_0 = digital.map_bb([0, 1, 3, 2]) + self.digital_diff_decoder_bb_0 = digital.diff_decoder_bb(4) + self.digital_costas_loop_cc_0 = digital.costas_loop_cc(phase_bw, 4, False) + self.digital_constellation_modulator_0 = digital.generic_mod( + constellation=const, + differential=True, + samples_per_symbol=sps, + pre_diff_code=True, + excess_bw=excess_bw, + verbose=False, + log=False) + self.digital_constellation_decoder_cb_0 = digital.constellation_decoder_cb(const) + self.digital_cma_equalizer_cc_0 = digital.cma_equalizer_cc(eq_ntaps, eq_mod, eq_gain, sps) + self.channels_channel_model_0 = channels.channel_model( + noise_voltage=noise_volt, + frequency_offset=freq_offset, + epsilon=time_offset, + taps=chn_taps, + noise_seed=0, + block_tags=False) + self.blocks_unpack_k_bits_bb_0 = blocks.unpack_k_bits_bb(2) + self.blocks_throttle_0 = blocks.throttle(gr.sizeof_gr_complex*1, samp_rate,True) + self.blocks_null_sink_0 = blocks.null_sink(gr.sizeof_float*1) + self.blocks_char_to_float_0 = blocks.char_to_float(1, 1) + self.analog_random_source_x_0 = blocks.vector_source_b(list(map(int, numpy.random.randint(0, 256, 1000))), True) + + + + ################################################## + # Connections + ################################################## + self.connect((self.analog_random_source_x_0, 0), (self.digital_constellation_modulator_0, 0)) + self.connect((self.blocks_char_to_float_0, 0), (self.blocks_null_sink_0, 0)) + self.connect((self.blocks_throttle_0, 0), (self.channels_channel_model_0, 0)) + self.connect((self.blocks_unpack_k_bits_bb_0, 0), (self.blocks_char_to_float_0, 0)) + self.connect((self.channels_channel_model_0, 0), (self.digital_pfb_clock_sync_xxx_0, 0)) + self.connect((self.digital_cma_equalizer_cc_0, 0), (self.digital_costas_loop_cc_0, 0)) + self.connect((self.digital_constellation_decoder_cb_0, 0), (self.digital_diff_decoder_bb_0, 0)) + self.connect((self.digital_constellation_modulator_0, 0), (self.blocks_throttle_0, 0)) + self.connect((self.digital_costas_loop_cc_0, 0), (self.digital_constellation_decoder_cb_0, 0)) + self.connect((self.digital_diff_decoder_bb_0, 0), (self.digital_map_bb_0, 0)) + self.connect((self.digital_map_bb_0, 0), (self.blocks_unpack_k_bits_bb_0, 0)) + self.connect((self.digital_pfb_clock_sync_xxx_0, 0), (self.digital_cma_equalizer_cc_0, 0)) + + + def get_sps(self): + return self.sps + + def set_sps(self, sps): + self.sps = sps + self.set_rrc_taps(firdes.root_raised_cosine(self.nfilts, self.nfilts, 1.0/float(self.sps), self.excess_bw, 45*self.nfilts)) + + def get_nfilts(self): + return self.nfilts + + def set_nfilts(self, nfilts): + self.nfilts = nfilts + self.set_rrc_taps(firdes.root_raised_cosine(self.nfilts, self.nfilts, 1.0/float(self.sps), self.excess_bw, 45*self.nfilts)) + + def get_excess_bw(self): + return self.excess_bw + + def set_excess_bw(self, excess_bw): + self.excess_bw = excess_bw + self.set_rrc_taps(firdes.root_raised_cosine(self.nfilts, self.nfilts, 1.0/float(self.sps), self.excess_bw, 45*self.nfilts)) + + def get_timing_loop_bw(self): + return self.timing_loop_bw + + def set_timing_loop_bw(self, timing_loop_bw): + self.timing_loop_bw = timing_loop_bw + self.digital_pfb_clock_sync_xxx_0.set_loop_bandwidth(self.timing_loop_bw) + + def get_time_offset(self): + return self.time_offset + + def set_time_offset(self, time_offset): + self.time_offset = time_offset + self.channels_channel_model_0.set_timing_offset(self.time_offset) + + def get_samp_rate(self): + return self.samp_rate + + def set_samp_rate(self, samp_rate): + self.samp_rate = samp_rate + self.blocks_throttle_0.set_sample_rate(self.samp_rate) + + def get_rrc_taps(self): + return self.rrc_taps + + def set_rrc_taps(self, rrc_taps): + self.rrc_taps = rrc_taps + self.digital_pfb_clock_sync_xxx_0.update_taps(self.rrc_taps) + + def get_qam_const(self): + return self.qam_const + + def set_qam_const(self, qam_const): + self.qam_const = qam_const + + def get_phase_bw(self): + return self.phase_bw + + def set_phase_bw(self, phase_bw): + self.phase_bw = phase_bw + self.digital_costas_loop_cc_0.set_loop_bandwidth(self.phase_bw) + + def get_noise_volt(self): + return self.noise_volt + + def set_noise_volt(self, noise_volt): + self.noise_volt = noise_volt + self.channels_channel_model_0.set_noise_voltage(self.noise_volt) + + def get_freq_offset(self): + return self.freq_offset + + def set_freq_offset(self, freq_offset): + self.freq_offset = freq_offset + self.channels_channel_model_0.set_frequency_offset(self.freq_offset) + + def get_eq_ntaps(self): + return self.eq_ntaps + + def set_eq_ntaps(self, eq_ntaps): + self.eq_ntaps = eq_ntaps + + def get_eq_mod(self): + return self.eq_mod + + def set_eq_mod(self, eq_mod): + self.eq_mod = eq_mod + self.digital_cma_equalizer_cc_0.set_modulus(self.eq_mod) + + def get_eq_gain(self): + return self.eq_gain + + def set_eq_gain(self, eq_gain): + self.eq_gain = eq_gain + self.digital_cma_equalizer_cc_0.set_gain(self.eq_gain) + + def get_const(self): + return self.const + + def set_const(self, const): + self.const = const + + def get_chn_taps(self): + return self.chn_taps + + def set_chn_taps(self, chn_taps): + self.chn_taps = chn_taps + self.channels_channel_model_0.set_taps(self.chn_taps) + + + + + +def main(top_block_cls=qam_nogui, options=None): + if gr.enable_realtime_scheduling() != gr.RT_OK: + print("Error: failed to enable real-time scheduling.") + 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/simulation/QPSK/qpks.py b/simulation/QPSK/qpks.py deleted file mode 100755 index 98a982f..0000000 --- a/simulation/QPSK/qpks.py +++ /dev/null @@ -1,644 +0,0 @@ -#!/usr/bin/env python3 -# -*- coding: utf-8 -*- - -# -# SPDX-License-Identifier: GPL-3.0 -# -# GNU Radio Python Flow Graph -# Title: QPSK -# Author: Pross Naoki, Halter Sara Cinzia -# GNU Radio version: 3.8.2.0 - -from distutils.version import 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 gnuradio import qtgui -from gnuradio.filter import firdes -import sip -from gnuradio import blocks -import numpy -from gnuradio import channels -from gnuradio import digital -from gnuradio import gr -import sys -import signal -from argparse import ArgumentParser -from gnuradio.eng_arg import eng_float, intx -from gnuradio import eng_notation -from gnuradio.qtgui import Range, RangeWidget - -from gnuradio import qtgui - -class qpks(gr.top_block, Qt.QWidget): - - def __init__(self): - gr.top_block.__init__(self, "QPSK") - Qt.QWidget.__init__(self) - self.setWindowTitle("QPSK") - 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", "qpks") - - 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.sps = sps = 4 - self.nfilts = nfilts = 32 - self.excess_bw = excess_bw = 350e-3 - self.timing_loop_bw = timing_loop_bw = 2 * 3.141592653589793 / 100 - self.time_offset = time_offset = 1.0 - self.samp_rate = samp_rate = 32000 - self.rrc_taps = rrc_taps = firdes.root_raised_cosine(nfilts, nfilts, 1.0/float(sps), excess_bw, 45*nfilts) - self.qpsk_const = qpsk_const = digital.constellation_rect([0.707+1j, -0.707+0.707j, -0.707-0.707j, 0.707-0.707j], [0, 1, 3, 2], - 4, 2, 2, 1, 1).base() - self.phase_bw = phase_bw = 2 * 3.141592653589793 / 100 - self.noise_volt = noise_volt = 0.0001 - self.freq_offset = freq_offset = 0 - self.eq_ntaps = eq_ntaps = 15 - self.eq_mod = eq_mod = 1 - self.eq_gain = eq_gain = .01 - self.chn_taps = chn_taps = [1.0 + 0.0j, ] - - ################################################## - # Blocks - ################################################## - self.params = Qt.QTabWidget() - self.params_widget_0 = Qt.QWidget() - self.params_layout_0 = Qt.QBoxLayout(Qt.QBoxLayout.TopToBottom, self.params_widget_0) - self.params_grid_layout_0 = Qt.QGridLayout() - self.params_layout_0.addLayout(self.params_grid_layout_0) - self.params.addTab(self.params_widget_0, 'Channel') - self.params_widget_1 = Qt.QWidget() - self.params_layout_1 = Qt.QBoxLayout(Qt.QBoxLayout.TopToBottom, self.params_widget_1) - self.params_grid_layout_1 = Qt.QGridLayout() - self.params_layout_1.addLayout(self.params_grid_layout_1) - self.params.addTab(self.params_widget_1, 'Receiver') - self.top_grid_layout.addWidget(self.params) - self._timing_loop_bw_range = Range(0, 200e-3, 10e-3, 2 * 3.141592653589793 / 100, 200) - self._timing_loop_bw_win = RangeWidget(self._timing_loop_bw_range, self.set_timing_loop_bw, 'Time Bandwidth', "counter_slider", float) - self.params_grid_layout_0.addWidget(self._timing_loop_bw_win, 1, 1, 1, 1) - for r in range(1, 2): - self.params_grid_layout_0.setRowStretch(r, 1) - for c in range(1, 2): - self.params_grid_layout_0.setColumnStretch(c, 1) - self._time_offset_range = Range(0.999, 1.001, 0.0001, 1.0, 200) - self._time_offset_win = RangeWidget(self._time_offset_range, self.set_time_offset, 'Timing Offset', "counter_slider", float) - self.params_grid_layout_0.addWidget(self._time_offset_win, 0, 1, 1, 1) - for r in range(0, 1): - self.params_grid_layout_0.setRowStretch(r, 1) - for c in range(1, 2): - self.params_grid_layout_0.setColumnStretch(c, 1) - self.plots = Qt.QTabWidget() - self.plots_widget_0 = Qt.QWidget() - self.plots_layout_0 = Qt.QBoxLayout(Qt.QBoxLayout.TopToBottom, self.plots_widget_0) - self.plots_grid_layout_0 = Qt.QGridLayout() - self.plots_layout_0.addLayout(self.plots_grid_layout_0) - self.plots.addTab(self.plots_widget_0, 'Constellations') - self.plots_widget_1 = Qt.QWidget() - self.plots_layout_1 = Qt.QBoxLayout(Qt.QBoxLayout.TopToBottom, self.plots_widget_1) - self.plots_grid_layout_1 = Qt.QGridLayout() - self.plots_layout_1.addLayout(self.plots_grid_layout_1) - self.plots.addTab(self.plots_widget_1, 'Frequency') - self.plots_widget_2 = Qt.QWidget() - self.plots_layout_2 = Qt.QBoxLayout(Qt.QBoxLayout.TopToBottom, self.plots_widget_2) - self.plots_grid_layout_2 = Qt.QGridLayout() - self.plots_layout_2.addLayout(self.plots_grid_layout_2) - self.plots.addTab(self.plots_widget_2, 'Time') - self.top_grid_layout.addWidget(self.plots) - self._phase_bw_range = Range(0, 1, .01, 2 * 3.141592653589793 / 100, 200) - self._phase_bw_win = RangeWidget(self._phase_bw_range, self.set_phase_bw, 'Phase Bandwidth', "counter_slider", float) - self.params_grid_layout_1.addWidget(self._phase_bw_win, 1, 0, 1, 1) - for r in range(1, 2): - self.params_grid_layout_1.setRowStretch(r, 1) - for c in range(0, 1): - self.params_grid_layout_1.setColumnStretch(c, 1) - self._noise_volt_range = Range(0, 1, 0.01, 0.0001, 200) - self._noise_volt_win = RangeWidget(self._noise_volt_range, self.set_noise_volt, 'Noise Voltage', "counter_slider", float) - self.params_grid_layout_0.addWidget(self._noise_volt_win, 0, 0, 1, 1) - for r in range(0, 1): - self.params_grid_layout_0.setRowStretch(r, 1) - for c in range(0, 1): - self.params_grid_layout_0.setColumnStretch(c, 1) - self._freq_offset_range = Range(-100e-3, 100e-3, 1e-3, 0, 200) - self._freq_offset_win = RangeWidget(self._freq_offset_range, self.set_freq_offset, 'Frequency Offset', "counter_slider", float) - self.params_grid_layout_0.addWidget(self._freq_offset_win, 1, 0, 1, 1) - for r in range(1, 2): - self.params_grid_layout_0.setRowStretch(r, 1) - for c in range(0, 1): - self.params_grid_layout_0.setColumnStretch(c, 1) - self._eq_gain_range = Range(0, .1, .001, .01, 200) - self._eq_gain_win = RangeWidget(self._eq_gain_range, self.set_eq_gain, 'Equalizer Rate', "counter_slider", float) - self.params_grid_layout_1.addWidget(self._eq_gain_win, 0, 0, 1, 1) - for r in range(0, 1): - self.params_grid_layout_1.setRowStretch(r, 1) - for c in range(0, 1): - self.params_grid_layout_1.setColumnStretch(c, 1) - self.qtgui_time_sink_x_0 = qtgui.time_sink_f( - 1024, #size - samp_rate, #samp_rate - "Decoded", #name - 2 #number of inputs - ) - self.qtgui_time_sink_x_0.set_update_time(0.10) - 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.0, 0, 0, "") - self.qtgui_time_sink_x_0.enable_autoscale(False) - self.qtgui_time_sink_x_0.enable_grid(False) - 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 = ['Received', 'Sent', 'Signal 3', 'Signal 4', 'Signal 5', - 'Signal 6', 'Signal 7', 'Signal 8', 'Signal 9', 'Signal 10'] - 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: - 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.pyqwidget(), Qt.QWidget) - self.plots_grid_layout_2.addWidget(self._qtgui_time_sink_x_0_win, 0, 0, 1, 1) - for r in range(0, 1): - self.plots_grid_layout_2.setRowStretch(r, 1) - for c in range(0, 1): - self.plots_grid_layout_2.setColumnStretch(c, 1) - self.qtgui_freq_sink_x_0 = qtgui.freq_sink_c( - 1024, #size - firdes.WIN_BLACKMAN_hARRIS, #wintype - 0, #fc - samp_rate, #bw - "Channel", #name - 1 - ) - 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) - - - - 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.pyqwidget(), Qt.QWidget) - self.plots_grid_layout_1.addWidget(self._qtgui_freq_sink_x_0_win, 0, 0, 1, 1) - for r in range(0, 1): - self.plots_grid_layout_1.setRowStretch(r, 1) - for c in range(0, 1): - self.plots_grid_layout_1.setColumnStretch(c, 1) - self.qtgui_const_sink_x_2 = qtgui.const_sink_c( - 1024, #size - "Locked", #name - 1 #number of inputs - ) - self.qtgui_const_sink_x_2.set_update_time(0.10) - self.qtgui_const_sink_x_2.set_y_axis(-2, 2) - self.qtgui_const_sink_x_2.set_x_axis(-2, 2) - self.qtgui_const_sink_x_2.set_trigger_mode(qtgui.TRIG_MODE_FREE, qtgui.TRIG_SLOPE_POS, 0.0, 0, "") - self.qtgui_const_sink_x_2.enable_autoscale(False) - self.qtgui_const_sink_x_2.enable_grid(False) - self.qtgui_const_sink_x_2.enable_axis_labels(True) - - - labels = ['', '', '', '', '', - '', '', '', '', ''] - widths = [1, 1, 1, 1, 1, - 1, 1, 1, 1, 1] - colors = ["blue", "red", "red", "red", "red", - "red", "red", "red", "red", "red"] - styles = [0, 0, 0, 0, 0, - 0, 0, 0, 0, 0] - markers = [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_const_sink_x_2.set_line_label(i, "Data {0}".format(i)) - else: - self.qtgui_const_sink_x_2.set_line_label(i, labels[i]) - self.qtgui_const_sink_x_2.set_line_width(i, widths[i]) - self.qtgui_const_sink_x_2.set_line_color(i, colors[i]) - self.qtgui_const_sink_x_2.set_line_style(i, styles[i]) - self.qtgui_const_sink_x_2.set_line_marker(i, markers[i]) - self.qtgui_const_sink_x_2.set_line_alpha(i, alphas[i]) - - self._qtgui_const_sink_x_2_win = sip.wrapinstance(self.qtgui_const_sink_x_2.pyqwidget(), Qt.QWidget) - self.plots_grid_layout_0.addWidget(self._qtgui_const_sink_x_2_win, 1, 1, 1, 1) - for r in range(1, 2): - self.plots_grid_layout_0.setRowStretch(r, 1) - for c in range(1, 2): - self.plots_grid_layout_0.setColumnStretch(c, 1) - self.qtgui_const_sink_x_1 = qtgui.const_sink_c( - 1024, #size - "Equalized", #name - 1 #number of inputs - ) - self.qtgui_const_sink_x_1.set_update_time(0.10) - self.qtgui_const_sink_x_1.set_y_axis(-2, 2) - self.qtgui_const_sink_x_1.set_x_axis(-2, 2) - self.qtgui_const_sink_x_1.set_trigger_mode(qtgui.TRIG_MODE_FREE, qtgui.TRIG_SLOPE_POS, 0.0, 0, "") - self.qtgui_const_sink_x_1.enable_autoscale(False) - self.qtgui_const_sink_x_1.enable_grid(False) - self.qtgui_const_sink_x_1.enable_axis_labels(True) - - - labels = ['', '', '', '', '', - '', '', '', '', ''] - widths = [1, 1, 1, 1, 1, - 1, 1, 1, 1, 1] - colors = ["blue", "red", "red", "red", "red", - "red", "red", "red", "red", "red"] - styles = [0, 0, 0, 0, 0, - 0, 0, 0, 0, 0] - markers = [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_const_sink_x_1.set_line_label(i, "Data {0}".format(i)) - else: - self.qtgui_const_sink_x_1.set_line_label(i, labels[i]) - self.qtgui_const_sink_x_1.set_line_width(i, widths[i]) - self.qtgui_const_sink_x_1.set_line_color(i, colors[i]) - self.qtgui_const_sink_x_1.set_line_style(i, styles[i]) - self.qtgui_const_sink_x_1.set_line_marker(i, markers[i]) - self.qtgui_const_sink_x_1.set_line_alpha(i, alphas[i]) - - self._qtgui_const_sink_x_1_win = sip.wrapinstance(self.qtgui_const_sink_x_1.pyqwidget(), Qt.QWidget) - self.plots_grid_layout_0.addWidget(self._qtgui_const_sink_x_1_win, 1, 0, 1, 1) - for r in range(1, 2): - self.plots_grid_layout_0.setRowStretch(r, 1) - for c in range(0, 1): - self.plots_grid_layout_0.setColumnStretch(c, 1) - self.qtgui_const_sink_x_0_0 = qtgui.const_sink_c( - 2048, #size - "Synchronized", #name - 1 #number of inputs - ) - self.qtgui_const_sink_x_0_0.set_update_time(0.10) - self.qtgui_const_sink_x_0_0.set_y_axis(-2, 2) - self.qtgui_const_sink_x_0_0.set_x_axis(-2, 2) - self.qtgui_const_sink_x_0_0.set_trigger_mode(qtgui.TRIG_MODE_FREE, qtgui.TRIG_SLOPE_POS, 0.0, 0, "") - self.qtgui_const_sink_x_0_0.enable_autoscale(False) - self.qtgui_const_sink_x_0_0.enable_grid(False) - self.qtgui_const_sink_x_0_0.enable_axis_labels(True) - - - labels = ['', '', '', '', '', - '', '', '', '', ''] - widths = [1, 1, 1, 1, 1, - 1, 1, 1, 1, 1] - colors = ["blue", "red", "red", "red", "red", - "red", "red", "red", "red", "red"] - styles = [0, 0, 0, 0, 0, - 0, 0, 0, 0, 0] - markers = [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_const_sink_x_0_0.set_line_label(i, "Data {0}".format(i)) - else: - self.qtgui_const_sink_x_0_0.set_line_label(i, labels[i]) - self.qtgui_const_sink_x_0_0.set_line_width(i, widths[i]) - self.qtgui_const_sink_x_0_0.set_line_color(i, colors[i]) - self.qtgui_const_sink_x_0_0.set_line_style(i, styles[i]) - self.qtgui_const_sink_x_0_0.set_line_marker(i, markers[i]) - self.qtgui_const_sink_x_0_0.set_line_alpha(i, alphas[i]) - - self._qtgui_const_sink_x_0_0_win = sip.wrapinstance(self.qtgui_const_sink_x_0_0.pyqwidget(), Qt.QWidget) - self.plots_grid_layout_0.addWidget(self._qtgui_const_sink_x_0_0_win, 0, 1, 1, 1) - for r in range(0, 1): - self.plots_grid_layout_0.setRowStretch(r, 1) - for c in range(1, 2): - self.plots_grid_layout_0.setColumnStretch(c, 1) - self.qtgui_const_sink_x_0 = qtgui.const_sink_c( - 2048, #size - "Channel", #name - 1 #number of inputs - ) - self.qtgui_const_sink_x_0.set_update_time(0.10) - self.qtgui_const_sink_x_0.set_y_axis(-2, 2) - self.qtgui_const_sink_x_0.set_x_axis(-2, 2) - self.qtgui_const_sink_x_0.set_trigger_mode(qtgui.TRIG_MODE_FREE, qtgui.TRIG_SLOPE_POS, 0.0, 0, "") - self.qtgui_const_sink_x_0.enable_autoscale(False) - self.qtgui_const_sink_x_0.enable_grid(False) - self.qtgui_const_sink_x_0.enable_axis_labels(True) - - - labels = ['', '', '', '', '', - '', '', '', '', ''] - widths = [1, 1, 1, 1, 1, - 1, 1, 1, 1, 1] - colors = ["blue", "red", "red", "red", "red", - "red", "red", "red", "red", "red"] - styles = [0, 0, 0, 0, 0, - 0, 0, 0, 0, 0] - markers = [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_const_sink_x_0.set_line_label(i, "Data {0}".format(i)) - else: - self.qtgui_const_sink_x_0.set_line_label(i, labels[i]) - self.qtgui_const_sink_x_0.set_line_width(i, widths[i]) - self.qtgui_const_sink_x_0.set_line_color(i, colors[i]) - self.qtgui_const_sink_x_0.set_line_style(i, styles[i]) - self.qtgui_const_sink_x_0.set_line_marker(i, markers[i]) - self.qtgui_const_sink_x_0.set_line_alpha(i, alphas[i]) - - self._qtgui_const_sink_x_0_win = sip.wrapinstance(self.qtgui_const_sink_x_0.pyqwidget(), Qt.QWidget) - self.plots_grid_layout_0.addWidget(self._qtgui_const_sink_x_0_win, 0, 0, 1, 1) - for r in range(0, 1): - self.plots_grid_layout_0.setRowStretch(r, 1) - for c in range(0, 1): - self.plots_grid_layout_0.setColumnStretch(c, 1) - self.digital_pfb_clock_sync_xxx_0 = digital.pfb_clock_sync_ccf(sps * 1.001, timing_loop_bw, rrc_taps, nfilts, nfilts/2, 1.5, 2) - self.digital_map_bb_0 = digital.map_bb([0, 1, 3, 2]) - self.digital_diff_decoder_bb_0 = digital.diff_decoder_bb(4) - self.digital_costas_loop_cc_0 = digital.costas_loop_cc(phase_bw, 4, False) - self.digital_constellation_modulator_0 = digital.generic_mod( - constellation=qpsk_const, - differential=True, - samples_per_symbol=sps, - pre_diff_code=True, - excess_bw=excess_bw, - verbose=False, - log=False) - self.digital_constellation_decoder_cb_0 = digital.constellation_decoder_cb(qpsk_const) - self.digital_cma_equalizer_cc_0 = digital.cma_equalizer_cc(eq_ntaps, eq_mod, eq_gain, 2) - self.channels_channel_model_0 = channels.channel_model( - noise_voltage=noise_volt, - frequency_offset=freq_offset, - epsilon=time_offset, - taps=chn_taps, - noise_seed=0, - block_tags=False) - self.blocks_unpack_k_bits_bb_0_0 = blocks.unpack_k_bits_bb(2) - self.blocks_unpack_k_bits_bb_0 = blocks.unpack_k_bits_bb(2) - self.blocks_throttle_0 = blocks.throttle(gr.sizeof_gr_complex*1, samp_rate,True) - self.blocks_delay_0 = blocks.delay(gr.sizeof_float*1, 50) - self.blocks_char_to_float_0_0 = blocks.char_to_float(1, 1) - self.blocks_char_to_float_0 = blocks.char_to_float(1, 1) - self.analog_random_source_x_0 = blocks.vector_source_b(list(map(int, numpy.random.randint(0, 256, 1000))), True) - - - - ################################################## - # Connections - ################################################## - self.connect((self.analog_random_source_x_0, 0), (self.blocks_unpack_k_bits_bb_0_0, 0)) - self.connect((self.analog_random_source_x_0, 0), (self.digital_constellation_modulator_0, 0)) - self.connect((self.blocks_char_to_float_0, 0), (self.qtgui_time_sink_x_0, 0)) - self.connect((self.blocks_char_to_float_0_0, 0), (self.blocks_delay_0, 0)) - self.connect((self.blocks_delay_0, 0), (self.qtgui_time_sink_x_0, 1)) - self.connect((self.blocks_throttle_0, 0), (self.channels_channel_model_0, 0)) - self.connect((self.blocks_unpack_k_bits_bb_0, 0), (self.blocks_char_to_float_0, 0)) - self.connect((self.blocks_unpack_k_bits_bb_0_0, 0), (self.blocks_char_to_float_0_0, 0)) - self.connect((self.channels_channel_model_0, 0), (self.digital_pfb_clock_sync_xxx_0, 0)) - self.connect((self.channels_channel_model_0, 0), (self.qtgui_const_sink_x_0, 0)) - self.connect((self.channels_channel_model_0, 0), (self.qtgui_freq_sink_x_0, 0)) - self.connect((self.digital_cma_equalizer_cc_0, 0), (self.digital_costas_loop_cc_0, 0)) - self.connect((self.digital_cma_equalizer_cc_0, 0), (self.qtgui_const_sink_x_1, 0)) - self.connect((self.digital_constellation_decoder_cb_0, 0), (self.digital_diff_decoder_bb_0, 0)) - self.connect((self.digital_constellation_modulator_0, 0), (self.blocks_throttle_0, 0)) - self.connect((self.digital_costas_loop_cc_0, 0), (self.digital_constellation_decoder_cb_0, 0)) - self.connect((self.digital_costas_loop_cc_0, 0), (self.qtgui_const_sink_x_2, 0)) - self.connect((self.digital_diff_decoder_bb_0, 0), (self.digital_map_bb_0, 0)) - self.connect((self.digital_map_bb_0, 0), (self.blocks_unpack_k_bits_bb_0, 0)) - self.connect((self.digital_pfb_clock_sync_xxx_0, 0), (self.digital_cma_equalizer_cc_0, 0)) - self.connect((self.digital_pfb_clock_sync_xxx_0, 0), (self.qtgui_const_sink_x_0_0, 0)) - - - def closeEvent(self, event): - self.settings = Qt.QSettings("GNU Radio", "qpks") - self.settings.setValue("geometry", self.saveGeometry()) - event.accept() - - def get_sps(self): - return self.sps - - def set_sps(self, sps): - self.sps = sps - self.set_rrc_taps(firdes.root_raised_cosine(self.nfilts, self.nfilts, 1.0/float(self.sps), self.excess_bw, 45*self.nfilts)) - - def get_nfilts(self): - return self.nfilts - - def set_nfilts(self, nfilts): - self.nfilts = nfilts - self.set_rrc_taps(firdes.root_raised_cosine(self.nfilts, self.nfilts, 1.0/float(self.sps), self.excess_bw, 45*self.nfilts)) - - def get_excess_bw(self): - return self.excess_bw - - def set_excess_bw(self, excess_bw): - self.excess_bw = excess_bw - self.set_rrc_taps(firdes.root_raised_cosine(self.nfilts, self.nfilts, 1.0/float(self.sps), self.excess_bw, 45*self.nfilts)) - - def get_timing_loop_bw(self): - return self.timing_loop_bw - - def set_timing_loop_bw(self, timing_loop_bw): - self.timing_loop_bw = timing_loop_bw - self.digital_pfb_clock_sync_xxx_0.set_loop_bandwidth(self.timing_loop_bw) - - def get_time_offset(self): - return self.time_offset - - def set_time_offset(self, time_offset): - self.time_offset = time_offset - self.channels_channel_model_0.set_timing_offset(self.time_offset) - - def get_samp_rate(self): - return self.samp_rate - - def set_samp_rate(self, samp_rate): - self.samp_rate = samp_rate - self.blocks_throttle_0.set_sample_rate(self.samp_rate) - self.qtgui_freq_sink_x_0.set_frequency_range(0, self.samp_rate) - self.qtgui_time_sink_x_0.set_samp_rate(self.samp_rate) - - def get_rrc_taps(self): - return self.rrc_taps - - def set_rrc_taps(self, rrc_taps): - self.rrc_taps = rrc_taps - self.digital_pfb_clock_sync_xxx_0.update_taps(self.rrc_taps) - - def get_qpsk_const(self): - return self.qpsk_const - - def set_qpsk_const(self, qpsk_const): - self.qpsk_const = qpsk_const - - def get_phase_bw(self): - return self.phase_bw - - def set_phase_bw(self, phase_bw): - self.phase_bw = phase_bw - self.digital_costas_loop_cc_0.set_loop_bandwidth(self.phase_bw) - - def get_noise_volt(self): - return self.noise_volt - - def set_noise_volt(self, noise_volt): - self.noise_volt = noise_volt - self.channels_channel_model_0.set_noise_voltage(self.noise_volt) - - def get_freq_offset(self): - return self.freq_offset - - def set_freq_offset(self, freq_offset): - self.freq_offset = freq_offset - self.channels_channel_model_0.set_frequency_offset(self.freq_offset) - - def get_eq_ntaps(self): - return self.eq_ntaps - - def set_eq_ntaps(self, eq_ntaps): - self.eq_ntaps = eq_ntaps - - def get_eq_mod(self): - return self.eq_mod - - def set_eq_mod(self, eq_mod): - self.eq_mod = eq_mod - self.digital_cma_equalizer_cc_0.set_modulus(self.eq_mod) - - def get_eq_gain(self): - return self.eq_gain - - def set_eq_gain(self, eq_gain): - self.eq_gain = eq_gain - self.digital_cma_equalizer_cc_0.set_gain(self.eq_gain) - - def get_chn_taps(self): - return self.chn_taps - - def set_chn_taps(self, chn_taps): - self.chn_taps = chn_taps - self.channels_channel_model_0.set_taps(self.chn_taps) - - - - - -def main(top_block_cls=qpks, options=None): - if gr.enable_realtime_scheduling() != gr.RT_OK: - print("Error: failed to enable real-time scheduling.") - - 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): - 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) - - def quitting(): - tb.stop() - tb.wait() - - qapp.aboutToQuit.connect(quitting) - qapp.exec_() - -if __name__ == '__main__': - main() diff --git a/src/sketch.py b/src/gui.py index 5f170b2..58e36a3 100755 --- a/src/sketch.py +++ b/src/gui.py @@ -36,7 +36,7 @@ create_viewport() setup_dearpygui() # Show demo for dev -# show_demo() +show_demo() #================================================ # Custom GNURadio blocks @@ -122,25 +122,40 @@ sim.connect((sim.digital_costas_loop_cc_0, 0), (locked_time_plot, 0)) # Settings Window with window(label="Settings", width=200, height=400, pos=(25, 450), tag="sim_win"): - add_button(label="Toggle Fullscreen", callback= toggle_viewport_fullscreen) + with child_window(autosize_x=True, height=100): + add_button(label="Toggle Fullscreen", callback= toggle_viewport_fullscreen) - add_text("Simulation running:") - add_text("false", tag="sim_running_lbl") + with child_window(autosize_x=True): + with group(horizontal=True): + add_text("Simulation running:") + add_text("false", tag="sim_running_lbl") - with group(horizontal=True): - def on_sim_start_btn_clicked(): - sim.start() - sim_runnig = True - logger.debug("Started simulation") + with group(tag="sim_grp", horizontal=True): + def on_sim_start_btn_clicked(): + global sim_running - def on_sim_stop_btn_clicked(): - sim.stop() - sim.wait() - sim_running = False - logger.debug("Stopped simulation") + if sim_running: + logger.error("Simulation is already running") + return - add_button(label="Start", tag="sim_start_btn", callback=on_sim_start_btn_clicked) - add_button(label="Stop", tag="sim_stop_btn", callback=on_sim_stop_btn_clicked) + sim.start() + sim_running = True + logger.debug("Started simulation") + + def on_sim_stop_btn_clicked(): + global sim_running + + if not sim_running: + logger.error("Simulation not running") + return + + sim.stop() + sim.wait() + sim_running = False + logger.debug("Stopped simulation") + + add_button(label="Start", tag="sim_start_btn", callback=on_sim_start_btn_clicked) + add_button(label="Stop", tag="sim_stop_btn", callback=on_sim_stop_btn_clicked) #================================================ # Flow Graph Window @@ -196,8 +211,3 @@ start_dearpygui() # clean up gui destroy_context() - -# Stop GNURadio -if sim_running: - sim.stop() - sim.wait() diff --git a/src/qam.py b/src/qam.py new file mode 120000 index 0000000..a59366b --- /dev/null +++ b/src/qam.py @@ -0,0 +1 @@ +../simulation/QAM/qam_nogui.py
\ No newline at end of file diff --git a/src/Test_Plots/test.py b/tests/dearpygui/test.py index 3fb0d51..3fb0d51 100644 --- a/src/Test_Plots/test.py +++ b/tests/dearpygui/test.py diff --git a/src/Test_Plots/test10.py b/tests/dearpygui/test10.py index d478d9a..d478d9a 100644 --- a/src/Test_Plots/test10.py +++ b/tests/dearpygui/test10.py diff --git a/src/Test_Plots/test1_updating_series_data.py b/tests/dearpygui/test1_updating_series_data.py index 1371008..1371008 100644 --- a/src/Test_Plots/test1_updating_series_data.py +++ b/tests/dearpygui/test1_updating_series_data.py diff --git a/src/Test_Plots/test2_axis_limis.py b/tests/dearpygui/test2_axis_limis.py index bdfeda1..bdfeda1 100644 --- a/src/Test_Plots/test2_axis_limis.py +++ b/tests/dearpygui/test2_axis_limis.py diff --git a/src/Test_Plots/test3_custom_axis_labels.py b/tests/dearpygui/test3_custom_axis_labels.py index be6b80b..be6b80b 100644 --- a/src/Test_Plots/test3_custom_axis_labels.py +++ b/tests/dearpygui/test3_custom_axis_labels.py diff --git a/src/Test_Plots/test4_multiple_y_axes.py b/tests/dearpygui/test4_multiple_y_axes.py index ebaac7e..ebaac7e 100644 --- a/src/Test_Plots/test4_multiple_y_axes.py +++ b/tests/dearpygui/test4_multiple_y_axes.py diff --git a/src/Test_Plots/test5_annotations.py b/tests/dearpygui/test5_annotations.py index 9deff6b..9deff6b 100644 --- a/src/Test_Plots/test5_annotations.py +++ b/tests/dearpygui/test5_annotations.py diff --git a/src/Test_Plots/test6_drag_points_and_lines.py b/tests/dearpygui/test6_drag_points_and_lines.py index c6d8862..c6d8862 100644 --- a/src/Test_Plots/test6_drag_points_and_lines.py +++ b/tests/dearpygui/test6_drag_points_and_lines.py diff --git a/src/Test_Plots/test7_querying.py b/tests/dearpygui/test7_querying.py index 06f3ceb..06f3ceb 100644 --- a/src/Test_Plots/test7_querying.py +++ b/tests/dearpygui/test7_querying.py diff --git a/src/Test_Plots/test8_custom_context_menus.py b/tests/dearpygui/test8_custom_context_menus.py index b459d15..b459d15 100644 --- a/src/Test_Plots/test8_custom_context_menus.py +++ b/tests/dearpygui/test8_custom_context_menus.py diff --git a/src/Test_Plots/test9_colors_and_styles.py b/tests/dearpygui/test9_colors_and_styles.py index 2f1c7ef..2f1c7ef 100644 --- a/src/Test_Plots/test9_colors_and_styles.py +++ b/tests/dearpygui/test9_colors_and_styles.py diff --git a/tests/zmq/lena512color.tiff b/tests/zmq/lena512color.tiff Binary files differnew file mode 100644 index 0000000..ffe5c83 --- /dev/null +++ b/tests/zmq/lena512color.tiff diff --git a/tests/zmq/server.py b/tests/zmq/server.py new file mode 100644 index 0000000..be4bede --- /dev/null +++ b/tests/zmq/server.py @@ -0,0 +1,4 @@ +import zmq +import pmt + +import numpy as np diff --git a/tests/zmq/zmqtest.grc b/tests/zmq/zmqtest.grc new file mode 100644 index 0000000..ad1729d --- /dev/null +++ b/tests/zmq/zmqtest.grc @@ -0,0 +1,112 @@ +options: + parameters: + author: Naoki Pross + category: '[GRC Hier Blocks]' + cmake_opt: '' + comment: '' + copyright: '' + description: '' + gen_cmake: 'On' + gen_linking: dynamic + generate_options: no_gui + hier_block_src_path: '.:' + id: zmqtest + max_nouts: '0' + output_language: python + placement: (0,0) + qt_qss_theme: '' + realtime_scheduling: '1' + run: 'True' + run_command: '{python} -u {filename}' + run_options: prompt + sizing_mode: fixed + thread_safe_setters: '' + title: ZMQ test + window_size: '' + states: + bus_sink: false + bus_source: false + bus_structure: null + coordinate: [8, 8] + rotation: 0 + state: enabled + +blocks: +- name: samp_rate + id: variable + parameters: + comment: '' + value: '32000' + states: + bus_sink: false + bus_source: false + bus_structure: null + coordinate: [184, 12] + rotation: 0 + state: enabled +- name: blocks_throttle_0 + id: blocks_throttle + parameters: + affinity: '' + alias: '' + comment: '' + ignoretag: 'True' + maxoutbuf: '0' + minoutbuf: '0' + samples_per_second: samp_rate + type: complex + vlen: '1' + states: + bus_sink: false + bus_source: false + bus_structure: null + coordinate: [440, 324.0] + rotation: 0 + state: true +- name: zeromq_rep_sink_0 + id: zeromq_rep_sink + parameters: + address: '' + affinity: '' + alias: '' + comment: '' + hwm: '-1' + pass_tags: 'False' + timeout: '100' + type: complex + vlen: '1' + states: + bus_sink: false + bus_source: false + bus_structure: null + coordinate: [664, 308.0] + rotation: 0 + state: true +- name: zeromq_req_source_0 + id: zeromq_req_source + parameters: + address: '' + affinity: '' + alias: '' + comment: '' + hwm: '-1' + maxoutbuf: '0' + minoutbuf: '0' + pass_tags: 'False' + timeout: '100' + type: complex + vlen: '1' + states: + bus_sink: false + bus_source: false + bus_structure: null + coordinate: [216, 308.0] + rotation: 0 + state: true + +connections: +- [blocks_throttle_0, '0', zeromq_rep_sink_0, '0'] +- [zeromq_req_source_0, '0', blocks_throttle_0, '0'] + +metadata: + file_format: 1 diff --git a/tests/zmq/zmqtest.py b/tests/zmq/zmqtest.py new file mode 100755 index 0000000..a046c13 --- /dev/null +++ b/tests/zmq/zmqtest.py @@ -0,0 +1,85 @@ +#!/usr/bin/env python3 +# -*- coding: utf-8 -*- + +# +# SPDX-License-Identifier: GPL-3.0 +# +# GNU Radio Python Flow Graph +# Title: ZMQ test +# Author: Naoki Pross +# GNU Radio version: 3.8.2.0 + +from gnuradio import blocks +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 zeromq + + +class zmqtest(gr.top_block): + + def __init__(self): + gr.top_block.__init__(self, "ZMQ test") + + ################################################## + # Variables + ################################################## + self.samp_rate = samp_rate = 32000 + + ################################################## + # Blocks + ################################################## + self.zeromq_req_source_0 = zeromq.req_source(gr.sizeof_gr_complex, 1, '', 100, False, -1) + self.zeromq_rep_sink_0 = zeromq.rep_sink(gr.sizeof_gr_complex, 1, '', 100, False, -1) + self.blocks_throttle_0 = blocks.throttle(gr.sizeof_gr_complex*1, samp_rate,True) + + + + ################################################## + # Connections + ################################################## + self.connect((self.blocks_throttle_0, 0), (self.zeromq_rep_sink_0, 0)) + self.connect((self.zeromq_req_source_0, 0), (self.blocks_throttle_0, 0)) + + + def get_samp_rate(self): + return self.samp_rate + + def set_samp_rate(self, samp_rate): + self.samp_rate = samp_rate + self.blocks_throttle_0.set_sample_rate(self.samp_rate) + + + + + +def main(top_block_cls=zmqtest, options=None): + if gr.enable_realtime_scheduling() != gr.RT_OK: + print("Error: failed to enable real-time scheduling.") + 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() |