diff options
author | sara <sara.halter@gmx.ch> | 2021-11-25 16:43:03 +0100 |
---|---|---|
committer | sara <sara.halter@gmx.ch> | 2021-11-25 16:43:03 +0100 |
commit | 53a380c41e18ea4452ab9fd4e57942eda6a29a0b (patch) | |
tree | 918193754cdcdce98f8ed5c2a4e009c3b94cf9a1 /simulation/QAM_Fading | |
parent | Create test files for correlator (diff) | |
download | Fading-53a380c41e18ea4452ab9fd4e57942eda6a29a0b.tar.gz Fading-53a380c41e18ea4452ab9fd4e57942eda6a29a0b.zip |
Test interpolation angefangen
Diffstat (limited to '')
-rw-r--r-- | simulation/QAM_Fading/epy_block_0.py | 6 | ||||
-rw-r--r-- | simulation/QAM_Fading/qam_fading_V2_eigerner_block.grc | 98 | ||||
-rwxr-xr-x | simulation/QAM_Fading/qam_fading_block.py | 60 |
3 files changed, 12 insertions, 152 deletions
diff --git a/simulation/QAM_Fading/epy_block_0.py b/simulation/QAM_Fading/epy_block_0.py index 8fbab3d..48fe6e9 100644 --- a/simulation/QAM_Fading/epy_block_0.py +++ b/simulation/QAM_Fading/epy_block_0.py @@ -53,12 +53,12 @@ class blk(gr.sync_block): # other base classes are basic_block, decim_block, in x = np.concatenate([np.zeros(d-1), [a], np.zeros(max_len-d)]) sum_x += x - #sum_x[0] = self.los + sum_x[0] = self.los print(sum_x) - H_int = fft(sum_x) + #H_int = fft(sum_x) - h = ifft(H_int) + #h = ifft(H_int) #h[0]=1 diff --git a/simulation/QAM_Fading/qam_fading_V2_eigerner_block.grc b/simulation/QAM_Fading/qam_fading_V2_eigerner_block.grc index 99e01b1..f14bda0 100644 --- a/simulation/QAM_Fading/qam_fading_V2_eigerner_block.grc +++ b/simulation/QAM_Fading/qam_fading_V2_eigerner_block.grc @@ -74,48 +74,6 @@ blocks: coordinate: [1056, 580.0] rotation: 0 state: true -- name: amp_2 - id: variable_qtgui_range - parameters: - comment: '' - gui_hint: 'params@2: 2,1,1,1' - label: Ampliude 2 - min_len: '200' - orient: Qt.Horizontal - rangeType: float - start: '0' - step: '0.1' - stop: '5' - value: '0' - widget: counter_slider - states: - bus_sink: false - bus_source: false - bus_structure: null - coordinate: [1064, 716.0] - rotation: 0 - state: true -- name: amp_3 - id: variable_qtgui_range - parameters: - comment: '' - gui_hint: 'params@2: 3,1,1,1' - label: Ampliude 3 - min_len: '200' - orient: Qt.Horizontal - rangeType: float - start: '0' - step: '0.1' - stop: '5' - value: '0' - widget: counter_slider - states: - bus_sink: false - bus_source: false - bus_structure: null - coordinate: [1064, 852.0] - rotation: 0 - state: true - name: chn_taps id: variable parameters: @@ -224,48 +182,6 @@ blocks: coordinate: [944, 580.0] rotation: 0 state: true -- name: fading_2 - id: variable_qtgui_range - parameters: - comment: '' - gui_hint: 'params@2: 2,0,1,1' - label: Fading 2 - min_len: '200' - orient: Qt.Horizontal - rangeType: int - start: '0' - step: '1' - stop: '30' - value: '0' - widget: counter_slider - states: - bus_sink: false - bus_source: false - bus_structure: null - coordinate: [944, 716.0] - rotation: 0 - state: true -- name: fading_3 - id: variable_qtgui_range - parameters: - comment: '' - gui_hint: 'params@2: 3,0,1,1' - label: Fading 3 - min_len: '200' - orient: Qt.Horizontal - rangeType: int - start: '0' - step: '1' - stop: '30' - value: '0' - widget: counter_slider - states: - bus_sink: false - bus_source: false - bus_structure: null - coordinate: [944, 852.0] - rotation: 0 - state: true - name: freq_offset id: variable_qtgui_range parameters: @@ -881,16 +797,16 @@ blocks: \ in zip(self.amplitudes,self.delays):\n # if d-1 <= 0:\n \ \ # x = np.concatenate([[a], np.zeros(max_len-1)])\n # else:\ \ \n x = np.concatenate([np.zeros(d-1), [a], np.zeros(max_len-d)])\n\ - \ sum_x += x\n \n #sum_x[0] = self.los\n print(sum_x)\n\ - \ \n H_int = fft(sum_x)\n\n h = ifft(H_int)\n\n \ - \ #h[0]=1\n\n y = np.convolve(inp, sum_x)\n \n y+=np.concatenate([self.temp,np.zeros(len(y)-len(self.temp))])\n\ + \ sum_x += x\n \n sum_x[0] = self.los\n print(sum_x)\n\ + \ \n #H_int = fft(sum_x)\n\n #h = ifft(H_int)\n\n \ + \ #h[0]=1\n\n y = np.convolve(inp, sum_x)\n \n y+=np.concatenate([self.temp,np.zeros(len(y)-len(self.temp))])\n\ \ \n\n oup[:] = y[:len(inp)]\n self.temp = y[len(inp):]\ \ \n \n\n return len(oup)" affinity: '' alias: '' - amplitudes: '[0.2,0.2,0.2,0.2,0.2]' + amplitudes: '[0.2,0.2]' comment: '' - delays: '[sps+1,sps+1,sps+1,sps+1,sps+1]' + delays: '[sps+1,sps+1]' los: 'True' maxoutbuf: '0' minoutbuf: '0' @@ -901,7 +817,7 @@ blocks: bus_sink: false bus_source: false bus_structure: null - coordinate: [960, 308.0] + coordinate: [968, 324.0] rotation: 0 state: true - name: epy_block_1 @@ -949,7 +865,7 @@ blocks: bus_sink: false bus_source: false bus_structure: null - coordinate: [600, 20.0] + coordinate: [592, 12.0] rotation: 0 state: true - name: params diff --git a/simulation/QAM_Fading/qam_fading_block.py b/simulation/QAM_Fading/qam_fading_block.py index 8f095b5..b16ac7a 100755 --- a/simulation/QAM_Fading/qam_fading_block.py +++ b/simulation/QAM_Fading/qam_fading_block.py @@ -87,16 +87,12 @@ 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_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 @@ -495,20 +491,6 @@ 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._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) @@ -516,7 +498,7 @@ class qam_fading_block(gr.top_block, Qt.QWidget): self.params_grid_layout_2.setRowStretch(r, 1) for c in range(0, 1): self.params_grid_layout_2.setColumnStretch(c, 1) - self.epy_block_0 = epy_block_0.blk(amplitudes=[0.2,0.2,0.2,0.2,0.2], delays=[sps+1,sps+1,sps+1,sps+1,sps+1], los=True) + self.epy_block_0 = epy_block_0.blk(amplitudes=[0.2,0.2], delays=[sps+1,sps+1], los=True) 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]) @@ -553,20 +535,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_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) @@ -638,7 +606,7 @@ class qam_fading_block(gr.top_block, Qt.QWidget): def set_sps(self, sps): self.sps = sps self.set_rrc_taps(firdes.root_raised_cosine(self.nfilts, self.nfilts, 1.0/float(self.sps), self.excess_bw, 45*self.nfilts)) - self.epy_block_0.delays = [self.sps+1,self.sps+1,self.sps+1,self.sps+1,self.sps+1] + self.epy_block_0.delays = [self.sps+1,self.sps+1] def get_nfilts(self): return self.nfilts @@ -709,18 +677,6 @@ class qam_fading_block(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 - - def get_fading_2(self): - return self.fading_2 - - def set_fading_2(self, fading_2): - self.fading_2 = fading_2 - def get_fading_1(self): return self.fading_1 @@ -762,18 +718,6 @@ class qam_fading_block(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 - - def get_amp_2(self): - return self.amp_2 - - def set_amp_2(self, amp_2): - self.amp_2 = amp_2 - def get_amp_1(self): return self.amp_1 |