diff options
Diffstat (limited to '')
-rwxr-xr-x | simulation/QAM_Fading/qam_fading.py | 61 | ||||
-rw-r--r-- | simulation/QAM_Fading/qam_fading_frequency_selectiv.grc | 70 |
2 files changed, 33 insertions, 98 deletions
diff --git a/simulation/QAM_Fading/qam_fading.py b/simulation/QAM_Fading/qam_fading.py index cc1bd08..ea8917c 100755 --- a/simulation/QAM_Fading/qam_fading.py +++ b/simulation/QAM_Fading/qam_fading.py @@ -116,13 +116,6 @@ class qam_fading(gr.top_block, Qt.QWidget): self.params_grid_layout_0.setRowStretch(r, 1) for c in range(1, 2): self.params_grid_layout_0.setColumnStretch(c, 1) - self._time_offset_range = Range(0.999, 1.001, 0.0001, 1.0, 200) - self._time_offset_win = RangeWidget(self._time_offset_range, self.set_time_offset, 'Timing Offset', "counter_slider", float) - self.params_grid_layout_0.addWidget(self._time_offset_win, 0, 1, 1, 1) - for r in range(0, 1): - self.params_grid_layout_0.setRowStretch(r, 1) - for c in range(1, 2): - self.params_grid_layout_0.setColumnStretch(c, 1) self.plots = Qt.QTabWidget() self.plots_widget_0 = Qt.QWidget() self.plots_layout_0 = Qt.QBoxLayout(Qt.QBoxLayout.TopToBottom, self.plots_widget_0) @@ -147,20 +140,6 @@ class qam_fading(gr.top_block, Qt.QWidget): self.params_grid_layout_1.setRowStretch(r, 1) for c in range(0, 1): self.params_grid_layout_1.setColumnStretch(c, 1) - self._noise_volt_range = Range(0, 1, 0.01, 0.0001, 200) - self._noise_volt_win = RangeWidget(self._noise_volt_range, self.set_noise_volt, 'Noise Voltage', "counter_slider", float) - self.params_grid_layout_0.addWidget(self._noise_volt_win, 0, 0, 1, 1) - for r in range(0, 1): - self.params_grid_layout_0.setRowStretch(r, 1) - for c in range(0, 1): - self.params_grid_layout_0.setColumnStretch(c, 1) - self._freq_offset_range = Range(-100e-3, 100e-3, 1e-3, 0, 200) - self._freq_offset_win = RangeWidget(self._freq_offset_range, self.set_freq_offset, 'Frequency Offset', "counter_slider", float) - self.params_grid_layout_0.addWidget(self._freq_offset_win, 1, 0, 1, 1) - for r in range(1, 2): - self.params_grid_layout_0.setRowStretch(r, 1) - for c in range(0, 1): - self.params_grid_layout_0.setColumnStretch(c, 1) self._fc_range = Range(0, 10, 1, 2.4, 200) self._fc_win = RangeWidget(self._fc_range, self.set_fc, 'fc', "counter_slider", float) self.params_grid_layout_0.addWidget(self._fc_win, 1, 2, 1, 1) @@ -175,6 +154,13 @@ class qam_fading(gr.top_block, Qt.QWidget): self.params_grid_layout_1.setRowStretch(r, 1) for c in range(0, 1): self.params_grid_layout_1.setColumnStretch(c, 1) + self._time_offset_range = Range(0.999, 1.001, 0.0001, 1.0, 200) + self._time_offset_win = RangeWidget(self._time_offset_range, self.set_time_offset, 'Timing Offset', "counter_slider", float) + self.params_grid_layout_0.addWidget(self._time_offset_win, 0, 1, 1, 1) + for r in range(0, 1): + self.params_grid_layout_0.setRowStretch(r, 1) + for c in range(1, 2): + self.params_grid_layout_0.setColumnStretch(c, 1) self.qtgui_time_sink_x_0 = qtgui.time_sink_f( 1024, #size samp_rate, #samp_rate @@ -446,6 +432,20 @@ 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._noise_volt_range = Range(0, 1, 0.01, 0.0001, 200) + self._noise_volt_win = RangeWidget(self._noise_volt_range, self.set_noise_volt, 'Noise Voltage', "counter_slider", float) + self.params_grid_layout_0.addWidget(self._noise_volt_win, 0, 0, 1, 1) + for r in range(0, 1): + self.params_grid_layout_0.setRowStretch(r, 1) + for c in range(0, 1): + self.params_grid_layout_0.setColumnStretch(c, 1) + self._freq_offset_range = Range(-100e-3, 100e-3, 1e-3, 0, 200) + self._freq_offset_win = RangeWidget(self._freq_offset_range, self.set_freq_offset, 'Frequency Offset', "counter_slider", float) + self.params_grid_layout_0.addWidget(self._freq_offset_win, 1, 0, 1, 1) + for r in range(1, 2): + self.params_grid_layout_0.setRowStretch(r, 1) + for c in range(0, 1): + self.params_grid_layout_0.setColumnStretch(c, 1) 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]) @@ -466,14 +466,7 @@ class qam_fading(gr.top_block, Qt.QWidget): self.digital_constellation_decoder_cb_0 = digital.constellation_decoder_cb(const) self.digital_cma_equalizer_cc_0_0 = digital.cma_equalizer_cc(eq_ntaps, eq_mod, eq_gain, 2) self.digital_cma_equalizer_cc_0 = digital.cma_equalizer_cc(eq_ntaps, eq_mod, eq_gain, 2) - self.channels_selective_fading_model_0 = channels.selective_fading_model( 8, ((2*fc*1e9)/(3*10e8))/samp_rate, False, 4, 21, (0,1.8), (1,0.12), 8 ) - self.channels_channel_model_0 = channels.channel_model( - noise_voltage=noise_volt, - frequency_offset=freq_offset, - epsilon=time_offset, - taps=chn_taps, - noise_seed=0, - block_tags=False) + self.channels_selective_fading_model_0 = channels.selective_fading_model( 8, 70/samp_rate, False, 4, 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_unpack_k_bits_bb_0_1 = blocks.unpack_k_bits_bb(2) self.blocks_unpack_k_bits_bb_0_0 = blocks.unpack_k_bits_bb(2) self.blocks_unpack_k_bits_bb_0 = blocks.unpack_k_bits_bb(2) @@ -495,14 +488,13 @@ class qam_fading(gr.top_block, Qt.QWidget): self.connect((self.blocks_char_to_float_0_0, 0), (self.blocks_delay_0, 0)) self.connect((self.blocks_char_to_float_0_1, 0), (self.qtgui_time_sink_x_0, 2)) self.connect((self.blocks_delay_0, 0), (self.qtgui_time_sink_x_0, 1)) - self.connect((self.blocks_throttle_0, 0), (self.channels_channel_model_0, 0)) + self.connect((self.blocks_throttle_0, 0), (self.digital_pfb_clock_sync_xxx_0_0, 0)) + self.connect((self.blocks_throttle_0, 0), (self.qtgui_const_sink_x_0, 1)) + self.connect((self.blocks_throttle_0, 0), (self.qtgui_freq_sink_x_0, 1)) self.connect((self.blocks_unpack_k_bits_bb_0, 0), (self.blocks_char_to_float_0, 0)) 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.channels_selective_fading_model_0, 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.qtgui_const_sink_x_0, 1)) - self.connect((self.channels_channel_model_0, 0), (self.qtgui_freq_sink_x_0, 1)) 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.qtgui_const_sink_x_0, 0)) self.connect((self.channels_selective_fading_model_0, 0), (self.qtgui_freq_sink_x_0, 0)) @@ -580,7 +572,7 @@ class qam_fading(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.fc*1e9)/(3*10e8))/self.samp_rate) + self.channels_selective_fading_model_0.set_fDTs(70/self.samp_rate) self.qtgui_freq_sink_x_0.set_frequency_range(0, self.samp_rate) self.qtgui_time_sink_x_0.set_samp_rate(self.samp_rate) @@ -619,7 +611,6 @@ class qam_fading(gr.top_block, Qt.QWidget): def set_fc(self, fc): self.fc = fc - self.channels_selective_fading_model_0.set_fDTs(((2*self.fc*1e9)/(3*10e8))/self.samp_rate) def get_eq_ntaps(self): return self.eq_ntaps diff --git a/simulation/QAM_Fading/qam_fading_frequency_selectiv.grc b/simulation/QAM_Fading/qam_fading_frequency_selectiv.grc index 109a74d..6ee63b3 100644 --- a/simulation/QAM_Fading/qam_fading_frequency_selectiv.grc +++ b/simulation/QAM_Fading/qam_fading_frequency_selectiv.grc @@ -502,32 +502,7 @@ blocks: bus_structure: null coordinate: [648, 316.0] rotation: 0 - state: enabled -- name: channels_selective_fading_model2_1 - id: channels_selective_fading_model2 - parameters: - K: '4.0' - LOS: 'False' - N: '8' - affinity: '' - alias: '' - comment: '' - delay_maxdev: (0.5,0.7,0.9) - delay_std: (1e-4,1e-4,1e-4) - delays: (1.0,1.9,2.7) - fDTs: 0.2/samp_rate - mags: (1,0.95,0.8) - maxoutbuf: '0' - minoutbuf: '0' - ntaps: '8' - seed: '0' - states: - bus_sink: false - bus_source: false - bus_structure: null - coordinate: [888, 276.0] - rotation: 0 - state: disabled + state: bypassed - name: channels_selective_fading_model_0 id: channels_selective_fading_model parameters: @@ -537,43 +512,20 @@ blocks: affinity: '' alias: '' comment: '' - delays: (0,1.8) - fDTs: ((2*fc*1e9)/(3*10e8))/samp_rate - mags: (1,0.12) + delays: (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) + fDTs: 70/samp_rate + mags: (0.7943282347242815,0.7943282347242815,0.7943282347242815,1,1,1,0.5011872336272722,0.31622776601683794,0.19952623149688797) maxoutbuf: '0' minoutbuf: '0' - ntaps: '8' - seed: '21' - states: - bus_sink: false - bus_source: false - bus_structure: null - coordinate: [976, 404.0] - rotation: 0 - state: enabled -- name: channels_selective_fading_model_2 - id: channels_selective_fading_model - parameters: - K: '4.0' - LOS: 'False' - N: '30' - affinity: '' - alias: '' - comment: '' - delays: (0.0,0.1,1.3) - fDTs: '0' - mags: (1,0.99,0.97) - maxoutbuf: '0' - minoutbuf: '0' - ntaps: '8' + ntaps: '9' seed: '0' states: bus_sink: false bus_source: false bus_structure: null - coordinate: [928, 140.0] + coordinate: [960, 300.0] rotation: 0 - state: disabled + state: enabled - name: digital_cma_equalizer_cc_0 id: digital_cma_equalizer_cc parameters: @@ -1532,21 +1484,13 @@ connections: - [blocks_unpack_k_bits_bb_0_0, '0', blocks_char_to_float_0_0, '0'] - [blocks_unpack_k_bits_bb_0_1, '0', blocks_char_to_float_0_1, '0'] - [blocks_vector_source_x_0, '0', digital_constellation_modulator_0, '0'] -- [channels_channel_model_0, '0', channels_selective_fading_model2_1, '0'] - [channels_channel_model_0, '0', channels_selective_fading_model_0, '0'] -- [channels_channel_model_0, '0', channels_selective_fading_model_2, '0'] - [channels_channel_model_0, '0', digital_pfb_clock_sync_xxx_0_0, '0'] - [channels_channel_model_0, '0', qtgui_const_sink_x_0, '1'] - [channels_channel_model_0, '0', qtgui_freq_sink_x_0, '1'] -- [channels_selective_fading_model2_1, '0', digital_pfb_clock_sync_xxx_0, '0'] -- [channels_selective_fading_model2_1, '0', qtgui_const_sink_x_0, '0'] -- [channels_selective_fading_model2_1, '0', qtgui_freq_sink_x_0, '0'] - [channels_selective_fading_model_0, '0', digital_pfb_clock_sync_xxx_0, '0'] - [channels_selective_fading_model_0, '0', qtgui_const_sink_x_0, '0'] - [channels_selective_fading_model_0, '0', qtgui_freq_sink_x_0, '0'] -- [channels_selective_fading_model_2, '0', digital_pfb_clock_sync_xxx_0, '0'] -- [channels_selective_fading_model_2, '0', qtgui_const_sink_x_0, '0'] -- [channels_selective_fading_model_2, '0', qtgui_freq_sink_x_0, '0'] - [digital_cma_equalizer_cc_0, '0', digital_costas_loop_cc_0, '0'] - [digital_cma_equalizer_cc_0, '0', qtgui_const_sink_x_1, '0'] - [digital_cma_equalizer_cc_0_0, '0', digital_costas_loop_cc_0_0, '0'] |