aboutsummaryrefslogtreecommitdiffstats
path: root/tests/fadingui/QAM/qam_nogui.py
diff options
context:
space:
mode:
authorNao Pross <np@0hm.ch>2021-11-22 19:59:14 +0100
committerNao Pross <np@0hm.ch>2021-11-22 19:59:14 +0100
commitec407f3bf29eca3271b428859b258b43222265c9 (patch)
treea62e18c762a256b2771029c5732d92cfdcda32f7 /tests/fadingui/QAM/qam_nogui.py
parentMake install.sh run QA (diff)
downloadFading-ec407f3bf29eca3271b428859b258b43222265c9.tar.gz
Fading-ec407f3bf29eca3271b428859b258b43222265c9.zip
Implement frame synchronization
There is an issue somewhere between the mod and demod, since frame synchronization works on a direct path.
Diffstat (limited to '')
-rwxr-xr-xtests/fadingui/QAM/qam_nogui.py57
1 files changed, 5 insertions, 52 deletions
diff --git a/tests/fadingui/QAM/qam_nogui.py b/tests/fadingui/QAM/qam_nogui.py
index 6cde63d..4116db5 100755
--- a/tests/fadingui/QAM/qam_nogui.py
+++ b/tests/fadingui/QAM/qam_nogui.py
@@ -21,9 +21,6 @@ if __name__ == '__main__':
except:
print("Warning: failed to XInitThreads()")
-from PyQt5 import Qt
-from gnuradio import qtgui
-import sip
from gnuradio import blocks
from gnuradio import channels
from gnuradio.filter import firdes
@@ -31,6 +28,7 @@ from gnuradio import digital
from gnuradio import gr
import sys
import signal
+from PyQt5 import Qt
from argparse import ArgumentParser
from gnuradio.eng_arg import eng_float, intx
from gnuradio import eng_notation
@@ -81,64 +79,23 @@ class qam_nogui(gr.top_block, Qt.QWidget):
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.phase_bw = phase_bw = .002
+ self.phase_bw = phase_bw = .01
self.noise_volt = noise_volt = 0
self.freq_offset = freq_offset = 0
self.frame = frame = fadingui.frame_obj(preamble=[190, 239], payload_len=32768)
self.eq_ntaps = eq_ntaps = 15
self.eq_mod = eq_mod = 1
- self.eq_gain = eq_gain = 10e-3
+ self.eq_gain = eq_gain = .002
self.const = const = digital.constellation_16qam().base()
self.chn_taps = chn_taps = [1.0 + 0.0j, ]
##################################################
# Blocks
##################################################
- self.qtgui_const_sink_x_0 = qtgui.const_sink_c(
- 1024, #size
- "", #name
- 3 #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(3):
- 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.top_grid_layout.addWidget(self._qtgui_const_sink_x_0_win)
- self.fadingui_xor_frame_sync_0 = fadingui.xor_frame_sync(sync_pattern=frame.preamble, buffer_size=frame.length * 4)
+ self.fadingui_xor_frame_sync_0 = fadingui.xor_frame_sync(sync_pattern=frame.preamble, buffer_size=frame.length * 5)
self.fadingui_deframer_0 = fadingui.deframer(frame_obj=frame)
self.fadingui_datasource_0 = fadingui.datasource(frame_obj=frame, filename='/home/god/Documents/Fading/tests/fadingui/QAM/lena512color.tiff')
self.digital_pfb_clock_sync_xxx_0 = digital.pfb_clock_sync_ccf(sps, timing_loop_bw, rrc_taps, nfilts, nfilts/2, 1.5, 1)
- 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(
@@ -169,15 +126,11 @@ class qam_nogui(gr.top_block, Qt.QWidget):
self.connect((self.blocks_throttle_0, 0), (self.channels_channel_model_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_cma_equalizer_cc_0, 0), (self.qtgui_const_sink_x_0, 1))
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_0, 2))
- self.connect((self.digital_diff_decoder_bb_0, 0), (self.digital_map_bb_0, 0))
- self.connect((self.digital_map_bb_0, 0), (self.fadingui_xor_frame_sync_0, 0))
+ self.connect((self.digital_diff_decoder_bb_0, 0), (self.fadingui_xor_frame_sync_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))
self.connect((self.fadingui_datasource_0, 0), (self.digital_constellation_modulator_0, 0))
self.connect((self.fadingui_deframer_0, 0), (self.blocks_null_sink_0, 0))
self.connect((self.fadingui_xor_frame_sync_0, 0), (self.fadingui_deframer_0, 0))