From fa87c9d862b86378791f302160f9e43d06a2df91 Mon Sep 17 00:00:00 2001 From: sara Date: Thu, 23 Dec 2021 17:14:41 +0100 Subject: Flowgraphs von demo --- flowgraphs/qam_sim.py | 21 ++++----------------- 1 file changed, 4 insertions(+), 17 deletions(-) (limited to 'flowgraphs/qam_sim.py') diff --git a/flowgraphs/qam_sim.py b/flowgraphs/qam_sim.py index 3a218f3..8ef5906 100755 --- a/flowgraphs/qam_sim.py +++ b/flowgraphs/qam_sim.py @@ -182,6 +182,7 @@ class qam_sim(gr.top_block, Qt.QWidget): self.fadingui_netsink_3 = fadingui.netsink(address='udp://localhost:31419', dtype="complex", vlen=1) self.fadingui_netsink_1 = fadingui.netsink(address='udp://localhost:31418', dtype="complex", 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.12], delays=[1.8], los =True) self.fadingui_ber_0 = fadingui.ber(vgl=testvec + list(np.zeros(4)), vlen=frame_len,address='udp://localhost:31415') 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_lms_dd_equalizer_cc_0 = digital.lms_dd_equalizer_cc(15, 2e-3, 1, qam_const) @@ -195,7 +196,6 @@ class qam_sim(gr.top_block, Qt.QWidget): verbose=False, log=False) self.digital_constellation_decoder_cb_0 = digital.constellation_decoder_cb(qam_const) - self.channels_selective_fading_model_0 = channels.selective_fading_model( 8, 70/samp_rate, False, 5, 21, (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.channels_channel_model_0 = channels.channel_model( noise_voltage=100e-3, frequency_offset=1e-3, @@ -210,14 +210,6 @@ class qam_sim(gr.top_block, Qt.QWidget): self.blocks_stream_mux_0 = blocks.stream_mux(gr.sizeof_char*1, [len(testvec), 4, 0]) self.blocks_repack_bits_bb_0 = blocks.repack_bits_bb(2, 8, "", False, gr.GR_LSB_FIRST) self.blocks_null_source_0 = blocks.null_source(gr.sizeof_char*1) - self.blocks_file_sink_3 = blocks.file_sink(gr.sizeof_gr_complex*1, 'data/locked_qam_sim.dat', False) - self.blocks_file_sink_3.set_unbuffered(False) - self.blocks_file_sink_2 = blocks.file_sink(gr.sizeof_gr_complex*1, 'data/equalized_qam_sim.dat', False) - self.blocks_file_sink_2.set_unbuffered(False) - self.blocks_file_sink_1 = blocks.file_sink(gr.sizeof_gr_complex*1, 'data/synchronized_qam_sim.dat', False) - self.blocks_file_sink_1.set_unbuffered(False) - self.blocks_file_sink_0 = blocks.file_sink(gr.sizeof_gr_complex*1, 'data/channel_qam_sim.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) @@ -235,23 +227,19 @@ class qam_sim(gr.top_block, Qt.QWidget): 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_channel_model_0, 0)) self.connect((self.blocks_vector_source_x_0, 0), (self.blocks_stream_mux_0, 0)) - self.connect((self.channels_channel_model_0, 0), (self.channels_selective_fading_model_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.channels_channel_model_0, 0), (self.fadingui_multipath_fading_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_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_lms_dd_equalizer_cc_0, 0), (self.blocks_file_sink_2, 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.fadingui_netsink_1, 0)) self.connect((self.digital_lms_dd_equalizer_cc_0, 0), (self.qtgui_const_sink_x_0, 1)) - self.connect((self.digital_pfb_clock_sync_xxx_0, 0), (self.blocks_file_sink_1, 0)) 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.fadingui_netsink_4, 0)) self.connect((self.digital_pfb_clock_sync_xxx_0, 0), (self.qtgui_const_sink_x_0, 0)) - self.connect((self.fadingui_phasecorrection_0, 0), (self.blocks_file_sink_3, 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.digital_constellation_decoder_cb_0, 0)) self.connect((self.fadingui_phasecorrection_0, 0), (self.fadingui_netsink_3, 0)) self.connect((self.fadingui_phasecorrection_0, 0), (self.qtgui_const_sink_x_0, 2)) @@ -298,7 +286,6 @@ class qam_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(70/self.samp_rate) self.qtgui_time_sink_x_0.set_samp_rate(self.samp_rate / self.sps) def get_rrc_taps(self): -- cgit v1.2.1