aboutsummaryrefslogtreecommitdiffstats
path: root/flowgraphs/qpsk_sim.py
diff options
context:
space:
mode:
Diffstat (limited to '')
-rwxr-xr-xflowgraphs/qpsk_sim.py19
1 files changed, 9 insertions, 10 deletions
diff --git a/flowgraphs/qpsk_sim.py b/flowgraphs/qpsk_sim.py
index 3c2b288..09a0741 100755
--- a/flowgraphs/qpsk_sim.py
+++ b/flowgraphs/qpsk_sim.py
@@ -136,6 +136,7 @@ class qpsk_sim(gr.top_block, Qt.QWidget):
self.fadingui_netsink_1 = fadingui.netsink(address='udp://localhost:31418', dtype="complex", vlen=1)
self.fadingui_netsink_0_0 = fadingui.netsink(address='udp://localhost:31415', dtype="float", vlen=1)
self.fadingui_netsink_0 = fadingui.netsink(address='udp://localhost:31416', dtype="complex", vlen=1)
+ self.fadingui_multipath_fading_0 = fadingui.multipath_fading(amplitudes=[0.2, 0.08, 0.5, 0.4], delays=[0.25, 3.25, 4, 6.3], los =False)
self.fadingui_ber_0 = fadingui.ber(vgl=list(np.zeros(frame_len)), vlen=frame_len,address='udp://localhost:31420')
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)
@@ -149,20 +150,19 @@ class qpsk_sim(gr.top_block, Qt.QWidget):
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.channels_selective_fading_model_0 = channels.selective_fading_model( 8, 5/samp_rate, True, 5, 0, (0,0.05e-6/samp_rate,0.12e-6/samp_rate,0.2e-6/samp_rate,0.23e-6/samp_rate,0.5e-6/samp_rate,1.6e-6/samp_rate,2.3e-6/samp_rate,5e-6/samp_rate), (0.7943282347242815,0.7943282347242815,0.7943282347242815,1,1,1,0.5011872336272722,0.31622776601683794,0.19952623149688797), 9 )
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])
self.blocks_repack_bits_bb_0 = blocks.repack_bits_bb(2, 8, "", False, gr.GR_LSB_FIRST)
- self.blocks_file_sink_3 = blocks.file_sink(gr.sizeof_gr_complex*1, 'data/qpsk_equalized.dat', False)
+ self.blocks_file_sink_3 = blocks.file_sink(gr.sizeof_gr_complex*1, 'data/equalized_qpsk.dat', False)
self.blocks_file_sink_3.set_unbuffered(False)
- self.blocks_file_sink_2 = blocks.file_sink(gr.sizeof_gr_complex*1, 'data/qpsk_sync.dat', False)
+ self.blocks_file_sink_2 = blocks.file_sink(gr.sizeof_gr_complex*1, 'data/synchronized_qpsk.dat', False)
self.blocks_file_sink_2.set_unbuffered(False)
- self.blocks_file_sink_1 = blocks.file_sink(gr.sizeof_gr_complex*1, 'data/qpsk_locked.dat', False)
+ self.blocks_file_sink_1 = blocks.file_sink(gr.sizeof_gr_complex*1, 'data/locked_qpsk.dat', False)
self.blocks_file_sink_1.set_unbuffered(False)
- self.blocks_file_sink_0 = blocks.file_sink(gr.sizeof_gr_complex*1, 'data/qpsk_channel.dat', False)
+ self.blocks_file_sink_0 = blocks.file_sink(gr.sizeof_gr_complex*1, 'data/channel_qpsk.dat', False)
self.blocks_file_sink_0.set_unbuffered(False)
self.blocks_complex_to_mag_0 = blocks.complex_to_mag(1)
self.analog_random_source_x_0 = blocks.vector_source_b(list(map(int, numpy.random.randint(0, 255, 400))), True)
@@ -178,11 +178,8 @@ class qpsk_sim(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.channels_selective_fading_model_0, 0))
+ self.connect((self.blocks_throttle_0, 0), (self.fadingui_multipath_fading_0, 0))
self.connect((self.blocks_vector_source_x_0, 0), (self.blocks_stream_mux_0, 0))
- self.connect((self.channels_selective_fading_model_0, 0), (self.blocks_file_sink_0, 0))
- self.connect((self.channels_selective_fading_model_0, 0), (self.digital_pfb_clock_sync_xxx_0, 0))
- self.connect((self.channels_selective_fading_model_0, 0), (self.fadingui_netsink_0, 0))
self.connect((self.digital_cma_equalizer_cc_0, 0), (self.blocks_file_sink_3, 0))
self.connect((self.digital_cma_equalizer_cc_0, 0), (self.digital_corr_est_cc_0, 0))
self.connect((self.digital_cma_equalizer_cc_0, 0), (self.fadingui_netsink_1, 0))
@@ -194,6 +191,9 @@ class qpsk_sim(gr.top_block, Qt.QWidget):
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.fadingui_netsink_4, 0))
self.connect((self.digital_pfb_clock_sync_xxx_0, 0), (self.qtgui_const_sink_x_1, 1))
+ self.connect((self.fadingui_multipath_fading_0, 0), (self.blocks_file_sink_0, 0))
+ self.connect((self.fadingui_multipath_fading_0, 0), (self.digital_pfb_clock_sync_xxx_0, 0))
+ self.connect((self.fadingui_multipath_fading_0, 0), (self.fadingui_netsink_0, 0))
self.connect((self.fadingui_phasecorrection_0, 0), (self.blocks_file_sink_1, 0))
self.connect((self.fadingui_phasecorrection_0, 0), (self.digital_constellation_decoder_cb_0, 0))
self.connect((self.fadingui_phasecorrection_0, 0), (self.fadingui_netsink_3, 0))
@@ -240,7 +240,6 @@ class qpsk_sim(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.channels_selective_fading_model_0.set_fDTs(5/self.samp_rate)
def get_rrc_taps(self):
return self.rrc_taps