def set_Sps(self, Sps): self.Sps = Sps self.set_Rs(self.samp_rate / self.Sps) self.set_h(wform.rect(self.Sps)) self.set_ntaps(self.Sps * 16) self.b_Eye_Diagram_simple_c_0.set_Sps1(self.Sps) self.blocks_multiply_const_vxx_0.set_k(1 / self.Sps) self.epy_block_0.Sps = self.Sps
def set_Sps(self, Sps): self.Sps = Sps self.set_hrrc(wform.rrcos(self.Sps,self.ntaps,self.rolloff)) self.set_hrc(wform.rcos(self.Sps,self.ntaps,self.rolloff)) self.set_hr(wform.rect(self.Sps,self.ntaps)) self.set_hn(wform.nyq(self.Sps,self.ntaps)) self.interp_fir_filter_xxx_0_0_2.set_taps((numpy.multiply(self.hrc,1./self.Sps))) self.interp_fir_filter_xxx_0_0_1_0.set_taps((numpy.multiply(self.hrrc,1./self.Sps))) self.interp_fir_filter_xxx_0_0_1.set_taps((numpy.multiply(self.hn,1./self.Sps))) self.interp_fir_filter_xxx_0_0.set_taps((numpy.multiply(self.hr,1./self.Sps))) self.b_sampler_cc_0_0.set_Sps(self.Sps) self.b_Eye_Diagram_simple_c_0_0_1.set_Sps1(self.Sps) self.b_Eye_Diagram_simple_c_0_0_0.set_Sps1(self.Sps) self.b_Eye_Diagram_simple_c_0_0.set_Sps1(self.Sps) self.b_Eye_Diagram_simple_c_0.set_Sps1(self.Sps) self.set_Rs(self.samp_rate/self.Sps)
def set_ntaps(self, ntaps): self.ntaps = ntaps self.set_hrrc(wform.rrcos(self.Sps,self.ntaps,self.rolloff)) self.set_hrc(wform.rcos(self.Sps,self.ntaps,self.rolloff)) self.set_hr(wform.rect(self.Sps,self.ntaps)) self.set_hn(wform.nyq(self.Sps,self.ntaps))
def __init__(self): gr.top_block.__init__(self, "Lab Total") Qt.QWidget.__init__(self) self.setWindowTitle("Lab Total") 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", "Lab_total") self.restoreGeometry(self.settings.value("geometry").toByteArray()) ################################################## # Variables ################################################## self.m = m = 9 self.samp_rate_usrp = samp_rate_usrp = 100000000 self.Kd = Kd = math.pow(2,m) self.Constelacion = Constelacion = [1.+0.j, -1.+0.j ] self.samp_rate = samp_rate = int(samp_rate_usrp/Kd) self.Sps = Sps = 16 self.M = M = len(Constelacion) self.rolloff = rolloff = 0.35 self.ntaps = ntaps = 128 self.Rs = Rs = samp_rate/Sps self.Bps = Bps = int(math.log(M,2)) self.run_stop = run_stop = True self.hrrc = hrrc = wform.rrcos(Sps,ntaps,rolloff) self.hrc = hrc = wform.rcos(Sps,ntaps,rolloff) self.hr = hr = wform.rect(Sps,ntaps) self.hn = hn = wform.nyq(Sps,ntaps) self.Tmax_scope = Tmax_scope = 64./Rs self.TimingDelay = TimingDelay = 0 self.Rb = Rb = Rs*Bps self.NodB = NodB = -65 self.MiconstellationObject = MiconstellationObject = digital.constellation_calcdist((Constelacion), (), 4, 1).base() self.Fc = Fc = 80e6 self.BW = BW = samp_rate/2. ################################################## # Blocks ################################################## self.pestana = Qt.QTabWidget() self.pestana_widget_0 = Qt.QWidget() self.pestana_layout_0 = Qt.QBoxLayout(Qt.QBoxLayout.TopToBottom, self.pestana_widget_0) self.pestana_grid_layout_0 = Qt.QGridLayout() self.pestana_layout_0.addLayout(self.pestana_grid_layout_0) self.pestana.addTab(self.pestana_widget_0, 'Osciloscopio Wave Forming') self.pestana_widget_1 = Qt.QWidget() self.pestana_layout_1 = Qt.QBoxLayout(Qt.QBoxLayout.TopToBottom, self.pestana_widget_1) self.pestana_grid_layout_1 = Qt.QGridLayout() self.pestana_layout_1.addLayout(self.pestana_grid_layout_1) self.pestana.addTab(self.pestana_widget_1, 'PSD Wave Forming') self.pestana_widget_2 = Qt.QWidget() self.pestana_layout_2 = Qt.QBoxLayout(Qt.QBoxLayout.TopToBottom, self.pestana_widget_2) self.pestana_grid_layout_2 = Qt.QGridLayout() self.pestana_layout_2.addLayout(self.pestana_grid_layout_2) self.pestana.addTab(self.pestana_widget_2, 'Osciloscopio Acoplamiento') self.pestana_widget_3 = Qt.QWidget() self.pestana_layout_3 = Qt.QBoxLayout(Qt.QBoxLayout.TopToBottom, self.pestana_widget_3) self.pestana_grid_layout_3 = Qt.QGridLayout() self.pestana_layout_3.addLayout(self.pestana_grid_layout_3) self.pestana.addTab(self.pestana_widget_3, 'PSD Acoplamiento') self.pestana_widget_4 = Qt.QWidget() self.pestana_layout_4 = Qt.QBoxLayout(Qt.QBoxLayout.TopToBottom, self.pestana_widget_4) self.pestana_grid_layout_4 = Qt.QGridLayout() self.pestana_layout_4.addLayout(self.pestana_grid_layout_4) self.pestana.addTab(self.pestana_widget_4, 'Diagrama de Ojo') self.top_grid_layout.addWidget(self.pestana, 1, 0, 1, 4) for r in range(1, 2): self.top_grid_layout.setRowStretch(r, 1) for c in range(0, 4): self.top_grid_layout.setColumnStretch(c, 1) self.ojo = Qt.QTabWidget() self.ojo_widget_0 = Qt.QWidget() self.ojo_layout_0 = Qt.QBoxLayout(Qt.QBoxLayout.TopToBottom, self.ojo_widget_0) self.ojo_grid_layout_0 = Qt.QGridLayout() self.ojo_layout_0.addLayout(self.ojo_grid_layout_0) self.ojo.addTab(self.ojo_widget_0, 'Rectangular') self.ojo_widget_1 = Qt.QWidget() self.ojo_layout_1 = Qt.QBoxLayout(Qt.QBoxLayout.TopToBottom, self.ojo_widget_1) self.ojo_grid_layout_1 = Qt.QGridLayout() self.ojo_layout_1.addLayout(self.ojo_grid_layout_1) self.ojo.addTab(self.ojo_widget_1, 'Nyquist') self.ojo_widget_2 = Qt.QWidget() self.ojo_layout_2 = Qt.QBoxLayout(Qt.QBoxLayout.TopToBottom, self.ojo_widget_2) self.ojo_grid_layout_2 = Qt.QGridLayout() self.ojo_layout_2.addLayout(self.ojo_grid_layout_2) self.ojo.addTab(self.ojo_widget_2, 'Raised Cosine') self.ojo_widget_3 = Qt.QWidget() self.ojo_layout_3 = Qt.QBoxLayout(Qt.QBoxLayout.TopToBottom, self.ojo_widget_3) self.ojo_grid_layout_3 = Qt.QGridLayout() self.ojo_layout_3.addLayout(self.ojo_grid_layout_3) self.ojo.addTab(self.ojo_widget_3, 'Root Raised Cosine') self.pestana_grid_layout_4.addWidget(self.ojo) self._TimingDelay_range = Range(0, Sps-1, 1, 0, 200) self._TimingDelay_win = RangeWidget(self._TimingDelay_range, self.set_TimingDelay, 'Timing', "counter_slider", int) self.top_grid_layout.addWidget(self._TimingDelay_win, 0, 3, 1, 1) for r in range(0, 1): self.top_grid_layout.setRowStretch(r, 1) for c in range(3, 4): self.top_grid_layout.setColumnStretch(c, 1) _run_stop_check_box = Qt.QCheckBox('Inicial/Parar') self._run_stop_choices = {True: True, False: False} self._run_stop_choices_inv = dict((v,k) for k,v in self._run_stop_choices.iteritems()) self._run_stop_callback = lambda i: Qt.QMetaObject.invokeMethod(_run_stop_check_box, "setChecked", Qt.Q_ARG("bool", self._run_stop_choices_inv[i])) self._run_stop_callback(self.run_stop) _run_stop_check_box.stateChanged.connect(lambda i: self.set_run_stop(self._run_stop_choices[bool(i)])) self.top_grid_layout.addWidget(_run_stop_check_box, 0, 0, 1, 1) for r in range(0, 1): self.top_grid_layout.setRowStretch(r, 1) for c in range(0, 1): self.top_grid_layout.setColumnStretch(c, 1) self.qtgui_time_sink_x_0_1 = qtgui.time_sink_c( int(Tmax_scope*samp_rate)/4, #size samp_rate, #samp_rate "Wave Forming", #name 4 #number of inputs ) self.qtgui_time_sink_x_0_1.set_update_time(0.10) self.qtgui_time_sink_x_0_1.set_y_axis(-3, 3) self.qtgui_time_sink_x_0_1.set_y_label('Amplitude', "") self.qtgui_time_sink_x_0_1.enable_tags(-1, True) self.qtgui_time_sink_x_0_1.set_trigger_mode(qtgui.TRIG_MODE_FREE, qtgui.TRIG_SLOPE_POS, 0.0, 0, 0, "") self.qtgui_time_sink_x_0_1.enable_autoscale(False) self.qtgui_time_sink_x_0_1.enable_grid(False) self.qtgui_time_sink_x_0_1.enable_axis_labels(True) self.qtgui_time_sink_x_0_1.enable_control_panel(False) self.qtgui_time_sink_x_0_1.enable_stem_plot(False) if not True: self.qtgui_time_sink_x_0_1.disable_legend() labels = ['Re', 'Im', 'Re.Nyq', 'Re.Nyq', 'Re.RC', 'Re.RC', 'Re.RRC', 'Re.RRC', '', ''] widths = [1, 1, 1, 1, 1, 1, 1, 1, 1, 1] colors = ["blue", "red", "green", "black", "cyan", "magenta", "yellow", "dark red", "dark green", "blue"] styles = [1, 1, 1, 1, 1, 1, 1, 1, 1, 1] markers = [-1, -1, -1, -1, -1, -1, -1, -1, -1, -1] 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(8): if len(labels[i]) == 0: if(i % 2 == 0): self.qtgui_time_sink_x_0_1.set_line_label(i, "Re{{Data {0}}}".format(i/2)) else: self.qtgui_time_sink_x_0_1.set_line_label(i, "Im{{Data {0}}}".format(i/2)) else: self.qtgui_time_sink_x_0_1.set_line_label(i, labels[i]) self.qtgui_time_sink_x_0_1.set_line_width(i, widths[i]) self.qtgui_time_sink_x_0_1.set_line_color(i, colors[i]) self.qtgui_time_sink_x_0_1.set_line_style(i, styles[i]) self.qtgui_time_sink_x_0_1.set_line_marker(i, markers[i]) self.qtgui_time_sink_x_0_1.set_line_alpha(i, alphas[i]) self._qtgui_time_sink_x_0_1_win = sip.wrapinstance(self.qtgui_time_sink_x_0_1.pyqwidget(), Qt.QWidget) self.pestana_grid_layout_0.addWidget(self._qtgui_time_sink_x_0_1_win, 0, 0, 1, 1) for r in range(0, 1): self.pestana_grid_layout_0.setRowStretch(r, 1) for c in range(0, 1): self.pestana_grid_layout_0.setColumnStretch(c, 1) self.qtgui_freq_sink_x_0_0 = qtgui.freq_sink_c( 1024, #size firdes.WIN_BLACKMAN_hARRIS, #wintype 0, #fc samp_rate, #bw "Wave Forming.PSD", #name 4 #number of inputs ) self.qtgui_freq_sink_x_0_0.set_update_time(0.10) self.qtgui_freq_sink_x_0_0.set_y_axis(-80, 10) self.qtgui_freq_sink_x_0_0.set_y_label('Relative Gain', 'dB') self.qtgui_freq_sink_x_0_0.set_trigger_mode(qtgui.TRIG_MODE_FREE, 0.0, 0, "") self.qtgui_freq_sink_x_0_0.enable_autoscale(False) self.qtgui_freq_sink_x_0_0.enable_grid(False) self.qtgui_freq_sink_x_0_0.set_fft_average(0.05) self.qtgui_freq_sink_x_0_0.enable_axis_labels(True) self.qtgui_freq_sink_x_0_0.enable_control_panel(True) if not True: self.qtgui_freq_sink_x_0_0.disable_legend() if "complex" == "float" or "complex" == "msg_float": self.qtgui_freq_sink_x_0_0.set_plot_pos_half(not True) labels = ['Rect', 'Nyq', 'RC', 'RRC', '', '', '', '', '', ''] widths = [3, 3, 3, 3, 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(4): if len(labels[i]) == 0: self.qtgui_freq_sink_x_0_0.set_line_label(i, "Data {0}".format(i)) else: self.qtgui_freq_sink_x_0_0.set_line_label(i, labels[i]) self.qtgui_freq_sink_x_0_0.set_line_width(i, widths[i]) self.qtgui_freq_sink_x_0_0.set_line_color(i, colors[i]) self.qtgui_freq_sink_x_0_0.set_line_alpha(i, alphas[i]) self._qtgui_freq_sink_x_0_0_win = sip.wrapinstance(self.qtgui_freq_sink_x_0_0.pyqwidget(), Qt.QWidget) self.pestana_grid_layout_1.addWidget(self._qtgui_freq_sink_x_0_0_win, 0, 0, 1, 1) for r in range(0, 1): self.pestana_grid_layout_1.setRowStretch(r, 1) for c in range(0, 1): self.pestana_grid_layout_1.setColumnStretch(c, 1) self.interp_fir_filter_xxx_0_0_2 = filter.interp_fir_filter_ccc(1, (numpy.multiply(hrc,1./Sps))) self.interp_fir_filter_xxx_0_0_2.declare_sample_delay(0) self.interp_fir_filter_xxx_0_0_1_0 = filter.interp_fir_filter_ccc(1, (numpy.multiply(hrrc,1./Sps))) self.interp_fir_filter_xxx_0_0_1_0.declare_sample_delay(0) self.interp_fir_filter_xxx_0_0_1 = filter.interp_fir_filter_ccc(1, (numpy.multiply(hn,1./Sps))) self.interp_fir_filter_xxx_0_0_1.declare_sample_delay(0) self.interp_fir_filter_xxx_0_0_0_0_1 = filter.interp_fir_filter_ccc(Sps, (hrrc)) self.interp_fir_filter_xxx_0_0_0_0_1.declare_sample_delay(0) self.interp_fir_filter_xxx_0_0_0_0_0 = filter.interp_fir_filter_ccc(Sps, (hrc)) self.interp_fir_filter_xxx_0_0_0_0_0.declare_sample_delay(0) self.interp_fir_filter_xxx_0_0_0_0 = filter.interp_fir_filter_ccc(Sps, (hn)) self.interp_fir_filter_xxx_0_0_0_0.declare_sample_delay(0) self.interp_fir_filter_xxx_0_0_0 = filter.interp_fir_filter_ccc(Sps, (hr)) self.interp_fir_filter_xxx_0_0_0.declare_sample_delay(0) self.interp_fir_filter_xxx_0_0 = filter.interp_fir_filter_ccc(1, (numpy.multiply(hr,1./Sps))) self.interp_fir_filter_xxx_0_0.declare_sample_delay(0) self.digital_constellation_decoder_cb_0_0 = digital.constellation_decoder_cb(MiconstellationObject) self.blocks_null_sink_0_0 = blocks.null_sink(gr.sizeof_char*1) self.blocks_null_sink_0 = blocks.null_sink(gr.sizeof_gr_complex*1) self.b_sampler_cc_0_0 = b_sampler_cc( DelayDiez=TimingDelay, Sps=Sps, ) self.b_Mod_BPSK_bc_0 = b_Mod_BPSK_bc() self.b_Eye_Diagram_simple_c_0_0_1 = b_Eye_Diagram_simple_c( AlphaLineas=0.5, Delay_i=0, GrosorLineas=20, Kint=1, N_eyes=2, Samprate1=samp_rate, Sps1=Sps, Title="Acoplamiento.RRC", Ymax=3, Ymin=-3, ) self.ojo_grid_layout_3.addWidget(self.b_Eye_Diagram_simple_c_0_0_1) self.b_Eye_Diagram_simple_c_0_0_0 = b_Eye_Diagram_simple_c( AlphaLineas=0.5, Delay_i=0, GrosorLineas=20, Kint=1, N_eyes=2, Samprate1=samp_rate, Sps1=Sps, Title="Acoplamiento.RC", Ymax=3, Ymin=-3, ) self.ojo_grid_layout_2.addWidget(self.b_Eye_Diagram_simple_c_0_0_0) self.b_Eye_Diagram_simple_c_0_0 = b_Eye_Diagram_simple_c( AlphaLineas=0.5, Delay_i=0, GrosorLineas=20, Kint=1, N_eyes=2, Samprate1=samp_rate, Sps1=Sps, Title="Acoplamiento.Nyq", Ymax=3, Ymin=-3, ) self.ojo_grid_layout_1.addWidget(self.b_Eye_Diagram_simple_c_0_0) self.b_Eye_Diagram_simple_c_0 = b_Eye_Diagram_simple_c( AlphaLineas=0.5, Delay_i=0, GrosorLineas=20, Kint=1, N_eyes=2, Samprate1=samp_rate, Sps1=Sps, Title="Acoplamiento.Rect", Ymax=3, Ymin=-3, ) self.ojo_grid_layout_0.addWidget(self.b_Eye_Diagram_simple_c_0) self.analog_random_source_x_0 = blocks.vector_source_b(map(int, numpy.random.randint(0, 2, 1000)), True) self._NodB_range = Range(-140., 0., 1., -65, 200) self._NodB_win = RangeWidget(self._NodB_range, self.set_NodB, 'No (in dB for white noise)', "counter_slider", float) self.top_grid_layout.addWidget(self._NodB_win, 0, 1, 1, 1) for r in range(0, 1): self.top_grid_layout.setRowStretch(r, 1) for c in range(1, 2): self.top_grid_layout.setColumnStretch(c, 1) self._BW_range = Range(0., samp_rate/2., (samp_rate/2)/128., samp_rate/2., 200) self._BW_win = RangeWidget(self._BW_range, self.set_BW, 'LPF BW (Hz)', "counter_slider", float) self.top_grid_layout.addWidget(self._BW_win, 0, 2, 1, 1) for r in range(0, 1): self.top_grid_layout.setRowStretch(r, 1) for c in range(2, 3): self.top_grid_layout.setColumnStretch(c, 1) ################################################## # Connections ################################################## self.connect((self.analog_random_source_x_0, 0), (self.b_Mod_BPSK_bc_0, 0)) self.connect((self.b_Mod_BPSK_bc_0, 0), (self.interp_fir_filter_xxx_0_0_0, 0)) self.connect((self.b_Mod_BPSK_bc_0, 0), (self.interp_fir_filter_xxx_0_0_0_0, 0)) self.connect((self.b_Mod_BPSK_bc_0, 0), (self.interp_fir_filter_xxx_0_0_0_0_0, 0)) self.connect((self.b_Mod_BPSK_bc_0, 0), (self.interp_fir_filter_xxx_0_0_0_0_1, 0)) self.connect((self.b_sampler_cc_0_0, 0), (self.blocks_null_sink_0, 0)) self.connect((self.b_sampler_cc_0_0, 1), (self.digital_constellation_decoder_cb_0_0, 0)) self.connect((self.digital_constellation_decoder_cb_0_0, 0), (self.blocks_null_sink_0_0, 0)) self.connect((self.interp_fir_filter_xxx_0_0, 0), (self.b_Eye_Diagram_simple_c_0, 0)) self.connect((self.interp_fir_filter_xxx_0_0, 0), (self.b_sampler_cc_0_0, 0)) self.connect((self.interp_fir_filter_xxx_0_0_0, 0), (self.interp_fir_filter_xxx_0_0, 0)) self.connect((self.interp_fir_filter_xxx_0_0_0, 0), (self.qtgui_freq_sink_x_0_0, 0)) self.connect((self.interp_fir_filter_xxx_0_0_0, 0), (self.qtgui_time_sink_x_0_1, 0)) self.connect((self.interp_fir_filter_xxx_0_0_0_0, 0), (self.interp_fir_filter_xxx_0_0_1, 0)) self.connect((self.interp_fir_filter_xxx_0_0_0_0, 0), (self.qtgui_freq_sink_x_0_0, 1)) self.connect((self.interp_fir_filter_xxx_0_0_0_0, 0), (self.qtgui_time_sink_x_0_1, 1)) self.connect((self.interp_fir_filter_xxx_0_0_0_0_0, 0), (self.interp_fir_filter_xxx_0_0_2, 0)) self.connect((self.interp_fir_filter_xxx_0_0_0_0_0, 0), (self.qtgui_freq_sink_x_0_0, 2)) self.connect((self.interp_fir_filter_xxx_0_0_0_0_0, 0), (self.qtgui_time_sink_x_0_1, 2)) self.connect((self.interp_fir_filter_xxx_0_0_0_0_1, 0), (self.interp_fir_filter_xxx_0_0_1_0, 0)) self.connect((self.interp_fir_filter_xxx_0_0_0_0_1, 0), (self.qtgui_freq_sink_x_0_0, 3)) self.connect((self.interp_fir_filter_xxx_0_0_0_0_1, 0), (self.qtgui_time_sink_x_0_1, 3)) self.connect((self.interp_fir_filter_xxx_0_0_1, 0), (self.b_Eye_Diagram_simple_c_0_0, 0)) self.connect((self.interp_fir_filter_xxx_0_0_1_0, 0), (self.b_Eye_Diagram_simple_c_0_0_1, 0)) self.connect((self.interp_fir_filter_xxx_0_0_2, 0), (self.b_Eye_Diagram_simple_c_0_0_0, 0))
def __init__(self): gr.top_block.__init__(self, "Top Block") Qt.QWidget.__init__(self) self.setWindowTitle("Top Block") 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", "top_block") self.restoreGeometry(self.settings.value("geometry").toByteArray()) ################################################## # Variables ################################################## self.Sps = Sps = 8 self.Rb = Rb = 32000 self.samp_rate = samp_rate = Rb * Sps self.run_stop = run_stop = True self.rolloff4 = rolloff4 = 0. self.rolloff3 = rolloff3 = 0.35 self.rolloff2 = rolloff2 = 0.5 self.rolloff1 = rolloff1 = 1.0 self.ntaps = ntaps = 128 ################################################## # Blocks ################################################## self.pestana = Qt.QTabWidget() self.pestana_widget_0 = Qt.QWidget() self.pestana_layout_0 = Qt.QBoxLayout(Qt.QBoxLayout.TopToBottom, self.pestana_widget_0) self.pestana_grid_layout_0 = Qt.QGridLayout() self.pestana_layout_0.addLayout(self.pestana_grid_layout_0) self.pestana.addTab(self.pestana_widget_0, 'Datos') self.pestana_widget_1 = Qt.QWidget() self.pestana_layout_1 = Qt.QBoxLayout(Qt.QBoxLayout.TopToBottom, self.pestana_widget_1) self.pestana_grid_layout_1 = Qt.QGridLayout() self.pestana_layout_1.addLayout(self.pestana_grid_layout_1) self.pestana.addTab(self.pestana_widget_1, 'Espectro') self.pestana_widget_2 = Qt.QWidget() self.pestana_layout_2 = Qt.QBoxLayout(Qt.QBoxLayout.TopToBottom, self.pestana_widget_2) self.pestana_grid_layout_2 = Qt.QGridLayout() self.pestana_layout_2.addLayout(self.pestana_grid_layout_2) self.pestana.addTab(self.pestana_widget_2, 'Diagrama de Ojo') self.top_grid_layout.addWidget(self.pestana) _run_stop_check_box = Qt.QCheckBox('Inicial/Parar') self._run_stop_choices = {True: True, False: False} self._run_stop_choices_inv = dict( (v, k) for k, v in self._run_stop_choices.iteritems()) self._run_stop_callback = lambda i: Qt.QMetaObject.invokeMethod( _run_stop_check_box, "setChecked", Qt.Q_ARG("bool", self._run_stop_choices_inv[i])) self._run_stop_callback(self.run_stop) _run_stop_check_box.stateChanged.connect( lambda i: self.set_run_stop(self._run_stop_choices[bool(i)])) self.top_grid_layout.addWidget(_run_stop_check_box, 0, 0, 1, 1) for r in range(0, 1): self.top_grid_layout.setRowStretch(r, 1) for c in range(0, 1): self.top_grid_layout.setColumnStretch(c, 1) self.qtgui_time_sink_x_0_0_0_0_0 = qtgui.time_sink_f( ntaps, #size samp_rate, #samp_rate "Wave Forming", #name 2 #number of inputs ) self.qtgui_time_sink_x_0_0_0_0_0.set_update_time(0.10) self.qtgui_time_sink_x_0_0_0_0_0.set_y_axis(-3, 3) self.qtgui_time_sink_x_0_0_0_0_0.set_y_label('RC Filter Poly', "") self.qtgui_time_sink_x_0_0_0_0_0.enable_tags(-1, True) self.qtgui_time_sink_x_0_0_0_0_0.set_trigger_mode( qtgui.TRIG_MODE_AUTO, qtgui.TRIG_SLOPE_POS, 0.0, 0, 0, "") self.qtgui_time_sink_x_0_0_0_0_0.enable_autoscale(False) self.qtgui_time_sink_x_0_0_0_0_0.enable_grid(False) self.qtgui_time_sink_x_0_0_0_0_0.enable_axis_labels(True) self.qtgui_time_sink_x_0_0_0_0_0.enable_control_panel(True) self.qtgui_time_sink_x_0_0_0_0_0.enable_stem_plot(False) if not True: self.qtgui_time_sink_x_0_0_0_0_0.disable_legend() labels = [ 'Rect', 'RC, rollof=1', 'RC, rollof=0.5', 'RC, rollof=0.35', 'RRC, rollof=0', '', '', '', '', '' ] widths = [3, 3, 3, 3, 1, 1, 1, 1, 1, 1] colors = [ "blue", "red", "green", "black", "cyan", "magenta", "yellow", "dark red", "dark green", "blue" ] styles = [1, 1, 1, 1, 1, 1, 1, 1, 1, 1] markers = [-1, -1, -1, -1, -1, -1, -1, -1, -1, -1] 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_time_sink_x_0_0_0_0_0.set_line_label( i, "Data {0}".format(i)) else: self.qtgui_time_sink_x_0_0_0_0_0.set_line_label(i, labels[i]) self.qtgui_time_sink_x_0_0_0_0_0.set_line_width(i, widths[i]) self.qtgui_time_sink_x_0_0_0_0_0.set_line_color(i, colors[i]) self.qtgui_time_sink_x_0_0_0_0_0.set_line_style(i, styles[i]) self.qtgui_time_sink_x_0_0_0_0_0.set_line_marker(i, markers[i]) self.qtgui_time_sink_x_0_0_0_0_0.set_line_alpha(i, alphas[i]) self._qtgui_time_sink_x_0_0_0_0_0_win = sip.wrapinstance( self.qtgui_time_sink_x_0_0_0_0_0.pyqwidget(), Qt.QWidget) self.pestana_grid_layout_0.addWidget( self._qtgui_time_sink_x_0_0_0_0_0_win) self.interp_fir_filter_xxx_0_0_0_0_0_0 = filter.interp_fir_filter_fff( Sps, (wform.rcos(Sps, ntaps, rolloff1))) self.interp_fir_filter_xxx_0_0_0_0_0_0.declare_sample_delay(0) self.interp_fir_filter_xxx_0_0_0_0_0 = filter.interp_fir_filter_fff( Sps, (wform.rect(Sps))) self.interp_fir_filter_xxx_0_0_0_0_0.declare_sample_delay(0) self.blocks_throttle_0_0_0_0 = blocks.throttle(gr.sizeof_float * 1, samp_rate, True) self.blocks_file_sink_0_0_0_0 = blocks.file_sink( gr.sizeof_float * 1, '/media/uis-e3t/DATADRIVE1/MisGitHub/Diagrama-de-ojo-Comunicaciones-II/GNU Radio/BW1', False) self.blocks_file_sink_0_0_0_0.set_unbuffered(False) self.blocks_file_sink_0_0_0 = blocks.file_sink( gr.sizeof_float * 1, '/media/uis-e3t/DATADRIVE1/MisGitHub/Diagrama-de-ojo-Comunicaciones-II/GNU Radio/Rect', False) self.blocks_file_sink_0_0_0.set_unbuffered(False) self.blocks_add_xx_0_0 = blocks.add_vff(1) self.blocks_add_xx_0 = blocks.add_vff(1) self.b_binary_gen_rand_0 = b_binary_gen_rand() self.analog_noise_source_x_0 = analog.noise_source_f( analog.GR_GAUSSIAN, 0.15, 0) ################################################## # Connections ################################################## self.connect((self.analog_noise_source_x_0, 0), (self.blocks_add_xx_0, 1)) self.connect((self.analog_noise_source_x_0, 0), (self.blocks_add_xx_0_0, 1)) self.connect((self.b_binary_gen_rand_0, 0), (self.interp_fir_filter_xxx_0_0_0_0_0, 0)) self.connect((self.b_binary_gen_rand_0, 0), (self.interp_fir_filter_xxx_0_0_0_0_0_0, 0)) self.connect((self.blocks_add_xx_0, 0), (self.blocks_throttle_0_0_0_0, 0)) self.connect((self.blocks_add_xx_0, 0), (self.qtgui_time_sink_x_0_0_0_0_0, 0)) self.connect((self.blocks_add_xx_0_0, 0), (self.blocks_file_sink_0_0_0_0, 0)) self.connect((self.blocks_add_xx_0_0, 0), (self.qtgui_time_sink_x_0_0_0_0_0, 1)) self.connect((self.blocks_throttle_0_0_0_0, 0), (self.blocks_file_sink_0_0_0, 0)) self.connect((self.interp_fir_filter_xxx_0_0_0_0_0, 0), (self.blocks_add_xx_0, 0)) self.connect((self.interp_fir_filter_xxx_0_0_0_0_0_0, 0), (self.blocks_add_xx_0_0, 0))
def set_Sps(self, Sps): self.Sps = Sps self.set_samp_rate(self.Rb * self.Sps) self.interp_fir_filter_xxx_0_0_0_0_0_0.set_taps( (wform.rcos(self.Sps, self.ntaps, self.rolloff1))) self.interp_fir_filter_xxx_0_0_0_0_0.set_taps((wform.rect(self.Sps)))
def __init__(self, Sps=10): gr.top_block.__init__(self, "Top Block") Qt.QWidget.__init__(self) self.setWindowTitle("Top Block") 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", "top_block") self.restoreGeometry(self.settings.value("geometry").toByteArray()) ################################################## # Parameters ################################################## self.Sps = Sps ################################################## # Variables ################################################## self.samp_rate = samp_rate = 32000 self.h = h = wform.rect(Sps) ################################################## # Blocks ################################################## self.qtgui_time_sink_x_0 = qtgui.time_sink_f( 1024, #size samp_rate, #samp_rate "", #name 1 #number of inputs ) self.qtgui_time_sink_x_0.set_update_time(0.10) self.qtgui_time_sink_x_0.set_y_axis(-1, 1) self.qtgui_time_sink_x_0.set_y_label('Amplitude', "") self.qtgui_time_sink_x_0.enable_tags(-1, 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(False) 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) if not True: self.qtgui_time_sink_x_0.disable_legend() labels = ['', '', '', '', '', '', '', '', '', ''] widths = [1, 1, 1, 1, 1, 1, 1, 1, 1, 1] colors = ["blue", "red", "green", "black", "cyan", "magenta", "yellow", "dark red", "dark green", "blue"] styles = [1, 1, 1, 1, 1, 1, 1, 1, 1, 1] markers = [-1, -1, -1, -1, -1, -1, -1, -1, -1, -1] 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_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_grid_layout.addWidget(self._qtgui_time_sink_x_0_win) self.interp_fir_filter_xxx_0 = filter.interp_fir_filter_fff(Sps, (h)) self.interp_fir_filter_xxx_0.declare_sample_delay(0) self.blocks_multiply_const_vxx_0 = blocks.multiply_const_vff((2., )) self.blocks_int_to_float_0 = blocks.int_to_float(1, 1) self.blocks_add_xx_0 = blocks.add_vff(1) self.blocks_add_const_vxx_0 = blocks.add_const_vff((-0.5, )) self.b_eye_diagram2_f_1 = b_eye_diagram2_f( Delay=int(Sps/2), Sps=Sps, samp_rate=samp_rate, ) self.analog_random_source_x_0 = blocks.vector_source_i(map(int, numpy.random.randint(0, 2, 1000000)), True) self.analog_noise_source_x_0 = analog.noise_source_f(analog.GR_GAUSSIAN, 0.2, 0) ################################################## # Connections ################################################## self.connect((self.analog_noise_source_x_0, 0), (self.blocks_add_xx_0, 1)) self.connect((self.analog_random_source_x_0, 0), (self.blocks_int_to_float_0, 0)) self.connect((self.blocks_add_const_vxx_0, 0), (self.blocks_multiply_const_vxx_0, 0)) self.connect((self.blocks_add_xx_0, 0), (self.b_eye_diagram2_f_1, 0)) self.connect((self.blocks_add_xx_0, 0), (self.qtgui_time_sink_x_0, 0)) self.connect((self.blocks_int_to_float_0, 0), (self.blocks_add_const_vxx_0, 0)) self.connect((self.blocks_multiply_const_vxx_0, 0), (self.interp_fir_filter_xxx_0, 0)) self.connect((self.interp_fir_filter_xxx_0, 0), (self.blocks_add_xx_0, 0))
def set_Sps(self, Sps): self.Sps = Sps self.set_h(wform.rect(self.Sps)) self.b_eye_diagram2_f_1.set_Delay(int(self.Sps/2)) self.b_eye_diagram2_f_1.set_Sps(self.Sps)
def __init__(self): gr.top_block.__init__(self, "Top Block", catch_exceptions=True) Qt.QWidget.__init__(self) self.setWindowTitle("Top Block") 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", "top_block") 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 = 1953125 self.Sps = Sps = 32 self.run_stop = run_stop = True self.h = h = wform.rect(Sps) self.Rb = Rb = samp_rate / Sps self.N = N = 16 * Sps self.Mean_reset = Mean_reset = 1 self.Ensayos = Ensayos = 1000000 ################################################## # Blocks ################################################## self.Menu = Qt.QTabWidget() self.Menu_widget_0 = Qt.QWidget() self.Menu_layout_0 = Qt.QBoxLayout(Qt.QBoxLayout.TopToBottom, self.Menu_widget_0) self.Menu_grid_layout_0 = Qt.QGridLayout() self.Menu_layout_0.addLayout(self.Menu_grid_layout_0) self.Menu.addTab(self.Menu_widget_0, 'banary random signal') self.top_grid_layout.addWidget(self.Menu, 1, 0, 1, 4) for r in range(1, 2): self.top_grid_layout.setRowStretch(r, 1) for c in range(0, 4): self.top_grid_layout.setColumnStretch(c, 1) _run_stop_check_box = Qt.QCheckBox('Inicial/Parar') self._run_stop_choices = {True: True, False: False} self._run_stop_choices_inv = dict( (v, k) for k, v in self._run_stop_choices.items()) self._run_stop_callback = lambda i: Qt.QMetaObject.invokeMethod( _run_stop_check_box, "setChecked", Qt.Q_ARG("bool", self._run_stop_choices_inv[i])) self._run_stop_callback(self.run_stop) _run_stop_check_box.stateChanged.connect( lambda i: self.set_run_stop(self._run_stop_choices[bool(i)])) self.top_grid_layout.addWidget(_run_stop_check_box, 0, 0, 1, 1) for r in range(0, 1): self.top_grid_layout.setRowStretch(r, 1) for c in range(0, 1): self.top_grid_layout.setColumnStretch(c, 1) self.qtgui_vector_sink_f_0_1 = qtgui.vector_sink_f( N, -samp_rate / 2, (samp_rate - 1) / N, "Frecuencia", "Amplitud (Watt/Hz)", 'PSD', 1, # Number of inputs None # parent ) self.qtgui_vector_sink_f_0_1.set_update_time(0.10) self.qtgui_vector_sink_f_0_1.set_y_axis(0., 1 / Rb) self.qtgui_vector_sink_f_0_1.enable_autoscale(False) self.qtgui_vector_sink_f_0_1.enable_grid(False) self.qtgui_vector_sink_f_0_1.set_x_axis_units("Hz") self.qtgui_vector_sink_f_0_1.set_y_axis_units("Watt/Hz") self.qtgui_vector_sink_f_0_1.set_ref_level(0) labels = ['.', '', '', '', '', '', '', '', '', ''] widths = [4, 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(1): if len(labels[i]) == 0: self.qtgui_vector_sink_f_0_1.set_line_label( i, "Data {0}".format(i)) else: self.qtgui_vector_sink_f_0_1.set_line_label(i, labels[i]) self.qtgui_vector_sink_f_0_1.set_line_width(i, widths[i]) self.qtgui_vector_sink_f_0_1.set_line_color(i, colors[i]) self.qtgui_vector_sink_f_0_1.set_line_alpha(i, alphas[i]) self._qtgui_vector_sink_f_0_1_win = sip.wrapinstance( self.qtgui_vector_sink_f_0_1.pyqwidget(), Qt.QWidget) self.Menu_grid_layout_0.addWidget(self._qtgui_vector_sink_f_0_1_win, 2, 0, 1, 1) for r in range(2, 3): self.Menu_grid_layout_0.setRowStretch(r, 1) for c in range(0, 1): self.Menu_grid_layout_0.setColumnStretch(c, 1) self.qtgui_vector_sink_f_0 = qtgui.vector_sink_f( N, -(N / 2) / samp_rate, (N / 2) / samp_rate, "Rx(T)", "Amplitud", 'Autocorrelacin', 1, # Number of inputs None # parent ) self.qtgui_vector_sink_f_0.set_update_time(0.10) self.qtgui_vector_sink_f_0.set_y_axis(-1, 2) self.qtgui_vector_sink_f_0.enable_autoscale(False) self.qtgui_vector_sink_f_0.enable_grid(False) self.qtgui_vector_sink_f_0.set_x_axis_units("T") self.qtgui_vector_sink_f_0.set_y_axis_units("Watt/Hz") self.qtgui_vector_sink_f_0.set_ref_level(0) labels = ['.', '', '', '', '', '', '', '', '', ''] widths = [4, 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(1): if len(labels[i]) == 0: self.qtgui_vector_sink_f_0.set_line_label( i, "Data {0}".format(i)) else: self.qtgui_vector_sink_f_0.set_line_label(i, labels[i]) self.qtgui_vector_sink_f_0.set_line_width(i, widths[i]) self.qtgui_vector_sink_f_0.set_line_color(i, colors[i]) self.qtgui_vector_sink_f_0.set_line_alpha(i, alphas[i]) self._qtgui_vector_sink_f_0_win = sip.wrapinstance( self.qtgui_vector_sink_f_0.pyqwidget(), Qt.QWidget) self.Menu_grid_layout_0.addWidget(self._qtgui_vector_sink_f_0_win, 1, 0, 1, 1) for r in range(1, 2): self.Menu_grid_layout_0.setRowStretch(r, 1) for c in range(0, 1): self.Menu_grid_layout_0.setColumnStretch(c, 1) self.interp_fir_filter_xxx_0 = filter.interp_fir_filter_fff(Sps, h) self.interp_fir_filter_xxx_0.declare_sample_delay(0) self.fft_vxx_1 = fft.fft_vfc(N, True, window.rectangular(N), True, 1) self.blocks_stream_to_vector_0 = blocks.stream_to_vector( gr.sizeof_float * 1, N) self.blocks_multiply_const_vxx_0 = blocks.multiply_const_vff(N * [ 1 / samp_rate, ]) self.blocks_complex_to_mag_0 = blocks.complex_to_mag(N) self.b_binary_bipolar_source1_f_0 = b_binary_bipolar_source1_f(Am=1., ) _Mean_reset_push_button = Qt.QPushButton( 'Push here to restart averaging procces') _Mean_reset_push_button = Qt.QPushButton( 'Push here to restart averaging procces') self._Mean_reset_choices = {'Pressed': 0, 'Released': 1} _Mean_reset_push_button.pressed.connect( lambda: self.set_Mean_reset(self._Mean_reset_choices['Pressed'])) _Mean_reset_push_button.released.connect( lambda: self.set_Mean_reset(self._Mean_reset_choices['Released'])) self.top_grid_layout.addWidget(_Mean_reset_push_button, 0, 3, 1, 1) for r in range(0, 1): self.top_grid_layout.setRowStretch(r, 1) for c in range(3, 4): self.top_grid_layout.setColumnStretch(c, 1) self.E3TRadio_vector_average_hob_0 = E3TRadio.vector_average_hob( N, Ensayos) self.E3TRadio_v_autocorr_ff_0 = E3TRadio.v_autocorr_ff(N) ################################################## # Connections ################################################## self.connect((self.E3TRadio_v_autocorr_ff_0, 0), (self.E3TRadio_vector_average_hob_0, 0)) self.connect((self.E3TRadio_vector_average_hob_0, 0), (self.fft_vxx_1, 0)) self.connect((self.E3TRadio_vector_average_hob_0, 0), (self.qtgui_vector_sink_f_0, 0)) self.connect((self.b_binary_bipolar_source1_f_0, 0), (self.interp_fir_filter_xxx_0, 0)) self.connect((self.blocks_complex_to_mag_0, 0), (self.blocks_multiply_const_vxx_0, 0)) self.connect((self.blocks_multiply_const_vxx_0, 0), (self.qtgui_vector_sink_f_0_1, 0)) self.connect((self.blocks_stream_to_vector_0, 0), (self.E3TRadio_v_autocorr_ff_0, 0)) self.connect((self.fft_vxx_1, 0), (self.blocks_complex_to_mag_0, 0)) self.connect((self.interp_fir_filter_xxx_0, 0), (self.blocks_stream_to_vector_0, 0))
def set_Sps(self, Sps): self.Sps = Sps self.set_N(16 * self.Sps) self.set_Rb(self.samp_rate / self.Sps) self.set_h(wform.rect(self.Sps))
def __init__(self): gr.top_block.__init__(self, "MODULADOR DQPSK") Qt.QWidget.__init__(self) self.setWindowTitle("MODULADOR DQPSK") 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", "top_block") 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_2920_rx = samp_rate_2920_rx = 100000000 self.coef_rx = coef_rx = 2**8 self.samp_rate = samp_rate = int(samp_rate_2920_rx / coef_rx) self.Sps = Sps = 128 self.M = M = 2 self.Rs = Rs = samp_rate / Sps self.BpS = BpS = int(math.log(M, 2)) self.Rb = Rb = Rs / BpS self.no_code = no_code = digital.utils.mod_codes.NO_CODE self.W = W = Rb / 2 self.Rolloff = Rolloff = 1.0 self.ntaps = ntaps = Sps * 16 self.h = h = wform.rect(Sps) self.constelacion = constelacion = digital.psk_constellation( M, no_code, False) self.Retardo_bits = Retardo_bits = 0 self.Retardo_Timing = Retardo_Timing = 0 self.BW_rect = BW_rect = samp_rate / 2 self.BW = BW = W * (1 + Rolloff) ################################################## # Blocks ################################################## self.menu = Qt.QTabWidget() self.menu_widget_0 = Qt.QWidget() self.menu_layout_0 = Qt.QBoxLayout(Qt.QBoxLayout.TopToBottom, self.menu_widget_0) self.menu_grid_layout_0 = Qt.QGridLayout() self.menu_layout_0.addLayout(self.menu_grid_layout_0) self.menu.addTab(self.menu_widget_0, 'Timing') self.menu_widget_1 = Qt.QWidget() self.menu_layout_1 = Qt.QBoxLayout(Qt.QBoxLayout.TopToBottom, self.menu_widget_1) self.menu_grid_layout_1 = Qt.QGridLayout() self.menu_layout_1.addLayout(self.menu_grid_layout_1) self.menu.addTab(self.menu_widget_1, 'T0 versus R0') self.menu_widget_2 = Qt.QWidget() self.menu_layout_2 = Qt.QBoxLayout(Qt.QBoxLayout.TopToBottom, self.menu_widget_2) self.menu_grid_layout_2 = Qt.QGridLayout() self.menu_layout_2.addLayout(self.menu_grid_layout_2) self.menu.addTab(self.menu_widget_2, 'T1 versus R1') self.menu_widget_3 = Qt.QWidget() self.menu_layout_3 = Qt.QBoxLayout(Qt.QBoxLayout.TopToBottom, self.menu_widget_3) self.menu_grid_layout_3 = Qt.QGridLayout() self.menu_layout_3.addLayout(self.menu_grid_layout_3) self.menu.addTab(self.menu_widget_3, 'T2 versus R2') self.menu_widget_4 = Qt.QWidget() self.menu_layout_4 = Qt.QBoxLayout(Qt.QBoxLayout.TopToBottom, self.menu_widget_4) self.menu_grid_layout_4 = Qt.QGridLayout() self.menu_layout_4.addLayout(self.menu_grid_layout_4) self.menu.addTab(self.menu_widget_4, 'T3 versus R3') self.menu_widget_5 = Qt.QWidget() self.menu_layout_5 = Qt.QBoxLayout(Qt.QBoxLayout.TopToBottom, self.menu_widget_5) self.menu_grid_layout_5 = Qt.QGridLayout() self.menu_layout_5.addLayout(self.menu_grid_layout_5) self.menu.addTab(self.menu_widget_5, 'RF') self.top_grid_layout.addWidget(self.menu, 2, 0, 1, 2) for r in range(2, 3): self.top_grid_layout.setRowStretch(r, 1) for c in range(0, 2): self.top_grid_layout.setColumnStretch(c, 1) self._Retardo_bits_range = Range(0, Sps * 10, 1, 0, 200) self._Retardo_bits_win = RangeWidget( self._Retardo_bits_range, self.set_Retardo_bits, 'Delay transmited signal to match with the received signal', "counter_slider", int) self.menu_grid_layout_4.addWidget(self._Retardo_bits_win, 0, 0, 1, 1) for r in range(0, 1): self.menu_grid_layout_4.setRowStretch(r, 1) for c in range(0, 1): self.menu_grid_layout_4.setColumnStretch(c, 1) self._Retardo_Timing_range = Range(0, Sps - 1, 1, 0, 200) self._Retardo_Timing_win = RangeWidget(self._Retardo_Timing_range, self.set_Retardo_Timing, 'Timing', "counter", int) self.menu_grid_layout_0.addWidget(self._Retardo_Timing_win, 0, 0, 1, 1) for r in range(0, 1): self.menu_grid_layout_0.setRowStretch(r, 1) for c in range(0, 1): self.menu_grid_layout_0.setColumnStretch(c, 1) self.qtgui_time_sink_x_1 = qtgui.time_sink_f( 1024, #size samp_rate, #samp_rate "", #name 3 #number of inputs ) self.qtgui_time_sink_x_1.set_update_time(0.10) self.qtgui_time_sink_x_1.set_y_axis(-1, 1) self.qtgui_time_sink_x_1.set_y_label('Amplitude', "") self.qtgui_time_sink_x_1.enable_tags(True) self.qtgui_time_sink_x_1.set_trigger_mode(qtgui.TRIG_MODE_FREE, qtgui.TRIG_SLOPE_POS, 0.0, 0, 0, "") self.qtgui_time_sink_x_1.enable_autoscale(False) self.qtgui_time_sink_x_1.enable_grid(False) self.qtgui_time_sink_x_1.enable_axis_labels(True) self.qtgui_time_sink_x_1.enable_control_panel(False) self.qtgui_time_sink_x_1.enable_stem_plot(False) labels = [ 'Senal RF', 'EC (Re)', 'EC(Im)', 'Signal 4', 'Signal 5', 'Signal 6', 'Signal 7', 'Signal 8', 'Signal 9', 'Signal 10' ] widths = [3, 3, 3, 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(3): if len(labels[i]) == 0: self.qtgui_time_sink_x_1.set_line_label( i, "Data {0}".format(i)) else: self.qtgui_time_sink_x_1.set_line_label(i, labels[i]) self.qtgui_time_sink_x_1.set_line_width(i, widths[i]) self.qtgui_time_sink_x_1.set_line_color(i, colors[i]) self.qtgui_time_sink_x_1.set_line_style(i, styles[i]) self.qtgui_time_sink_x_1.set_line_marker(i, markers[i]) self.qtgui_time_sink_x_1.set_line_alpha(i, alphas[i]) self._qtgui_time_sink_x_1_win = sip.wrapinstance( self.qtgui_time_sink_x_1.pyqwidget(), Qt.QWidget) self.menu_grid_layout_5.addWidget(self._qtgui_time_sink_x_1_win, 0, 0, 1, 1) for r in range(0, 1): self.menu_grid_layout_5.setRowStretch(r, 1) for c in range(0, 1): self.menu_grid_layout_5.setColumnStretch(c, 1) self.qtgui_time_sink_x_0_1 = qtgui.time_sink_c( 1024, #size samp_rate, #samp_rate "", #name 2 #number of inputs ) self.qtgui_time_sink_x_0_1.set_update_time(0.10) self.qtgui_time_sink_x_0_1.set_y_axis(-1, 1) self.qtgui_time_sink_x_0_1.set_y_label('Amplitude', "") self.qtgui_time_sink_x_0_1.enable_tags(True) self.qtgui_time_sink_x_0_1.set_trigger_mode(qtgui.TRIG_MODE_FREE, qtgui.TRIG_SLOPE_POS, 0.0, 0, 0, "") self.qtgui_time_sink_x_0_1.enable_autoscale(False) self.qtgui_time_sink_x_0_1.enable_grid(False) self.qtgui_time_sink_x_0_1.enable_axis_labels(True) self.qtgui_time_sink_x_0_1.enable_control_panel(False) self.qtgui_time_sink_x_0_1.enable_stem_plot(False) labels = [ 'Signal 1', 'Signal 2', '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(4): if len(labels[i]) == 0: if (i % 2 == 0): self.qtgui_time_sink_x_0_1.set_line_label( i, "Re{{Data {0}}}".format(i / 2)) else: self.qtgui_time_sink_x_0_1.set_line_label( i, "Im{{Data {0}}}".format(i / 2)) else: self.qtgui_time_sink_x_0_1.set_line_label(i, labels[i]) self.qtgui_time_sink_x_0_1.set_line_width(i, widths[i]) self.qtgui_time_sink_x_0_1.set_line_color(i, colors[i]) self.qtgui_time_sink_x_0_1.set_line_style(i, styles[i]) self.qtgui_time_sink_x_0_1.set_line_marker(i, markers[i]) self.qtgui_time_sink_x_0_1.set_line_alpha(i, alphas[i]) self._qtgui_time_sink_x_0_1_win = sip.wrapinstance( self.qtgui_time_sink_x_0_1.pyqwidget(), Qt.QWidget) self.menu_grid_layout_1.addWidget(self._qtgui_time_sink_x_0_1_win, 2, 0, 1, 1) for r in range(2, 3): self.menu_grid_layout_1.setRowStretch(r, 1) for c in range(0, 1): self.menu_grid_layout_1.setColumnStretch(c, 1) self.qtgui_time_sink_x_0_0 = qtgui.time_sink_f( 1024, #size Rs, #samp_rate "", #name 2 #number of inputs ) self.qtgui_time_sink_x_0_0.set_update_time(0.10) self.qtgui_time_sink_x_0_0.set_y_axis(-0.5, 1.5) self.qtgui_time_sink_x_0_0.set_y_label('Amplitude', "") self.qtgui_time_sink_x_0_0.enable_tags(True) self.qtgui_time_sink_x_0_0.set_trigger_mode(qtgui.TRIG_MODE_FREE, qtgui.TRIG_SLOPE_POS, 0.0, 0, 0, "") self.qtgui_time_sink_x_0_0.enable_autoscale(False) self.qtgui_time_sink_x_0_0.enable_grid(False) self.qtgui_time_sink_x_0_0.enable_axis_labels(True) self.qtgui_time_sink_x_0_0.enable_control_panel(False) self.qtgui_time_sink_x_0_0.enable_stem_plot(True) labels = [ 'Signal 1', 'Signal 2', '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 = [0, 0, -1, -1, -1, -1, -1, -1, -1, -1] for i in range(2): if len(labels[i]) == 0: self.qtgui_time_sink_x_0_0.set_line_label( i, "Data {0}".format(i)) else: self.qtgui_time_sink_x_0_0.set_line_label(i, labels[i]) self.qtgui_time_sink_x_0_0.set_line_width(i, widths[i]) self.qtgui_time_sink_x_0_0.set_line_color(i, colors[i]) self.qtgui_time_sink_x_0_0.set_line_style(i, styles[i]) self.qtgui_time_sink_x_0_0.set_line_marker(i, markers[i]) self.qtgui_time_sink_x_0_0.set_line_alpha(i, alphas[i]) self._qtgui_time_sink_x_0_0_win = sip.wrapinstance( self.qtgui_time_sink_x_0_0.pyqwidget(), Qt.QWidget) self.menu_grid_layout_4.addWidget(self._qtgui_time_sink_x_0_0_win, 1, 0, 1, 1) for r in range(1, 2): self.menu_grid_layout_4.setRowStretch(r, 1) for c in range(0, 1): self.menu_grid_layout_4.setColumnStretch(c, 1) self.qtgui_time_sink_x_0 = qtgui.time_sink_f( 1024, #size Rs, #samp_rate "", #name 2 #number of inputs ) self.qtgui_time_sink_x_0.set_update_time(0.10) self.qtgui_time_sink_x_0.set_y_axis(-1, 1) 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(False) 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(True) labels = [ 'Signal 1', 'Signal 2', '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 = [0, 0, -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.menu_grid_layout_3.addWidget(self._qtgui_time_sink_x_0_win, 1, 0, 1, 1) for r in range(1, 2): self.menu_grid_layout_3.setRowStretch(r, 1) for c in range(0, 1): self.menu_grid_layout_3.setColumnStretch(c, 1) self.qtgui_const_sink_x_0_0_0_0 = qtgui.const_sink_c( 1024, #size "", #name 1 #number of inputs ) self.qtgui_const_sink_x_0_0_0_0.set_update_time(0.10) self.qtgui_const_sink_x_0_0_0_0.set_y_axis(-2, 2) self.qtgui_const_sink_x_0_0_0_0.set_x_axis(-2, 2) self.qtgui_const_sink_x_0_0_0_0.set_trigger_mode( qtgui.TRIG_MODE_FREE, qtgui.TRIG_SLOPE_POS, 0.0, 0, "") self.qtgui_const_sink_x_0_0_0_0.enable_autoscale(False) self.qtgui_const_sink_x_0_0_0_0.enable_grid(False) self.qtgui_const_sink_x_0_0_0_0.enable_axis_labels(True) labels = ['', '', '', '', '', '', '', '', '', ''] widths = [1, 1, 1, 1, 1, 1, 1, 1, 1, 1] colors = [ "blue", "red", "red", "red", "red", "red", "red", "red", "red", "red" ] styles = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0] markers = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0] 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): if len(labels[i]) == 0: self.qtgui_const_sink_x_0_0_0_0.set_line_label( i, "Data {0}".format(i)) else: self.qtgui_const_sink_x_0_0_0_0.set_line_label(i, labels[i]) self.qtgui_const_sink_x_0_0_0_0.set_line_width(i, widths[i]) self.qtgui_const_sink_x_0_0_0_0.set_line_color(i, colors[i]) self.qtgui_const_sink_x_0_0_0_0.set_line_style(i, styles[i]) self.qtgui_const_sink_x_0_0_0_0.set_line_marker(i, markers[i]) self.qtgui_const_sink_x_0_0_0_0.set_line_alpha(i, alphas[i]) self._qtgui_const_sink_x_0_0_0_0_win = sip.wrapinstance( self.qtgui_const_sink_x_0_0_0_0.pyqwidget(), Qt.QWidget) self.menu_grid_layout_0.addWidget(self._qtgui_const_sink_x_0_0_0_0_win, 2, 1, 1, 1) for r in range(2, 3): self.menu_grid_layout_0.setRowStretch(r, 1) for c in range(1, 2): self.menu_grid_layout_0.setColumnStretch(c, 1) self.qtgui_const_sink_x_0_0_0 = qtgui.const_sink_c( 1024, #size "", #name 1 #number of inputs ) self.qtgui_const_sink_x_0_0_0.set_update_time(0.10) self.qtgui_const_sink_x_0_0_0.set_y_axis(-2, 2) self.qtgui_const_sink_x_0_0_0.set_x_axis(-2, 2) self.qtgui_const_sink_x_0_0_0.set_trigger_mode(qtgui.TRIG_MODE_FREE, qtgui.TRIG_SLOPE_POS, 0.0, 0, "") self.qtgui_const_sink_x_0_0_0.enable_autoscale(False) self.qtgui_const_sink_x_0_0_0.enable_grid(False) self.qtgui_const_sink_x_0_0_0.enable_axis_labels(True) labels = ['', '', '', '', '', '', '', '', '', ''] widths = [1, 1, 1, 1, 1, 1, 1, 1, 1, 1] colors = [ "blue", "red", "red", "red", "red", "red", "red", "red", "red", "red" ] styles = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0] markers = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0] 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): if len(labels[i]) == 0: self.qtgui_const_sink_x_0_0_0.set_line_label( i, "Data {0}".format(i)) else: self.qtgui_const_sink_x_0_0_0.set_line_label(i, labels[i]) self.qtgui_const_sink_x_0_0_0.set_line_width(i, widths[i]) self.qtgui_const_sink_x_0_0_0.set_line_color(i, colors[i]) self.qtgui_const_sink_x_0_0_0.set_line_style(i, styles[i]) self.qtgui_const_sink_x_0_0_0.set_line_marker(i, markers[i]) self.qtgui_const_sink_x_0_0_0.set_line_alpha(i, alphas[i]) self._qtgui_const_sink_x_0_0_0_win = sip.wrapinstance( self.qtgui_const_sink_x_0_0_0.pyqwidget(), Qt.QWidget) self.menu_grid_layout_0.addWidget(self._qtgui_const_sink_x_0_0_0_win, 2, 0, 1, 1) for r in range(2, 3): self.menu_grid_layout_0.setRowStretch(r, 1) for c in range(0, 1): self.menu_grid_layout_0.setColumnStretch(c, 1) self.qtgui_const_sink_x_0_0 = qtgui.const_sink_c( 1024, #size "", #name 2 #number of inputs ) 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 = ['', '', '', '', '', '', '', '', '', ''] widths = [1, 1, 1, 1, 1, 1, 1, 1, 1, 1] colors = [ "blue", "red", "red", "red", "red", "red", "red", "red", "red", "red" ] styles = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0] markers = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0] 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_const_sink_x_0_0.set_line_label( i, "Data {0}".format(i)) else: 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.menu_grid_layout_2.addWidget(self._qtgui_const_sink_x_0_0_win, 1, 0, 1, 1) for r in range(1, 2): self.menu_grid_layout_2.setRowStretch(r, 1) for c in range(0, 1): self.menu_grid_layout_2.setColumnStretch(c, 1) self.qtgui_const_sink_x_0 = qtgui.const_sink_c( 1024, #size "", #name 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) labels = ['', '', '', '', '', '', '', '', '', ''] widths = [1, 1, 1, 1, 1, 1, 1, 1, 1, 1] colors = [ "blue", "red", "red", "red", "red", "red", "red", "red", "red", "red" ] styles = [1, 1, 0, 0, 0, 0, 0, 0, 0, 0] markers = [-1, -1, 0, 0, 0, 0, 0, 0, 0, 0] 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_const_sink_x_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.menu_grid_layout_1.addWidget(self._qtgui_const_sink_x_0_win, 1, 0, 1, 1) for r in range(1, 2): self.menu_grid_layout_1.setRowStretch(r, 1) for c in range(0, 1): self.menu_grid_layout_1.setColumnStretch(c, 1) self.interp_fir_filter_xxx_0_0 = filter.interp_fir_filter_ccc(1, h) self.interp_fir_filter_xxx_0_0.declare_sample_delay(0) self.interp_fir_filter_xxx_0 = filter.interp_fir_filter_ccc(Sps, h) self.interp_fir_filter_xxx_0.declare_sample_delay(0) self.epy_block_0 = epy_block_0.blk(Sps=Sps) self.e_VCO_fase_fc_0 = e_VCO_fase_fc_0.blk() self.digital_constellation_receiver_cb_0 = digital.constellation_receiver_cb( constelacion.base(), 2 * math.pi / 1000.0, -0.250, 0.250) self.blocks_unpacked_to_packed_xx_0_1 = blocks.unpacked_to_packed_bb( BpS, gr.GR_MSB_FIRST) self.blocks_unpack_k_bits_bb_0 = blocks.unpack_k_bits_bb(8) self.blocks_throttle_0 = blocks.throttle(gr.sizeof_gr_complex * 1, samp_rate, True) self.blocks_packed_to_unpacked_xx_0_0 = blocks.packed_to_unpacked_bb( BpS, gr.GR_MSB_FIRST) self.blocks_pack_k_bits_bb_0_0_0 = blocks.pack_k_bits_bb(8) self.blocks_null_sink_0 = blocks.null_sink(gr.sizeof_char * 1) self.blocks_multiply_const_vxx_0_0 = blocks.multiply_const_ff( (2 * math.pi) / M) self.blocks_multiply_const_vxx_0 = blocks.multiply_const_cc(1 / Sps) self.blocks_delay_1 = blocks.delay(gr.sizeof_float * 1, Retardo_bits) self.blocks_delay_0 = blocks.delay(gr.sizeof_gr_complex * 1, Retardo_Timing) self.blocks_complex_to_float_0 = blocks.complex_to_float(1) self.blocks_char_to_float_0_2 = blocks.char_to_float(1, 1) self.blocks_char_to_float_0_1 = blocks.char_to_float(1, 1) self.blocks_char_to_float_0_0_0 = blocks.char_to_float(1, 1) 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.blocks_add_xx_0 = blocks.add_vcc(1) self.b_upconverter_cf_0 = b_upconverter_cf( Fc=Rs * 2, samp_rate=44000, ) self.b_PSD_c_0 = b_PSD_c( Ensayos=1000000, Fc=0, N=1024, Ymax=6e-6, samp_rate_audio=samp_rate, ) self.menu_grid_layout_1.addWidget(self.b_PSD_c_0, 3, 0, 1, 1) for r in range(3, 4): self.menu_grid_layout_1.setRowStretch(r, 1) for c in range(0, 1): self.menu_grid_layout_1.setColumnStretch(c, 1) self.b_Eye_Diagram_simple_c_0 = b_Eye_Diagram_simple_c( AlphaLineas=0.5, Delay_i=0, GrosorLineas=20, Kint=1, N_eyes=2, Samprate1=samp_rate, Sps1=Sps, Title="Eye Diagramm", Ymax=2, Ymin=-2, ) self.menu_grid_layout_0.addWidget(self.b_Eye_Diagram_simple_c_0, 1, 0, 1, 2) for r in range(1, 2): self.menu_grid_layout_0.setRowStretch(r, 1) for c in range(0, 2): self.menu_grid_layout_0.setColumnStretch(c, 1) self.analog_random_source_x_0 = blocks.vector_source_b( list(map(int, numpy.random.randint(0, 2, 10000000))), True) self.analog_noise_source_x_0 = analog.noise_source_c( analog.GR_GAUSSIAN, 0.1, 0) self.analog_const_source_x_0_0_0 = analog.sig_source_f( 0, analog.GR_CONST_WAVE, 0, 0, 1) ################################################## # Connections ################################################## self.connect((self.analog_const_source_x_0_0_0, 0), (self.e_VCO_fase_fc_0, 1)) self.connect((self.analog_noise_source_x_0, 0), (self.blocks_add_xx_0, 0)) self.connect((self.analog_random_source_x_0, 0), (self.blocks_char_to_float_0_1, 0)) self.connect((self.analog_random_source_x_0, 0), (self.blocks_pack_k_bits_bb_0_0_0, 0)) self.connect((self.b_upconverter_cf_0, 0), (self.qtgui_time_sink_x_1, 0)) self.connect((self.blocks_add_xx_0, 0), (self.interp_fir_filter_xxx_0_0, 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.qtgui_time_sink_x_0, 1)) self.connect((self.blocks_char_to_float_0_0_0, 0), (self.qtgui_time_sink_x_0_0, 1)) self.connect((self.blocks_char_to_float_0_1, 0), (self.blocks_delay_1, 0)) self.connect((self.blocks_char_to_float_0_2, 0), (self.blocks_multiply_const_vxx_0_0, 0)) self.connect((self.blocks_complex_to_float_0, 1), (self.qtgui_time_sink_x_1, 2)) self.connect((self.blocks_complex_to_float_0, 0), (self.qtgui_time_sink_x_1, 1)) self.connect((self.blocks_delay_0, 0), (self.b_Eye_Diagram_simple_c_0, 0)) self.connect((self.blocks_delay_0, 0), (self.epy_block_0, 0)) self.connect((self.blocks_delay_0, 0), (self.qtgui_const_sink_x_0_0_0, 0)) self.connect((self.blocks_delay_1, 0), (self.qtgui_time_sink_x_0_0, 0)) self.connect((self.blocks_multiply_const_vxx_0, 0), (self.b_PSD_c_0, 0)) self.connect((self.blocks_multiply_const_vxx_0, 0), (self.blocks_delay_0, 0)) self.connect((self.blocks_multiply_const_vxx_0, 0), (self.qtgui_const_sink_x_0, 0)) self.connect((self.blocks_multiply_const_vxx_0, 0), (self.qtgui_time_sink_x_0_1, 1)) self.connect((self.blocks_multiply_const_vxx_0_0, 0), (self.e_VCO_fase_fc_0, 0)) self.connect((self.blocks_pack_k_bits_bb_0_0_0, 0), (self.blocks_packed_to_unpacked_xx_0_0, 0)) self.connect((self.blocks_packed_to_unpacked_xx_0_0, 0), (self.blocks_char_to_float_0, 0)) self.connect((self.blocks_packed_to_unpacked_xx_0_0, 0), (self.blocks_char_to_float_0_2, 0)) self.connect((self.blocks_throttle_0, 0), (self.blocks_add_xx_0, 1)) self.connect((self.blocks_unpack_k_bits_bb_0, 0), (self.blocks_char_to_float_0_0_0, 0)) self.connect((self.blocks_unpack_k_bits_bb_0, 0), (self.blocks_null_sink_0, 0)) self.connect((self.blocks_unpacked_to_packed_xx_0_1, 0), (self.blocks_unpack_k_bits_bb_0, 0)) self.connect((self.digital_constellation_receiver_cb_0, 0), (self.blocks_char_to_float_0_0, 0)) self.connect((self.digital_constellation_receiver_cb_0, 0), (self.blocks_unpacked_to_packed_xx_0_1, 0)) self.connect((self.e_VCO_fase_fc_0, 0), (self.interp_fir_filter_xxx_0, 0)) self.connect((self.e_VCO_fase_fc_0, 0), (self.qtgui_const_sink_x_0_0, 0)) self.connect((self.epy_block_0, 0), (self.digital_constellation_receiver_cb_0, 0)) self.connect((self.epy_block_0, 0), (self.qtgui_const_sink_x_0_0, 1)) self.connect((self.epy_block_0, 0), (self.qtgui_const_sink_x_0_0_0_0, 0)) self.connect((self.interp_fir_filter_xxx_0, 0), (self.b_upconverter_cf_0, 0)) self.connect((self.interp_fir_filter_xxx_0, 0), (self.blocks_complex_to_float_0, 0)) self.connect((self.interp_fir_filter_xxx_0, 0), (self.blocks_throttle_0, 0)) self.connect((self.interp_fir_filter_xxx_0, 0), (self.qtgui_const_sink_x_0, 1)) self.connect((self.interp_fir_filter_xxx_0, 0), (self.qtgui_time_sink_x_0_1, 0)) self.connect((self.interp_fir_filter_xxx_0_0, 0), (self.blocks_multiply_const_vxx_0, 0))