Hi Marcus, I have fixed the two parallel SISO by removing packeting encoding, using QT GUI instead of WX. But the 'L' indicator still comes on, even sooner than previous version. The GRC and generated python files are attached.
Rui On Tue, Aug 1, 2017 at 12:04 PM, Marcus Müller <muel...@kit.edu> wrote: > Ah, cool, but then I wouldn't start by packetizing data. > > Simply send your file GMSK-Modulated; drop the packet encoding; think > about it: the MIMO coding (usually) happens *after* the data has been > formed to logical data units. > > A few notes on your flowgraphs: Don't use the WX GUI elements in new > flowgraphs. We have deprecated them, since no-one can maintain them, and > the Qt GUI sinks have shown to be both more stable and efficient. As far as > I can foresee your application's needs, Qt has replacements for all the WX > visualizations you'd need. > > For the receiver, I'd guess you'd first simply start by just recording > from to channels, and then experimenting with things like > cross-correlation, and estimating the channel matrix based on your known > transmit signal. I wouldn't be surprised if the channel is rather boring in > your setup – I blindly assume you're doing this indoors, and that limits > the path difference and the amount of change (and hence, the delay spread > and the doppler spread) your signals are subject to, especially since your > bandwidth is so low. Of course, having a flat channel is nice :) but it > also means that it might be quite hard to get any actual MIMO gain, because > the two RX antennas might be very correlated. If in doubt, increase > bandwidth. Be agressive with roll-off / Bandwidth factors of your GMSK. > Cheers, > Marcus > > > On 08/01/2017 05:51 PM, Rui ZOU wrote: > > Hi Marcus, > > My goal is to first build a 2-by-2 space multiplexing MIMO using two X310s > and GNU Radio. As I'm new to all this stuff, I'm starting from building 2 > parallel SISOs. If there are some good kick-start materials or any > resources, they will be very valuable. Thanks. > > Rui > > On Tue, Aug 1, 2017 at 11:37 AM, Marcus Müller <muel...@kit.edu> wrote: > >> Hi Rui, >> >> sorry, I might simply have missed those, and didn't find your first email >> when I saw your recent one! I apologize. >> >> So, hm, interestingly, we have a severe bug in the packet_encoder block >> (its design is pretty bad, and that triggers an unexpected behaviour >> underneath). That might mean the packet_encoder is just consuming items as >> fast as it can, without actually producing packets. In other words, >> packet_encoder is broken; you can't use it right now. >> >> The more appropriate way of dealing with data might be in the example >> flowgraphs that you'd find under /usr/[local/]share/doc/gnuradi >> o/examples/digital/packet_loopback_hier.grc ; it's a lot more >> complicated, though, and you'd have to write a message / PDU source that >> gives you the data you want to transmit, rather than the Random PDU block! >> >> I don't really know if that is the way to go. What is it, that you want >> to build? Maybe the mailing list can advise? >> >> Best regards, >> >> Marcus >> >> On 08/01/2017 05:26 PM, Rui ZOU wrote: >> >> Here are the two flowgraphs I have used. I have tried to attach the two >> files in my first email. Probably failed in doing that. If still not seen, >> please let me know so I will try again. Thanks for your help. >> >> Running the first flow graph will cause GRC stop responding instantly, >> while the second one can run for a little while and produce lots of 'L' >> before going not responsive. >> >> Rui >> >> On Tue, Aug 1, 2017 at 11:09 AM, Marcus Müller <muel...@kit.edu> wrote: >> >>> Hi Rui, >>> >>> don't know, to me, it looks like replying didn't work out great, since >>> my mail client showed your mail in a new thread. Really, replying to a >>> mailing list mail should be nothing more than hitting the "reply" or "reply >>> all" button. >>> >>> Anyway, even the slowest PC/laptop/Raspberry Pi/… I could think of would >>> be able to deal with these rates, so there's very, very likely something >>> wrong with the GNU Radio flowgraph you're using. Maybe you'd want to share >>> that! >>> >>> Best regards, >>> >>> Marcus >>> >>> On 08/01/2017 04:59 PM, Rui ZOU wrote: >>> >>> Hi Marcus, >>> >>> Sorry for leaving the title empty, that's the first time to post to a >>> mailing list. This is also the first time to reply, no sure if I replied >>> correctly. >>> >>> I use 390.625k as the sampling rate because this is the lowest I can get >>> using the Ettus X310 without giving me a warning saying that the sampling >>> rate cannot be provided by the hardware. The application is just >>> transmitting a file using GMSK modulation on the two daughter boards of >>> X310. >>> >>> Rui >>> >>> >>> _______________________________________________ >>> Discuss-gnuradio mailing >>> listDiscuss-gnuradio@gnu.orghttps://lists.gnu.org/mailman/listinfo/discuss-gnuradio >>> >>> >>> >> >> > >
twoparatx.grc
Description: Binary data
#!/usr/bin/env python2 # -*- coding: utf-8 -*- ################################################## # GNU Radio Python Flow Graph # Title: Twoparatx # Generated: Tue Aug 1 14:26:31 2017 ################################################## 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 PyQt4 import Qt from gnuradio import blocks from gnuradio import digital from gnuradio import eng_notation from gnuradio import gr from gnuradio import qtgui from gnuradio import uhd from gnuradio.eng_option import eng_option from gnuradio.filter import firdes from gnuradio.qtgui import Range, RangeWidget from optparse import OptionParser import sip import sys import time class twoparatx(gr.top_block, Qt.QWidget): def __init__(self): gr.top_block.__init__(self, "Twoparatx") Qt.QWidget.__init__(self) self.setWindowTitle("Twoparatx") 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", "twoparatx") self.restoreGeometry(self.settings.value("geometry").toByteArray()) ################################################## # Variables ################################################## self.samp_rate = samp_rate = 390.625e3 self.center_freq = center_freq = 2.41e9 ################################################## # Blocks ################################################## self._center_freq_range = Range(2.4e9, 2.48e9, 1e7, 2.41e9, 200) self._center_freq_win = RangeWidget(self._center_freq_range, self.set_center_freq, "center_freq", "counter_slider", float) self.top_layout.addWidget(self._center_freq_win) self.uhd_usrp_sink_0 = uhd.usrp_sink( ",".join(("addr0=192.168.10.2", "")), uhd.stream_args( cpu_format="fc32", channels=range(2), ), ) self.uhd_usrp_sink_0.set_subdev_spec('A:0 B:0', 0) self.uhd_usrp_sink_0.set_samp_rate(samp_rate) self.uhd_usrp_sink_0.set_center_freq(2.41e9, 0) self.uhd_usrp_sink_0.set_gain(20, 0) self.uhd_usrp_sink_0.set_antenna('TX/RX', 0) self.uhd_usrp_sink_0.set_center_freq(2.47e9, 1) self.uhd_usrp_sink_0.set_gain(20, 1) self.uhd_usrp_sink_0.set_antenna('TX/RX', 1) self.qtgui_freq_sink_x_0 = qtgui.freq_sink_c( 1024, #size firdes.WIN_BLACKMAN_hARRIS, #wintype center_freq, #fc samp_rate, #bw "", #name 2 #number of inputs ) self.qtgui_freq_sink_x_0.set_update_time(0.10) self.qtgui_freq_sink_x_0.set_y_axis(-140, 10) self.qtgui_freq_sink_x_0.set_y_label('Relative Gain', 'dB') self.qtgui_freq_sink_x_0.set_trigger_mode(qtgui.TRIG_MODE_FREE, 0.0, 0, "") self.qtgui_freq_sink_x_0.enable_autoscale(False) self.qtgui_freq_sink_x_0.enable_grid(False) self.qtgui_freq_sink_x_0.set_fft_average(1.0) self.qtgui_freq_sink_x_0.enable_axis_labels(True) self.qtgui_freq_sink_x_0.enable_control_panel(False) if not True: self.qtgui_freq_sink_x_0.disable_legend() if "complex" == "float" or "complex" == "msg_float": self.qtgui_freq_sink_x_0.set_plot_pos_half(not True) labels = ['', '', '', '', '', '', '', '', '', ''] 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 xrange(2): if len(labels[i]) == 0: self.qtgui_freq_sink_x_0.set_line_label(i, "Data {0}".format(i)) else: self.qtgui_freq_sink_x_0.set_line_label(i, labels[i]) self.qtgui_freq_sink_x_0.set_line_width(i, widths[i]) self.qtgui_freq_sink_x_0.set_line_color(i, colors[i]) self.qtgui_freq_sink_x_0.set_line_alpha(i, alphas[i]) self._qtgui_freq_sink_x_0_win = sip.wrapinstance(self.qtgui_freq_sink_x_0.pyqwidget(), Qt.QWidget) self.top_layout.addWidget(self._qtgui_freq_sink_x_0_win) self.digital_gmsk_mod_0_0 = digital.gmsk_mod( samples_per_symbol=2, bt=0.35, verbose=False, log=False, ) self.digital_gmsk_mod_0 = digital.gmsk_mod( samples_per_symbol=2, bt=0.35, verbose=False, log=False, ) self.blocks_multiply_const_vxx_0_0 = blocks.multiply_const_vcc((1, )) self.blocks_multiply_const_vxx_0 = blocks.multiply_const_vcc((1, )) self.blocks_file_source_0_0 = blocks.file_source(gr.sizeof_char*1, '/home/netwis8/gnuradiopractice/srcfile2', True) self.blocks_file_source_0 = blocks.file_source(gr.sizeof_char*1, '/home/netwis8/gnuradiopractice/srcfile1', True) ################################################## # Connections ################################################## self.connect((self.blocks_file_source_0, 0), (self.digital_gmsk_mod_0, 0)) self.connect((self.blocks_file_source_0_0, 0), (self.digital_gmsk_mod_0_0, 0)) self.connect((self.blocks_multiply_const_vxx_0, 0), (self.qtgui_freq_sink_x_0, 0)) self.connect((self.blocks_multiply_const_vxx_0, 0), (self.uhd_usrp_sink_0, 0)) self.connect((self.blocks_multiply_const_vxx_0_0, 0), (self.qtgui_freq_sink_x_0, 1)) self.connect((self.blocks_multiply_const_vxx_0_0, 0), (self.uhd_usrp_sink_0, 1)) self.connect((self.digital_gmsk_mod_0, 0), (self.blocks_multiply_const_vxx_0, 0)) self.connect((self.digital_gmsk_mod_0_0, 0), (self.blocks_multiply_const_vxx_0_0, 0)) def closeEvent(self, event): self.settings = Qt.QSettings("GNU Radio", "twoparatx") self.settings.setValue("geometry", self.saveGeometry()) event.accept() def get_samp_rate(self): return self.samp_rate def set_samp_rate(self, samp_rate): self.samp_rate = samp_rate self.uhd_usrp_sink_0.set_samp_rate(self.samp_rate) self.qtgui_freq_sink_x_0.set_frequency_range(self.center_freq, self.samp_rate) def get_center_freq(self): return self.center_freq def set_center_freq(self, center_freq): self.center_freq = center_freq self.qtgui_freq_sink_x_0.set_frequency_range(self.center_freq, self.samp_rate) def main(top_block_cls=twoparatx, options=None): if gr.enable_realtime_scheduling() != gr.RT_OK: print "Error: failed to enable real-time scheduling." from distutils.version import StrictVersion if StrictVersion(Qt.qVersion()) >= StrictVersion("4.5.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 quitting(): tb.stop() tb.wait() qapp.connect(qapp, Qt.SIGNAL("aboutToQuit()"), quitting) qapp.exec_() if __name__ == '__main__': main()
onefile2tx.grc
Description: Binary data
#!/usr/bin/env python2 # -*- coding: utf-8 -*- ################################################## # GNU Radio Python Flow Graph # Title: Onefile2Tx # Generated: Tue Aug 1 14:21:57 2017 ################################################## 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 PyQt4 import Qt from gnuradio import blocks from gnuradio import digital from gnuradio import eng_notation from gnuradio import gr from gnuradio import qtgui from gnuradio import uhd from gnuradio.eng_option import eng_option from gnuradio.filter import firdes from gnuradio.qtgui import Range, RangeWidget from optparse import OptionParser import sip import sys import time class onefile2tx(gr.top_block, Qt.QWidget): def __init__(self): gr.top_block.__init__(self, "Onefile2Tx") Qt.QWidget.__init__(self) self.setWindowTitle("Onefile2Tx") 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", "onefile2tx") self.restoreGeometry(self.settings.value("geometry").toByteArray()) ################################################## # Variables ################################################## self.samp_rate = samp_rate = 390.625e3 self.center_freq = center_freq = 2.41e9 ################################################## # Blocks ################################################## self._center_freq_range = Range(2.4e9, 2.48e9, 1e7, 2.41e9, 200) self._center_freq_win = RangeWidget(self._center_freq_range, self.set_center_freq, "center_freq", "counter_slider", float) self.top_layout.addWidget(self._center_freq_win) self.uhd_usrp_sink_0 = uhd.usrp_sink( ",".join(("addr0=192.168.10.2", "")), uhd.stream_args( cpu_format="fc32", channels=range(2), ), ) self.uhd_usrp_sink_0.set_subdev_spec('A:0 B:0', 0) self.uhd_usrp_sink_0.set_samp_rate(samp_rate) self.uhd_usrp_sink_0.set_center_freq(2.41e9, 0) self.uhd_usrp_sink_0.set_gain(20, 0) self.uhd_usrp_sink_0.set_antenna('TX/RX', 0) self.uhd_usrp_sink_0.set_center_freq(2.47e9, 1) self.uhd_usrp_sink_0.set_gain(20, 1) self.uhd_usrp_sink_0.set_antenna('TX/RX', 1) self.qtgui_freq_sink_x_0 = qtgui.freq_sink_c( 1024, #size firdes.WIN_BLACKMAN_hARRIS, #wintype center_freq, #fc samp_rate, #bw "", #name 1 #number of inputs ) self.qtgui_freq_sink_x_0.set_update_time(0.10) self.qtgui_freq_sink_x_0.set_y_axis(-140, 10) self.qtgui_freq_sink_x_0.set_y_label('Relative Gain', 'dB') self.qtgui_freq_sink_x_0.set_trigger_mode(qtgui.TRIG_MODE_FREE, 0.0, 0, "") self.qtgui_freq_sink_x_0.enable_autoscale(False) self.qtgui_freq_sink_x_0.enable_grid(False) self.qtgui_freq_sink_x_0.set_fft_average(1.0) self.qtgui_freq_sink_x_0.enable_axis_labels(True) self.qtgui_freq_sink_x_0.enable_control_panel(False) if not True: self.qtgui_freq_sink_x_0.disable_legend() if "complex" == "float" or "complex" == "msg_float": self.qtgui_freq_sink_x_0.set_plot_pos_half(not True) labels = ['', '', '', '', '', '', '', '', '', ''] 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 xrange(1): if len(labels[i]) == 0: self.qtgui_freq_sink_x_0.set_line_label(i, "Data {0}".format(i)) else: self.qtgui_freq_sink_x_0.set_line_label(i, labels[i]) self.qtgui_freq_sink_x_0.set_line_width(i, widths[i]) self.qtgui_freq_sink_x_0.set_line_color(i, colors[i]) self.qtgui_freq_sink_x_0.set_line_alpha(i, alphas[i]) self._qtgui_freq_sink_x_0_win = sip.wrapinstance(self.qtgui_freq_sink_x_0.pyqwidget(), Qt.QWidget) self.top_layout.addWidget(self._qtgui_freq_sink_x_0_win) self.digital_gmsk_mod_0 = digital.gmsk_mod( samples_per_symbol=2, bt=0.35, verbose=False, log=False, ) self.blocks_multiply_const_vxx_0 = blocks.multiply_const_vcc((1, )) self.blocks_file_source_0 = blocks.file_source(gr.sizeof_char*1, '/home/netwis8/gnuradiopractice/srcfile1', True) ################################################## # Connections ################################################## self.connect((self.blocks_file_source_0, 0), (self.digital_gmsk_mod_0, 0)) self.connect((self.blocks_multiply_const_vxx_0, 0), (self.qtgui_freq_sink_x_0, 0)) self.connect((self.blocks_multiply_const_vxx_0, 0), (self.uhd_usrp_sink_0, 0)) self.connect((self.blocks_multiply_const_vxx_0, 0), (self.uhd_usrp_sink_0, 1)) self.connect((self.digital_gmsk_mod_0, 0), (self.blocks_multiply_const_vxx_0, 0)) def closeEvent(self, event): self.settings = Qt.QSettings("GNU Radio", "onefile2tx") self.settings.setValue("geometry", self.saveGeometry()) event.accept() def get_samp_rate(self): return self.samp_rate def set_samp_rate(self, samp_rate): self.samp_rate = samp_rate self.uhd_usrp_sink_0.set_samp_rate(self.samp_rate) self.qtgui_freq_sink_x_0.set_frequency_range(self.center_freq, self.samp_rate) def get_center_freq(self): return self.center_freq def set_center_freq(self, center_freq): self.center_freq = center_freq self.qtgui_freq_sink_x_0.set_frequency_range(self.center_freq, self.samp_rate) def main(top_block_cls=onefile2tx, options=None): if gr.enable_realtime_scheduling() != gr.RT_OK: print "Error: failed to enable real-time scheduling." from distutils.version import StrictVersion if StrictVersion(Qt.qVersion()) >= StrictVersion("4.5.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 quitting(): tb.stop() tb.wait() qapp.connect(qapp, Qt.SIGNAL("aboutToQuit()"), quitting) qapp.exec_() if __name__ == '__main__': main()
_______________________________________________ Discuss-gnuradio mailing list Discuss-gnuradio@gnu.org https://lists.gnu.org/mailman/listinfo/discuss-gnuradio