aboutsummaryrefslogtreecommitdiffstats
path: root/flowgraphs
diff options
context:
space:
mode:
authorsara <sara.halter@gmx.ch>2021-12-11 16:53:21 +0100
committersara <sara.halter@gmx.ch>2021-12-11 16:53:21 +0100
commitdb30c78a9ea1fb786e87559acf6bf66aaed2c33d (patch)
tree38304b9fc87148711e2269d382c6d302aafb06be /flowgraphs
parentPrepare flowgraph for QPSK on USRP hardware (diff)
downloadFading-db30c78a9ea1fb786e87559acf6bf66aaed2c33d.tar.gz
Fading-db30c78a9ea1fb786e87559acf6bf66aaed2c33d.zip
Hardware file angepasst
Diffstat (limited to 'flowgraphs')
-rw-r--r--flowgraphs/qpsk_hw.grc31
-rwxr-xr-xflowgraphs/qpsk_hw.py58
2 files changed, 46 insertions, 43 deletions
diff --git a/flowgraphs/qpsk_hw.grc b/flowgraphs/qpsk_hw.grc
index c47a5df..0acdc61 100644
--- a/flowgraphs/qpsk_hw.grc
+++ b/flowgraphs/qpsk_hw.grc
@@ -537,7 +537,7 @@ blocks:
coordinate: [224, 12.0]
rotation: 0
state: enabled
-- name: qtgui_const_sink_x_0
+- name: qtgui_const_sink_x_0_0
id: qtgui_const_sink_x
parameters:
affinity: ''
@@ -589,7 +589,7 @@ blocks:
marker8: '0'
marker9: '0'
name: '""'
- nconnections: '1'
+ nconnections: '2'
size: '1024'
style1: '0'
style10: '0'
@@ -626,7 +626,7 @@ blocks:
bus_sink: false
bus_source: false
bus_structure: null
- coordinate: [1240, 828.0]
+ coordinate: [1208, 804.0]
rotation: 0
state: true
- name: qtgui_time_sink_x_0
@@ -795,7 +795,7 @@ blocks:
bw7: '0'
bw8: '0'
bw9: '0'
- center_freq0: '0'
+ center_freq0: 2.4e9
center_freq1: '0'
center_freq10: '0'
center_freq11: '0'
@@ -828,7 +828,7 @@ blocks:
center_freq8: '0'
center_freq9: '0'
clock_rate: 0e0
- clock_source0: ''
+ clock_source0: internal
clock_source1: ''
clock_source2: ''
clock_source3: ''
@@ -837,9 +837,9 @@ blocks:
clock_source6: ''
clock_source7: ''
comment: ''
- dev_addr: '""'
+ dev_addr: '"serial=309AF59 "'
dev_args: '""'
- gain0: '0'
+ gain0: '0.4'
gain1: '0'
gain10: '0'
gain11: '0'
@@ -939,7 +939,7 @@ blocks:
maxoutbuf: '0'
minoutbuf: '0'
nchan: '1'
- norm_gain0: 'False'
+ norm_gain0: 'True'
norm_gain1: 'False'
norm_gain10: 'False'
norm_gain11: 'False'
@@ -1000,7 +1000,7 @@ blocks:
bus_sink: false
bus_source: false
bus_structure: null
- coordinate: [320, 700.0]
+ coordinate: [312, 692.0]
rotation: 0
state: true
- name: uhd_usrp_source_0
@@ -1072,7 +1072,7 @@ blocks:
bw7: '0'
bw8: '0'
bw9: '0'
- center_freq0: '0'
+ center_freq0: 2.4e9
center_freq1: '0'
center_freq10: '0'
center_freq11: '0'
@@ -1146,9 +1146,9 @@ blocks:
dc_offs_enb7: '""'
dc_offs_enb8: '""'
dc_offs_enb9: '""'
- dev_addr: '""'
+ dev_addr: '"serial=309AF6A "'
dev_args: '""'
- gain0: '0'
+ gain0: '1'
gain1: '0'
gain10: '0'
gain11: '0'
@@ -1279,7 +1279,7 @@ blocks:
maxoutbuf: '0'
minoutbuf: '0'
nchan: '1'
- norm_gain0: 'False'
+ norm_gain0: 'True'
norm_gain1: 'False'
norm_gain10: 'False'
norm_gain11: 'False'
@@ -1372,7 +1372,7 @@ blocks:
bus_sink: false
bus_source: false
bus_structure: null
- coordinate: [696, 692.0]
+ coordinate: [696, 684.0]
rotation: 0
state: true
- name: virtual_sink_0
@@ -1472,9 +1472,10 @@ connections:
- [digital_corr_est_cc_0, '1', blocks_complex_to_mag_0, '0']
- [digital_pfb_clock_sync_xxx_0, '0', digital_cma_equalizer_cc_0, '0']
- [digital_pfb_clock_sync_xxx_0, '0', fadingui_netsink_4, '0']
+- [digital_pfb_clock_sync_xxx_0, '0', qtgui_const_sink_x_0_0, '0']
- [fadingui_datasource_0, '0', digital_constellation_modulator_0, '0']
- [fadingui_phasecorrection_0, '0', fadingui_netsink_3, '0']
-- [fadingui_phasecorrection_0, '0', qtgui_const_sink_x_0, '0']
+- [fadingui_phasecorrection_0, '0', qtgui_const_sink_x_0_0, '1']
- [fadingui_phasecorrection_0, '0', virtual_sink_2, '0']
- [uhd_usrp_source_0, '0', virtual_sink_1, '0']
- [virtual_source_0, '0', digital_constellation_decoder_cb_0, '0']
diff --git a/flowgraphs/qpsk_hw.py b/flowgraphs/qpsk_hw.py
index 6f64876..198f944 100755
--- a/flowgraphs/qpsk_hw.py
+++ b/flowgraphs/qpsk_hw.py
@@ -81,7 +81,7 @@ class qpsk_hw(gr.top_block, Qt.QWidget):
self.sps = sps = 4
self.nfilts = nfilts = 32
self.excess_bw = excess_bw = 0.35
- self.samp_rate = samp_rate = 1e6
+ self.samp_rate = samp_rate = 1.5e6
self.rrc_taps = rrc_taps = firdes.root_raised_cosine(nfilts, nfilts, 1.0/float(sps), excess_bw, 45*nfilts)
self.qpsk_const = qpsk_const = digital.constellation_qpsk().base()
self.frame_len = frame_len = len(testvec) +4
@@ -91,20 +91,20 @@ class qpsk_hw(gr.top_block, Qt.QWidget):
# Blocks
##################################################
self.uhd_usrp_source_0 = uhd.usrp_source(
- ",".join(("", "")),
+ ",".join(("serial=309AF6A ", "")),
uhd.stream_args(
cpu_format="fc32",
args='',
channels=list(range(0,1)),
),
)
- self.uhd_usrp_source_0.set_center_freq(0, 0)
- self.uhd_usrp_source_0.set_gain(0, 0)
+ self.uhd_usrp_source_0.set_center_freq(2.4e9, 0)
+ self.uhd_usrp_source_0.set_normalized_gain(1, 0)
self.uhd_usrp_source_0.set_antenna('RX2', 0)
self.uhd_usrp_source_0.set_samp_rate(samp_rate)
self.uhd_usrp_source_0.set_time_unknown_pps(uhd.time_spec())
self.uhd_usrp_sink_0 = uhd.usrp_sink(
- ",".join(("", "")),
+ ",".join(("serial=309AF59 ", "")),
uhd.stream_args(
cpu_format="fc32",
args='',
@@ -112,8 +112,9 @@ class qpsk_hw(gr.top_block, Qt.QWidget):
),
'',
)
- self.uhd_usrp_sink_0.set_center_freq(0, 0)
- self.uhd_usrp_sink_0.set_gain(0, 0)
+ self.uhd_usrp_sink_0.set_clock_source('internal', 0)
+ self.uhd_usrp_sink_0.set_center_freq(2.4e9, 0)
+ self.uhd_usrp_sink_0.set_normalized_gain(0.4, 0)
self.uhd_usrp_sink_0.set_antenna('TX/RX', 0)
self.uhd_usrp_sink_0.set_samp_rate(samp_rate)
self.uhd_usrp_sink_0.set_time_unknown_pps(uhd.time_spec())
@@ -164,18 +165,18 @@ class qpsk_hw(gr.top_block, Qt.QWidget):
self._qtgui_time_sink_x_0_win = sip.wrapinstance(self.qtgui_time_sink_x_0.pyqwidget(), Qt.QWidget)
self.top_grid_layout.addWidget(self._qtgui_time_sink_x_0_win)
- self.qtgui_const_sink_x_0 = qtgui.const_sink_c(
+ self.qtgui_const_sink_x_0_0 = qtgui.const_sink_c(
1024, #size
"", #name
- 1 #number of inputs
+ 2 #number of inputs
)
- self.qtgui_const_sink_x_0.set_update_time(0.10)
- self.qtgui_const_sink_x_0.set_y_axis(-2, 2)
- self.qtgui_const_sink_x_0.set_x_axis(-2, 2)
- self.qtgui_const_sink_x_0.set_trigger_mode(qtgui.TRIG_MODE_FREE, qtgui.TRIG_SLOPE_POS, 0.0, 0, "")
- self.qtgui_const_sink_x_0.enable_autoscale(False)
- self.qtgui_const_sink_x_0.enable_grid(False)
- self.qtgui_const_sink_x_0.enable_axis_labels(True)
+ self.qtgui_const_sink_x_0_0.set_update_time(0.10)
+ self.qtgui_const_sink_x_0_0.set_y_axis(-2, 2)
+ self.qtgui_const_sink_x_0_0.set_x_axis(-2, 2)
+ self.qtgui_const_sink_x_0_0.set_trigger_mode(qtgui.TRIG_MODE_FREE, qtgui.TRIG_SLOPE_POS, 0.0, 0, "")
+ self.qtgui_const_sink_x_0_0.enable_autoscale(False)
+ self.qtgui_const_sink_x_0_0.enable_grid(False)
+ self.qtgui_const_sink_x_0_0.enable_axis_labels(True)
labels = ['', '', '', '', '',
@@ -191,19 +192,19 @@ class qpsk_hw(gr.top_block, Qt.QWidget):
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(1):
+ for i in range(2):
if len(labels[i]) == 0:
- self.qtgui_const_sink_x_0.set_line_label(i, "Data {0}".format(i))
+ self.qtgui_const_sink_x_0_0.set_line_label(i, "Data {0}".format(i))
else:
- self.qtgui_const_sink_x_0.set_line_label(i, labels[i])
- self.qtgui_const_sink_x_0.set_line_width(i, widths[i])
- self.qtgui_const_sink_x_0.set_line_color(i, colors[i])
- self.qtgui_const_sink_x_0.set_line_style(i, styles[i])
- self.qtgui_const_sink_x_0.set_line_marker(i, markers[i])
- self.qtgui_const_sink_x_0.set_line_alpha(i, alphas[i])
-
- self._qtgui_const_sink_x_0_win = sip.wrapinstance(self.qtgui_const_sink_x_0.pyqwidget(), Qt.QWidget)
- self.top_grid_layout.addWidget(self._qtgui_const_sink_x_0_win)
+ self.qtgui_const_sink_x_0_0.set_line_label(i, labels[i])
+ self.qtgui_const_sink_x_0_0.set_line_width(i, widths[i])
+ self.qtgui_const_sink_x_0_0.set_line_color(i, colors[i])
+ self.qtgui_const_sink_x_0_0.set_line_style(i, styles[i])
+ self.qtgui_const_sink_x_0_0.set_line_marker(i, markers[i])
+ self.qtgui_const_sink_x_0_0.set_line_alpha(i, alphas[i])
+
+ self._qtgui_const_sink_x_0_0_win = sip.wrapinstance(self.qtgui_const_sink_x_0_0.pyqwidget(), Qt.QWidget)
+ self.top_grid_layout.addWidget(self._qtgui_const_sink_x_0_0_win)
self.fadingui_phasecorrection_0 = fadingui.phasecorrection(frame_len)
self.fadingui_ber_0 = fadingui.ber(vgl=testvec + list(np.zeros(4)), vlen=frame_len)
self.digital_pfb_clock_sync_xxx_0 = digital.pfb_clock_sync_ccf(sps, 2 * np.pi / 100, rrc_taps, 32, 16, 1.5, 1)
@@ -246,8 +247,9 @@ class qpsk_hw(gr.top_block, Qt.QWidget):
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_pfb_clock_sync_xxx_0, 0), (self.digital_cma_equalizer_cc_0, 0))
+ self.connect((self.digital_pfb_clock_sync_xxx_0, 0), (self.qtgui_const_sink_x_0_0, 0))
self.connect((self.fadingui_phasecorrection_0, 0), (self.digital_constellation_decoder_cb_0, 0))
- self.connect((self.fadingui_phasecorrection_0, 0), (self.qtgui_const_sink_x_0, 0))
+ self.connect((self.fadingui_phasecorrection_0, 0), (self.qtgui_const_sink_x_0_0, 1))
self.connect((self.uhd_usrp_source_0, 0), (self.digital_pfb_clock_sync_xxx_0, 0))