diff options
Diffstat (limited to 'simulation/QAM_Fading/qam_fading.py')
-rwxr-xr-x | simulation/QAM_Fading/qam_fading.py | 24 |
1 files changed, 10 insertions, 14 deletions
diff --git a/simulation/QAM_Fading/qam_fading.py b/simulation/QAM_Fading/qam_fading.py index d6ace52..063c91b 100755 --- a/simulation/QAM_Fading/qam_fading.py +++ b/simulation/QAM_Fading/qam_fading.py @@ -37,6 +37,7 @@ from argparse import ArgumentParser from gnuradio.eng_arg import eng_float, intx from gnuradio import eng_notation from gnuradio.qtgui import Range, RangeWidget +import numpy as np from gnuradio import qtgui @@ -160,7 +161,7 @@ class qam_fading(gr.top_block, Qt.QWidget): self.params_grid_layout_0.setRowStretch(r, 1) for c in range(0, 1): self.params_grid_layout_0.setColumnStretch(c, 1) - self._fading_1_range = Range(1, 10, 1, 2, 200) + self._fading_1_range = Range(1, 30, 1, 2, 200) self._fading_1_win = RangeWidget(self._fading_1_range, self.set_fading_1, 'Fading', "counter_slider", int) self.params_grid_layout_0.addWidget(self._fading_1_win, 2, 0, 1, 1) for r in range(2, 3): @@ -490,7 +491,8 @@ class qam_fading(gr.top_block, Qt.QWidget): self.plots_grid_layout_0.setRowStretch(r, 1) for c in range(0, 1): self.plots_grid_layout_0.setColumnStretch(c, 1) - self.freq_xlating_fir_filter_xxx_0 = filter.freq_xlating_fir_filter_ccc(1, [1]+([0]*fading_1)+[0.2], 0, samp_rate) + self.interp_fir_filter_xxx_0 = filter.interp_fir_filter_ccc(1, [1]+([0]*fading_1)+[0.2]) + self.interp_fir_filter_xxx_0.declare_sample_delay(0) self.digital_pfb_clock_sync_xxx_0_0 = digital.pfb_clock_sync_ccf(sps , timing_loop_bw, rrc_taps, nfilts, nfilts/2, 1.5, 1) 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_0 = digital.map_bb([0, 1, 3, 2]) @@ -546,7 +548,7 @@ class qam_fading(gr.top_block, Qt.QWidget): self.connect((self.blocks_unpack_k_bits_bb_0_0, 0), (self.blocks_char_to_float_0_0, 0)) self.connect((self.blocks_unpack_k_bits_bb_0_1, 0), (self.blocks_char_to_float_0_1, 0)) self.connect((self.channels_channel_model_0, 0), (self.digital_pfb_clock_sync_xxx_0_0, 0)) - self.connect((self.channels_channel_model_0, 0), (self.freq_xlating_fir_filter_xxx_0, 0)) + self.connect((self.channels_channel_model_0, 0), (self.interp_fir_filter_xxx_0, 0)) self.connect((self.channels_channel_model_0, 0), (self.qtgui_const_sink_x_0, 1)) self.connect((self.channels_channel_model_0, 0), (self.qtgui_freq_sink_x_0, 1)) self.connect((self.digital_cma_equalizer_cc_0, 0), (self.digital_costas_loop_cc_0, 0)) @@ -568,9 +570,9 @@ class qam_fading(gr.top_block, Qt.QWidget): self.connect((self.digital_pfb_clock_sync_xxx_0, 0), (self.qtgui_const_sink_x_0_0, 0)) self.connect((self.digital_pfb_clock_sync_xxx_0_0, 0), (self.digital_cma_equalizer_cc_0_0, 0)) self.connect((self.digital_pfb_clock_sync_xxx_0_0, 0), (self.qtgui_const_sink_x_0_0, 1)) - self.connect((self.freq_xlating_fir_filter_xxx_0, 0), (self.digital_pfb_clock_sync_xxx_0, 0)) - self.connect((self.freq_xlating_fir_filter_xxx_0, 0), (self.qtgui_const_sink_x_0, 0)) - self.connect((self.freq_xlating_fir_filter_xxx_0, 0), (self.qtgui_freq_sink_x_0, 0)) + self.connect((self.interp_fir_filter_xxx_0, 0), (self.digital_pfb_clock_sync_xxx_0, 0)) + self.connect((self.interp_fir_filter_xxx_0, 0), (self.qtgui_const_sink_x_0, 0)) + self.connect((self.interp_fir_filter_xxx_0, 0), (self.qtgui_freq_sink_x_0, 0)) def closeEvent(self, event): @@ -659,7 +661,7 @@ class qam_fading(gr.top_block, Qt.QWidget): def set_fading_1(self, fading_1): self.fading_1 = fading_1 - self.freq_xlating_fir_filter_xxx_0.set_taps([1]+([0]*self.fading_1)+[0.2]) + self.interp_fir_filter_xxx_0.set_taps([1]+([0]*self.fading_1)+[0.2]) def get_eq_ntaps(self): return self.eq_ntaps @@ -696,12 +698,6 @@ class qam_fading(gr.top_block, Qt.QWidget): self.chn_taps = chn_taps self.channels_channel_model_0.set_taps(self.chn_taps) -def snipfcn_snippet_0(self): - import numpy as np - - -def snippets_main_after_init(tb): - snipfcn_snippet_0(tb) @@ -716,7 +712,7 @@ def main(top_block_cls=qam_fading, options=None): qapp = Qt.QApplication(sys.argv) tb = top_block_cls() - snippets_main_after_init(tb) + tb.start() tb.show() |