Пример #1
0
    def __init__(self):
        gr.top_block.__init__(self, "Simulator Dual Cw")
        Qt.QWidget.__init__(self)
        self.setWindowTitle("Simulator Dual Cw")
        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", "simulator_dual_cw")
        self.restoreGeometry(self.settings.value("geometry").toByteArray())

        ##################################################
        # Variables
        ##################################################
        self.samp_rate = samp_rate = 5000000
        self.packet_len = packet_len = 2**19
        self.freq_res = freq_res = samp_rate / float(packet_len)
        self.freq = freq = (-1000000, 1000000)
        self.center_freq = center_freq = 2.45e9
        self.vel = vel = 50
        self.value_range = value_range = 30
        self.v_res = v_res = freq_res * 3e8 / 2 / center_freq
        self.time_res = time_res = packet_len / float(samp_rate)
        self.range_res = range_res = 3e8 / 2 / float((freq[1] - freq[0]))
        self.min_output_buffer = min_output_buffer = int(packet_len * 2)
        self.max_output_buffer = max_output_buffer = 0
        self.decim_fac = decim_fac = 2**10

        ##################################################
        # Blocks
        ##################################################
        self._vel_range = Range(-50, 50, 0.1, 50, 200)
        self._vel_win = RangeWidget(self._vel_range, self.set_vel, "vel",
                                    "counter_slider", float)
        self.top_layout.addWidget(self._vel_win)
        self._value_range_range = Range(0, 100, 1, 30, 200)
        self._value_range_win = RangeWidget(self._value_range_range,
                                            self.set_value_range, 'range',
                                            "counter_slider", float)
        self.top_layout.addWidget(self._value_range_win)
        self.rational_resampler_xxx_0_0 = filter.rational_resampler_ccc(
            interpolation=1,
            decimation=decim_fac,
            taps=None,
            fractional_bw=None,
        )
        self.rational_resampler_xxx_0 = filter.rational_resampler_ccc(
            interpolation=1,
            decimation=decim_fac,
            taps=None,
            fractional_bw=None,
        )
        self.radar_ts_fft_cc_0_0 = radar.ts_fft_cc(packet_len / decim_fac,
                                                   "packet_len")
        (self.radar_ts_fft_cc_0_0).set_min_output_buffer(1048576)
        self.radar_ts_fft_cc_0 = radar.ts_fft_cc(packet_len / decim_fac,
                                                 "packet_len")
        (self.radar_ts_fft_cc_0).set_min_output_buffer(1048576)
        self.radar_trigger_command_0 = radar.trigger_command(
            "./play_sound beep.mp3", ("range", ), (0, ), (10, ), 500)
        self.radar_static_target_simulator_cc_0 = radar.static_target_simulator_cc(
            (value_range, ), (vel, ), (1e14, ), (0, ), (0, ), samp_rate,
            center_freq, -10, True, True, "packet_len")
        (self.radar_static_target_simulator_cc_0
         ).set_min_output_buffer(1048576)
        self.radar_signal_generator_cw_c_0_0 = radar.signal_generator_cw_c(
            packet_len, samp_rate, (freq[1], ), 1, "packet_len")
        (self.radar_signal_generator_cw_c_0_0).set_min_output_buffer(1048576)
        self.radar_signal_generator_cw_c_0 = radar.signal_generator_cw_c(
            packet_len, samp_rate, (freq[0], ), 1, "packet_len")
        (self.radar_signal_generator_cw_c_0).set_min_output_buffer(1048576)
        self.radar_qtgui_time_plot_0 = radar.qtgui_time_plot(
            100, 'range', (0, 75), 30, '')
        self.radar_qtgui_scatter_plot_0 = radar.qtgui_scatter_plot(
            100, 'range', 'velocity', (0, 75), (-5, 5), '')
        self.radar_print_results_0 = radar.print_results(False, "")
        self.radar_find_max_peak_c_0 = radar.find_max_peak_c(
            samp_rate / decim_fac, -200, 0, (-1000, 1000), True, "packet_len")
        self.radar_estimator_fsk_0 = radar.estimator_fsk(
            center_freq, (freq[1] - freq[0]), False)
        self.qtgui_sink_x_0 = qtgui.sink_c(
            1024,  #fftsize
            firdes.WIN_BLACKMAN_hARRIS,  #wintype
            0,  #fc
            samp_rate,  #bw
            "",  #name
            True,  #plotfreq
            True,  #plotwaterfall
            True,  #plottime
            True,  #plotconst
        )
        self.qtgui_sink_x_0.set_update_time(1.0 / 10)
        self._qtgui_sink_x_0_win = sip.wrapinstance(
            self.qtgui_sink_x_0.pyqwidget(), Qt.QWidget)
        self.top_layout.addWidget(self._qtgui_sink_x_0_win)

        self.qtgui_sink_x_0.enable_rf_freq(False)

        self.qtgui_freq_sink_x_0 = qtgui.freq_sink_c(
            packet_len / decim_fac,  #size
            firdes.WIN_BLACKMAN_hARRIS,  #wintype
            0,  #fc
            samp_rate / decim_fac,  #bw
            'QT GUI Plot',  #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.blocks_throttle_0_0 = blocks.throttle(gr.sizeof_gr_complex * 1,
                                                   samp_rate, True)
        (self.blocks_throttle_0_0).set_min_output_buffer(1048576)
        self.blocks_throttle_0 = blocks.throttle(gr.sizeof_gr_complex * 1,
                                                 samp_rate, True)
        (self.blocks_throttle_0).set_min_output_buffer(1048576)
        self.blocks_tagged_stream_multiply_length_0_0 = blocks.tagged_stream_multiply_length(
            gr.sizeof_gr_complex * 1, "packet_len", 1.0 / float(decim_fac))
        (self.blocks_tagged_stream_multiply_length_0_0
         ).set_min_output_buffer(1048576)
        self.blocks_tagged_stream_multiply_length_0 = blocks.tagged_stream_multiply_length(
            gr.sizeof_gr_complex * 1, "packet_len", 1.0 / float(decim_fac))
        (self.blocks_tagged_stream_multiply_length_0
         ).set_min_output_buffer(1048576)
        self.blocks_multiply_conjugate_cc_1 = blocks.multiply_conjugate_cc(1)
        (self.blocks_multiply_conjugate_cc_1).set_min_output_buffer(1048576)
        self.blocks_multiply_conjugate_cc_0_0 = blocks.multiply_conjugate_cc(1)
        (self.blocks_multiply_conjugate_cc_0_0).set_min_output_buffer(1048576)
        self.blocks_multiply_conjugate_cc_0 = blocks.multiply_conjugate_cc(1)
        (self.blocks_multiply_conjugate_cc_0).set_min_output_buffer(1048576)
        self.blocks_add_xx_1 = blocks.add_vcc(1)
        (self.blocks_add_xx_1).set_min_output_buffer(1048576)
        self.blocks_add_xx_0 = blocks.add_vcc(1)
        (self.blocks_add_xx_0).set_min_output_buffer(1048576)
        self.analog_noise_source_x_0 = analog.noise_source_c(
            analog.GR_GAUSSIAN, 0.5, 0)
        (self.analog_noise_source_x_0).set_min_output_buffer(1048576)

        ##################################################
        # Connections
        ##################################################
        self.msg_connect((self.radar_estimator_fsk_0, 'Msg out'),
                         (self.radar_print_results_0, 'Msg in'))
        self.msg_connect((self.radar_estimator_fsk_0, 'Msg out'),
                         (self.radar_qtgui_scatter_plot_0, 'Msg in'))
        self.msg_connect((self.radar_estimator_fsk_0, 'Msg out'),
                         (self.radar_qtgui_time_plot_0, 'Msg in'))
        self.msg_connect((self.radar_estimator_fsk_0, 'Msg out'),
                         (self.radar_trigger_command_0, 'Msg in'))
        self.msg_connect((self.radar_find_max_peak_c_0, 'Msg out'),
                         (self.radar_estimator_fsk_0, 'Msg in'))
        self.connect((self.analog_noise_source_x_0, 0),
                     (self.blocks_add_xx_0, 0))
        self.connect((self.blocks_add_xx_0, 0),
                     (self.blocks_multiply_conjugate_cc_0, 0))
        self.connect((self.blocks_add_xx_0, 0),
                     (self.blocks_multiply_conjugate_cc_0_0, 0))
        self.connect((self.blocks_add_xx_1, 0),
                     (self.radar_static_target_simulator_cc_0, 0))
        self.connect((self.blocks_multiply_conjugate_cc_0, 0),
                     (self.rational_resampler_xxx_0, 0))
        self.connect((self.blocks_multiply_conjugate_cc_0_0, 0),
                     (self.rational_resampler_xxx_0_0, 0))
        self.connect((self.blocks_multiply_conjugate_cc_1, 0),
                     (self.radar_find_max_peak_c_0, 0))
        self.connect((self.blocks_tagged_stream_multiply_length_0, 0),
                     (self.qtgui_sink_x_0, 0))
        self.connect((self.blocks_tagged_stream_multiply_length_0, 0),
                     (self.radar_ts_fft_cc_0, 0))
        self.connect((self.blocks_tagged_stream_multiply_length_0_0, 0),
                     (self.radar_ts_fft_cc_0_0, 0))
        self.connect((self.blocks_throttle_0, 0), (self.blocks_add_xx_1, 0))
        self.connect((self.blocks_throttle_0, 0),
                     (self.blocks_multiply_conjugate_cc_0, 1))
        self.connect((self.blocks_throttle_0_0, 0), (self.blocks_add_xx_1, 1))
        self.connect((self.blocks_throttle_0_0, 0),
                     (self.blocks_multiply_conjugate_cc_0_0, 1))
        self.connect((self.radar_signal_generator_cw_c_0, 0),
                     (self.blocks_throttle_0, 0))
        self.connect((self.radar_signal_generator_cw_c_0_0, 0),
                     (self.blocks_throttle_0_0, 0))
        self.connect((self.radar_static_target_simulator_cc_0, 0),
                     (self.blocks_add_xx_0, 1))
        self.connect((self.radar_ts_fft_cc_0, 0),
                     (self.blocks_multiply_conjugate_cc_1, 0))
        self.connect((self.radar_ts_fft_cc_0_0, 0),
                     (self.blocks_multiply_conjugate_cc_1, 1))
        self.connect((self.rational_resampler_xxx_0, 0),
                     (self.blocks_tagged_stream_multiply_length_0, 0))
        self.connect((self.rational_resampler_xxx_0, 0),
                     (self.qtgui_freq_sink_x_0, 0))
        self.connect((self.rational_resampler_xxx_0_0, 0),
                     (self.blocks_tagged_stream_multiply_length_0_0, 0))
        self.connect((self.rational_resampler_xxx_0_0, 0),
                     (self.qtgui_freq_sink_x_0, 1))
Пример #2
0
    def __init__(self):
        gr.top_block.__init__(self, "Simulator Fsk")
        Qt.QWidget.__init__(self)
        self.setWindowTitle("Simulator Fsk")
        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", "simulator_fsk")
        self.restoreGeometry(self.settings.value("geometry").toByteArray())

        ##################################################
        # Variables
        ##################################################
        self.samp_rate = samp_rate = 5000000
        self.blocks_per_tag = blocks_per_tag = 2**17
        self.samp_per_freq = samp_per_freq = 1
        self.freq_res = freq_res = samp_rate / 2 / blocks_per_tag
        self.delta_freq = delta_freq = samp_rate / 4
        self.center_freq = center_freq = 2.4e9
        self.velocity = velocity = 20
        self.value_range = value_range = 10
        self.v_res = v_res = freq_res * 3e8 / 2 / center_freq
        self.samp_discard = samp_discard = 0
        self.min_output_buffer = min_output_buffer = 2 * (blocks_per_tag *
                                                          samp_per_freq * 2)
        self.decimator_fac = decimator_fac = 2**7
        self.R_max = R_max = 3e8 / 2 / delta_freq

        ##################################################
        # Blocks
        ##################################################
        self._velocity_range = Range(-30, 30, 1, 20, 200)
        self._velocity_win = RangeWidget(self._velocity_range,
                                         self.set_velocity, "velocity",
                                         "counter_slider", float)
        self.top_grid_layout.addWidget(self._velocity_win)
        self._value_range_range = Range(0, R_max + R_max / 2, 1, 10, 200)
        self._value_range_win = RangeWidget(self._value_range_range,
                                            self.set_value_range, 'range',
                                            "counter_slider", float)
        self.top_grid_layout.addWidget(self._value_range_win)
        self.rational_resampler_xxx_0_0 = filter.rational_resampler_ccc(
            interpolation=1,
            decimation=decimator_fac,
            taps=None,
            fractional_bw=None,
        )
        self.rational_resampler_xxx_0 = filter.rational_resampler_ccc(
            interpolation=1,
            decimation=decimator_fac,
            taps=None,
            fractional_bw=None,
        )
        self.radar_ts_fft_cc_0_0 = radar.ts_fft_cc(
            blocks_per_tag / decimator_fac, "packet_len")
        self.radar_ts_fft_cc_0 = radar.ts_fft_cc(
            blocks_per_tag / decimator_fac, "packet_len")
        self.radar_static_target_simulator_cc_0 = radar.static_target_simulator_cc(
            (value_range, ), (velocity, ), (1e16, ), (0, ), (0, ), samp_rate,
            center_freq, -10, True, True, "packet_len")
        (self.radar_static_target_simulator_cc_0).set_min_output_buffer(524288)
        self.radar_split_fsk_cc_0 = radar.split_fsk_cc(samp_per_freq,
                                                       samp_discard,
                                                       "packet_len")
        (self.radar_split_fsk_cc_0).set_min_output_buffer(524288)
        self.radar_signal_generator_fsk_c_0 = radar.signal_generator_fsk_c(
            samp_rate, samp_per_freq, blocks_per_tag, -delta_freq / 2,
            delta_freq / 2, 1, "packet_len")
        (self.radar_signal_generator_fsk_c_0).set_min_output_buffer(524288)
        self.radar_print_results_0 = radar.print_results(False, "test.txt")
        self.radar_os_cfar_c_0 = radar.os_cfar_c(samp_rate / 2 / decimator_fac,
                                                 15, 0, 0.78, 30, True,
                                                 "packet_len")
        (self.radar_os_cfar_c_0).set_min_output_buffer(524288)
        self.radar_estimator_fsk_0 = radar.estimator_fsk(
            center_freq, delta_freq, False)
        self.qtgui_sink_x_0 = qtgui.sink_c(
            blocks_per_tag / decimator_fac,  #fftsize
            firdes.WIN_BLACKMAN_hARRIS,  #wintype
            0,  #fc
            samp_rate / decimator_fac / 2,  #bw
            'QT GUI Plot',  #name
            True,  #plotfreq
            True,  #plotwaterfall
            True,  #plottime
            True,  #plotconst
        )
        self.qtgui_sink_x_0.set_update_time(1.0 / 10)
        self._qtgui_sink_x_0_win = sip.wrapinstance(
            self.qtgui_sink_x_0.pyqwidget(), Qt.QWidget)
        self.top_grid_layout.addWidget(self._qtgui_sink_x_0_win)

        self.qtgui_sink_x_0.enable_rf_freq(False)

        self.blocks_throttle_0 = blocks.throttle(gr.sizeof_gr_complex * 1,
                                                 samp_rate, True)
        (self.blocks_throttle_0).set_min_output_buffer(524288)
        self.blocks_tagged_stream_multiply_length_0_0 = blocks.tagged_stream_multiply_length(
            gr.sizeof_gr_complex * 1, "packet_len", 1.0 / decimator_fac)
        (self.blocks_tagged_stream_multiply_length_0_0
         ).set_min_output_buffer(524288)
        self.blocks_tagged_stream_multiply_length_0 = blocks.tagged_stream_multiply_length(
            gr.sizeof_gr_complex * 1, "packet_len", 1.0 / decimator_fac)
        (self.blocks_tagged_stream_multiply_length_0
         ).set_min_output_buffer(524288)
        self.blocks_multiply_conjugate_cc_1 = blocks.multiply_conjugate_cc(1)
        (self.blocks_multiply_conjugate_cc_1).set_min_output_buffer(524288)
        self.blocks_multiply_conjugate_cc_0 = blocks.multiply_conjugate_cc(1)
        (self.blocks_multiply_conjugate_cc_0).set_min_output_buffer(524288)
        self.blocks_add_xx_0 = blocks.add_vcc(1)
        (self.blocks_add_xx_0).set_min_output_buffer(524288)
        self.analog_noise_source_x_0 = analog.noise_source_c(
            analog.GR_GAUSSIAN, 0.5, 0)
        (self.analog_noise_source_x_0).set_min_output_buffer(524288)

        ##################################################
        # Connections
        ##################################################
        self.msg_connect((self.radar_estimator_fsk_0, 'Msg out'),
                         (self.radar_print_results_0, 'Msg in'))
        self.msg_connect((self.radar_os_cfar_c_0, 'Msg out'),
                         (self.radar_estimator_fsk_0, 'Msg in'))
        self.connect((self.analog_noise_source_x_0, 0),
                     (self.blocks_add_xx_0, 0))
        self.connect((self.blocks_add_xx_0, 0),
                     (self.blocks_multiply_conjugate_cc_1, 0))
        self.connect((self.blocks_multiply_conjugate_cc_0, 0),
                     (self.radar_os_cfar_c_0, 0))
        self.connect((self.blocks_multiply_conjugate_cc_1, 0),
                     (self.radar_split_fsk_cc_0, 0))
        self.connect((self.blocks_tagged_stream_multiply_length_0, 0),
                     (self.qtgui_sink_x_0, 0))
        self.connect((self.blocks_tagged_stream_multiply_length_0, 0),
                     (self.radar_ts_fft_cc_0, 0))
        self.connect((self.blocks_tagged_stream_multiply_length_0_0, 0),
                     (self.radar_ts_fft_cc_0_0, 0))
        self.connect((self.blocks_throttle_0, 0),
                     (self.blocks_multiply_conjugate_cc_1, 1))
        self.connect((self.blocks_throttle_0, 0),
                     (self.radar_static_target_simulator_cc_0, 0))
        self.connect((self.radar_signal_generator_fsk_c_0, 0),
                     (self.blocks_throttle_0, 0))
        self.connect((self.radar_split_fsk_cc_0, 0),
                     (self.rational_resampler_xxx_0, 0))
        self.connect((self.radar_split_fsk_cc_0, 1),
                     (self.rational_resampler_xxx_0_0, 0))
        self.connect((self.radar_static_target_simulator_cc_0, 0),
                     (self.blocks_add_xx_0, 1))
        self.connect((self.radar_ts_fft_cc_0, 0),
                     (self.blocks_multiply_conjugate_cc_0, 1))
        self.connect((self.radar_ts_fft_cc_0_0, 0),
                     (self.blocks_multiply_conjugate_cc_0, 0))
        self.connect((self.rational_resampler_xxx_0, 0),
                     (self.blocks_tagged_stream_multiply_length_0, 0))
        self.connect((self.rational_resampler_xxx_0_0, 0),
                     (self.blocks_tagged_stream_multiply_length_0_0, 0))
Пример #3
0
    def __init__(self):
        gr.top_block.__init__(self, "Simulator Ofdm")
        Qt.QWidget.__init__(self)
        self.setWindowTitle("Simulator Ofdm")
        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", "simulator_ofdm")
        self.restoreGeometry(self.settings.value("geometry").toByteArray())

        ##################################################
        # Variables
        ##################################################
        self.samp_rate = samp_rate = 5000000
        self.packet_len = packet_len = 2**9
        self.occupied_carriers_all = occupied_carriers_all = (range(-26, 27), )
        self.fft_len = fft_len = 2**6
        self.zeropadding_fac = zeropadding_fac = 2
        self.velocity = velocity = 500
        self.value_range = value_range = 100
        self.v_max = v_max = 2000
        self.transpose_len = transpose_len = int(
            np.ceil(packet_len * 4.0 / len(occupied_carriers_all[0])))
        self.sync_word2 = sync_word2 = [
            0, 0, 0, 0, 0, 0, -1, -1, -1, -1, 1, 1, -1, -1, -1, 1, -1, 1, 1, 1,
            1, 1, -1, -1, -1, -1, -1, 1, -1, -1, 1, -1, 0, 1, -1, 1, 1, 1, -1,
            1, 1, 1, -1, 1, 1, 1, 1, -1, 1, -1, -1, -1, 1, -1, 1, -1, -1, -1,
            -1, 0, 0, 0, 0, 0
        ]
        self.sync_word1 = sync_word1 = [
            0., 0., 0., 0., 0., 0., 0., 1.41421356, 0., -1.41421356, 0.,
            1.41421356, 0., -1.41421356, 0., -1.41421356, 0., -1.41421356, 0.,
            1.41421356, 0., -1.41421356, 0., 1.41421356, 0., -1.41421356, 0.,
            -1.41421356, 0., -1.41421356, 0., -1.41421356, 0., 1.41421356, 0.,
            -1.41421356, 0., 1.41421356, 0., 1.41421356, 0., 1.41421356, 0.,
            -1.41421356, 0., 1.41421356, 0., 1.41421356, 0., 1.41421356, 0.,
            -1.41421356, 0., 1.41421356, 0., 1.41421356, 0., 1.41421356, 0.,
            0., 0., 0., 0., 0.
        ]
        self.pilot_symbols = pilot_symbols = ((
            1,
            1,
            1,
            -1,
        ), )
        self.pilot_carriers = pilot_carriers = ((
            -21,
            -7,
            7,
            21,
        ), )
        self.payload_mod = payload_mod = digital.constellation_qpsk()
        self.occupied_carriers = occupied_carriers = (
            range(-26, -21) + range(-20, -7) + range(-6, 0) + range(1, 7) +
            range(8, 21) + range(22, 27), )
        self.length_tag_key = length_tag_key = "packet_len"
        self.discarded_carriers = discarded_carriers = []
        self.center_freq = center_freq = 2.45e9
        self.R_max = R_max = 3e8 / 2 / samp_rate * fft_len

        ##################################################
        # Blocks
        ##################################################
        self._velocity_range = Range(-v_max, v_max, 1, 500, 200)
        self._velocity_win = RangeWidget(self._velocity_range,
                                         self.set_velocity, 'Velocity',
                                         "counter_slider", float)
        self.top_grid_layout.addWidget(self._velocity_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._value_range_range = Range(0.1, R_max, 1, 100, 200)
        self._value_range_win = RangeWidget(self._value_range_range,
                                            self.set_value_range, 'range',
                                            "counter_slider", float)
        self.top_grid_layout.addWidget(self._value_range_win, 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.radar_transpose_matrix_vcvc_0_0 = radar.transpose_matrix_vcvc(
            transpose_len, fft_len * zeropadding_fac, "packet_len")
        (self.radar_transpose_matrix_vcvc_0_0).set_min_output_buffer(78)
        self.radar_transpose_matrix_vcvc_0 = radar.transpose_matrix_vcvc(
            fft_len * zeropadding_fac, transpose_len, "packet_len")
        (self.radar_transpose_matrix_vcvc_0).set_min_output_buffer(256)
        self.radar_static_target_simulator_cc_0 = radar.static_target_simulator_cc(
            (value_range, ), (velocity, ), (1e25, ), (0, ), (0, ), samp_rate,
            center_freq, -10, True, True, "packet_len")
        (self.radar_static_target_simulator_cc_0).set_min_output_buffer(6240)
        self.radar_qtgui_spectrogram_plot_0 = radar.qtgui_spectrogram_plot(
            fft_len * zeropadding_fac, 500, 'value_range', 'Velocity',
            'OFDM Radar', (0, R_max), (0, v_max), (-15, -12), True,
            "packet_len")
        self.radar_print_results_0 = radar.print_results(False, "")
        self.radar_os_cfar_2d_vc_0 = radar.os_cfar_2d_vc(
            fft_len * zeropadding_fac, (10, 10), (0, 0), 0.78, 30,
            "packet_len")
        self.radar_ofdm_divide_vcvc_0 = radar.ofdm_divide_vcvc(
            fft_len, (fft_len - len(discarded_carriers)) * zeropadding_fac,
            (()), 0, "packet_len")
        (self.radar_ofdm_divide_vcvc_0).set_min_output_buffer(78)
        self.radar_ofdm_cyclic_prefix_remover_cvc_0 = radar.ofdm_cyclic_prefix_remover_cvc(
            fft_len, fft_len / 4, "packet_len")
        (self.radar_ofdm_cyclic_prefix_remover_cvc_0).set_min_output_buffer(78)
        self.radar_estimator_ofdm_0 = radar.estimator_ofdm(
            'range', fft_len * zeropadding_fac, (0, R_max), 'velocity',
            transpose_len, (0, v_max, -v_max, 0), True)
        self.fft_vxx_0_1_0 = fft.fft_vcc(
            transpose_len, False, (window.blackmanharris(transpose_len)),
            False, 1)
        self.fft_vxx_0_1 = fft.fft_vcc(
            fft_len * zeropadding_fac, True,
            (window.blackmanharris(fft_len * zeropadding_fac)), False, 1)
        self.fft_vxx_0_0 = fft.fft_vcc(fft_len, True, (()), True, 1)
        (self.fft_vxx_0_0).set_min_output_buffer(78)
        self.fft_vxx_0 = fft.fft_vcc(fft_len, False, (()), True, 1)
        self.digital_ofdm_cyclic_prefixer_0 = digital.ofdm_cyclic_prefixer(
            fft_len, fft_len + fft_len / 4, 0, length_tag_key)
        (self.digital_ofdm_cyclic_prefixer_0).set_min_output_buffer(6240)
        self.digital_ofdm_carrier_allocator_cvc_0 = digital.ofdm_carrier_allocator_cvc(
            fft_len, occupied_carriers_all, ((), ), ((), ), (), length_tag_key)
        (self.digital_ofdm_carrier_allocator_cvc_0).set_min_output_buffer(78)
        self.digital_chunks_to_symbols_xx_0_0 = digital.chunks_to_symbols_bc(
            (payload_mod.points()), 1)
        (self.digital_chunks_to_symbols_xx_0_0).set_min_output_buffer(4096)
        self.blocks_throttle_0 = blocks.throttle(gr.sizeof_char * 1, samp_rate,
                                                 True)
        self.blocks_stream_to_tagged_stream_0 = blocks.stream_to_tagged_stream(
            gr.sizeof_char, 1, packet_len, length_tag_key)
        self.blocks_repack_bits_bb_0 = blocks.repack_bits_bb(
            8, payload_mod.bits_per_symbol(), length_tag_key, False,
            gr.GR_LSB_FIRST)
        self.blocks_null_sink_0 = blocks.null_sink(gr.sizeof_float * fft_len *
                                                   zeropadding_fac)
        self.blocks_nlog10_ff_0 = blocks.nlog10_ff(1,
                                                   fft_len * zeropadding_fac,
                                                   0)
        self.blocks_complex_to_mag_squared_0 = blocks.complex_to_mag_squared(
            fft_len * zeropadding_fac)
        self.blocks_add_xx_0 = blocks.add_vcc(1)
        self.analog_random_source_x_0 = blocks.vector_source_b(
            map(int, numpy.random.randint(0, 255, 1000)), True)
        self.analog_noise_source_x_0 = analog.noise_source_c(
            analog.GR_GAUSSIAN, 0.1, 0)

        ##################################################
        # Connections
        ##################################################
        self.msg_connect((self.radar_estimator_ofdm_0, 'Msg out'),
                         (self.radar_print_results_0, 'Msg in'))
        self.msg_connect((self.radar_os_cfar_2d_vc_0, 'Msg out'),
                         (self.radar_estimator_ofdm_0, 'Msg in'))
        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_throttle_0, 0))
        self.connect((self.blocks_add_xx_0, 0),
                     (self.radar_ofdm_cyclic_prefix_remover_cvc_0, 0))
        self.connect((self.blocks_complex_to_mag_squared_0, 0),
                     (self.blocks_nlog10_ff_0, 0))
        self.connect((self.blocks_nlog10_ff_0, 0),
                     (self.blocks_null_sink_0, 0))
        self.connect((self.blocks_nlog10_ff_0, 0),
                     (self.radar_qtgui_spectrogram_plot_0, 0))
        self.connect((self.blocks_repack_bits_bb_0, 0),
                     (self.digital_chunks_to_symbols_xx_0_0, 0))
        self.connect((self.blocks_stream_to_tagged_stream_0, 0),
                     (self.blocks_repack_bits_bb_0, 0))
        self.connect((self.blocks_throttle_0, 0),
                     (self.blocks_stream_to_tagged_stream_0, 0))
        self.connect((self.digital_chunks_to_symbols_xx_0_0, 0),
                     (self.digital_ofdm_carrier_allocator_cvc_0, 0))
        self.connect((self.digital_ofdm_carrier_allocator_cvc_0, 0),
                     (self.fft_vxx_0, 0))
        self.connect((self.digital_ofdm_carrier_allocator_cvc_0, 0),
                     (self.radar_ofdm_divide_vcvc_0, 0))
        self.connect((self.digital_ofdm_cyclic_prefixer_0, 0),
                     (self.radar_static_target_simulator_cc_0, 0))
        self.connect((self.fft_vxx_0, 0),
                     (self.digital_ofdm_cyclic_prefixer_0, 0))
        self.connect((self.fft_vxx_0_0, 0), (self.radar_ofdm_divide_vcvc_0, 1))
        self.connect((self.fft_vxx_0_1, 0),
                     (self.radar_transpose_matrix_vcvc_0, 0))
        self.connect((self.fft_vxx_0_1_0, 0),
                     (self.radar_transpose_matrix_vcvc_0_0, 0))
        self.connect((self.radar_ofdm_cyclic_prefix_remover_cvc_0, 0),
                     (self.fft_vxx_0_0, 0))
        self.connect((self.radar_ofdm_divide_vcvc_0, 0), (self.fft_vxx_0_1, 0))
        self.connect((self.radar_static_target_simulator_cc_0, 0),
                     (self.blocks_add_xx_0, 1))
        self.connect((self.radar_transpose_matrix_vcvc_0, 0),
                     (self.fft_vxx_0_1_0, 0))
        self.connect((self.radar_transpose_matrix_vcvc_0_0, 0),
                     (self.blocks_complex_to_mag_squared_0, 0))
        self.connect((self.radar_transpose_matrix_vcvc_0_0, 0),
                     (self.radar_os_cfar_2d_vc_0, 0))
Пример #4
0
    def __init__(self):
        gr.top_block.__init__(self, "Top Block")
        Qt.QWidget.__init__(self)
        self.setWindowTitle("Top Block")
        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.samp_rate = samp_rate = 5000000
        self.packet_len = packet_len = 2**19
        self.freq_res = freq_res = samp_rate/float(packet_len)
        self.freq = freq = (-1000000,1000000)
        self.center_freq = center_freq = 2.45e9
        self.vel = vel = 50
        self.v_res = v_res = freq_res*3e8/2/center_freq
        self.time_res = time_res = packet_len/float(samp_rate)
        self.range_res = range_res = 3e8/2/float((freq[1]-freq[0]))
        self.min_output_buffer = min_output_buffer = int(packet_len*2)
        self.decim_fac = decim_fac = 2**10
        self.Range = Range = 30

        ##################################################
        # Blocks
        ##################################################
        self._vel_layout = Qt.QVBoxLayout()
        self._vel_tool_bar = Qt.QToolBar(self)
        self._vel_layout.addWidget(self._vel_tool_bar)
        self._vel_tool_bar.addWidget(Qt.QLabel("vel"+": "))
        class qwt_counter_pyslot(Qwt.QwtCounter):
            def __init__(self, parent=None):
                Qwt.QwtCounter.__init__(self, parent)
            @pyqtSlot('double')
            def setValue(self, value):
                super(Qwt.QwtCounter, self).setValue(value)
        self._vel_counter = qwt_counter_pyslot()
        self._vel_counter.setRange(-50, 50, 0.1)
        self._vel_counter.setNumButtons(2)
        self._vel_counter.setValue(self.vel)
        self._vel_tool_bar.addWidget(self._vel_counter)
        self._vel_counter.valueChanged.connect(self.set_vel)
        self._vel_slider = Qwt.QwtSlider(None, Qt.Qt.Horizontal, Qwt.QwtSlider.BottomScale, Qwt.QwtSlider.BgSlot)
        self._vel_slider.setRange(-50, 50, 0.1)
        self._vel_slider.setValue(self.vel)
        self._vel_slider.setMinimumWidth(200)
        self._vel_slider.valueChanged.connect(self.set_vel)
        self._vel_layout.addWidget(self._vel_slider)
        self.top_layout.addLayout(self._vel_layout)
        self._Range_layout = Qt.QVBoxLayout()
        self._Range_tool_bar = Qt.QToolBar(self)
        self._Range_layout.addWidget(self._Range_tool_bar)
        self._Range_tool_bar.addWidget(Qt.QLabel("Range"+": "))
        class qwt_counter_pyslot(Qwt.QwtCounter):
            def __init__(self, parent=None):
                Qwt.QwtCounter.__init__(self, parent)
            @pyqtSlot('double')
            def setValue(self, value):
                super(Qwt.QwtCounter, self).setValue(value)
        self._Range_counter = qwt_counter_pyslot()
        self._Range_counter.setRange(0, 100, 1)
        self._Range_counter.setNumButtons(2)
        self._Range_counter.setValue(self.Range)
        self._Range_tool_bar.addWidget(self._Range_counter)
        self._Range_counter.valueChanged.connect(self.set_Range)
        self._Range_slider = Qwt.QwtSlider(None, Qt.Qt.Horizontal, Qwt.QwtSlider.BottomScale, Qwt.QwtSlider.BgSlot)
        self._Range_slider.setRange(0, 100, 1)
        self._Range_slider.setValue(self.Range)
        self._Range_slider.setMinimumWidth(200)
        self._Range_slider.valueChanged.connect(self.set_Range)
        self._Range_layout.addWidget(self._Range_slider)
        self.top_layout.addLayout(self._Range_layout)
        self.rational_resampler_xxx_0_0 = filter.rational_resampler_ccc(
                interpolation=1,
                decimation=decim_fac,
                taps=None,
                fractional_bw=None,
        )
        self.rational_resampler_xxx_0 = filter.rational_resampler_ccc(
                interpolation=1,
                decimation=decim_fac,
                taps=None,
                fractional_bw=None,
        )
        self.radar_ts_fft_cc_0_0 = radar.ts_fft_cc(packet_len/decim_fac,  "packet_len")
        (self.radar_ts_fft_cc_0_0).set_min_output_buffer(1048576)
        self.radar_ts_fft_cc_0 = radar.ts_fft_cc(packet_len/decim_fac,  "packet_len")
        (self.radar_ts_fft_cc_0).set_min_output_buffer(1048576)
        self.radar_static_target_simulator_cc_0 = radar.static_target_simulator_cc((Range,), (vel, ), (1e14, ), (0,), (0,), samp_rate, center_freq, -10, True, True, "packet_len")
        (self.radar_static_target_simulator_cc_0).set_min_output_buffer(1048576)
        self.radar_signal_generator_cw_c_0_0 = radar.signal_generator_cw_c(packet_len, samp_rate, (freq[1], ), 0.5, "packet_len")
        (self.radar_signal_generator_cw_c_0_0).set_min_output_buffer(1048576)
        self.radar_signal_generator_cw_c_0 = radar.signal_generator_cw_c(packet_len, samp_rate, (freq[0], ), 0.5, "packet_len")
        (self.radar_signal_generator_cw_c_0).set_min_output_buffer(1048576)
        self.qtgui_vector_sink_f_0 = qtgui.vector_sink_f(
            packet_len/decim_fac,
            0,
            1.0,
            "x-Axis",
            "y-Axis",
            "",
            1 # Number of inputs
        )
        self.qtgui_vector_sink_f_0.set_update_time(0.10)
        self.qtgui_vector_sink_f_0.set_y_axis(-140, 10)
        self.qtgui_vector_sink_f_0.enable_autoscale(True)
        self.qtgui_vector_sink_f_0.enable_grid(False)
        self.qtgui_vector_sink_f_0.set_x_axis_units("")
        self.qtgui_vector_sink_f_0.set_y_axis_units("")
        self.qtgui_vector_sink_f_0.set_ref_level(0)
        
        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_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.top_layout.addWidget(self._qtgui_vector_sink_f_0_win)
        self.blocks_throttle_0_0 = blocks.throttle(gr.sizeof_gr_complex*1, samp_rate,True)
        (self.blocks_throttle_0_0).set_min_output_buffer(1048576)
        self.blocks_throttle_0 = blocks.throttle(gr.sizeof_gr_complex*1, samp_rate,True)
        (self.blocks_throttle_0).set_min_output_buffer(1048576)
        self.blocks_tagged_stream_multiply_length_0_0 = blocks.tagged_stream_multiply_length(gr.sizeof_gr_complex*1, "packet_len", 1.0/float(decim_fac))
        (self.blocks_tagged_stream_multiply_length_0_0).set_min_output_buffer(1048576)
        self.blocks_tagged_stream_multiply_length_0 = blocks.tagged_stream_multiply_length(gr.sizeof_gr_complex*1, "packet_len", 1.0/float(decim_fac))
        (self.blocks_tagged_stream_multiply_length_0).set_min_output_buffer(1048576)
        self.blocks_stream_to_vector_0 = blocks.stream_to_vector(gr.sizeof_float*1, packet_len/decim_fac)
        self.blocks_multiply_conjugate_cc_1 = blocks.multiply_conjugate_cc(1)
        (self.blocks_multiply_conjugate_cc_1).set_min_output_buffer(1048576)
        self.blocks_multiply_conjugate_cc_0_0 = blocks.multiply_conjugate_cc(1)
        (self.blocks_multiply_conjugate_cc_0_0).set_min_output_buffer(1048576)
        self.blocks_multiply_conjugate_cc_0 = blocks.multiply_conjugate_cc(1)
        (self.blocks_multiply_conjugate_cc_0).set_min_output_buffer(1048576)
        self.blocks_complex_to_mag_squared_0 = blocks.complex_to_mag_squared(1)
        self.blocks_add_xx_1 = blocks.add_vcc(1)
        (self.blocks_add_xx_1).set_min_output_buffer(1048576)
        self.blocks_add_xx_0 = blocks.add_vcc(1)
        (self.blocks_add_xx_0).set_min_output_buffer(1048576)
        self.analog_noise_source_x_0 = analog.noise_source_c(analog.GR_GAUSSIAN, 0.5, 0)
        (self.analog_noise_source_x_0).set_min_output_buffer(1048576)

        ##################################################
        # Connections
        ##################################################
        self.connect((self.radar_signal_generator_cw_c_0, 0), (self.blocks_throttle_0, 0))
        self.connect((self.analog_noise_source_x_0, 0), (self.blocks_add_xx_0, 0))
        self.connect((self.blocks_add_xx_0, 0), (self.blocks_multiply_conjugate_cc_0, 0))
        self.connect((self.radar_signal_generator_cw_c_0_0, 0), (self.blocks_throttle_0_0, 0))
        self.connect((self.blocks_throttle_0, 0), (self.blocks_add_xx_1, 0))
        self.connect((self.blocks_throttle_0_0, 0), (self.blocks_add_xx_1, 1))
        self.connect((self.blocks_add_xx_1, 0), (self.radar_static_target_simulator_cc_0, 0))
        self.connect((self.blocks_add_xx_0, 0), (self.blocks_multiply_conjugate_cc_0_0, 0))
        self.connect((self.blocks_throttle_0_0, 0), (self.blocks_multiply_conjugate_cc_0_0, 1))
        self.connect((self.blocks_multiply_conjugate_cc_0, 0), (self.rational_resampler_xxx_0, 0))
        self.connect((self.blocks_multiply_conjugate_cc_0_0, 0), (self.rational_resampler_xxx_0_0, 0))
        self.connect((self.blocks_tagged_stream_multiply_length_0, 0), (self.radar_ts_fft_cc_0, 0))
        self.connect((self.rational_resampler_xxx_0, 0), (self.blocks_tagged_stream_multiply_length_0, 0))
        self.connect((self.blocks_tagged_stream_multiply_length_0_0, 0), (self.radar_ts_fft_cc_0_0, 0))
        self.connect((self.rational_resampler_xxx_0_0, 0), (self.blocks_tagged_stream_multiply_length_0_0, 0))
        self.connect((self.radar_ts_fft_cc_0_0, 0), (self.blocks_multiply_conjugate_cc_1, 1))
        self.connect((self.radar_ts_fft_cc_0, 0), (self.blocks_multiply_conjugate_cc_1, 0))
        self.connect((self.radar_static_target_simulator_cc_0, 0), (self.blocks_add_xx_0, 1))
        self.connect((self.blocks_throttle_0, 0), (self.blocks_multiply_conjugate_cc_0, 1))
        self.connect((self.blocks_complex_to_mag_squared_0, 0), (self.blocks_stream_to_vector_0, 0))
        self.connect((self.blocks_multiply_conjugate_cc_1, 0), (self.blocks_complex_to_mag_squared_0, 0))
        self.connect((self.blocks_stream_to_vector_0, 0), (self.qtgui_vector_sink_f_0, 0))
Пример #5
0
    def __init__(self):
        grc_wxgui.top_block_gui.__init__(self, title="Test Split Cc")

        ##################################################
        # Variables
        ##################################################
        self.samp_up = samp_up = 512
        self.samp_rate = samp_rate = 1024
        self.samp_down = samp_down = 512
        self.samp_cw = samp_cw = 1024

        ##################################################
        # Blocks
        ##################################################
        self.wxgui_fftsink2_0 = fftsink2.fft_sink_c(
            self.GetWin(),
            baseband_freq=0,
            y_per_div=10,
            y_divs=10,
            ref_level=0,
            ref_scale=2.0,
            sample_rate=samp_rate,
            fft_size=1024,
            fft_rate=15,
            average=False,
            avg_alpha=None,
            title='FFT Plot',
            peak_hold=False,
        )
        self.Add(self.wxgui_fftsink2_0.win)
        self.radar_static_target_simulator_cc_0 = radar.static_target_simulator_cc(
            (10, ), (5, ), (1e12, ), (0, ), (0, ), samp_rate, 2.4e9, -10, True,
            True, "packet_len")
        self.radar_split_cc_0_1 = radar.split_cc(
            2, ((samp_cw, samp_up, samp_down)), "packet_len")
        self.radar_split_cc_0_0 = radar.split_cc(
            1, ((samp_cw, samp_up, samp_down)), "packet_len")
        self.radar_split_cc_0 = radar.split_cc(0,
                                               ((samp_cw, samp_up, samp_down)),
                                               "packet_len")
        self.radar_signal_generator_fmcw_c_0 = radar.signal_generator_fmcw_c(
            samp_rate, samp_up, samp_down, samp_cw, 0, 250, 1, "packet_len")
        self.blocks_throttle_0 = blocks.throttle(gr.sizeof_gr_complex * 1,
                                                 samp_rate, True)
        self.blocks_null_sink_1 = blocks.null_sink(gr.sizeof_gr_complex * 1)
        self.blocks_null_sink_0 = blocks.null_sink(gr.sizeof_gr_complex * 1)
        self.blocks_multiply_xx_0 = blocks.multiply_vcc(1)

        ##################################################
        # Connections
        ##################################################
        self.connect((self.blocks_multiply_xx_0, 0),
                     (self.radar_split_cc_0, 0))
        self.connect((self.blocks_multiply_xx_0, 0),
                     (self.radar_split_cc_0_0, 0))
        self.connect((self.blocks_multiply_xx_0, 0),
                     (self.radar_split_cc_0_1, 0))
        self.connect((self.blocks_throttle_0, 0),
                     (self.blocks_multiply_xx_0, 1))
        self.connect((self.radar_signal_generator_fmcw_c_0, 0),
                     (self.blocks_throttle_0, 0))
        self.connect((self.radar_signal_generator_fmcw_c_0, 0),
                     (self.radar_static_target_simulator_cc_0, 0))
        self.connect((self.radar_split_cc_0, 0), (self.wxgui_fftsink2_0, 0))
        self.connect((self.radar_split_cc_0_0, 0),
                     (self.blocks_null_sink_0, 0))
        self.connect((self.radar_split_cc_0_1, 0),
                     (self.blocks_null_sink_1, 0))
        self.connect((self.radar_static_target_simulator_cc_0, 0),
                     (self.blocks_multiply_xx_0, 0))
Пример #6
0
    def __init__(self):
        gr.top_block.__init__(self, "Simulator Cw")
        Qt.QWidget.__init__(self)
        self.setWindowTitle("Simulator Cw")
        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", "simulator_cw")
        self.restoreGeometry(self.settings.value("geometry").toByteArray())

        ##################################################
        # Variables
        ##################################################
        self.samp_rate = samp_rate = 250000
        self.packet_len = packet_len = 2**15
        self.freq_res = freq_res = samp_rate / float(packet_len)
        self.center_freq = center_freq = 5.7e9
        self.vel = vel = 50
        self.v_res = v_res = freq_res * 3e8 / 2 / center_freq
        self.time_res = time_res = packet_len / float(samp_rate)
        self.range_value = range_value = 2000
        self.min_output_buffer = min_output_buffer = int(packet_len * 2)
        self.max_output_buffer = max_output_buffer = 0
        self.freq = freq = (0, )
        self.decimator_fac = decimator_fac = 2**0

        ##################################################
        # Blocks
        ##################################################
        self._vel_range = Range(-50, 50, 0.1, 50, 200)
        self._vel_win = RangeWidget(self._vel_range, self.set_vel, "vel",
                                    "counter_slider", float)
        self.top_layout.addWidget(self._vel_win)
        self._range_value_range = Range(0, 10000, 100, 2000, 200)
        self._range_value_win = RangeWidget(self._range_value_range,
                                            self.set_range_value, 'range',
                                            "counter_slider", float)
        self.top_layout.addWidget(self._range_value_win)
        self.rational_resampler_xxx_0 = filter.rational_resampler_ccc(
            interpolation=1,
            decimation=decimator_fac,
            taps=None,
            fractional_bw=None,
        )
        self.radar_ts_fft_cc_0 = radar.ts_fft_cc(packet_len / decimator_fac,
                                                 "packet_len")
        (self.radar_ts_fft_cc_0).set_min_output_buffer(65536)
        self.radar_static_target_simulator_cc_0 = radar.static_target_simulator_cc(
            (range_value, ), (vel, ), (1e22, ), (0, ), (0, ), samp_rate,
            center_freq, -10, True, False, "packet_len")
        (self.radar_static_target_simulator_cc_0).set_min_output_buffer(65536)
        self.radar_signal_generator_cw_c_0 = radar.signal_generator_cw_c(
            packet_len, samp_rate, (freq), 1, "packet_len")
        (self.radar_signal_generator_cw_c_0).set_min_output_buffer(65536)
        self.radar_print_results_0 = radar.print_results(False, "")
        self.radar_os_cfar_c_0 = radar.os_cfar_c(samp_rate, 10, 0, 0.78, 20,
                                                 True, "packet_len")
        (self.radar_os_cfar_c_0).set_min_output_buffer(65536)
        self.radar_estimator_cw_0 = radar.estimator_cw(center_freq)
        self.qtgui_sink_x_0 = qtgui.sink_c(
            packet_len / decimator_fac,  #fftsize
            firdes.WIN_BLACKMAN_hARRIS,  #wintype
            0,  #fc
            samp_rate / decimator_fac,  #bw
            'QT GUI Plot',  #name
            True,  #plotfreq
            True,  #plotwaterfall
            True,  #plottime
            True,  #plotconst
        )
        self.qtgui_sink_x_0.set_update_time(1.0 / 10)
        self._qtgui_sink_x_0_win = sip.wrapinstance(
            self.qtgui_sink_x_0.pyqwidget(), Qt.QWidget)
        self.top_layout.addWidget(self._qtgui_sink_x_0_win)

        self.qtgui_sink_x_0.enable_rf_freq(False)

        self.blocks_throttle_0 = blocks.throttle(gr.sizeof_gr_complex * 1,
                                                 samp_rate, True)
        (self.blocks_throttle_0).set_min_output_buffer(65536)
        self.blocks_tagged_stream_multiply_length_0 = blocks.tagged_stream_multiply_length(
            gr.sizeof_gr_complex * 1, "packet_len", 1 / float(decimator_fac))
        (self.blocks_tagged_stream_multiply_length_0
         ).set_min_output_buffer(65536)
        self.blocks_multiply_conjugate_cc_0 = blocks.multiply_conjugate_cc(1)
        self.blocks_add_xx_0 = blocks.add_vcc(1)
        (self.blocks_add_xx_0).set_min_output_buffer(65536)
        self.analog_noise_source_x_0 = analog.noise_source_c(
            analog.GR_GAUSSIAN, 0.5, 0)
        (self.analog_noise_source_x_0).set_min_output_buffer(65536)

        ##################################################
        # Connections
        ##################################################
        self.msg_connect((self.radar_estimator_cw_0, 'Msg out'),
                         (self.radar_print_results_0, 'Msg in'))
        self.msg_connect((self.radar_os_cfar_c_0, 'Msg out'),
                         (self.radar_estimator_cw_0, 'Msg in'))
        self.connect((self.analog_noise_source_x_0, 0),
                     (self.blocks_add_xx_0, 0))
        self.connect((self.blocks_add_xx_0, 0),
                     (self.blocks_multiply_conjugate_cc_0, 0))
        self.connect((self.blocks_multiply_conjugate_cc_0, 0),
                     (self.rational_resampler_xxx_0, 0))
        self.connect((self.blocks_tagged_stream_multiply_length_0, 0),
                     (self.radar_ts_fft_cc_0, 0))
        self.connect((self.blocks_throttle_0, 0),
                     (self.blocks_multiply_conjugate_cc_0, 1))
        self.connect((self.blocks_throttle_0, 0),
                     (self.radar_static_target_simulator_cc_0, 0))
        self.connect((self.radar_signal_generator_cw_c_0, 0),
                     (self.blocks_throttle_0, 0))
        self.connect((self.radar_static_target_simulator_cc_0, 0),
                     (self.blocks_add_xx_0, 1))
        self.connect((self.radar_ts_fft_cc_0, 0), (self.radar_os_cfar_c_0, 0))
        self.connect((self.rational_resampler_xxx_0, 0),
                     (self.blocks_tagged_stream_multiply_length_0, 0))
        self.connect((self.rational_resampler_xxx_0, 0),
                     (self.qtgui_sink_x_0, 0))
    def __init__(self):
        gr.top_block.__init__(self, "Simulator Fsk Tracking Singletarget")
        Qt.QWidget.__init__(self)
        self.setWindowTitle("Simulator Fsk Tracking Singletarget")
        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", "simulator_fsk_tracking_singletarget")
        self.restoreGeometry(self.settings.value("geometry").toByteArray())

        ##################################################
        # Variables
        ##################################################
        self.samp_rate = samp_rate = 5000000
        self.blocks_per_tag = blocks_per_tag = 2**17
        self.samp_per_freq = samp_per_freq = 1
        self.freq_res = freq_res = samp_rate/2/blocks_per_tag
        self.delta_freq = delta_freq = samp_rate/4
        self.center_freq = center_freq = 2.4e9
        self.velocity = velocity = 20
        self.v_res = v_res = freq_res*3e8/2/center_freq
        self.threshold = threshold = -120
        self.samp_discard = samp_discard = 0
        self.range_value = range_value = 10
        self.range_time = range_time = 10
        self.min_output_buffer = min_output_buffer = 2*(blocks_per_tag*samp_per_freq*2)
        self.decimator_fac = decimator_fac = 2**7
        self.R_max = R_max = 3e8/2/delta_freq

        ##################################################
        # Blocks
        ##################################################
        self._velocity_range = Range(-30, 30, 1, 20, 200)
        self._velocity_win = RangeWidget(self._velocity_range, self.set_velocity, "velocity", "counter_slider", float)
        self.top_layout.addWidget(self._velocity_win)
        self._threshold_range = Range(-200, 1000, 1, -120, 200)
        self._threshold_win = RangeWidget(self._threshold_range, self.set_threshold, 'Threshold Peak detector', "counter_slider", float)
        self.top_layout.addWidget(self._threshold_win)
        self._range_value_range = Range(0, 120, 1, 10, 200)
        self._range_value_win = RangeWidget(self._range_value_range, self.set_range_value, 'range', "counter_slider", float)
        self.top_layout.addWidget(self._range_value_win)
        self.rational_resampler_xxx_0_0 = filter.rational_resampler_ccc(
                interpolation=1,
                decimation=decimator_fac,
                taps=None,
                fractional_bw=None,
        )
        self.rational_resampler_xxx_0 = filter.rational_resampler_ccc(
                interpolation=1,
                decimation=decimator_fac,
                taps=None,
                fractional_bw=None,
        )
        self.radar_ts_fft_cc_0_0 = radar.ts_fft_cc(blocks_per_tag/decimator_fac,  "packet_len")
        self.radar_ts_fft_cc_0 = radar.ts_fft_cc(blocks_per_tag/decimator_fac,  "packet_len")
        self.radar_tracking_singletarget_0 = radar.tracking_singletarget(100, 1, v_res, 0.1, 0.001, 3, "particle")
        self.radar_static_target_simulator_cc_0 = radar.static_target_simulator_cc((range_value,), (velocity,), (1e16,), (0,), (0,), samp_rate, center_freq, -10, True, True, "packet_len")
        (self.radar_static_target_simulator_cc_0).set_min_output_buffer(524288)
        self.radar_split_fsk_cc_0 = radar.split_fsk_cc(samp_per_freq, samp_discard, "packet_len")
        (self.radar_split_fsk_cc_0).set_min_output_buffer(524288)
        self.radar_signal_generator_fsk_c_0 = radar.signal_generator_fsk_c(samp_rate, samp_per_freq, blocks_per_tag, -delta_freq/2, delta_freq/2, 1, "packet_len")
        (self.radar_signal_generator_fsk_c_0).set_min_output_buffer(524288)
        self.radar_qtgui_time_plot_0_0_0 = radar.qtgui_time_plot(250, 'range', (0,R_max), range_time, '')
        self.radar_qtgui_time_plot_0_0 = radar.qtgui_time_plot(250, 'range', (0,R_max), range_time, "TRACKING")
        self.radar_find_max_peak_c_0 = radar.find_max_peak_c(samp_rate/decimator_fac/2, threshold, 0, (), False, "packet_len")
        self.radar_estimator_fsk_0 = radar.estimator_fsk(center_freq, delta_freq, False)
        self.blocks_throttle_0 = blocks.throttle(gr.sizeof_gr_complex*1, samp_rate,True)
        (self.blocks_throttle_0).set_min_output_buffer(524288)
        self.blocks_tagged_stream_multiply_length_0_0 = blocks.tagged_stream_multiply_length(gr.sizeof_gr_complex*1, "packet_len", 1.0/decimator_fac)
        (self.blocks_tagged_stream_multiply_length_0_0).set_min_output_buffer(524288)
        self.blocks_tagged_stream_multiply_length_0 = blocks.tagged_stream_multiply_length(gr.sizeof_gr_complex*1, "packet_len", 1.0/decimator_fac)
        (self.blocks_tagged_stream_multiply_length_0).set_min_output_buffer(524288)
        self.blocks_multiply_conjugate_cc_1 = blocks.multiply_conjugate_cc(1)
        (self.blocks_multiply_conjugate_cc_1).set_min_output_buffer(524288)
        self.blocks_multiply_conjugate_cc_0 = blocks.multiply_conjugate_cc(1)
        (self.blocks_multiply_conjugate_cc_0).set_min_output_buffer(524288)
        self.blocks_add_xx_0 = blocks.add_vcc(1)
        (self.blocks_add_xx_0).set_min_output_buffer(524288)
        self.analog_noise_source_x_0 = analog.noise_source_c(analog.GR_GAUSSIAN, 0.5, 0)
        (self.analog_noise_source_x_0).set_min_output_buffer(524288)

        ##################################################
        # Connections
        ##################################################
        self.msg_connect((self.radar_estimator_fsk_0, 'Msg out'), (self.radar_qtgui_time_plot_0_0_0, 'Msg in'))
        self.msg_connect((self.radar_estimator_fsk_0, 'Msg out'), (self.radar_tracking_singletarget_0, 'Msg in'))
        self.msg_connect((self.radar_find_max_peak_c_0, 'Msg out'), (self.radar_estimator_fsk_0, 'Msg in'))
        self.msg_connect((self.radar_tracking_singletarget_0, 'Msg out'), (self.radar_qtgui_time_plot_0_0, 'Msg in'))
        self.connect((self.analog_noise_source_x_0, 0), (self.blocks_add_xx_0, 0))
        self.connect((self.blocks_add_xx_0, 0), (self.blocks_multiply_conjugate_cc_1, 0))
        self.connect((self.blocks_multiply_conjugate_cc_0, 0), (self.radar_find_max_peak_c_0, 0))
        self.connect((self.blocks_multiply_conjugate_cc_1, 0), (self.radar_split_fsk_cc_0, 0))
        self.connect((self.blocks_tagged_stream_multiply_length_0, 0), (self.radar_ts_fft_cc_0, 0))
        self.connect((self.blocks_tagged_stream_multiply_length_0_0, 0), (self.radar_ts_fft_cc_0_0, 0))
        self.connect((self.blocks_throttle_0, 0), (self.blocks_multiply_conjugate_cc_1, 1))
        self.connect((self.blocks_throttle_0, 0), (self.radar_static_target_simulator_cc_0, 0))
        self.connect((self.radar_signal_generator_fsk_c_0, 0), (self.blocks_throttle_0, 0))
        self.connect((self.radar_split_fsk_cc_0, 0), (self.rational_resampler_xxx_0, 0))
        self.connect((self.radar_split_fsk_cc_0, 1), (self.rational_resampler_xxx_0_0, 0))
        self.connect((self.radar_static_target_simulator_cc_0, 0), (self.blocks_add_xx_0, 1))
        self.connect((self.radar_ts_fft_cc_0, 0), (self.blocks_multiply_conjugate_cc_0, 1))
        self.connect((self.radar_ts_fft_cc_0_0, 0), (self.blocks_multiply_conjugate_cc_0, 0))
        self.connect((self.rational_resampler_xxx_0, 0), (self.blocks_tagged_stream_multiply_length_0, 0))
        self.connect((self.rational_resampler_xxx_0_0, 0), (self.blocks_tagged_stream_multiply_length_0_0, 0))
Пример #8
0
    def __init__(self):
        gr.top_block.__init__(self, "Top Block")
        Qt.QWidget.__init__(self)
        self.setWindowTitle("Top Block")
        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.samp_rate = samp_rate = 5000000
        self.packet_len = packet_len = 2**19
        self.freq_res = freq_res = samp_rate/float(packet_len)
        self.freq = freq = (-1000000,1000000)
        self.center_freq = center_freq = 2.45e9
        self.vel = vel = 50
        self.v_res = v_res = freq_res*3e8/2/center_freq
        self.time_res = time_res = packet_len/float(samp_rate)
        self.range_res = range_res = 3e8/2/float((freq[1]-freq[0]))
        self.min_output_buffer = min_output_buffer = int(packet_len*2)
        self.max_output_buffer = max_output_buffer = 0
        self.decim_fac = decim_fac = 2**10
        self.Range = Range = 30

        ##################################################
        # Blocks
        ##################################################
        self._vel_layout = Qt.QVBoxLayout()
        self._vel_tool_bar = Qt.QToolBar(self)
        self._vel_layout.addWidget(self._vel_tool_bar)
        self._vel_tool_bar.addWidget(Qt.QLabel("vel"+": "))
        class qwt_counter_pyslot(Qwt.QwtCounter):
            def __init__(self, parent=None):
                Qwt.QwtCounter.__init__(self, parent)
            @pyqtSlot('double')
            def setValue(self, value):
                super(Qwt.QwtCounter, self).setValue(value)
        self._vel_counter = qwt_counter_pyslot()
        self._vel_counter.setRange(-50, 50, 0.1)
        self._vel_counter.setNumButtons(2)
        self._vel_counter.setValue(self.vel)
        self._vel_tool_bar.addWidget(self._vel_counter)
        self._vel_counter.valueChanged.connect(self.set_vel)
        self._vel_slider = Qwt.QwtSlider(None, Qt.Qt.Horizontal, Qwt.QwtSlider.BottomScale, Qwt.QwtSlider.BgSlot)
        self._vel_slider.setRange(-50, 50, 0.1)
        self._vel_slider.setValue(self.vel)
        self._vel_slider.setMinimumWidth(200)
        self._vel_slider.valueChanged.connect(self.set_vel)
        self._vel_layout.addWidget(self._vel_slider)
        self.top_layout.addLayout(self._vel_layout)
        self._Range_layout = Qt.QVBoxLayout()
        self._Range_tool_bar = Qt.QToolBar(self)
        self._Range_layout.addWidget(self._Range_tool_bar)
        self._Range_tool_bar.addWidget(Qt.QLabel("Range"+": "))
        class qwt_counter_pyslot(Qwt.QwtCounter):
            def __init__(self, parent=None):
                Qwt.QwtCounter.__init__(self, parent)
            @pyqtSlot('double')
            def setValue(self, value):
                super(Qwt.QwtCounter, self).setValue(value)
        self._Range_counter = qwt_counter_pyslot()
        self._Range_counter.setRange(0, 100, 1)
        self._Range_counter.setNumButtons(2)
        self._Range_counter.setValue(self.Range)
        self._Range_tool_bar.addWidget(self._Range_counter)
        self._Range_counter.valueChanged.connect(self.set_Range)
        self._Range_slider = Qwt.QwtSlider(None, Qt.Qt.Horizontal, Qwt.QwtSlider.BottomScale, Qwt.QwtSlider.BgSlot)
        self._Range_slider.setRange(0, 100, 1)
        self._Range_slider.setValue(self.Range)
        self._Range_slider.setMinimumWidth(200)
        self._Range_slider.valueChanged.connect(self.set_Range)
        self._Range_layout.addWidget(self._Range_slider)
        self.top_layout.addLayout(self._Range_layout)
        self.rational_resampler_xxx_0_0 = filter.rational_resampler_ccc(
                interpolation=1,
                decimation=decim_fac,
                taps=None,
                fractional_bw=None,
        )
        self.rational_resampler_xxx_0 = filter.rational_resampler_ccc(
                interpolation=1,
                decimation=decim_fac,
                taps=None,
                fractional_bw=None,
        )
        self.radar_ts_fft_cc_0_0 = radar.ts_fft_cc(packet_len/decim_fac,  "packet_len")
        (self.radar_ts_fft_cc_0_0).set_min_output_buffer(1048576)
        self.radar_ts_fft_cc_0 = radar.ts_fft_cc(packet_len/decim_fac,  "packet_len")
        (self.radar_ts_fft_cc_0).set_min_output_buffer(1048576)
        self.radar_trigger_command_0 = radar.trigger_command("python get_pic.py", ("range",), (10, ), (20, ), 500)
        self.radar_static_target_simulator_cc_0 = radar.static_target_simulator_cc((Range,), (vel, ), (1e14, ), (0,), (0,), samp_rate, center_freq, -10, True, True, "packet_len")
        (self.radar_static_target_simulator_cc_0).set_min_output_buffer(1048576)
        self.radar_signal_generator_cw_c_0_0 = radar.signal_generator_cw_c(packet_len, samp_rate, (freq[1], ), 1, "packet_len")
        (self.radar_signal_generator_cw_c_0_0).set_min_output_buffer(1048576)
        self.radar_signal_generator_cw_c_0 = radar.signal_generator_cw_c(packet_len, samp_rate, (freq[0], ), 1, "packet_len")
        (self.radar_signal_generator_cw_c_0).set_min_output_buffer(1048576)
        self.radar_qtgui_time_plot_0 = radar.qtgui_time_plot(100, 'range', (0,75), 30, "")
        self.radar_qtgui_scatter_plot_0 = radar.qtgui_scatter_plot(100, 'range', 'velocity', (0,75), (-5,5), "")
        self.radar_print_results_0 = radar.print_results(False, "")
        self.radar_find_max_peak_c_0 = radar.find_max_peak_c(samp_rate/decim_fac, -200, 0, (-1000,1000), True, "packet_len")
        self.radar_estimator_fsk_0 = radar.estimator_fsk(center_freq, (freq[1]-freq[0]), False)
        self.qtgui_freq_sink_x_0 = qtgui.freq_sink_c(
        	packet_len/decim_fac, #size
        	firdes.WIN_BLACKMAN_hARRIS, #wintype
        	0, #fc
        	samp_rate/decim_fac, #bw
        	"QT GUI Plot", #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.enable_autoscale(False)
        self.qtgui_freq_sink_x_0.enable_grid(False)
        self.qtgui_freq_sink_x_0.set_fft_average(1.0)
        
        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.blocks_throttle_0_0 = blocks.throttle(gr.sizeof_gr_complex*1, samp_rate,True)
        (self.blocks_throttle_0_0).set_min_output_buffer(1048576)
        self.blocks_throttle_0 = blocks.throttle(gr.sizeof_gr_complex*1, samp_rate,True)
        (self.blocks_throttle_0).set_min_output_buffer(1048576)
        self.blocks_tagged_stream_multiply_length_0_0 = blocks.tagged_stream_multiply_length(gr.sizeof_gr_complex*1, "packet_len", 1.0/float(decim_fac))
        (self.blocks_tagged_stream_multiply_length_0_0).set_min_output_buffer(1048576)
        self.blocks_tagged_stream_multiply_length_0 = blocks.tagged_stream_multiply_length(gr.sizeof_gr_complex*1, "packet_len", 1.0/float(decim_fac))
        (self.blocks_tagged_stream_multiply_length_0).set_min_output_buffer(1048576)
        self.blocks_multiply_conjugate_cc_1 = blocks.multiply_conjugate_cc(1)
        (self.blocks_multiply_conjugate_cc_1).set_min_output_buffer(1048576)
        self.blocks_multiply_conjugate_cc_0_0 = blocks.multiply_conjugate_cc(1)
        (self.blocks_multiply_conjugate_cc_0_0).set_min_output_buffer(1048576)
        self.blocks_multiply_conjugate_cc_0 = blocks.multiply_conjugate_cc(1)
        (self.blocks_multiply_conjugate_cc_0).set_min_output_buffer(1048576)
        self.blocks_add_xx_1 = blocks.add_vcc(1)
        (self.blocks_add_xx_1).set_min_output_buffer(1048576)
        self.blocks_add_xx_0 = blocks.add_vcc(1)
        (self.blocks_add_xx_0).set_min_output_buffer(1048576)
        self.analog_noise_source_x_0 = analog.noise_source_c(analog.GR_GAUSSIAN, 0.5, 0)
        (self.analog_noise_source_x_0).set_min_output_buffer(1048576)

        ##################################################
        # Connections
        ##################################################
        self.connect((self.radar_signal_generator_cw_c_0, 0), (self.blocks_throttle_0, 0))
        self.connect((self.analog_noise_source_x_0, 0), (self.blocks_add_xx_0, 0))
        self.connect((self.blocks_add_xx_0, 0), (self.blocks_multiply_conjugate_cc_0, 0))
        self.connect((self.radar_signal_generator_cw_c_0_0, 0), (self.blocks_throttle_0_0, 0))
        self.connect((self.blocks_throttle_0, 0), (self.blocks_add_xx_1, 0))
        self.connect((self.blocks_throttle_0_0, 0), (self.blocks_add_xx_1, 1))
        self.connect((self.blocks_add_xx_1, 0), (self.radar_static_target_simulator_cc_0, 0))
        self.connect((self.blocks_add_xx_0, 0), (self.blocks_multiply_conjugate_cc_0_0, 0))
        self.connect((self.blocks_throttle_0_0, 0), (self.blocks_multiply_conjugate_cc_0_0, 1))
        self.connect((self.blocks_multiply_conjugate_cc_0, 0), (self.rational_resampler_xxx_0, 0))
        self.connect((self.blocks_multiply_conjugate_cc_0_0, 0), (self.rational_resampler_xxx_0_0, 0))
        self.connect((self.blocks_tagged_stream_multiply_length_0, 0), (self.radar_ts_fft_cc_0, 0))
        self.connect((self.rational_resampler_xxx_0, 0), (self.blocks_tagged_stream_multiply_length_0, 0))
        self.connect((self.blocks_tagged_stream_multiply_length_0_0, 0), (self.radar_ts_fft_cc_0_0, 0))
        self.connect((self.rational_resampler_xxx_0_0, 0), (self.blocks_tagged_stream_multiply_length_0_0, 0))
        self.connect((self.rational_resampler_xxx_0, 0), (self.qtgui_freq_sink_x_0, 0))
        self.connect((self.rational_resampler_xxx_0_0, 0), (self.qtgui_freq_sink_x_0, 1))
        self.connect((self.blocks_multiply_conjugate_cc_1, 0), (self.radar_find_max_peak_c_0, 0))
        self.connect((self.radar_ts_fft_cc_0_0, 0), (self.blocks_multiply_conjugate_cc_1, 1))
        self.connect((self.radar_ts_fft_cc_0, 0), (self.blocks_multiply_conjugate_cc_1, 0))
        self.connect((self.radar_static_target_simulator_cc_0, 0), (self.blocks_add_xx_0, 1))
        self.connect((self.blocks_throttle_0, 0), (self.blocks_multiply_conjugate_cc_0, 1))

        ##################################################
        # Asynch Message Connections
        ##################################################
        self.msg_connect(self.radar_estimator_fsk_0, "Msg out", self.radar_print_results_0, "Msg in")
        self.msg_connect(self.radar_find_max_peak_c_0, "Msg out", self.radar_estimator_fsk_0, "Msg in")
        self.msg_connect(self.radar_estimator_fsk_0, "Msg out", self.radar_trigger_command_0, "Msg in")
        self.msg_connect(self.radar_estimator_fsk_0, "Msg out", self.radar_qtgui_scatter_plot_0, "Msg in")
        self.msg_connect(self.radar_estimator_fsk_0, "Msg out", self.radar_qtgui_time_plot_0, "Msg in")
Пример #9
0
    def __init__(self):
        gr.top_block.__init__(self, "Simulator Fmcw Rcs")
        Qt.QWidget.__init__(self)
        self.setWindowTitle("Simulator Fmcw Rcs")
        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", "simulator_fmcw_rcs")
        self.restoreGeometry(self.settings.value("geometry").toByteArray())

        ##################################################
        # Variables
        ##################################################
        self.samp_up = samp_up = 2**14
        self.samp_rate = samp_rate = 10000000
        self.sweep_freq = sweep_freq = samp_rate / 2
        self.samp_down = samp_down = samp_up
        self.samp_cw = samp_cw = 2**14
        self.center_freq = center_freq = 5.9e9
        self.velocity = velocity = 30
        self.value_range = value_range = 200
        self.v_res = v_res = samp_rate / samp_cw * 3e8 / 2 / center_freq
        self.threshold = threshold = -200
        self.rcs = rcs = 10
        self.range_res = range_res = 3e8 / 2 / sweep_freq
        self.protect_samp = protect_samp = 1
        self.min_output_buffer = min_output_buffer = int(
            (samp_up + samp_down + samp_cw) * 2)
        self.meas_duration = meas_duration = (samp_cw + samp_up +
                                              samp_down) / float(samp_rate)
        self.max_output_buffer = max_output_buffer = 0
        self.decim_fac = decim_fac = 2**5

        ##################################################
        # Blocks
        ##################################################
        self._velocity_range = Range(0, 100, 1, 30, 200)
        self._velocity_win = RangeWidget(self._velocity_range,
                                         self.set_velocity, "velocity",
                                         "counter_slider", float)
        self.top_layout.addWidget(self._velocity_win)
        self._value_range_range = Range(0, 1000, 1, 200, 200)
        self._value_range_win = RangeWidget(self._value_range_range,
                                            self.set_value_range, "range",
                                            "counter_slider", float)
        self.top_layout.addWidget(self._value_range_win)
        self._threshold_range = Range(-200, 0, 1, -200, 200)
        self._threshold_win = RangeWidget(self._threshold_range,
                                          self.set_threshold, "threshold",
                                          "counter_slider", float)
        self.top_layout.addWidget(self._threshold_win)
        self._rcs_range = Range(1, 100, 1, 10, 200)
        self._rcs_win = RangeWidget(self._rcs_range, self.set_rcs, "rcs",
                                    "counter_slider", float)
        self.top_layout.addWidget(self._rcs_win)
        self._protect_samp_range = Range(0, 100, 1, 1, 200)
        self._protect_samp_win = RangeWidget(self._protect_samp_range,
                                             self.set_protect_samp,
                                             "protect_samp", "counter_slider",
                                             float)
        self.top_layout.addWidget(self._protect_samp_win)
        self.rational_resampler_xxx_0 = filter.rational_resampler_ccc(
            interpolation=1,
            decimation=decim_fac,
            taps=None,
            fractional_bw=None,
        )
        self.radar_ts_fft_cc_0_1 = radar.ts_fft_cc(samp_down / decim_fac,
                                                   "packet_len")
        self.radar_ts_fft_cc_0_0 = radar.ts_fft_cc(samp_up / decim_fac,
                                                   "packet_len")
        self.radar_ts_fft_cc_0 = radar.ts_fft_cc(samp_cw / decim_fac,
                                                 "packet_len")
        self.radar_static_target_simulator_cc_0 = radar.static_target_simulator_cc(
            (value_range, ), (velocity, ), (rcs, ), (0, ), (0, ), samp_rate,
            center_freq, -10, True, True, "packet_len")
        (self.radar_static_target_simulator_cc_0).set_min_output_buffer(98304)
        self.radar_split_cc_0_0_0 = radar.split_cc(
            2, ((samp_cw / decim_fac, samp_up / decim_fac,
                 samp_down / decim_fac)), "packet_len")
        (self.radar_split_cc_0_0_0).set_min_output_buffer(98304)
        self.radar_split_cc_0_0 = radar.split_cc(
            1, ((samp_cw / decim_fac, samp_up / decim_fac,
                 samp_down / decim_fac)), "packet_len")
        (self.radar_split_cc_0_0).set_min_output_buffer(98304)
        self.radar_split_cc_0 = radar.split_cc(
            0, ((samp_cw / decim_fac, samp_up / decim_fac,
                 samp_down / decim_fac)), "packet_len")
        (self.radar_split_cc_0).set_min_output_buffer(98304)
        self.radar_signal_generator_fmcw_c_0 = radar.signal_generator_fmcw_c(
            samp_rate, samp_up, samp_down, samp_cw, -sweep_freq / 2,
            sweep_freq, 1, "packet_len")
        (self.radar_signal_generator_fmcw_c_0).set_min_output_buffer(98304)
        self.radar_print_results_0 = radar.print_results(False, "")
        self.radar_find_max_peak_c_0_0_0 = radar.find_max_peak_c(
            samp_rate / decim_fac, threshold, protect_samp, (), False,
            "packet_len")
        self.radar_find_max_peak_c_0_0 = radar.find_max_peak_c(
            samp_rate / decim_fac, threshold, protect_samp, (), False,
            "packet_len")
        self.radar_find_max_peak_c_0 = radar.find_max_peak_c(
            samp_rate / decim_fac, threshold, protect_samp, (), False,
            "packet_len")
        self.radar_estimator_rcs_0 = radar.estimator_rcs(
            10, center_freq, 0, 0, 0, 1, 0.85, 1)
        self.radar_estimator_fmcw_0 = radar.estimator_fmcw(
            samp_rate / decim_fac, center_freq, sweep_freq,
            samp_up / decim_fac, samp_down / decim_fac, True)
        self.blocks_throttle_0 = blocks.throttle(gr.sizeof_gr_complex * 1,
                                                 samp_rate, True)
        (self.blocks_throttle_0).set_min_output_buffer(98304)
        self.blocks_tagged_stream_multiply_length_0 = blocks.tagged_stream_multiply_length(
            gr.sizeof_gr_complex * 1, "packet_len", 1.0 / decim_fac)
        (self.blocks_tagged_stream_multiply_length_0
         ).set_min_output_buffer(98304)
        self.blocks_multiply_const_vxx_2 = blocks.multiply_const_vcc(
            (1.0 / (samp_down / decim_fac), ))
        self.blocks_multiply_const_vxx_1 = blocks.multiply_const_vcc(
            (1.0 / (samp_up / decim_fac), ))
        self.blocks_multiply_const_vxx_0 = blocks.multiply_const_vcc(
            (1.0 / (samp_cw / decim_fac), ))
        self.blocks_multiply_conjugate_cc_0 = blocks.multiply_conjugate_cc(1)
        (self.blocks_multiply_conjugate_cc_0).set_min_output_buffer(98304)
        self.blocks_add_xx_0 = blocks.add_vcc(1)
        (self.blocks_add_xx_0).set_min_output_buffer(98304)
        self.analog_noise_source_x_0 = analog.noise_source_c(
            analog.GR_GAUSSIAN, 10e-9, 0)
        (self.analog_noise_source_x_0).set_min_output_buffer(98304)

        ##################################################
        # Connections
        ##################################################
        self.msg_connect((self.radar_estimator_fmcw_0, 'Msg out'),
                         (self.radar_estimator_rcs_0, 'Msg in'))
        self.msg_connect((self.radar_estimator_rcs_0, 'Msg out'),
                         (self.radar_print_results_0, 'Msg in'))
        self.msg_connect((self.radar_find_max_peak_c_0, 'Msg out'),
                         (self.radar_estimator_fmcw_0, 'Msg in CW'))
        self.msg_connect((self.radar_find_max_peak_c_0_0, 'Msg out'),
                         (self.radar_estimator_fmcw_0, 'Msg in UP'))
        self.msg_connect((self.radar_find_max_peak_c_0_0_0, 'Msg out'),
                         (self.radar_estimator_fmcw_0, 'Msg in DOWN'))
        self.connect((self.analog_noise_source_x_0, 0),
                     (self.blocks_add_xx_0, 0))
        self.connect((self.blocks_add_xx_0, 0),
                     (self.blocks_multiply_conjugate_cc_0, 1))
        self.connect((self.blocks_multiply_conjugate_cc_0, 0),
                     (self.rational_resampler_xxx_0, 0))
        self.connect((self.blocks_multiply_const_vxx_0, 0),
                     (self.radar_find_max_peak_c_0, 0))
        self.connect((self.blocks_multiply_const_vxx_1, 0),
                     (self.radar_find_max_peak_c_0_0, 0))
        self.connect((self.blocks_multiply_const_vxx_2, 0),
                     (self.radar_find_max_peak_c_0_0_0, 0))
        self.connect((self.blocks_tagged_stream_multiply_length_0, 0),
                     (self.radar_split_cc_0, 0))
        self.connect((self.blocks_tagged_stream_multiply_length_0, 0),
                     (self.radar_split_cc_0_0, 0))
        self.connect((self.blocks_tagged_stream_multiply_length_0, 0),
                     (self.radar_split_cc_0_0_0, 0))
        self.connect((self.blocks_throttle_0, 0),
                     (self.radar_static_target_simulator_cc_0, 0))
        self.connect((self.radar_signal_generator_fmcw_c_0, 0),
                     (self.blocks_multiply_conjugate_cc_0, 0))
        self.connect((self.radar_signal_generator_fmcw_c_0, 0),
                     (self.blocks_throttle_0, 0))
        self.connect((self.radar_split_cc_0, 0), (self.radar_ts_fft_cc_0, 0))
        self.connect((self.radar_split_cc_0_0, 0),
                     (self.radar_ts_fft_cc_0_0, 0))
        self.connect((self.radar_split_cc_0_0_0, 0),
                     (self.radar_ts_fft_cc_0_1, 0))
        self.connect((self.radar_static_target_simulator_cc_0, 0),
                     (self.blocks_add_xx_0, 1))
        self.connect((self.radar_ts_fft_cc_0, 0),
                     (self.blocks_multiply_const_vxx_0, 0))
        self.connect((self.radar_ts_fft_cc_0_0, 0),
                     (self.blocks_multiply_const_vxx_1, 0))
        self.connect((self.radar_ts_fft_cc_0_1, 0),
                     (self.blocks_multiply_const_vxx_2, 0))
        self.connect((self.rational_resampler_xxx_0, 0),
                     (self.blocks_tagged_stream_multiply_length_0, 0))
Пример #10
0
    def __init__(self):
        gr.top_block.__init__(self, "Simulator Fmcw")
        Qt.QWidget.__init__(self)
        self.setWindowTitle("Simulator Fmcw")
        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", "simulator_fmcw")
        self.restoreGeometry(self.settings.value("geometry").toByteArray())

        ##################################################
        # Variables
        ##################################################
        self.samp_up = samp_up = 2**14
        self.samp_rate = samp_rate = 20000000
        self.sweep_freq = sweep_freq = samp_rate / 2
        self.samp_down = samp_down = samp_up
        self.samp_cw = samp_cw = 2**14
        self.center_freq = center_freq = 5.9e9
        self.velocity = velocity = 50
        self.value_range = value_range = 200
        self.v_res = v_res = samp_rate / samp_cw * 3e8 / 2 / center_freq
        self.threshold = threshold = -120
        self.range_res = range_res = 3e8 / 2 / sweep_freq
        self.protect_samp = protect_samp = 1
        self.min_output_buffer = min_output_buffer = int(
            (samp_up + samp_down + samp_cw) * 2)
        self.meas_duration = meas_duration = (samp_cw + samp_up +
                                              samp_down) / float(samp_rate)
        self.max_output_buffer = max_output_buffer = 0
        self.decim_fac = decim_fac = 2**5

        ##################################################
        # Blocks
        ##################################################
        self._velocity_range = Range(0, 100, 1, 50, 200)
        self._velocity_win = RangeWidget(self._velocity_range,
                                         self.set_velocity, "velocity",
                                         "counter_slider", float)
        self.top_layout.addWidget(self._velocity_win)
        self._value_range_range = Range(0, 1000, 1, 200, 200)
        self._value_range_win = RangeWidget(self._value_range_range,
                                            self.set_value_range, 'range',
                                            "counter_slider", float)
        self.top_layout.addWidget(self._value_range_win)
        self._threshold_range = Range(-120, 0, 1, -120, 200)
        self._threshold_win = RangeWidget(self._threshold_range,
                                          self.set_threshold, "threshold",
                                          "counter_slider", float)
        self.top_layout.addWidget(self._threshold_win)
        self._protect_samp_range = Range(0, 100, 1, 1, 200)
        self._protect_samp_win = RangeWidget(self._protect_samp_range,
                                             self.set_protect_samp,
                                             "protect_samp", "counter_slider",
                                             float)
        self.top_layout.addWidget(self._protect_samp_win)
        self.rational_resampler_xxx_0 = filter.rational_resampler_ccc(
            interpolation=1,
            decimation=decim_fac,
            taps=None,
            fractional_bw=None,
        )
        self.radar_ts_fft_cc_0_1 = radar.ts_fft_cc(samp_down / decim_fac,
                                                   "packet_len")
        self.radar_ts_fft_cc_0_0 = radar.ts_fft_cc(samp_up / decim_fac,
                                                   "packet_len")
        self.radar_ts_fft_cc_0 = radar.ts_fft_cc(samp_cw / decim_fac,
                                                 "packet_len")
        self.radar_static_target_simulator_cc_0 = radar.static_target_simulator_cc(
            (value_range, ), (velocity, ), (1e16, ), (0, ), (0, ), samp_rate,
            center_freq, -10, False, False, "packet_len")
        (self.radar_static_target_simulator_cc_0).set_min_output_buffer(98304)
        self.radar_split_cc_0_0_0 = radar.split_cc(
            2, ((samp_cw / decim_fac, samp_up / decim_fac,
                 samp_down / decim_fac)), "packet_len")
        (self.radar_split_cc_0_0_0).set_min_output_buffer(98304)
        self.radar_split_cc_0_0 = radar.split_cc(
            1, ((samp_cw / decim_fac, samp_up / decim_fac,
                 samp_down / decim_fac)), "packet_len")
        (self.radar_split_cc_0_0).set_min_output_buffer(98304)
        self.radar_split_cc_0 = radar.split_cc(
            0, ((samp_cw / decim_fac, samp_up / decim_fac,
                 samp_down / decim_fac)), "packet_len")
        (self.radar_split_cc_0).set_min_output_buffer(98304)
        self.radar_signal_generator_fmcw_c_0 = radar.signal_generator_fmcw_c(
            samp_rate, samp_up, samp_down, samp_cw, -sweep_freq / 2,
            sweep_freq, 1, "packet_len")
        (self.radar_signal_generator_fmcw_c_0).set_min_output_buffer(98304)
        self.radar_print_results_0 = radar.print_results(False, "")
        self.radar_find_max_peak_c_0_0_0 = radar.find_max_peak_c(
            samp_rate / decim_fac, threshold, protect_samp, (), False,
            "packet_len")
        self.radar_find_max_peak_c_0_0 = radar.find_max_peak_c(
            samp_rate / decim_fac, threshold, protect_samp, (), False,
            "packet_len")
        self.radar_find_max_peak_c_0 = radar.find_max_peak_c(
            samp_rate / decim_fac, threshold, protect_samp, (), False,
            "packet_len")
        self.radar_estimator_fmcw_0 = radar.estimator_fmcw(
            samp_rate / decim_fac, center_freq, sweep_freq,
            samp_up / decim_fac, samp_down / decim_fac, False)
        self.qtgui_sink_x_0_1 = qtgui.sink_c(
            samp_cw / decim_fac,  #fftsize
            firdes.WIN_BLACKMAN_hARRIS,  #wintype
            0,  #fc
            samp_rate / decim_fac,  #bw
            'CW',  #name
            True,  #plotfreq
            True,  #plotwaterfall
            True,  #plottime
            True,  #plotconst
        )
        self.qtgui_sink_x_0_1.set_update_time(1.0 / 10)
        self._qtgui_sink_x_0_1_win = sip.wrapinstance(
            self.qtgui_sink_x_0_1.pyqwidget(), Qt.QWidget)
        self.top_layout.addWidget(self._qtgui_sink_x_0_1_win)

        self.qtgui_sink_x_0_1.enable_rf_freq(False)

        self.qtgui_sink_x_0 = qtgui.sink_c(
            samp_cw / decim_fac,  #fftsize
            firdes.WIN_BLACKMAN_hARRIS,  #wintype
            0,  #fc
            samp_rate / decim_fac,  #bw
            'CW',  #name
            True,  #plotfreq
            True,  #plotwaterfall
            True,  #plottime
            True,  #plotconst
        )
        self.qtgui_sink_x_0.set_update_time(1.0 / 10)
        self._qtgui_sink_x_0_win = sip.wrapinstance(
            self.qtgui_sink_x_0.pyqwidget(), Qt.QWidget)
        self.top_layout.addWidget(self._qtgui_sink_x_0_win)

        self.qtgui_sink_x_0.enable_rf_freq(False)

        self.blocks_throttle_0 = blocks.throttle(gr.sizeof_gr_complex * 1,
                                                 samp_rate, True)
        (self.blocks_throttle_0).set_min_output_buffer(98304)
        self.blocks_tagged_stream_multiply_length_0 = blocks.tagged_stream_multiply_length(
            gr.sizeof_gr_complex * 1, "packet_len", 1.0 / decim_fac)
        (self.blocks_tagged_stream_multiply_length_0
         ).set_min_output_buffer(98304)
        self.blocks_multiply_conjugate_cc_0 = blocks.multiply_conjugate_cc(1)
        (self.blocks_multiply_conjugate_cc_0).set_min_output_buffer(98304)
        self.blocks_add_xx_0 = blocks.add_vcc(1)
        (self.blocks_add_xx_0).set_min_output_buffer(98304)
        self.analog_noise_source_x_0 = analog.noise_source_c(
            analog.GR_GAUSSIAN, 0.1, 0)
        (self.analog_noise_source_x_0).set_min_output_buffer(98304)

        ##################################################
        # Connections
        ##################################################
        self.msg_connect((self.radar_estimator_fmcw_0, 'Msg out'),
                         (self.radar_print_results_0, 'Msg in'))
        self.msg_connect((self.radar_find_max_peak_c_0, 'Msg out'),
                         (self.radar_estimator_fmcw_0, 'Msg in CW'))
        self.msg_connect((self.radar_find_max_peak_c_0_0, 'Msg out'),
                         (self.radar_estimator_fmcw_0, 'Msg in UP'))
        self.msg_connect((self.radar_find_max_peak_c_0_0_0, 'Msg out'),
                         (self.radar_estimator_fmcw_0, 'Msg in DOWN'))
        self.connect((self.analog_noise_source_x_0, 0),
                     (self.blocks_add_xx_0, 0))
        self.connect((self.blocks_add_xx_0, 0),
                     (self.blocks_multiply_conjugate_cc_0, 1))
        self.connect((self.blocks_multiply_conjugate_cc_0, 0),
                     (self.qtgui_sink_x_0_1, 0))
        self.connect((self.blocks_multiply_conjugate_cc_0, 0),
                     (self.rational_resampler_xxx_0, 0))
        self.connect((self.blocks_tagged_stream_multiply_length_0, 0),
                     (self.radar_split_cc_0, 0))
        self.connect((self.blocks_tagged_stream_multiply_length_0, 0),
                     (self.radar_split_cc_0_0, 0))
        self.connect((self.blocks_tagged_stream_multiply_length_0, 0),
                     (self.radar_split_cc_0_0_0, 0))
        self.connect((self.blocks_throttle_0, 0),
                     (self.radar_static_target_simulator_cc_0, 0))
        self.connect((self.radar_signal_generator_fmcw_c_0, 0),
                     (self.blocks_multiply_conjugate_cc_0, 0))
        self.connect((self.radar_signal_generator_fmcw_c_0, 0),
                     (self.blocks_throttle_0, 0))
        self.connect((self.radar_split_cc_0, 0), (self.radar_ts_fft_cc_0, 0))
        self.connect((self.radar_split_cc_0_0, 0),
                     (self.radar_ts_fft_cc_0_0, 0))
        self.connect((self.radar_split_cc_0_0_0, 0),
                     (self.radar_ts_fft_cc_0_1, 0))
        self.connect((self.radar_static_target_simulator_cc_0, 0),
                     (self.blocks_add_xx_0, 1))
        self.connect((self.radar_ts_fft_cc_0, 0),
                     (self.radar_find_max_peak_c_0, 0))
        self.connect((self.radar_ts_fft_cc_0_0, 0), (self.qtgui_sink_x_0, 0))
        self.connect((self.radar_ts_fft_cc_0_0, 0),
                     (self.radar_find_max_peak_c_0_0, 0))
        self.connect((self.radar_ts_fft_cc_0_1, 0),
                     (self.radar_find_max_peak_c_0_0_0, 0))
        self.connect((self.rational_resampler_xxx_0, 0),
                     (self.blocks_tagged_stream_multiply_length_0, 0))