aboutsummaryrefslogtreecommitdiffstats
path: root/flowgraphs/qam_sim.py
diff options
context:
space:
mode:
Diffstat (limited to '')
-rwxr-xr-xflowgraphs/qam_sim.py17
1 files changed, 14 insertions, 3 deletions
diff --git a/flowgraphs/qam_sim.py b/flowgraphs/qam_sim.py
index 4d65f2c..3a218f3 100755
--- a/flowgraphs/qam_sim.py
+++ b/flowgraphs/qam_sim.py
@@ -195,7 +195,7 @@ 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, ((2*carrier_freq)/(3*10e8))/samp_rate, False, 4.0, 21, (0,1.8), (1,0.12), 8 )
+ 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,6 +210,14 @@ 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)
@@ -228,18 +236,22 @@ class qam_sim(gr.top_block, Qt.QWidget):
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.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_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))
@@ -286,7 +298,7 @@ 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(((2*self.carrier_freq)/(3*10e8))/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):
@@ -313,7 +325,6 @@ class qam_sim(gr.top_block, Qt.QWidget):
def set_carrier_freq(self, carrier_freq):
self.carrier_freq = carrier_freq
- self.channels_selective_fading_model_0.set_fDTs(((2*self.carrier_freq)/(3*10e8))/self.samp_rate)
def get_access_code(self):
return self.access_code