Sorry, I forgot to also attach the .py generated by GNU Radio.
Thank you for your time,
Álvaro
El mar, 22 feb 2022 a las 17:08, Alvaro Pendas Recondo (<[email protected]>)
escribió:
> I am trying to reproduce the simple example described in
> https://kb.ettus.com/Synchronization_and_MIMO_Capability_with_USRP_Devices
> (I did first with 2 N210 with a perfect result both with a MIMO cable and
> an octoclock). I am using GNU Radio, so I attach the two schemes. Those
> are, 2 B210 2 Rx that works as well as with 2 N210; and 2 B210 4 Rx, where
> the problem arises. I already knew that B210 is not recommended for MIMO
> with multiple devices, but I was just giving it a try. By the way, I also
> was capable of reproducing the test with one B210 and one N210 both
> synchronized with the octoclock. I also attach screenshots showing the
> problem between signals of two different devices (again, this only happens
> when using 4 Rx, but not when using 2 Rx with 2 different B210).
>
> El mar, 22 feb 2022 a las 16:20, Marcus D. Leech (<[email protected]>)
> escribió:
>
>> On 2022-02-22 07:36, Alvaro Pendas Recondo wrote:
>> > Hello,
>> >
>> > When I work with 1 B210 I can get 2 Rx perfectly synchronized as
>> > expected. Also, if I use 2 B210 with 1 Rx each, I can synchronize them
>> > with an external reference (in this case the octoclock) without any
>> > problem. However, when using 2 B210 with 2 Rx each (4 Rx in total) the
>> > synchronization is still perfect between Rx of the same devices, but
>> > has some problems between Rx of different devices. Of course, the
>> > result with the octoclock is way better than if I do not use any
>> > external reference. Nevertheless, it seems that there are some
>> > problems with the phase sync (although the frequency sync seems
>> > correct). I wonder if this is a hardware limitation or if there is
>> > something I am not doing right.
>> >
>> > Thank you very much,
>> >
>> > Álvaro
>> >
>> You could perhaps share with us the code you're using to set-up sync
>> among all 4 channels. The B2xx series is not actually designed to
>> support synchronization external
>> to the board, but in some cases, you can sort-of achieve it.
>>
>> _______________________________________________
>> USRP-users mailing list -- [email protected]
>> To unsubscribe send an email to [email protected]
>>
>
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
# SPDX-License-Identifier: GPL-3.0
#
# GNU Radio Python Flow Graph
# Title: mimo_test_2B210_2rx
# GNU Radio version: 3.9.0.0
from distutils.version import StrictVersion
if __name__ == '__main__':
import ctypes
import sys
if sys.platform.startswith('linux'):
try:
x11 = ctypes.cdll.LoadLibrary('libX11.so')
x11.XInitThreads()
except:
print("Warning: failed to XInitThreads()")
from PyQt5 import Qt
from gnuradio import qtgui
from gnuradio.filter import firdes
import sip
from gnuradio import analog
from gnuradio import blocks
from gnuradio import gr
from gnuradio.fft import window
import sys
import signal
from argparse import ArgumentParser
from gnuradio.eng_arg import eng_float, intx
from gnuradio import eng_notation
from gnuradio import uhd
import time
from gnuradio.qtgui import Range, RangeWidget
from PyQt5 import QtCore
from gnuradio import qtgui
class mimo_test_2B210_2rx(gr.top_block, Qt.QWidget):
def __init__(self):
gr.top_block.__init__(self, "mimo_test_2B210_2rx", catch_exceptions=True)
Qt.QWidget.__init__(self)
self.setWindowTitle("mimo_test_2B210_2rx")
qtgui.util.check_set_qss()
try:
self.setWindowIcon(Qt.QIcon.fromTheme('gnuradio-grc'))
except:
pass
self.top_scroll_layout = Qt.QVBoxLayout()
self.setLayout(self.top_scroll_layout)
self.top_scroll = Qt.QScrollArea()
self.top_scroll.setFrameStyle(Qt.QFrame.NoFrame)
self.top_scroll_layout.addWidget(self.top_scroll)
self.top_scroll.setWidgetResizable(True)
self.top_widget = Qt.QWidget()
self.top_scroll.setWidget(self.top_widget)
self.top_layout = Qt.QVBoxLayout(self.top_widget)
self.top_grid_layout = Qt.QGridLayout()
self.top_layout.addLayout(self.top_grid_layout)
self.settings = Qt.QSettings("GNU Radio", "mimo_test_2B210_2rx")
try:
if StrictVersion(Qt.qVersion()) < StrictVersion("5.0.0"):
self.restoreGeometry(self.settings.value("geometry").toByteArray())
else:
self.restoreGeometry(self.settings.value("geometry"))
except:
pass
##################################################
# Variables
##################################################
self.samp_rate = samp_rate = 100e3
self.gain_tx = gain_tx = 0
self.gain_rx = gain_rx = 30
self.freq = freq = 900e6
self.d = d = 0
self.a = a = 40
##################################################
# Blocks
##################################################
self._a_range = Range(1, 200, 1, 40, 200)
self._a_win = RangeWidget(self._a_range, self.set_a, 'a', "counter_slider", float, QtCore.Qt.Horizontal)
self.top_layout.addWidget(self._a_win)
self._gain_tx_range = Range(0, 50, 1, 0, 200)
self._gain_tx_win = RangeWidget(self._gain_tx_range, self.set_gain_tx, 'gain_tx', "counter_slider", float, QtCore.Qt.Horizontal)
self.top_layout.addWidget(self._gain_tx_win)
self._gain_rx_range = Range(0, 50, 1, 30, 200)
self._gain_rx_win = RangeWidget(self._gain_rx_range, self.set_gain_rx, 'gain_rx', "counter_slider", float, QtCore.Qt.Horizontal)
self.top_layout.addWidget(self._gain_rx_win)
self._freq_range = Range(100e6, 5e9, 10e6, 900e6, 200)
self._freq_win = RangeWidget(self._freq_range, self.set_freq, 'freq', "counter_slider", float, QtCore.Qt.Horizontal)
self.top_layout.addWidget(self._freq_win)
self._d_range = Range(0, 100, 1, 0, 200)
self._d_win = RangeWidget(self._d_range, self.set_d, 'd', "counter_slider", int, QtCore.Qt.Horizontal)
self.top_layout.addWidget(self._d_win)
self.uhd_usrp_source_0_0 = uhd.usrp_source(
",".join(("serial=3237C53", "")),
uhd.stream_args(
cpu_format="fc32",
args='',
channels=list(range(0,1)),
),
)
self.uhd_usrp_source_0_0.set_clock_source('external', 0)
self.uhd_usrp_source_0_0.set_time_source('external', 0)
self.uhd_usrp_source_0_0.set_samp_rate(samp_rate)
# No synchronization enforced.
self.uhd_usrp_source_0_0.set_center_freq(freq, 0)
self.uhd_usrp_source_0_0.set_antenna("TX/RX", 0)
self.uhd_usrp_source_0_0.set_gain(gain_rx, 0)
self.uhd_usrp_source_0_0.set_auto_iq_balance(False, 0)
self.uhd_usrp_source_0 = uhd.usrp_source(
",".join(("serial=3237BFC", "")),
uhd.stream_args(
cpu_format="fc32",
args='',
channels=list(range(0,1)),
),
)
self.uhd_usrp_source_0.set_clock_source('external', 0)
self.uhd_usrp_source_0.set_time_source('external', 0)
self.uhd_usrp_source_0.set_samp_rate(samp_rate)
# No synchronization enforced.
self.uhd_usrp_source_0.set_center_freq(freq, 0)
self.uhd_usrp_source_0.set_antenna("TX/RX", 0)
self.uhd_usrp_source_0.set_gain(gain_rx, 0)
self.uhd_usrp_source_0.set_auto_iq_balance(False, 0)
self.uhd_usrp_sink_0 = uhd.usrp_sink(
",".join(('addr0=192.168.10.2', "")),
uhd.stream_args(
cpu_format="fc32",
args='',
channels=[0],
),
'',
)
self.uhd_usrp_sink_0.set_samp_rate(samp_rate)
# No synchronization enforced.
self.uhd_usrp_sink_0.set_center_freq(freq, 0)
self.uhd_usrp_sink_0.set_antenna("TX/RX", 0)
self.uhd_usrp_sink_0.set_gain(gain_tx, 0)
self.qtgui_time_sink_x_0 = qtgui.time_sink_f(
256, #size
samp_rate, #samp_rate
"", #name
2, #number of inputs
None # parent
)
self.qtgui_time_sink_x_0.set_update_time(0.10)
self.qtgui_time_sink_x_0.set_y_axis(-3, 3)
self.qtgui_time_sink_x_0.set_y_label('Amplitude', "")
self.qtgui_time_sink_x_0.enable_tags(True)
self.qtgui_time_sink_x_0.set_trigger_mode(qtgui.TRIG_MODE_FREE, qtgui.TRIG_SLOPE_POS, 0.0, 0, 0, "")
self.qtgui_time_sink_x_0.enable_autoscale(False)
self.qtgui_time_sink_x_0.enable_grid(True)
self.qtgui_time_sink_x_0.enable_axis_labels(True)
self.qtgui_time_sink_x_0.enable_control_panel(False)
self.qtgui_time_sink_x_0.enable_stem_plot(False)
labels = ['C1', 'C2', 'Signal 3', 'Signal 4', 'Signal 5',
'Signal 6', 'Signal 7', 'Signal 8', 'Signal 9', 'Signal 10']
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]
styles = [1, 1, 1, 1, 1,
1, 1, 1, 1, 1]
markers = [-1, -1, -1, -1, -1,
-1, -1, -1, -1, -1]
for i in range(2):
if len(labels[i]) == 0:
self.qtgui_time_sink_x_0.set_line_label(i, "Data {0}".format(i))
else:
self.qtgui_time_sink_x_0.set_line_label(i, labels[i])
self.qtgui_time_sink_x_0.set_line_width(i, widths[i])
self.qtgui_time_sink_x_0.set_line_color(i, colors[i])
self.qtgui_time_sink_x_0.set_line_style(i, styles[i])
self.qtgui_time_sink_x_0.set_line_marker(i, markers[i])
self.qtgui_time_sink_x_0.set_line_alpha(i, alphas[i])
self._qtgui_time_sink_x_0_win = sip.wrapinstance(self.qtgui_time_sink_x_0.pyqwidget(), Qt.QWidget)
self.top_layout.addWidget(self._qtgui_time_sink_x_0_win)
self.blocks_multiply_const_vxx_1_0 = blocks.multiply_const_cc(40)
self.blocks_multiply_const_vxx_1 = blocks.multiply_const_cc(a)
self.blocks_multiply_const_vxx_0 = blocks.multiply_const_cc(0.9)
self.blocks_delay_1_0 = blocks.delay(gr.sizeof_gr_complex*1, 0)
self.blocks_delay_1 = blocks.delay(gr.sizeof_gr_complex*1, d)
self.blocks_complex_to_real_0_0 = blocks.complex_to_real(1)
self.blocks_complex_to_real_0 = blocks.complex_to_real(1)
self.analog_sig_source_x_0 = analog.sig_source_c(samp_rate, analog.GR_COS_WAVE, 500e3/100, 1, 0, 0)
##################################################
# Connections
##################################################
self.connect((self.analog_sig_source_x_0, 0), (self.blocks_multiply_const_vxx_0, 0))
self.connect((self.blocks_complex_to_real_0, 0), (self.qtgui_time_sink_x_0, 0))
self.connect((self.blocks_complex_to_real_0_0, 0), (self.qtgui_time_sink_x_0, 1))
self.connect((self.blocks_delay_1, 0), (self.blocks_complex_to_real_0, 0))
self.connect((self.blocks_delay_1_0, 0), (self.blocks_complex_to_real_0_0, 0))
self.connect((self.blocks_multiply_const_vxx_0, 0), (self.uhd_usrp_sink_0, 0))
self.connect((self.blocks_multiply_const_vxx_1, 0), (self.blocks_delay_1, 0))
self.connect((self.blocks_multiply_const_vxx_1_0, 0), (self.blocks_delay_1_0, 0))
self.connect((self.uhd_usrp_source_0, 0), (self.blocks_multiply_const_vxx_1, 0))
self.connect((self.uhd_usrp_source_0_0, 0), (self.blocks_multiply_const_vxx_1_0, 0))
def closeEvent(self, event):
self.settings = Qt.QSettings("GNU Radio", "mimo_test_2B210_2rx")
self.settings.setValue("geometry", self.saveGeometry())
self.stop()
self.wait()
event.accept()
def get_samp_rate(self):
return self.samp_rate
def set_samp_rate(self, samp_rate):
self.samp_rate = samp_rate
self.analog_sig_source_x_0.set_sampling_freq(self.samp_rate)
self.qtgui_time_sink_x_0.set_samp_rate(self.samp_rate)
self.uhd_usrp_sink_0.set_samp_rate(self.samp_rate)
self.uhd_usrp_source_0.set_samp_rate(self.samp_rate)
self.uhd_usrp_source_0_0.set_samp_rate(self.samp_rate)
def get_gain_tx(self):
return self.gain_tx
def set_gain_tx(self, gain_tx):
self.gain_tx = gain_tx
self.uhd_usrp_sink_0.set_gain(self.gain_tx, 0)
def get_gain_rx(self):
return self.gain_rx
def set_gain_rx(self, gain_rx):
self.gain_rx = gain_rx
self.uhd_usrp_source_0.set_gain(self.gain_rx, 0)
self.uhd_usrp_source_0_0.set_gain(self.gain_rx, 0)
def get_freq(self):
return self.freq
def set_freq(self, freq):
self.freq = freq
self.uhd_usrp_sink_0.set_center_freq(self.freq, 0)
self.uhd_usrp_source_0.set_center_freq(self.freq, 0)
self.uhd_usrp_source_0_0.set_center_freq(self.freq, 0)
def get_d(self):
return self.d
def set_d(self, d):
self.d = d
self.blocks_delay_1.set_dly(self.d)
def get_a(self):
return self.a
def set_a(self, a):
self.a = a
self.blocks_multiply_const_vxx_1.set_k(self.a)
def main(top_block_cls=mimo_test_2B210_2rx, options=None):
if StrictVersion("4.5.0") <= StrictVersion(Qt.qVersion()) < StrictVersion("5.0.0"):
style = gr.prefs().get_string('qtgui', 'style', 'raster')
Qt.QApplication.setGraphicsSystem(style)
qapp = Qt.QApplication(sys.argv)
tb = top_block_cls()
tb.start()
tb.show()
def sig_handler(sig=None, frame=None):
tb.stop()
tb.wait()
Qt.QApplication.quit()
signal.signal(signal.SIGINT, sig_handler)
signal.signal(signal.SIGTERM, sig_handler)
timer = Qt.QTimer()
timer.start(500)
timer.timeout.connect(lambda: None)
qapp.exec_()
if __name__ == '__main__':
main()
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
# SPDX-License-Identifier: GPL-3.0
#
# GNU Radio Python Flow Graph
# Title: mimo_test_2B210_4rx
# GNU Radio version: 3.9.0.0
from distutils.version import StrictVersion
if __name__ == '__main__':
import ctypes
import sys
if sys.platform.startswith('linux'):
try:
x11 = ctypes.cdll.LoadLibrary('libX11.so')
x11.XInitThreads()
except:
print("Warning: failed to XInitThreads()")
from PyQt5 import Qt
from gnuradio import qtgui
from gnuradio.filter import firdes
import sip
from gnuradio import analog
from gnuradio import blocks
from gnuradio import gr
from gnuradio.fft import window
import sys
import signal
from argparse import ArgumentParser
from gnuradio.eng_arg import eng_float, intx
from gnuradio import eng_notation
from gnuradio import uhd
import time
from gnuradio.qtgui import Range, RangeWidget
from PyQt5 import QtCore
from gnuradio import qtgui
class mimo_test_2B210_4rx(gr.top_block, Qt.QWidget):
def __init__(self):
gr.top_block.__init__(self, "mimo_test_2B210_4rx", catch_exceptions=True)
Qt.QWidget.__init__(self)
self.setWindowTitle("mimo_test_2B210_4rx")
qtgui.util.check_set_qss()
try:
self.setWindowIcon(Qt.QIcon.fromTheme('gnuradio-grc'))
except:
pass
self.top_scroll_layout = Qt.QVBoxLayout()
self.setLayout(self.top_scroll_layout)
self.top_scroll = Qt.QScrollArea()
self.top_scroll.setFrameStyle(Qt.QFrame.NoFrame)
self.top_scroll_layout.addWidget(self.top_scroll)
self.top_scroll.setWidgetResizable(True)
self.top_widget = Qt.QWidget()
self.top_scroll.setWidget(self.top_widget)
self.top_layout = Qt.QVBoxLayout(self.top_widget)
self.top_grid_layout = Qt.QGridLayout()
self.top_layout.addLayout(self.top_grid_layout)
self.settings = Qt.QSettings("GNU Radio", "mimo_test_2B210_4rx")
try:
if StrictVersion(Qt.qVersion()) < StrictVersion("5.0.0"):
self.restoreGeometry(self.settings.value("geometry").toByteArray())
else:
self.restoreGeometry(self.settings.value("geometry"))
except:
pass
##################################################
# Variables
##################################################
self.samp_rate = samp_rate = 100e3
self.gain_tx = gain_tx = 0
self.gain_rx = gain_rx = 20
self.freq = freq = 900e6
self.d3 = d3 = 0
self.d2 = d2 = 0
self.d1 = d1 = 0
self.a3 = a3 = 40
self.a2 = a2 = 40
self.a1 = a1 = 40
##################################################
# Blocks
##################################################
self._gain_tx_range = Range(0, 50, 1, 0, 200)
self._gain_tx_win = RangeWidget(self._gain_tx_range, self.set_gain_tx, 'gain_tx', "counter_slider", float, QtCore.Qt.Horizontal)
self.top_layout.addWidget(self._gain_tx_win)
self._gain_rx_range = Range(0, 50, 1, 20, 200)
self._gain_rx_win = RangeWidget(self._gain_rx_range, self.set_gain_rx, 'gain_rx', "counter_slider", float, QtCore.Qt.Horizontal)
self.top_layout.addWidget(self._gain_rx_win)
self._freq_range = Range(100e6, 5e9, 10e6, 900e6, 200)
self._freq_win = RangeWidget(self._freq_range, self.set_freq, 'freq', "counter_slider", float, QtCore.Qt.Horizontal)
self.top_layout.addWidget(self._freq_win)
self._d3_range = Range(0, 100, 1, 0, 200)
self._d3_win = RangeWidget(self._d3_range, self.set_d3, 'd3', "counter_slider", int, QtCore.Qt.Horizontal)
self.top_layout.addWidget(self._d3_win)
self._d2_range = Range(0, 100, 1, 0, 200)
self._d2_win = RangeWidget(self._d2_range, self.set_d2, 'd2', "counter_slider", int, QtCore.Qt.Horizontal)
self.top_layout.addWidget(self._d2_win)
self._d1_range = Range(0, 100, 1, 0, 200)
self._d1_win = RangeWidget(self._d1_range, self.set_d1, 'd1', "counter_slider", int, QtCore.Qt.Horizontal)
self.top_layout.addWidget(self._d1_win)
self._a3_range = Range(1, 1000, 1, 40, 200)
self._a3_win = RangeWidget(self._a3_range, self.set_a3, 'a3', "counter_slider", float, QtCore.Qt.Horizontal)
self.top_layout.addWidget(self._a3_win)
self._a2_range = Range(1, 1000, 1, 40, 200)
self._a2_win = RangeWidget(self._a2_range, self.set_a2, 'a2', "counter_slider", float, QtCore.Qt.Horizontal)
self.top_layout.addWidget(self._a2_win)
self._a1_range = Range(1, 1000, 1, 40, 200)
self._a1_win = RangeWidget(self._a1_range, self.set_a1, 'a1', "counter_slider", float, QtCore.Qt.Horizontal)
self.top_layout.addWidget(self._a1_win)
self.uhd_usrp_source_0_1_0 = uhd.usrp_source(
",".join(("serial=3237C53", "")),
uhd.stream_args(
cpu_format="fc32",
args='',
channels=list(range(0,2)),
),
)
self.uhd_usrp_source_0_1_0.set_clock_source('external', 0)
self.uhd_usrp_source_0_1_0.set_time_source('external', 0)
self.uhd_usrp_source_0_1_0.set_samp_rate(samp_rate)
# No synchronization enforced.
self.uhd_usrp_source_0_1_0.set_center_freq(freq, 0)
self.uhd_usrp_source_0_1_0.set_antenna("TX/RX", 0)
self.uhd_usrp_source_0_1_0.set_gain(gain_rx, 0)
self.uhd_usrp_source_0_1_0.set_auto_iq_balance(False, 0)
self.uhd_usrp_source_0_1_0.set_center_freq(freq, 1)
self.uhd_usrp_source_0_1_0.set_antenna("TX/RX", 1)
self.uhd_usrp_source_0_1_0.set_gain(gain_rx, 1)
self.uhd_usrp_source_0_1_0.set_auto_iq_balance(False, 1)
self.uhd_usrp_source_0_1 = uhd.usrp_source(
",".join(("serial=3237BFC", "")),
uhd.stream_args(
cpu_format="fc32",
args='',
channels=list(range(0,2)),
),
)
self.uhd_usrp_source_0_1.set_clock_source('external', 0)
self.uhd_usrp_source_0_1.set_time_source('external', 0)
self.uhd_usrp_source_0_1.set_samp_rate(samp_rate)
self.uhd_usrp_source_0_1.set_time_unknown_pps(uhd.time_spec(0))
self.uhd_usrp_source_0_1.set_center_freq(freq, 0)
self.uhd_usrp_source_0_1.set_antenna("TX/RX", 0)
self.uhd_usrp_source_0_1.set_gain(gain_rx, 0)
self.uhd_usrp_source_0_1.set_auto_iq_balance(False, 0)
self.uhd_usrp_source_0_1.set_center_freq(freq, 1)
self.uhd_usrp_source_0_1.set_antenna("TX/RX", 1)
self.uhd_usrp_source_0_1.set_gain(gain_rx, 1)
self.uhd_usrp_source_0_1.set_auto_iq_balance(False, 1)
self.uhd_usrp_sink_0 = uhd.usrp_sink(
",".join(('addr0=192.168.10.2', "")),
uhd.stream_args(
cpu_format="fc32",
args='',
channels=[0],
),
'',
)
self.uhd_usrp_sink_0.set_samp_rate(samp_rate*2)
# No synchronization enforced.
self.uhd_usrp_sink_0.set_center_freq(freq, 0)
self.uhd_usrp_sink_0.set_antenna("TX/RX", 0)
self.uhd_usrp_sink_0.set_gain(gain_tx, 0)
self.qtgui_time_sink_x_0 = qtgui.time_sink_f(
256, #size
samp_rate, #samp_rate
"", #name
4, #number of inputs
None # parent
)
self.qtgui_time_sink_x_0.set_update_time(0.10)
self.qtgui_time_sink_x_0.set_y_axis(-3, 3)
self.qtgui_time_sink_x_0.set_y_label('Amplitude', "")
self.qtgui_time_sink_x_0.enable_tags(True)
self.qtgui_time_sink_x_0.set_trigger_mode(qtgui.TRIG_MODE_FREE, qtgui.TRIG_SLOPE_POS, 0.0, 0, 0, "")
self.qtgui_time_sink_x_0.enable_autoscale(False)
self.qtgui_time_sink_x_0.enable_grid(True)
self.qtgui_time_sink_x_0.enable_axis_labels(True)
self.qtgui_time_sink_x_0.enable_control_panel(False)
self.qtgui_time_sink_x_0.enable_stem_plot(False)
labels = ['C1', 'C2', 'C3', 'Signal 4', 'Signal 5',
'Signal 6', 'Signal 7', 'Signal 8', 'Signal 9', 'Signal 10']
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]
styles = [1, 1, 1, 1, 1,
1, 1, 1, 1, 1]
markers = [-1, -1, -1, -1, -1,
-1, -1, -1, -1, -1]
for i in range(4):
if len(labels[i]) == 0:
self.qtgui_time_sink_x_0.set_line_label(i, "Data {0}".format(i))
else:
self.qtgui_time_sink_x_0.set_line_label(i, labels[i])
self.qtgui_time_sink_x_0.set_line_width(i, widths[i])
self.qtgui_time_sink_x_0.set_line_color(i, colors[i])
self.qtgui_time_sink_x_0.set_line_style(i, styles[i])
self.qtgui_time_sink_x_0.set_line_marker(i, markers[i])
self.qtgui_time_sink_x_0.set_line_alpha(i, alphas[i])
self._qtgui_time_sink_x_0_win = sip.wrapinstance(self.qtgui_time_sink_x_0.pyqwidget(), Qt.QWidget)
self.top_layout.addWidget(self._qtgui_time_sink_x_0_win)
self.blocks_multiply_const_vxx_1_0_0 = blocks.multiply_const_cc(a3)
self.blocks_multiply_const_vxx_1_0 = blocks.multiply_const_cc(a2)
self.blocks_multiply_const_vxx_1 = blocks.multiply_const_cc(a1)
self.blocks_multiply_const_vxx_0 = blocks.multiply_const_cc(0.9)
self.blocks_delay_1_0_0 = blocks.delay(gr.sizeof_gr_complex*1, d3)
self.blocks_delay_1_0 = blocks.delay(gr.sizeof_gr_complex*1, d2)
self.blocks_delay_1 = blocks.delay(gr.sizeof_gr_complex*1, d1)
self.blocks_complex_to_real_0_1 = blocks.complex_to_real(1)
self.blocks_complex_to_real_0_0_0 = blocks.complex_to_real(1)
self.blocks_complex_to_real_0_0 = blocks.complex_to_real(1)
self.blocks_complex_to_real_0 = blocks.complex_to_real(1)
self.analog_sig_source_x_0 = analog.sig_source_c(samp_rate, analog.GR_COS_WAVE, 500e3/100, 1, 0, 0)
##################################################
# Connections
##################################################
self.connect((self.analog_sig_source_x_0, 0), (self.blocks_multiply_const_vxx_0, 0))
self.connect((self.blocks_complex_to_real_0, 0), (self.qtgui_time_sink_x_0, 0))
self.connect((self.blocks_complex_to_real_0_0, 0), (self.qtgui_time_sink_x_0, 1))
self.connect((self.blocks_complex_to_real_0_0_0, 0), (self.qtgui_time_sink_x_0, 2))
self.connect((self.blocks_complex_to_real_0_1, 0), (self.qtgui_time_sink_x_0, 3))
self.connect((self.blocks_delay_1, 0), (self.blocks_complex_to_real_0, 0))
self.connect((self.blocks_delay_1_0, 0), (self.blocks_complex_to_real_0_0, 0))
self.connect((self.blocks_delay_1_0_0, 0), (self.blocks_complex_to_real_0_0_0, 0))
self.connect((self.blocks_multiply_const_vxx_0, 0), (self.uhd_usrp_sink_0, 0))
self.connect((self.blocks_multiply_const_vxx_1, 0), (self.blocks_delay_1, 0))
self.connect((self.blocks_multiply_const_vxx_1_0, 0), (self.blocks_delay_1_0, 0))
self.connect((self.blocks_multiply_const_vxx_1_0_0, 0), (self.blocks_delay_1_0_0, 0))
self.connect((self.uhd_usrp_source_0_1, 0), (self.blocks_multiply_const_vxx_1_0, 0))
self.connect((self.uhd_usrp_source_0_1, 1), (self.blocks_multiply_const_vxx_1_0_0, 0))
self.connect((self.uhd_usrp_source_0_1_0, 0), (self.blocks_complex_to_real_0_1, 0))
self.connect((self.uhd_usrp_source_0_1_0, 1), (self.blocks_multiply_const_vxx_1, 0))
def closeEvent(self, event):
self.settings = Qt.QSettings("GNU Radio", "mimo_test_2B210_4rx")
self.settings.setValue("geometry", self.saveGeometry())
self.stop()
self.wait()
event.accept()
def get_samp_rate(self):
return self.samp_rate
def set_samp_rate(self, samp_rate):
self.samp_rate = samp_rate
self.analog_sig_source_x_0.set_sampling_freq(self.samp_rate)
self.qtgui_time_sink_x_0.set_samp_rate(self.samp_rate)
self.uhd_usrp_sink_0.set_samp_rate(self.samp_rate*2)
self.uhd_usrp_source_0_1.set_samp_rate(self.samp_rate)
self.uhd_usrp_source_0_1_0.set_samp_rate(self.samp_rate)
def get_gain_tx(self):
return self.gain_tx
def set_gain_tx(self, gain_tx):
self.gain_tx = gain_tx
self.uhd_usrp_sink_0.set_gain(self.gain_tx, 0)
def get_gain_rx(self):
return self.gain_rx
def set_gain_rx(self, gain_rx):
self.gain_rx = gain_rx
self.uhd_usrp_source_0_1.set_gain(self.gain_rx, 0)
self.uhd_usrp_source_0_1.set_gain(self.gain_rx, 1)
self.uhd_usrp_source_0_1_0.set_gain(self.gain_rx, 0)
self.uhd_usrp_source_0_1_0.set_gain(self.gain_rx, 1)
def get_freq(self):
return self.freq
def set_freq(self, freq):
self.freq = freq
self.uhd_usrp_sink_0.set_center_freq(self.freq, 0)
self.uhd_usrp_source_0_1.set_center_freq(self.freq, 0)
self.uhd_usrp_source_0_1.set_center_freq(self.freq, 1)
self.uhd_usrp_source_0_1_0.set_center_freq(self.freq, 0)
self.uhd_usrp_source_0_1_0.set_center_freq(self.freq, 1)
def get_d3(self):
return self.d3
def set_d3(self, d3):
self.d3 = d3
self.blocks_delay_1_0_0.set_dly(self.d3)
def get_d2(self):
return self.d2
def set_d2(self, d2):
self.d2 = d2
self.blocks_delay_1_0.set_dly(self.d2)
def get_d1(self):
return self.d1
def set_d1(self, d1):
self.d1 = d1
self.blocks_delay_1.set_dly(self.d1)
def get_a3(self):
return self.a3
def set_a3(self, a3):
self.a3 = a3
self.blocks_multiply_const_vxx_1_0_0.set_k(self.a3)
def get_a2(self):
return self.a2
def set_a2(self, a2):
self.a2 = a2
self.blocks_multiply_const_vxx_1_0.set_k(self.a2)
def get_a1(self):
return self.a1
def set_a1(self, a1):
self.a1 = a1
self.blocks_multiply_const_vxx_1.set_k(self.a1)
def main(top_block_cls=mimo_test_2B210_4rx, options=None):
if StrictVersion("4.5.0") <= StrictVersion(Qt.qVersion()) < StrictVersion("5.0.0"):
style = gr.prefs().get_string('qtgui', 'style', 'raster')
Qt.QApplication.setGraphicsSystem(style)
qapp = Qt.QApplication(sys.argv)
tb = top_block_cls()
tb.start()
tb.show()
def sig_handler(sig=None, frame=None):
tb.stop()
tb.wait()
Qt.QApplication.quit()
signal.signal(signal.SIGINT, sig_handler)
signal.signal(signal.SIGTERM, sig_handler)
timer = Qt.QTimer()
timer.start(500)
timer.timeout.connect(lambda: None)
qapp.exec_()
if __name__ == '__main__':
main()
_______________________________________________
USRP-users mailing list -- [email protected]
To unsubscribe send an email to [email protected]