diff options
Diffstat (limited to 'flowgraphs/qpsk_hw.py')
-rwxr-xr-x | flowgraphs/qpsk_hw.py | 29 |
1 files changed, 14 insertions, 15 deletions
diff --git a/flowgraphs/qpsk_hw.py b/flowgraphs/qpsk_hw.py index 198f944..eb6bf70 100755 --- a/flowgraphs/qpsk_hw.py +++ b/flowgraphs/qpsk_hw.py @@ -81,11 +81,11 @@ class qpsk_hw(gr.top_block, Qt.QWidget): self.sps = sps = 4 self.nfilts = nfilts = 32 self.excess_bw = excess_bw = 0.35 - self.samp_rate = samp_rate = 1.5e6 + self.samp_rate = samp_rate = 1e6 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_qpsk().base() self.frame_len = frame_len = len(testvec) +4 - self.access_code_symbols = access_code_symbols = [(-0.7071067811865475-0.7071067811865475j), (0.7071067811865475-0.7071067811865475j), (0.7071067811865475+0.7071067811865475j), (0.7071067811865475+0.7071067811865475j), (-0.7071067811865475-0.7071067811865475j), (0.7071067811865475+0.7071067811865475j), (0.7071067811865475-0.7071067811865475j), (0.7071067811865475-0.7071067811865475j)] + self.access_code_symbols = access_code_symbols = 2 * np.array([(-0.7071067811865475-0.7071067811865475j), (0.7071067811865475-0.7071067811865475j), (0.7071067811865475+0.7071067811865475j), (0.7071067811865475+0.7071067811865475j), (-0.7071067811865475-0.7071067811865475j), (0.7071067811865475+0.7071067811865475j), (0.7071067811865475-0.7071067811865475j), (0.7071067811865475-0.7071067811865475j)]) ################################################## # Blocks @@ -98,6 +98,7 @@ class qpsk_hw(gr.top_block, Qt.QWidget): 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_normalized_gain(1, 0) self.uhd_usrp_source_0.set_antenna('RX2', 0) @@ -112,7 +113,7 @@ class qpsk_hw(gr.top_block, Qt.QWidget): ), '', ) - self.uhd_usrp_sink_0.set_clock_source('internal', 0) + 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.4, 0) self.uhd_usrp_sink_0.set_antenna('TX/RX', 0) @@ -168,7 +169,7 @@ class qpsk_hw(gr.top_block, Qt.QWidget): self.qtgui_const_sink_x_0_0 = qtgui.const_sink_c( 1024, #size "", #name - 2 #number of inputs + 3 #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) @@ -183,7 +184,7 @@ class qpsk_hw(gr.top_block, Qt.QWidget): '', '', '', '', ''] widths = [1, 1, 1, 1, 1, 1, 1, 1, 1, 1] - colors = ["blue", "red", "red", "red", "red", + colors = ["blue", "red", "dark green", "red", "red", "red", "red", "red", "red", "red"] styles = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0] @@ -192,7 +193,7 @@ class qpsk_hw(gr.top_block, Qt.QWidget): 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(2): + for i in range(3): if len(labels[i]) == 0: self.qtgui_const_sink_x_0_0.set_line_label(i, "Data {0}".format(i)) else: @@ -208,7 +209,8 @@ class qpsk_hw(gr.top_block, Qt.QWidget): self.fadingui_phasecorrection_0 = fadingui.phasecorrection(frame_len) self.fadingui_ber_0 = fadingui.ber(vgl=testvec + list(np.zeros(4)), vlen=frame_len) self.digital_pfb_clock_sync_xxx_0 = digital.pfb_clock_sync_ccf(sps, 2 * np.pi / 100, rrc_taps, 32, 16, 1.5, 1) - self.digital_corr_est_cc_0 = digital.corr_est_cc(access_code_symbols, 1, len(access_code_symbols) // 2, 0.9, digital.THRESHOLD_ABSOLUTE) + self.digital_lms_dd_equalizer_cc_0 = digital.lms_dd_equalizer_cc(15, 3e-3, 1, qpsk_const) + self.digital_corr_est_cc_0 = digital.corr_est_cc(access_code_symbols, 1, len(access_code_symbols) // 2, 0.85, digital.THRESHOLD_ABSOLUTE) self.digital_constellation_modulator_0 = digital.generic_mod( constellation=qpsk_const, differential=False, @@ -218,9 +220,7 @@ class qpsk_hw(gr.top_block, Qt.QWidget): 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(15, 1, 2e-3, 1) self.blocks_vector_source_x_0 = blocks.vector_source_b(testvec, True, 1, []) - self.blocks_throttle_0 = blocks.throttle(gr.sizeof_gr_complex*1, samp_rate,True) self.blocks_tagged_stream_align_0 = blocks.tagged_stream_align(gr.sizeof_char*1, 'frame_start') self.blocks_stream_to_vector_0 = blocks.stream_to_vector(gr.sizeof_char*1, frame_len) self.blocks_stream_mux_0 = blocks.stream_mux(gr.sizeof_char*1, [len(testvec), 4]) @@ -239,17 +239,17 @@ class qpsk_hw(gr.top_block, Qt.QWidget): self.connect((self.blocks_stream_mux_0, 0), (self.digital_constellation_modulator_0, 0)) self.connect((self.blocks_stream_to_vector_0, 0), (self.fadingui_ber_0, 0)) self.connect((self.blocks_tagged_stream_align_0, 0), (self.blocks_repack_bits_bb_0, 0)) - self.connect((self.blocks_throttle_0, 0), (self.uhd_usrp_sink_0, 0)) self.connect((self.blocks_vector_source_x_0, 0), (self.blocks_stream_mux_0, 0)) - self.connect((self.digital_cma_equalizer_cc_0, 0), (self.digital_corr_est_cc_0, 0)) self.connect((self.digital_constellation_decoder_cb_0, 0), (self.blocks_tagged_stream_align_0, 0)) - self.connect((self.digital_constellation_modulator_0, 0), (self.blocks_throttle_0, 0)) + self.connect((self.digital_constellation_modulator_0, 0), (self.uhd_usrp_sink_0, 0)) self.connect((self.digital_corr_est_cc_0, 1), (self.blocks_complex_to_mag_0, 0)) self.connect((self.digital_corr_est_cc_0, 0), (self.fadingui_phasecorrection_0, 0)) - self.connect((self.digital_pfb_clock_sync_xxx_0, 0), (self.digital_cma_equalizer_cc_0, 0)) + self.connect((self.digital_lms_dd_equalizer_cc_0, 0), (self.digital_corr_est_cc_0, 0)) + self.connect((self.digital_lms_dd_equalizer_cc_0, 0), (self.qtgui_const_sink_x_0_0, 1)) + self.connect((self.digital_pfb_clock_sync_xxx_0, 0), (self.digital_lms_dd_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.fadingui_phasecorrection_0, 0), (self.digital_constellation_decoder_cb_0, 0)) - self.connect((self.fadingui_phasecorrection_0, 0), (self.qtgui_const_sink_x_0_0, 1)) + self.connect((self.fadingui_phasecorrection_0, 0), (self.qtgui_const_sink_x_0_0, 2)) self.connect((self.uhd_usrp_source_0, 0), (self.digital_pfb_clock_sync_xxx_0, 0)) @@ -293,7 +293,6 @@ class qpsk_hw(gr.top_block, Qt.QWidget): def set_samp_rate(self, samp_rate): self.samp_rate = samp_rate - self.blocks_throttle_0.set_sample_rate(self.samp_rate) self.qtgui_time_sink_x_0.set_samp_rate(self.samp_rate / self.sps) self.uhd_usrp_sink_0.set_samp_rate(self.samp_rate) self.uhd_usrp_source_0.set_samp_rate(self.samp_rate) |