diff --git a/grc_blocks/app/usrp_1tx_1rx_pdu_gen.grc b/grc_blocks/app/usrp_1tx_1rx_pdu_gen.grc new file mode 100644 index 0000000..d5a33cd --- /dev/null +++ b/grc_blocks/app/usrp_1tx_1rx_pdu_gen.grc @@ -0,0 +1,3671 @@ + + + + Mon Jul 23 11:24:05 2018 + + options + + author + + + + window_size + + + + category + [GRC Hier Blocks] + + + comment + + + + description + + + + _enabled + True + + + _coordinate + (0, 4) + + + _rotation + 0 + + + generate_options + qt_gui + + + hier_block_src_path + .: + + + id + usrp_1tx_1rx_pdu_gen + + + max_nouts + 0 + + + qt_qss_theme + + + + realtime_scheduling + + + + run_command + {python} -u {filename} + + + run_options + prompt + + + run + True + + + thread_safe_setters + + + + title + + + + + variable_qtgui_range + + comment + + + + value + 0.1 + + + _enabled + 1 + + + _coordinate + (944, 8) + + + gui_hint + + + + _rotation + 0 + + + id + mul1 + + + label + mul1 + + + min_len + 200 + + + orient + Qt.Horizontal + + + start + 0 + + + step + 0.01 + + + stop + 1 + + + rangeType + float + + + widget + counter_slider + + + + variable + + comment + + + + _enabled + True + + + _coordinate + (8, 96) + + + _rotation + 0 + + + id + occupied_carriers + + + value + (range(-26, -21) + range(-20, -7) + range(-6, 0) + range(1, 7) + range(8, 21) + range(22, 27),) + + + + variable + + comment + + + + _enabled + True + + + _coordinate + (168, 96) + + + _rotation + 0 + + + id + pilot_carriers + + + value + ((-21, -7, 7, 21,),) + + + + variable + + comment + + + + _enabled + True + + + _coordinate + (296, 96) + + + _rotation + 0 + + + id + pilot_symbols + + + value + ((1, 1, 1, -1,),) + + + + variable + + comment + + + + _enabled + True + + + _coordinate + (32, 168) + + + _rotation + 0 + + + id + sync_word1 + + + value + [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.] + + + + variable + + comment + + + + _enabled + True + + + _coordinate + (176, 168) + + + _rotation + 0 + + + id + sync_word2 + + + value + [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] + + + + analog_random_source_x + + alias + + + + comment + + + + affinity + + + + _enabled + 0 + + + _coordinate + (8, 440) + + + _rotation + 0 + + + id + analog_random_source_x_0 + + + maxoutbuf + 0 + + + max + 10 + + + minoutbuf + 0 + + + min + 0 + + + num_samps + 1000 + + + type + byte + + + repeat + True + + + + blocks_message_debug + + alias + + + + comment + + + + affinity + + + + _enabled + 0 + + + _coordinate + (848, 232) + + + _rotation + 0 + + + id + blocks_message_debug_0 + + + + blocks_message_strobe + + alias + + + + comment + + + + affinity + + + + _enabled + 1 + + + _coordinate + (16, 280) + + + _rotation + 0 + + + id + blocks_message_strobe_0 + + + maxoutbuf + 0 + + + msg + pmt.intern("TEST") + + + minoutbuf + 0 + + + period + 100 + + + + blocks_multiply_const_vxx + + alias + + + + comment + + + + const + mul1 + + + affinity + + + + _enabled + 1 + + + _coordinate + (760, 464) + + + _rotation + 0 + + + id + blocks_multiply_const_vxx_0 + + + type + complex + + + maxoutbuf + 0 + + + minoutbuf + 0 + + + vlen + 1 + + + + blocks_pdu_to_tagged_stream + + alias + + + + comment + + + + affinity + + + + _enabled + 1 + + + _coordinate + (456, 288) + + + _rotation + 0 + + + id + blocks_pdu_to_tagged_stream_0 + + + type + byte + + + tag + "len" + + + maxoutbuf + 0 + + + minoutbuf + 0 + + + + blocks_random_pdu + + alias + + + + mask + 0xFF + + + comment + + + + affinity + + + + _enabled + 1 + + + _coordinate + (216, 264) + + + _rotation + 0 + + + id + blocks_random_pdu_0 + + + length_modulo + 2 + + + maxsize + 100 + + + maxoutbuf + 0 + + + minsize + 50 + + + minoutbuf + 0 + + + + blocks_stream_to_tagged_stream + + alias + + + + comment + + + + affinity + + + + _enabled + 0 + + + _coordinate + (176, 456) + + + _rotation + 0 + + + id + blocks_stream_to_tagged_stream_0 + + + len_tag_key + "len" + + + maxoutbuf + 0 + + + minoutbuf + 0 + + + packet_len + 100 + + + type + byte + + + vlen + 1 + + + + blocks_tag_debug + + alias + + + + comment + + + + affinity + + + + display + True + + + _enabled + 1 + + + _coordinate + (216, 688) + + + _rotation + 180 + + + id + blocks_tag_debug_0 + + + type + byte + + + filter + "" + + + name + VR1 RX + + + num_inputs + 1 + + + vlen + 1 + + + + blocks_tagged_stream_to_pdu + + alias + + + + comment + + + + affinity + + + + _enabled + 0 + + + _coordinate + (16, 736) + + + _rotation + 180 + + + id + blocks_tagged_stream_to_pdu_0 + + + type + byte + + + tag + packet_len + + + maxoutbuf + 0 + + + minoutbuf + 0 + + + + blocks_throttle + + alias + + + + comment + + + + affinity + + + + _enabled + 1 + + + _coordinate + (600, 464) + + + _rotation + 0 + + + id + blocks_throttle_0 + + + ignoretag + True + + + maxoutbuf + 0 + + + minoutbuf + 0 + + + samples_per_second + samp_rate * 2 + + + type + complex + + + vlen + 1 + + + + digital_ofdm_rx + + alias + + + + comment + + + + affinity + + + + cp_len + 16 + + + _enabled + True + + + fft_len + 64 + + + _coordinate + (416, 624) + + + _rotation + 180 + + + header_mod + "BPSK" + + + id + digital_ofdm_rx_0 + + + log + False + + + maxoutbuf + 0 + + + minoutbuf + 0 + + + occupied_carriers + occupied_carriers + + + packet_len_key + "len" + + + payload_mod + "BPSK" + + + pilot_carriers + pilot_carriers + + + pilot_symbols + pilot_symbols + + + scramble_bits + False + + + sync_word1 + sync_word1 + + + sync_word2 + sync_word2 + + + + digital_ofdm_tx + + alias + + + + comment + + + + affinity + + + + cp_len + 16 + + + _enabled + True + + + fft_len + 64 + + + _coordinate + (384, 376) + + + _rotation + 0 + + + header_mod + "BPSK" + + + id + digital_ofdm_tx_0 + + + packet_len_key + "len" + + + log + False + + + maxoutbuf + 0 + + + minoutbuf + 0 + + + occupied_carriers + occupied_carriers + + + payload_mod + "BPSK" + + + pilot_carriers + pilot_carriers + + + pilot_symbols + pilot_symbols + + + rolloff + 0 + + + scramble_bits + False + + + sync_word1 + sync_word1 + + + sync_word2 + sync_word2 + + + + parameter + + alias + + + + comment + + + + _enabled + True + + + _coordinate + (720, 8) + + + _rotation + 0 + + + id + freqrx + + + label + + + + short_id + + + + type + + + + value + 1.1e9 + + + + parameter + + alias + + + + comment + + + + _enabled + True + + + _coordinate + (616, 8) + + + _rotation + 0 + + + id + freqtx + + + label + + + + short_id + + + + type + + + + value + 1.1e9 + + + + parameter + + alias + + + + comment + + + + _enabled + True + + + _coordinate + (816, 8) + + + _rotation + 0 + + + id + hydraClient + + + label + + + + short_id + + + + type + string + + + value + 192.168.5.52 + + + + qtgui_waterfall_sink_x + + axislabels + True + + + bw + samp_rate + + + alias + + + + fc + 0 + + + comment + + + + affinity + + + + _enabled + 1 + + + fftsize + 1024 + + + _coordinate + (432, 840) + + + gui_hint + + + + _rotation + 180 + + + grid + False + + + id + qtgui_waterfall_sink_x_0 + + + int_max + 10 + + + int_min + -140 + + + legend + True + + + alpha1 + 1.0 + + + color1 + 0 + + + label1 + + + + alpha10 + 1.0 + + + color10 + 0 + + + label10 + + + + alpha2 + 1.0 + + + color2 + 0 + + + label2 + + + + alpha3 + 1.0 + + + color3 + 0 + + + label3 + + + + alpha4 + 1.0 + + + color4 + 0 + + + label4 + + + + alpha5 + 1.0 + + + color5 + 0 + + + label5 + + + + alpha6 + 1.0 + + + color6 + 0 + + + label6 + + + + alpha7 + 1.0 + + + color7 + 0 + + + label7 + + + + alpha8 + 1.0 + + + color8 + 0 + + + label8 + + + + alpha9 + 1.0 + + + color9 + 0 + + + label9 + + + + maxoutbuf + 0 + + + minoutbuf + 0 + + + name + "" + + + nconnections + 1 + + + showports + True + + + freqhalf + True + + + type + complex + + + update_time + 0.10 + + + wintype + firdes.WIN_BLACKMAN_hARRIS + + + + parameter + + alias + + + + comment + + + + _enabled + True + + + _coordinate + (520, 8) + + + _rotation + 0 + + + id + samp_rate + + + label + + + + short_id + + + + type + + + + value + 200e3 + + + + uhd_usrp_sink + + alias + + + + ant0 + TX/RX + + + bw0 + 0 + + + center_freq0 + freqtx + vr1offset + + + norm_gain0 + True + + + gain0 + 0.7 + + + ant10 + + + + bw10 + 0 + + + center_freq10 + 0 + + + norm_gain10 + False + + + gain10 + 0 + + + ant11 + + + + bw11 + 0 + + + center_freq11 + 0 + + + norm_gain11 + False + + + gain11 + 0 + + + ant12 + + + + bw12 + 0 + + + center_freq12 + 0 + + + norm_gain12 + False + + + gain12 + 0 + + + ant13 + + + + bw13 + 0 + + + center_freq13 + 0 + + + norm_gain13 + False + + + gain13 + 0 + + + ant14 + + + + bw14 + 0 + + + center_freq14 + 0 + + + norm_gain14 + False + + + gain14 + 0 + + + ant15 + + + + bw15 + 0 + + + center_freq15 + 0 + + + norm_gain15 + False + + + gain15 + 0 + + + ant16 + + + + bw16 + 0 + + + center_freq16 + 0 + + + norm_gain16 + False + + + gain16 + 0 + + + ant17 + + + + bw17 + 0 + + + center_freq17 + 0 + + + norm_gain17 + False + + + gain17 + 0 + + + ant18 + + + + bw18 + 0 + + + center_freq18 + 0 + + + norm_gain18 + False + + + gain18 + 0 + + + ant19 + + + + bw19 + 0 + + + center_freq19 + 0 + + + norm_gain19 + False + + + gain19 + 0 + + + ant1 + + + + bw1 + 0 + + + center_freq1 + 0 + + + norm_gain1 + False + + + gain1 + 0 + + + ant20 + + + + bw20 + 0 + + + center_freq20 + 0 + + + norm_gain20 + False + + + gain20 + 0 + + + ant21 + + + + bw21 + 0 + + + center_freq21 + 0 + + + norm_gain21 + False + + + gain21 + 0 + + + ant22 + + + + bw22 + 0 + + + center_freq22 + 0 + + + norm_gain22 + False + + + gain22 + 0 + + + ant23 + + + + bw23 + 0 + + + center_freq23 + 0 + + + norm_gain23 + False + + + gain23 + 0 + + + ant24 + + + + bw24 + 0 + + + center_freq24 + 0 + + + norm_gain24 + False + + + gain24 + 0 + + + ant25 + + + + bw25 + 0 + + + center_freq25 + 0 + + + norm_gain25 + False + + + gain25 + 0 + + + ant26 + + + + bw26 + 0 + + + center_freq26 + 0 + + + norm_gain26 + False + + + gain26 + 0 + + + ant27 + + + + bw27 + 0 + + + center_freq27 + 0 + + + norm_gain27 + False + + + gain27 + 0 + + + ant28 + + + + bw28 + 0 + + + center_freq28 + 0 + + + norm_gain28 + False + + + gain28 + 0 + + + ant29 + + + + bw29 + 0 + + + center_freq29 + 0 + + + norm_gain29 + False + + + gain29 + 0 + + + ant2 + + + + bw2 + 0 + + + center_freq2 + 0 + + + norm_gain2 + False + + + gain2 + 0 + + + ant30 + + + + bw30 + 0 + + + center_freq30 + 0 + + + norm_gain30 + False + + + gain30 + 0 + + + ant31 + + + + bw31 + 0 + + + center_freq31 + 0 + + + norm_gain31 + False + + + gain31 + 0 + + + ant3 + + + + bw3 + 0 + + + center_freq3 + 0 + + + norm_gain3 + False + + + gain3 + 0 + + + ant4 + + + + bw4 + 0 + + + center_freq4 + 0 + + + norm_gain4 + False + + + gain4 + 0 + + + ant5 + + + + bw5 + 0 + + + center_freq5 + 0 + + + norm_gain5 + False + + + gain5 + 0 + + + ant6 + + + + bw6 + 0 + + + center_freq6 + 0 + + + norm_gain6 + False + + + gain6 + 0 + + + ant7 + + + + bw7 + 0 + + + center_freq7 + 0 + + + norm_gain7 + False + + + gain7 + 0 + + + ant8 + + + + bw8 + 0 + + + center_freq8 + 0 + + + norm_gain8 + False + + + gain8 + 0 + + + ant9 + + + + bw9 + 0 + + + center_freq9 + 0 + + + norm_gain9 + False + + + gain9 + 0 + + + clock_rate + 0.0 + + + comment + + + + affinity + + + + dev_addr + "" + + + dev_args + "" + + + _enabled + True + + + _coordinate + (904, 408) + + + _rotation + 0 + + + id + uhd_usrp_sink_0 + + + type + fc32 + + + clock_source0 + + + + sd_spec0 + + + + time_source0 + + + + clock_source1 + + + + sd_spec1 + + + + time_source1 + + + + clock_source2 + + + + sd_spec2 + + + + time_source2 + + + + clock_source3 + + + + sd_spec3 + + + + time_source3 + + + + clock_source4 + + + + sd_spec4 + + + + time_source4 + + + + clock_source5 + + + + sd_spec5 + + + + time_source5 + + + + clock_source6 + + + + sd_spec6 + + + + time_source6 + + + + clock_source7 + + + + sd_spec7 + + + + time_source7 + + + + nchan + 1 + + + num_mboards + 1 + + + samp_rate + samp_rate * 2 + + + hide_cmd_port + False + + + hide_lo_controls + True + + + stream_args + + + + stream_chans + [] + + + sync + + + + len_tag_name + + + + otw + + + + + uhd_usrp_source + + alias + + + + ant0 + RX2 + + + bw0 + 0 + + + center_freq0 + freqrx + vr1offset + + + dc_offs_enb0 + "" + + + iq_imbal_enb0 + "" + + + norm_gain0 + False + + + gain0 + 0 + + + lo_export0 + False + + + lo_source0 + internal + + + ant10 + + + + bw10 + 0 + + + center_freq10 + 0 + + + dc_offs_enb10 + "" + + + iq_imbal_enb10 + "" + + + norm_gain10 + False + + + gain10 + 0 + + + lo_export10 + False + + + lo_source10 + internal + + + ant11 + + + + bw11 + 0 + + + center_freq11 + 0 + + + dc_offs_enb11 + "" + + + iq_imbal_enb11 + "" + + + norm_gain11 + False + + + gain11 + 0 + + + lo_export11 + False + + + lo_source11 + internal + + + ant12 + + + + bw12 + 0 + + + center_freq12 + 0 + + + dc_offs_enb12 + "" + + + iq_imbal_enb12 + "" + + + norm_gain12 + False + + + gain12 + 0 + + + lo_export12 + False + + + lo_source12 + internal + + + ant13 + + + + bw13 + 0 + + + center_freq13 + 0 + + + dc_offs_enb13 + "" + + + iq_imbal_enb13 + "" + + + norm_gain13 + False + + + gain13 + 0 + + + lo_export13 + False + + + lo_source13 + internal + + + ant14 + + + + bw14 + 0 + + + center_freq14 + 0 + + + dc_offs_enb14 + "" + + + iq_imbal_enb14 + "" + + + norm_gain14 + False + + + gain14 + 0 + + + lo_export14 + False + + + lo_source14 + internal + + + ant15 + + + + bw15 + 0 + + + center_freq15 + 0 + + + dc_offs_enb15 + "" + + + iq_imbal_enb15 + "" + + + norm_gain15 + False + + + gain15 + 0 + + + lo_export15 + False + + + lo_source15 + internal + + + ant16 + + + + bw16 + 0 + + + center_freq16 + 0 + + + dc_offs_enb16 + "" + + + iq_imbal_enb16 + "" + + + norm_gain16 + False + + + gain16 + 0 + + + lo_export16 + False + + + lo_source16 + internal + + + ant17 + + + + bw17 + 0 + + + center_freq17 + 0 + + + dc_offs_enb17 + "" + + + iq_imbal_enb17 + "" + + + norm_gain17 + False + + + gain17 + 0 + + + lo_export17 + False + + + lo_source17 + internal + + + ant18 + + + + bw18 + 0 + + + center_freq18 + 0 + + + dc_offs_enb18 + "" + + + iq_imbal_enb18 + "" + + + norm_gain18 + False + + + gain18 + 0 + + + lo_export18 + False + + + lo_source18 + internal + + + ant19 + + + + bw19 + 0 + + + center_freq19 + 0 + + + dc_offs_enb19 + "" + + + iq_imbal_enb19 + "" + + + norm_gain19 + False + + + gain19 + 0 + + + lo_export19 + False + + + lo_source19 + internal + + + ant1 + + + + bw1 + 0 + + + center_freq1 + 0 + + + dc_offs_enb1 + "" + + + iq_imbal_enb1 + "" + + + norm_gain1 + False + + + gain1 + 0 + + + lo_export1 + False + + + lo_source1 + internal + + + ant20 + + + + bw20 + 0 + + + center_freq20 + 0 + + + dc_offs_enb20 + "" + + + iq_imbal_enb20 + "" + + + norm_gain20 + False + + + gain20 + 0 + + + lo_export20 + False + + + lo_source20 + internal + + + ant21 + + + + bw21 + 0 + + + center_freq21 + 0 + + + dc_offs_enb21 + "" + + + iq_imbal_enb21 + "" + + + norm_gain21 + False + + + gain21 + 0 + + + lo_export21 + False + + + lo_source21 + internal + + + ant22 + + + + bw22 + 0 + + + center_freq22 + 0 + + + dc_offs_enb22 + "" + + + iq_imbal_enb22 + "" + + + norm_gain22 + False + + + gain22 + 0 + + + lo_export22 + False + + + lo_source22 + internal + + + ant23 + + + + bw23 + 0 + + + center_freq23 + 0 + + + dc_offs_enb23 + "" + + + iq_imbal_enb23 + "" + + + norm_gain23 + False + + + gain23 + 0 + + + lo_export23 + False + + + lo_source23 + internal + + + ant24 + + + + bw24 + 0 + + + center_freq24 + 0 + + + dc_offs_enb24 + "" + + + iq_imbal_enb24 + "" + + + norm_gain24 + False + + + gain24 + 0 + + + lo_export24 + False + + + lo_source24 + internal + + + ant25 + + + + bw25 + 0 + + + center_freq25 + 0 + + + dc_offs_enb25 + "" + + + iq_imbal_enb25 + "" + + + norm_gain25 + False + + + gain25 + 0 + + + lo_export25 + False + + + lo_source25 + internal + + + ant26 + + + + bw26 + 0 + + + center_freq26 + 0 + + + dc_offs_enb26 + "" + + + iq_imbal_enb26 + "" + + + norm_gain26 + False + + + gain26 + 0 + + + lo_export26 + False + + + lo_source26 + internal + + + ant27 + + + + bw27 + 0 + + + center_freq27 + 0 + + + dc_offs_enb27 + "" + + + iq_imbal_enb27 + "" + + + norm_gain27 + False + + + gain27 + 0 + + + lo_export27 + False + + + lo_source27 + internal + + + ant28 + + + + bw28 + 0 + + + center_freq28 + 0 + + + dc_offs_enb28 + "" + + + iq_imbal_enb28 + "" + + + norm_gain28 + False + + + gain28 + 0 + + + lo_export28 + False + + + lo_source28 + internal + + + ant29 + + + + bw29 + 0 + + + center_freq29 + 0 + + + dc_offs_enb29 + "" + + + iq_imbal_enb29 + "" + + + norm_gain29 + False + + + gain29 + 0 + + + lo_export29 + False + + + lo_source29 + internal + + + ant2 + + + + bw2 + 0 + + + center_freq2 + 0 + + + dc_offs_enb2 + "" + + + iq_imbal_enb2 + "" + + + norm_gain2 + False + + + gain2 + 0 + + + lo_export2 + False + + + lo_source2 + internal + + + ant30 + + + + bw30 + 0 + + + center_freq30 + 0 + + + dc_offs_enb30 + "" + + + iq_imbal_enb30 + "" + + + norm_gain30 + False + + + gain30 + 0 + + + lo_export30 + False + + + lo_source30 + internal + + + ant31 + + + + bw31 + 0 + + + center_freq31 + 0 + + + dc_offs_enb31 + "" + + + iq_imbal_enb31 + "" + + + norm_gain31 + False + + + gain31 + 0 + + + lo_export31 + False + + + lo_source31 + internal + + + ant3 + + + + bw3 + 0 + + + center_freq3 + 0 + + + dc_offs_enb3 + "" + + + iq_imbal_enb3 + "" + + + norm_gain3 + False + + + gain3 + 0 + + + lo_export3 + False + + + lo_source3 + internal + + + ant4 + + + + bw4 + 0 + + + center_freq4 + 0 + + + dc_offs_enb4 + "" + + + iq_imbal_enb4 + "" + + + norm_gain4 + False + + + gain4 + 0 + + + lo_export4 + False + + + lo_source4 + internal + + + ant5 + + + + bw5 + 0 + + + center_freq5 + 0 + + + dc_offs_enb5 + "" + + + iq_imbal_enb5 + "" + + + norm_gain5 + False + + + gain5 + 0 + + + lo_export5 + False + + + lo_source5 + internal + + + ant6 + + + + bw6 + 0 + + + center_freq6 + 0 + + + dc_offs_enb6 + "" + + + iq_imbal_enb6 + "" + + + norm_gain6 + False + + + gain6 + 0 + + + lo_export6 + False + + + lo_source6 + internal + + + ant7 + + + + bw7 + 0 + + + center_freq7 + 0 + + + dc_offs_enb7 + "" + + + iq_imbal_enb7 + "" + + + norm_gain7 + False + + + gain7 + 0 + + + lo_export7 + False + + + lo_source7 + internal + + + ant8 + + + + bw8 + 0 + + + center_freq8 + 0 + + + dc_offs_enb8 + "" + + + iq_imbal_enb8 + "" + + + norm_gain8 + False + + + gain8 + 0 + + + lo_export8 + False + + + lo_source8 + internal + + + ant9 + + + + bw9 + 0 + + + center_freq9 + 0 + + + dc_offs_enb9 + "" + + + iq_imbal_enb9 + "" + + + norm_gain9 + False + + + gain9 + 0 + + + lo_export9 + False + + + lo_source9 + internal + + + clock_rate + 0.0 + + + comment + + + + affinity + + + + dev_addr + "" + + + dev_args + "" + + + _enabled + True + + + _coordinate + (672, 680) + + + _rotation + 180 + + + id + uhd_usrp_source_0 + + + maxoutbuf + 0 + + + clock_source0 + + + + sd_spec0 + + + + time_source0 + + + + clock_source1 + + + + sd_spec1 + + + + time_source1 + + + + clock_source2 + + + + sd_spec2 + + + + time_source2 + + + + clock_source3 + + + + sd_spec3 + + + + time_source3 + + + + clock_source4 + + + + sd_spec4 + + + + time_source4 + + + + clock_source5 + + + + sd_spec5 + + + + time_source5 + + + + clock_source6 + + + + sd_spec6 + + + + time_source6 + + + + clock_source7 + + + + sd_spec7 + + + + time_source7 + + + + minoutbuf + 0 + + + nchan + 1 + + + num_mboards + 1 + + + type + fc32 + + + samp_rate + samp_rate * 2 + + + hide_cmd_port + False + + + hide_lo_controls + True + + + stream_args + + + + stream_chans + [] + + + sync + + + + otw + + + + + parameter + + alias + + + + comment + + + + _enabled + True + + + _coordinate + (616, 80) + + + _rotation + 0 + + + id + vr1offset + + + label + + + + short_id + + + + type + + + + value + -100e3 + + + + parameter + + alias + + + + comment + + + + _enabled + True + + + _coordinate + (720, 80) + + + _rotation + 0 + + + id + vr2offset + + + label + + + + short_id + + + + type + + + + value + 700e3 + + + + analog_random_source_x_0 + blocks_stream_to_tagged_stream_0 + 0 + 0 + + + blocks_message_strobe_0 + blocks_random_pdu_0 + strobe + generate + + + blocks_multiply_const_vxx_0 + uhd_usrp_sink_0 + 0 + 0 + + + blocks_pdu_to_tagged_stream_0 + digital_ofdm_tx_0 + 0 + 0 + + + blocks_random_pdu_0 + blocks_pdu_to_tagged_stream_0 + pdus + pdus + + + blocks_stream_to_tagged_stream_0 + digital_ofdm_tx_0 + 0 + 0 + + + blocks_throttle_0 + blocks_multiply_const_vxx_0 + 0 + 0 + + + digital_ofdm_rx_0 + blocks_tag_debug_0 + 0 + 0 + + + digital_ofdm_tx_0 + blocks_throttle_0 + 0 + 0 + + + uhd_usrp_source_0 + digital_ofdm_rx_0 + 0 + 0 + + + uhd_usrp_source_0 + qtgui_waterfall_sink_x_0 + 0 + 0 + + diff --git a/grc_blocks/app/usrp_1tx_1rx_pdu_gen.py b/grc_blocks/app/usrp_1tx_1rx_pdu_gen.py new file mode 100755 index 0000000..859603d --- /dev/null +++ b/grc_blocks/app/usrp_1tx_1rx_pdu_gen.py @@ -0,0 +1,318 @@ +#!/usr/bin/env python2 +# -*- coding: utf-8 -*- +################################################## +# GNU Radio Python Flow Graph +# Title: Usrp 1Tx 1Rx Pdu Gen +# Generated: Fri Jan 18 13:54:15 2019 +################################################## + +from distutils.version import StrictVersion + +if __name__ == '__main__': + import ctypes + import sys + if sys.platform.startswith('linux'): + try: + x11 = ctypes.cdll.LoadLibrary('libX11.so') + x11.XInitThreads() + except: + print "Warning: failed to XInitThreads()" + +from PyQt5 import Qt +from PyQt5 import Qt, QtCore +from gnuradio import blocks +from gnuradio import digital +from gnuradio import eng_notation +from gnuradio import gr +from gnuradio import qtgui +from gnuradio import uhd +from gnuradio.eng_option import eng_option +from gnuradio.filter import firdes +from gnuradio.qtgui import Range, RangeWidget +from optparse import OptionParser +import pmt +import sip +import sys +import time +from gnuradio import qtgui + + +class usrp_1tx_1rx_pdu_gen(gr.top_block, Qt.QWidget): + + def __init__(self, freqrx=1.1e9, freqtx=1.1e9, hydraClient='192.168.5.52', samp_rate=200e3, vr1offset=-100e3, vr2offset=700e3): + gr.top_block.__init__(self, "Usrp 1Tx 1Rx Pdu Gen") + Qt.QWidget.__init__(self) + self.setWindowTitle("Usrp 1Tx 1Rx Pdu Gen") + 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", "usrp_1tx_1rx_pdu_gen") + + if StrictVersion(Qt.qVersion()) < StrictVersion("5.0.0"): + self.restoreGeometry(self.settings.value("geometry").toByteArray()) + else: + self.restoreGeometry(self.settings.value("geometry", type=QtCore.QByteArray)) + + ################################################## + # Parameters + ################################################## + self.freqrx = freqrx + self.freqtx = freqtx + self.hydraClient = hydraClient + self.samp_rate = samp_rate + self.vr1offset = vr1offset + self.vr2offset = vr2offset + + ################################################## + # Variables + ################################################## + 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.occupied_carriers = occupied_carriers = (range(-26, -21) + range(-20, -7) + range(-6, 0) + range(1, 7) + range(8, 21) + range(22, 27),) + self.mul1 = mul1 = 0.1 + + ################################################## + # Blocks + ################################################## + self._mul1_range = Range(0, 1, 0.01, 0.1, 200) + self._mul1_win = RangeWidget(self._mul1_range, self.set_mul1, 'mul1', "counter_slider", float) + self.top_layout.addWidget(self._mul1_win) + self.uhd_usrp_source_0 = uhd.usrp_source( + ",".join(("", "")), + uhd.stream_args( + cpu_format="fc32", + channels=range(1), + ), + ) + self.uhd_usrp_source_0.set_samp_rate(samp_rate * 2) + self.uhd_usrp_source_0.set_center_freq(freqrx + vr1offset, 0) + self.uhd_usrp_source_0.set_gain(0, 0) + self.uhd_usrp_source_0.set_antenna('RX2', 0) + self.uhd_usrp_sink_0 = uhd.usrp_sink( + ",".join(("", "")), + uhd.stream_args( + cpu_format="fc32", + channels=range(1), + ), + ) + self.uhd_usrp_sink_0.set_samp_rate(samp_rate * 2) + self.uhd_usrp_sink_0.set_center_freq(freqtx + vr1offset, 0) + self.uhd_usrp_sink_0.set_normalized_gain(0.7, 0) + self.uhd_usrp_sink_0.set_antenna('TX/RX', 0) + self.qtgui_waterfall_sink_x_0 = qtgui.waterfall_sink_c( + 1024, #size + firdes.WIN_BLACKMAN_hARRIS, #wintype + 0, #fc + samp_rate, #bw + "", #name + 1 #number of inputs + ) + self.qtgui_waterfall_sink_x_0.set_update_time(0.10) + self.qtgui_waterfall_sink_x_0.enable_grid(False) + self.qtgui_waterfall_sink_x_0.enable_axis_labels(True) + + if not True: + self.qtgui_waterfall_sink_x_0.disable_legend() + + if "complex" == "float" or "complex" == "msg_float": + self.qtgui_waterfall_sink_x_0.set_plot_pos_half(not True) + + labels = ['', '', '', '', '', + '', '', '', '', ''] + colors = [0, 0, 0, 0, 0, + 0, 0, 0, 0, 0] + alphas = [1.0, 1.0, 1.0, 1.0, 1.0, + 1.0, 1.0, 1.0, 1.0, 1.0] + for i in xrange(1): + if len(labels[i]) == 0: + self.qtgui_waterfall_sink_x_0.set_line_label(i, "Data {0}".format(i)) + else: + self.qtgui_waterfall_sink_x_0.set_line_label(i, labels[i]) + self.qtgui_waterfall_sink_x_0.set_color_map(i, colors[i]) + self.qtgui_waterfall_sink_x_0.set_line_alpha(i, alphas[i]) + + self.qtgui_waterfall_sink_x_0.set_intensity_range(-140, 10) + + self._qtgui_waterfall_sink_x_0_win = sip.wrapinstance(self.qtgui_waterfall_sink_x_0.pyqwidget(), Qt.QWidget) + self.top_layout.addWidget(self._qtgui_waterfall_sink_x_0_win) + self.digital_ofdm_tx_0 = digital.ofdm_tx( + fft_len=64, cp_len=16, + packet_length_tag_key="len", + occupied_carriers=occupied_carriers, + pilot_carriers=pilot_carriers, + pilot_symbols=pilot_symbols, + sync_word1=sync_word1, + sync_word2=sync_word2, + bps_header=1, + bps_payload=1, + rolloff=0, + debug_log=False, + scramble_bits=False + ) + self.digital_ofdm_rx_0 = digital.ofdm_rx( + fft_len=64, cp_len=16, + frame_length_tag_key='frame_'+"len", + packet_length_tag_key="len", + occupied_carriers=occupied_carriers, + pilot_carriers=pilot_carriers, + pilot_symbols=pilot_symbols, + sync_word1=sync_word1, + sync_word2=sync_word2, + bps_header=1, + bps_payload=1, + debug_log=False, + scramble_bits=False + ) + self.blocks_throttle_0 = blocks.throttle(gr.sizeof_gr_complex*1, samp_rate * 2,True) + self.blocks_tag_debug_0 = blocks.tag_debug(gr.sizeof_char*1, 'VR1 RX', ""); self.blocks_tag_debug_0.set_display(True) + self.blocks_random_pdu_0 = blocks.random_pdu(50, 100, chr(0xFF), 2) + self.blocks_pdu_to_tagged_stream_0 = blocks.pdu_to_tagged_stream(blocks.byte_t, "len") + self.blocks_multiply_const_vxx_0 = blocks.multiply_const_vcc((mul1, )) + self.blocks_message_strobe_0 = blocks.message_strobe(pmt.intern("TEST"), 100) + + ################################################## + # Connections + ################################################## + self.msg_connect((self.blocks_message_strobe_0, 'strobe'), (self.blocks_random_pdu_0, 'generate')) + self.msg_connect((self.blocks_random_pdu_0, 'pdus'), (self.blocks_pdu_to_tagged_stream_0, 'pdus')) + self.connect((self.blocks_multiply_const_vxx_0, 0), (self.uhd_usrp_sink_0, 0)) + self.connect((self.blocks_pdu_to_tagged_stream_0, 0), (self.digital_ofdm_tx_0, 0)) + self.connect((self.blocks_throttle_0, 0), (self.blocks_multiply_const_vxx_0, 0)) + self.connect((self.digital_ofdm_rx_0, 0), (self.blocks_tag_debug_0, 0)) + self.connect((self.digital_ofdm_tx_0, 0), (self.blocks_throttle_0, 0)) + self.connect((self.uhd_usrp_source_0, 0), (self.digital_ofdm_rx_0, 0)) + self.connect((self.uhd_usrp_source_0, 0), (self.qtgui_waterfall_sink_x_0, 0)) + + def closeEvent(self, event): + self.settings = Qt.QSettings("GNU Radio", "usrp_1tx_1rx_pdu_gen") + self.settings.setValue("geometry", self.saveGeometry()) + event.accept() + + def get_freqrx(self): + return self.freqrx + + def set_freqrx(self, freqrx): + self.freqrx = freqrx + self.uhd_usrp_source_0.set_center_freq(self.freqrx + self.vr1offset, 0) + + def get_freqtx(self): + return self.freqtx + + def set_freqtx(self, freqtx): + self.freqtx = freqtx + self.uhd_usrp_sink_0.set_center_freq(self.freqtx + self.vr1offset, 0) + + def get_hydraClient(self): + return self.hydraClient + + def set_hydraClient(self, hydraClient): + self.hydraClient = hydraClient + + def get_samp_rate(self): + return self.samp_rate + + def set_samp_rate(self, samp_rate): + self.samp_rate = samp_rate + self.uhd_usrp_source_0.set_samp_rate(self.samp_rate * 2) + self.uhd_usrp_sink_0.set_samp_rate(self.samp_rate * 2) + self.qtgui_waterfall_sink_x_0.set_frequency_range(0, self.samp_rate) + self.blocks_throttle_0.set_sample_rate(self.samp_rate * 2) + + def get_vr1offset(self): + return self.vr1offset + + def set_vr1offset(self, vr1offset): + self.vr1offset = vr1offset + self.uhd_usrp_source_0.set_center_freq(self.freqrx + self.vr1offset, 0) + self.uhd_usrp_sink_0.set_center_freq(self.freqtx + self.vr1offset, 0) + + def get_vr2offset(self): + return self.vr2offset + + def set_vr2offset(self, vr2offset): + self.vr2offset = vr2offset + + def get_sync_word2(self): + return self.sync_word2 + + def set_sync_word2(self, sync_word2): + self.sync_word2 = sync_word2 + + def get_sync_word1(self): + return self.sync_word1 + + def set_sync_word1(self, sync_word1): + self.sync_word1 = sync_word1 + + def get_pilot_symbols(self): + return self.pilot_symbols + + def set_pilot_symbols(self, pilot_symbols): + self.pilot_symbols = pilot_symbols + + def get_pilot_carriers(self): + return self.pilot_carriers + + def set_pilot_carriers(self, pilot_carriers): + self.pilot_carriers = pilot_carriers + + def get_occupied_carriers(self): + return self.occupied_carriers + + def set_occupied_carriers(self, occupied_carriers): + self.occupied_carriers = occupied_carriers + + def get_mul1(self): + return self.mul1 + + def set_mul1(self, mul1): + self.mul1 = mul1 + self.blocks_multiply_const_vxx_0.set_k((self.mul1, )) + + +def argument_parser(): + parser = OptionParser(usage="%prog: [options]", option_class=eng_option) + parser.add_option( + "", "--hydraClient", dest="hydraClient", type="string", default='192.168.5.52', + help="Set hydraClient [default=%default]") + return parser + + +def main(top_block_cls=usrp_1tx_1rx_pdu_gen, options=None): + if options is None: + options, _ = argument_parser().parse_args() + + if StrictVersion("4.5.0") <= StrictVersion(Qt.qVersion()) < StrictVersion("5.0.0"): + style = gr.prefs().get_string('qtgui', 'style', 'raster') + Qt.QApplication.setGraphicsSystem(style) + qapp = Qt.QApplication(sys.argv) + + tb = top_block_cls(hydraClient=options.hydraClient) + tb.start() + tb.show() + + def quitting(): + tb.stop() + tb.wait() + qapp.aboutToQuit.connect(quitting) + qapp.exec_() + + +if __name__ == '__main__': + main()