aboutsummaryrefslogtreecommitdiffstats
path: root/simulation/QAM_Fading
diff options
context:
space:
mode:
authorsara <sara.halter@gmx.ch>2021-11-29 16:56:27 +0100
committersara <sara.halter@gmx.ch>2021-11-29 16:56:27 +0100
commit5481f7cd6fca55a54c4c386204e0971cd1b6c036 (patch)
tree626bdf5a8be7a6c5ac34cdbd471d7e233e3c56aa /simulation/QAM_Fading
parentMerge remote-tracking branch 'origin/master' (diff)
downloadFading-5481f7cd6fca55a54c4c386204e0971cd1b6c036.tar.gz
Fading-5481f7cd6fca55a54c4c386204e0971cd1b6c036.zip
FIR Block verbessert
Diffstat (limited to 'simulation/QAM_Fading')
-rwxr-xr-xsimulation/QAM_Fading/qam_fading.py181
-rw-r--r--simulation/QAM_Fading/qam_fading_V2_eigerner_block.grc14
-rwxr-xr-xsimulation/QAM_Fading/qam_fading_block.py33
-rw-r--r--simulation/QAM_Fading/qam_fading_frequency_selectiv_copy.grc2
4 files changed, 35 insertions, 195 deletions
diff --git a/simulation/QAM_Fading/qam_fading.py b/simulation/QAM_Fading/qam_fading.py
index 957530d..42199d1 100755
--- a/simulation/QAM_Fading/qam_fading.py
+++ b/simulation/QAM_Fading/qam_fading.py
@@ -29,7 +29,6 @@ from gnuradio import blocks
import numpy
from gnuradio import channels
from gnuradio import digital
-from gnuradio import filter
from gnuradio import gr
import sys
import signal
@@ -37,7 +36,6 @@ 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
@@ -87,18 +85,11 @@ class qam_fading(gr.top_block, Qt.QWidget):
self.phase_bw = phase_bw = 2 * 3.141592653589793 / 100
self.noise_volt = noise_volt = 0.0001
self.freq_offset = freq_offset = 0
- self.fading_3 = fading_3 = 0
- self.fading_2 = fading_2 = 0
- self.fading_1 = fading_1 = 2
self.eq_ntaps = eq_ntaps = 15
self.eq_mod = eq_mod = 1
self.eq_gain = eq_gain = .01
self.const = const = digital.constellation_16qam().base()
self.chn_taps = chn_taps = [1.0 + 0.0j, ]
- self.amp_3 = amp_3 = 0
- self.amp_2 = amp_2 = 0
- self.amp_1 = amp_1 = 0.2
- self.LOS_NLOS = LOS_NLOS = 1
##################################################
# Blocks
@@ -114,11 +105,6 @@ class qam_fading(gr.top_block, Qt.QWidget):
self.params_grid_layout_1 = Qt.QGridLayout()
self.params_layout_1.addLayout(self.params_grid_layout_1)
self.params.addTab(self.params_widget_1, 'Receiver')
- self.params_widget_2 = Qt.QWidget()
- self.params_layout_2 = Qt.QBoxLayout(Qt.QBoxLayout.TopToBottom, self.params_widget_2)
- self.params_grid_layout_2 = Qt.QGridLayout()
- self.params_layout_2.addLayout(self.params_grid_layout_2)
- self.params.addTab(self.params_widget_2, 'Fading')
self.top_grid_layout.addWidget(self.params)
self._timing_loop_bw_range = Range(0, 200e-3, 10e-3, 2 * 3.141592653589793 / 100, 200)
self._timing_loop_bw_win = RangeWidget(self._timing_loop_bw_range, self.set_timing_loop_bw, 'Time Bandwidth', "counter_slider", float)
@@ -172,27 +158,6 @@ 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_3_range = Range(0, 30, 1, 0, 200)
- self._fading_3_win = RangeWidget(self._fading_3_range, self.set_fading_3, 'Fading 3', "counter_slider", int)
- self.params_grid_layout_2.addWidget(self._fading_3_win, 3, 0, 1, 1)
- for r in range(3, 4):
- self.params_grid_layout_2.setRowStretch(r, 1)
- for c in range(0, 1):
- self.params_grid_layout_2.setColumnStretch(c, 1)
- self._fading_2_range = Range(0, 30, 1, 0, 200)
- self._fading_2_win = RangeWidget(self._fading_2_range, self.set_fading_2, 'Fading 2', "counter_slider", int)
- self.params_grid_layout_2.addWidget(self._fading_2_win, 2, 0, 1, 1)
- for r in range(2, 3):
- self.params_grid_layout_2.setRowStretch(r, 1)
- for c in range(0, 1):
- self.params_grid_layout_2.setColumnStretch(c, 1)
- 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_2.addWidget(self._fading_1_win, 1, 0, 1, 1)
- for r in range(1, 2):
- self.params_grid_layout_2.setRowStretch(r, 1)
- for c in range(0, 1):
- self.params_grid_layout_2.setColumnStretch(c, 1)
self._eq_gain_range = Range(0, .1, .001, .01, 200)
self._eq_gain_win = RangeWidget(self._eq_gain_range, self.set_eq_gain, 'Equalizer Rate', "counter_slider", float)
self.params_grid_layout_1.addWidget(self._eq_gain_win, 0, 0, 1, 1)
@@ -200,34 +165,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._amp_3_range = Range(0, 5, 0.1, 0, 200)
- self._amp_3_win = RangeWidget(self._amp_3_range, self.set_amp_3, 'Ampliude 3', "counter_slider", float)
- self.params_grid_layout_2.addWidget(self._amp_3_win, 3, 1, 1, 1)
- for r in range(3, 4):
- self.params_grid_layout_2.setRowStretch(r, 1)
- for c in range(1, 2):
- self.params_grid_layout_2.setColumnStretch(c, 1)
- self._amp_2_range = Range(0, 5, 0.1, 0, 200)
- self._amp_2_win = RangeWidget(self._amp_2_range, self.set_amp_2, 'Ampliude 2', "counter_slider", float)
- self.params_grid_layout_2.addWidget(self._amp_2_win, 2, 1, 1, 1)
- for r in range(2, 3):
- self.params_grid_layout_2.setRowStretch(r, 1)
- for c in range(1, 2):
- self.params_grid_layout_2.setColumnStretch(c, 1)
- self._amp_1_range = Range(0, 5, 0.1, 0.2, 200)
- self._amp_1_win = RangeWidget(self._amp_1_range, self.set_amp_1, 'Ampliude', "counter_slider", float)
- self.params_grid_layout_2.addWidget(self._amp_1_win, 1, 1, 1, 1)
- for r in range(1, 2):
- self.params_grid_layout_2.setRowStretch(r, 1)
- for c in range(1, 2):
- self.params_grid_layout_2.setColumnStretch(c, 1)
- self._LOS_NLOS_range = Range(0, 1, 1, 1, 200)
- self._LOS_NLOS_win = RangeWidget(self._LOS_NLOS_range, self.set_LOS_NLOS, 'LOS_NLOS', "counter_slider", int)
- self.params_grid_layout_2.addWidget(self._LOS_NLOS_win, 0, 0, 1, 1)
- for r in range(0, 1):
- self.params_grid_layout_2.setRowStretch(r, 1)
- for c in range(0, 1):
- self.params_grid_layout_2.setColumnStretch(c, 1)
self.qtgui_time_sink_x_0 = qtgui.time_sink_f(
1024, #size
samp_rate, #samp_rate
@@ -279,51 +216,6 @@ class qam_fading(gr.top_block, Qt.QWidget):
self.plots_grid_layout_2.setRowStretch(r, 1)
for c in range(0, 1):
self.plots_grid_layout_2.setColumnStretch(c, 1)
- self.qtgui_freq_sink_x_2_1 = qtgui.freq_sink_f(
- 1024, #size
- firdes.WIN_BLACKMAN_hARRIS, #wintype
- 0, #fc
- samp_rate, #bw
- "", #name
- 2
- )
- self.qtgui_freq_sink_x_2_1.set_update_time(0.10)
- self.qtgui_freq_sink_x_2_1.set_y_axis(-140, 10)
- self.qtgui_freq_sink_x_2_1.set_y_label('Relative Gain', 'dB')
- self.qtgui_freq_sink_x_2_1.set_trigger_mode(qtgui.TRIG_MODE_FREE, 0.0, 0, "")
- self.qtgui_freq_sink_x_2_1.enable_autoscale(False)
- self.qtgui_freq_sink_x_2_1.enable_grid(False)
- self.qtgui_freq_sink_x_2_1.set_fft_average(1.0)
- self.qtgui_freq_sink_x_2_1.enable_axis_labels(True)
- self.qtgui_freq_sink_x_2_1.enable_control_panel(False)
-
-
- self.qtgui_freq_sink_x_2_1.set_plot_pos_half(not True)
-
- labels = ['Fading', '', '', '', '',
- '', '', '', '', '']
- widths = [1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1]
- colors = ["blue", "red", "green", "black", "cyan",
- "magenta", "yellow", "dark red", "dark green", "dark blue"]
- alphas = [1.0, 1.0, 1.0, 1.0, 1.0,
- 1.0, 1.0, 1.0, 1.0, 1.0]
-
- for i in range(2):
- if len(labels[i]) == 0:
- self.qtgui_freq_sink_x_2_1.set_line_label(i, "Data {0}".format(i))
- else:
- self.qtgui_freq_sink_x_2_1.set_line_label(i, labels[i])
- self.qtgui_freq_sink_x_2_1.set_line_width(i, widths[i])
- self.qtgui_freq_sink_x_2_1.set_line_color(i, colors[i])
- self.qtgui_freq_sink_x_2_1.set_line_alpha(i, alphas[i])
-
- self._qtgui_freq_sink_x_2_1_win = sip.wrapinstance(self.qtgui_freq_sink_x_2_1.pyqwidget(), Qt.QWidget)
- self.plots_grid_layout_1.addWidget(self._qtgui_freq_sink_x_2_1_win, 1, 0, 1, 1)
- for r in range(1, 2):
- self.plots_grid_layout_1.setRowStretch(r, 1)
- for c in range(0, 1):
- self.plots_grid_layout_1.setColumnStretch(c, 1)
self.qtgui_freq_sink_x_0 = qtgui.freq_sink_c(
1024, #size
firdes.WIN_BLACKMAN_hARRIS, #wintype
@@ -382,7 +274,7 @@ class qam_fading(gr.top_block, Qt.QWidget):
self.qtgui_const_sink_x_2.enable_axis_labels(True)
- labels = ['fading', 'normal', '', '', '',
+ labels = ['Fading', '', '', '', '',
'', '', '', '', '']
widths = [1, 1, 1, 1, 1,
1, 1, 1, 1, 1]
@@ -426,7 +318,7 @@ class qam_fading(gr.top_block, Qt.QWidget):
self.qtgui_const_sink_x_1.enable_axis_labels(True)
- labels = ['fading', 'normal', '', '', '',
+ labels = ['Fading', '', '', '', '',
'', '', '', '', '']
widths = [1, 1, 1, 1, 1,
1, 1, 1, 1, 1]
@@ -470,7 +362,7 @@ class qam_fading(gr.top_block, Qt.QWidget):
self.qtgui_const_sink_x_0_0.enable_axis_labels(True)
- labels = ['fading', 'normal', '', '', '',
+ labels = ['Fading', '', '', '', '',
'', '', '', '', '']
widths = [1, 1, 1, 1, 1,
1, 1, 1, 1, 1]
@@ -514,7 +406,7 @@ class qam_fading(gr.top_block, Qt.QWidget):
self.qtgui_const_sink_x_0.enable_axis_labels(True)
- labels = ['fading', 'normal', '', '', '',
+ labels = ['Fading', '', '', '', '',
'', '', '', '', '']
widths = [1, 1, 1, 1, 1,
1, 1, 1, 1, 1]
@@ -544,10 +436,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.interp_fir_filter_xxx_0 = filter.interp_fir_filter_ccc(1, [LOS_NLOS]+(([0]*fading_1)+[amp_1])+(([0]*fading_2)+[amp_2])+(([0]*fading_3)+[amp_3]))
- 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_pfb_clock_sync_xxx_0 = digital.pfb_clock_sync_ccf(sps * 1.001, timing_loop_bw, rrc_taps, nfilts, nfilts/2, 1.5, 1)
self.digital_map_bb_0_0 = digital.map_bb([0, 1, 3, 2])
self.digital_map_bb_0 = digital.map_bb([0, 1, 3, 2])
self.digital_diff_decoder_bb_0_0 = digital.diff_decoder_bb(4)
@@ -566,6 +456,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, 0, False, 1.0, 0, (0,7), (1,0.2), 2 )
self.channels_channel_model_0 = channels.channel_model(
noise_voltage=noise_volt,
frequency_offset=freq_offset,
@@ -590,20 +481,21 @@ class qam_fading(gr.top_block, Qt.QWidget):
##################################################
self.connect((self.analog_random_source_x_0, 0), (self.blocks_unpack_k_bits_bb_0_0, 0))
self.connect((self.analog_random_source_x_0, 0), (self.digital_constellation_modulator_0, 0))
- self.connect((self.blocks_char_to_float_0, 0), (self.qtgui_freq_sink_x_2_1, 0))
self.connect((self.blocks_char_to_float_0, 0), (self.qtgui_time_sink_x_0, 0))
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_freq_sink_x_2_1, 1))
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_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.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.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))
self.connect((self.digital_cma_equalizer_cc_0, 0), (self.digital_costas_loop_cc_0, 0))
self.connect((self.digital_cma_equalizer_cc_0, 0), (self.qtgui_const_sink_x_1, 0))
self.connect((self.digital_cma_equalizer_cc_0_0, 0), (self.digital_costas_loop_cc_0_0, 0))
@@ -623,9 +515,6 @@ 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.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):
@@ -676,7 +565,6 @@ class qam_fading(gr.top_block, Qt.QWidget):
self.samp_rate = samp_rate
self.blocks_throttle_0.set_sample_rate(self.samp_rate)
self.qtgui_freq_sink_x_0.set_frequency_range(0, self.samp_rate)
- self.qtgui_freq_sink_x_2_1.set_frequency_range(0, self.samp_rate)
self.qtgui_time_sink_x_0.set_samp_rate(self.samp_rate)
def get_rrc_taps(self):
@@ -709,27 +597,6 @@ class qam_fading(gr.top_block, Qt.QWidget):
self.freq_offset = freq_offset
self.channels_channel_model_0.set_frequency_offset(self.freq_offset)
- def get_fading_3(self):
- return self.fading_3
-
- def set_fading_3(self, fading_3):
- self.fading_3 = fading_3
- self.interp_fir_filter_xxx_0.set_taps([self.LOS_NLOS]+(([0]*self.fading_1)+[self.amp_1])+(([0]*self.fading_2)+[self.amp_2])+(([0]*self.fading_3)+[self.amp_3]))
-
- def get_fading_2(self):
- return self.fading_2
-
- def set_fading_2(self, fading_2):
- self.fading_2 = fading_2
- self.interp_fir_filter_xxx_0.set_taps([self.LOS_NLOS]+(([0]*self.fading_1)+[self.amp_1])+(([0]*self.fading_2)+[self.amp_2])+(([0]*self.fading_3)+[self.amp_3]))
-
- def get_fading_1(self):
- return self.fading_1
-
- def set_fading_1(self, fading_1):
- self.fading_1 = fading_1
- self.interp_fir_filter_xxx_0.set_taps([self.LOS_NLOS]+(([0]*self.fading_1)+[self.amp_1])+(([0]*self.fading_2)+[self.amp_2])+(([0]*self.fading_3)+[self.amp_3]))
-
def get_eq_ntaps(self):
return self.eq_ntaps
@@ -765,34 +632,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 get_amp_3(self):
- return self.amp_3
-
- def set_amp_3(self, amp_3):
- self.amp_3 = amp_3
- self.interp_fir_filter_xxx_0.set_taps([self.LOS_NLOS]+(([0]*self.fading_1)+[self.amp_1])+(([0]*self.fading_2)+[self.amp_2])+(([0]*self.fading_3)+[self.amp_3]))
-
- def get_amp_2(self):
- return self.amp_2
-
- def set_amp_2(self, amp_2):
- self.amp_2 = amp_2
- self.interp_fir_filter_xxx_0.set_taps([self.LOS_NLOS]+(([0]*self.fading_1)+[self.amp_1])+(([0]*self.fading_2)+[self.amp_2])+(([0]*self.fading_3)+[self.amp_3]))
-
- def get_amp_1(self):
- return self.amp_1
-
- def set_amp_1(self, amp_1):
- self.amp_1 = amp_1
- self.interp_fir_filter_xxx_0.set_taps([self.LOS_NLOS]+(([0]*self.fading_1)+[self.amp_1])+(([0]*self.fading_2)+[self.amp_2])+(([0]*self.fading_3)+[self.amp_3]))
-
- def get_LOS_NLOS(self):
- return self.LOS_NLOS
-
- def set_LOS_NLOS(self, LOS_NLOS):
- self.LOS_NLOS = LOS_NLOS
- self.interp_fir_filter_xxx_0.set_taps([self.LOS_NLOS]+(([0]*self.fading_1)+[self.amp_1])+(([0]*self.fading_2)+[self.amp_2])+(([0]*self.fading_3)+[self.amp_3]))
-
diff --git a/simulation/QAM_Fading/qam_fading_V2_eigerner_block.grc b/simulation/QAM_Fading/qam_fading_V2_eigerner_block.grc
index 23cb577..641d78e 100644
--- a/simulation/QAM_Fading/qam_fading_V2_eigerner_block.grc
+++ b/simulation/QAM_Fading/qam_fading_V2_eigerner_block.grc
@@ -169,11 +169,11 @@ blocks:
label: Fading
min_len: '200'
orient: Qt.Horizontal
- rangeType: int
+ rangeType: float
start: '1'
- step: '1'
+ step: '0.0001'
stop: '30'
- value: '2'
+ value: sps
widget: counter_slider
states:
bus_sink: false
@@ -808,17 +808,17 @@ blocks:
parameters:
affinity: ''
alias: ''
- amplitudes: '[0.2, 0.2]'
+ amplitudes: '[amp_1]'
comment: ''
- delays: '[4,4]'
- los: 'True'
+ delays: '[fading_1]'
+ los: 'False'
maxoutbuf: '0'
minoutbuf: '0'
states:
bus_sink: false
bus_source: false
bus_structure: null
- coordinate: [968, 324.0]
+ coordinate: [992, 316.0]
rotation: 0
state: true
- name: import_0
diff --git a/simulation/QAM_Fading/qam_fading_block.py b/simulation/QAM_Fading/qam_fading_block.py
index 5622e69..89c4a32 100755
--- a/simulation/QAM_Fading/qam_fading_block.py
+++ b/simulation/QAM_Fading/qam_fading_block.py
@@ -87,7 +87,7 @@ class qam_fading_block(gr.top_block, Qt.QWidget):
self.phase_bw = phase_bw = 2 * 3.141592653589793 / 100
self.noise_volt = noise_volt = 0.0001
self.freq_offset = freq_offset = 0
- self.fading_1 = fading_1 = 2
+ self.fading_1 = fading_1 = sps
self.eq_ntaps = eq_ntaps = 15
self.eq_mod = eq_mod = 1
self.eq_gain = eq_gain = .01
@@ -168,6 +168,13 @@ class qam_fading_block(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, 30, 0.0001, sps, 200)
+ self._fading_1_win = RangeWidget(self._fading_1_range, self.set_fading_1, 'Fading', "counter_slider", float)
+ self.params_grid_layout_2.addWidget(self._fading_1_win, 1, 0, 1, 1)
+ for r in range(1, 2):
+ self.params_grid_layout_2.setRowStretch(r, 1)
+ for c in range(0, 1):
+ self.params_grid_layout_2.setColumnStretch(c, 1)
self._eq_gain_range = Range(0, .1, .001, .01, 200)
self._eq_gain_win = RangeWidget(self._eq_gain_range, self.set_eq_gain, 'Equalizer Rate', "counter_slider", float)
self.params_grid_layout_1.addWidget(self._eq_gain_win, 0, 0, 1, 1)
@@ -175,6 +182,13 @@ class qam_fading_block(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._amp_1_range = Range(0, 5, 0.1, 0.2, 200)
+ self._amp_1_win = RangeWidget(self._amp_1_range, self.set_amp_1, 'Ampliude', "counter_slider", float)
+ self.params_grid_layout_2.addWidget(self._amp_1_win, 1, 1, 1, 1)
+ for r in range(1, 2):
+ self.params_grid_layout_2.setRowStretch(r, 1)
+ for c in range(1, 2):
+ self.params_grid_layout_2.setColumnStretch(c, 1)
self.qtgui_time_sink_x_0 = qtgui.time_sink_f(
1024, #size
samp_rate, #samp_rate
@@ -491,14 +505,7 @@ class qam_fading_block(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.fadingui_multipath_fading_0 = fadingui.multipath_fading(amplitudes=[0.2, 0.2], delays=[4,4])
- 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_2.addWidget(self._fading_1_win, 1, 0, 1, 1)
- for r in range(1, 2):
- self.params_grid_layout_2.setRowStretch(r, 1)
- for c in range(0, 1):
- self.params_grid_layout_2.setColumnStretch(c, 1)
+ self.fadingui_multipath_fading_0 = fadingui.multipath_fading(amplitudes=[amp_1], delays=[fading_1], los =False)
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])
@@ -535,13 +542,6 @@ class qam_fading_block(gr.top_block, Qt.QWidget):
self.blocks_char_to_float_0_0 = blocks.char_to_float(1, 1)
self.blocks_char_to_float_0 = blocks.char_to_float(1, 1)
self.analog_random_source_x_0 = blocks.vector_source_b(list(map(int, numpy.random.randint(0, 256, 1000))), True)
- self._amp_1_range = Range(0, 5, 0.1, 0.2, 200)
- self._amp_1_win = RangeWidget(self._amp_1_range, self.set_amp_1, 'Ampliude', "counter_slider", float)
- self.params_grid_layout_2.addWidget(self._amp_1_win, 1, 1, 1, 1)
- for r in range(1, 2):
- self.params_grid_layout_2.setRowStretch(r, 1)
- for c in range(1, 2):
- self.params_grid_layout_2.setColumnStretch(c, 1)
self._LOS_NLOS_range = Range(0, 1, 1, 1, 200)
self._LOS_NLOS_win = RangeWidget(self._LOS_NLOS_range, self.set_LOS_NLOS, 'LOS_NLOS', "counter_slider", int)
self.params_grid_layout_2.addWidget(self._LOS_NLOS_win, 0, 0, 1, 1)
@@ -605,6 +605,7 @@ class qam_fading_block(gr.top_block, Qt.QWidget):
def set_sps(self, sps):
self.sps = sps
+ self.set_fading_1(self.sps)
self.set_rrc_taps(firdes.root_raised_cosine(self.nfilts, self.nfilts, 1.0/float(self.sps), self.excess_bw, 45*self.nfilts))
def get_nfilts(self):
diff --git a/simulation/QAM_Fading/qam_fading_frequency_selectiv_copy.grc b/simulation/QAM_Fading/qam_fading_frequency_selectiv_copy.grc
index 18f7893..a960ec8 100644
--- a/simulation/QAM_Fading/qam_fading_frequency_selectiv_copy.grc
+++ b/simulation/QAM_Fading/qam_fading_frequency_selectiv_copy.grc
@@ -464,7 +464,7 @@ blocks:
mags: (1,0.2)
maxoutbuf: '0'
minoutbuf: '0'
- ntaps: '1'
+ ntaps: '2'
seed: '0'
states:
bus_sink: false