diff --git a/Architecture.png b/Architecture.png new file mode 100644 index 0000000..473a6e9 Binary files /dev/null and b/Architecture.png differ diff --git a/Physical-Layer-GNURadio/twoways_listener.grc b/Physical-Layer-GNURadio/twoways_listener.grc index 7b1cd4f..034da63 100644 --- a/Physical-Layer-GNURadio/twoways_listener.grc +++ b/Physical-Layer-GNURadio/twoways_listener.grc @@ -159,7 +159,7 @@ _coordinate - (632, 608) + (616, 428) _rotation @@ -214,7 +214,7 @@ _coordinate - (344, 352) + (336, 124) _rotation @@ -277,7 +277,7 @@ _coordinate - (776, 392) + (784, 164) _rotation @@ -328,7 +328,7 @@ _coordinate - (240, 848) + (168, 644) _rotation @@ -375,7 +375,7 @@ _coordinate - (80, 280) + (72, 244) _rotation @@ -422,7 +422,7 @@ _coordinate - (112, 144) + (96, 108) _rotation @@ -481,7 +481,7 @@ _coordinate - (928, 792) + (936, 628) _rotation @@ -540,7 +540,7 @@ _coordinate - (888, 608) + (904, 428) _rotation @@ -595,7 +595,7 @@ _coordinate - (112, 392) + (96, 332) _rotation @@ -646,7 +646,7 @@ _coordinate - (912, 712) + (904, 532) _rotation @@ -697,7 +697,7 @@ _coordinate - (400, 584) + (384, 404) _rotation @@ -764,7 +764,7 @@ _coordinate - (584, 384) + (576, 156) _rotation @@ -831,7 +831,7 @@ _coordinate - (384, 800) + (328, 596) _rotation @@ -1542,7 +1542,7 @@ _coordinate - (952, 336) + (1024, 60) _rotation @@ -2877,7 +2877,7 @@ _coordinate - (16, 624) + (104, 404) _rotation @@ -3072,7 +3072,7 @@ _coordinate - (952, 112) + (1016, 208) _rotation @@ -3175,7 +3175,7 @@ _coordinate - (640, 784) + (544, 576) _rotation diff --git a/Physical-Layer-GNURadio/twoways_sender.grc b/Physical-Layer-GNURadio/twoways_sender.grc index bd1b7a8..aa372af 100644 --- a/Physical-Layer-GNURadio/twoways_sender.grc +++ b/Physical-Layer-GNURadio/twoways_sender.grc @@ -159,7 +159,7 @@ _coordinate - (632, 604) + (792, 452) _rotation @@ -214,7 +214,7 @@ _coordinate - (344, 348) + (336, 92) _rotation @@ -277,7 +277,7 @@ _coordinate - (776, 388) + (776, 132) _rotation @@ -328,7 +328,7 @@ _coordinate - (240, 844) + (128, 644) _rotation @@ -375,7 +375,7 @@ _coordinate - (80, 276) + (80, 236) _rotation @@ -422,7 +422,7 @@ _coordinate - (112, 140) + (112, 100) _rotation @@ -481,7 +481,7 @@ _coordinate - (928, 788) + (1056, 644) _rotation @@ -540,7 +540,7 @@ _coordinate - (888, 604) + (1008, 452) _rotation @@ -595,7 +595,7 @@ _coordinate - (112, 388) + (112, 348) _rotation @@ -646,7 +646,7 @@ _coordinate - (912, 708) + (1032, 556) _rotation @@ -697,7 +697,7 @@ _coordinate - (400, 580) + (576, 428) _rotation @@ -764,7 +764,7 @@ _coordinate - (584, 380) + (568, 124) _rotation @@ -831,7 +831,7 @@ _coordinate - (384, 796) + (344, 596) _rotation @@ -1542,7 +1542,7 @@ _coordinate - (952, 332) + (1016, 76) _rotation @@ -2877,7 +2877,7 @@ _coordinate - (16, 620) + (80, 444) _rotation @@ -3072,7 +3072,7 @@ _coordinate - (952, 112) + (1024, 224) _rotation @@ -3175,7 +3175,7 @@ _coordinate - (632, 776) + (576, 576) _rotation diff --git a/TestGraph/ContinuousSender.py b/TestGraph/ContinuousSender.py new file mode 100644 index 0000000..1087698 --- /dev/null +++ b/TestGraph/ContinuousSender.py @@ -0,0 +1,25 @@ +import time +import sys +from socket import * + +writeHostname = 'localhost' +writePortNo = 52002 + +writeSockObj = socket(AF_INET, SOCK_STREAM) +writeSockObj.connect((writeHostname, writePortNo)) + +print('Enter Message: ') +msg = input() + +print('Enter interval time (seconds)') +timeInterval = input() +timeInterval = float(timeInterval) + +counter = 1; + +while True: + print('\nSending message #' + str(counter) + " ...") + writeSockObj.sendall(msg.encode()) + print('Message sent.') + time.sleep(timeInterval) + counter += 1; diff --git a/TestGraph/Socket-TestDifferentParameters.grc b/TestGraph/Socket-TestDifferentParameters.grc new file mode 100644 index 0000000..f2176e7 --- /dev/null +++ b/TestGraph/Socket-TestDifferentParameters.grc @@ -0,0 +1,4069 @@ + + + + Wed May 30 16:19:07 2018 + + options + + author + + + + window_size + + + + category + [GRC Hier Blocks] + + + comment + + + + description + + + + _enabled + True + + + _coordinate + (8, 8) + + + _rotation + 0 + + + generate_options + qt_gui + + + hier_block_src_path + .: + + + id + top_block + + + max_nouts + 0 + + + qt_qss_theme + + + + realtime_scheduling + + + + run_command + {python} -u {filename} + + + run_options + prompt + + + run + True + + + thread_safe_setters + + + + title + + + + + variable + + comment + + + + _enabled + True + + + _coordinate + (288, 16) + + + _rotation + 0 + + + id + samp_per_symb + + + value + 10 + + + + variable + + comment + + + + _enabled + True + + + _coordinate + (192, 16) + + + _rotation + 0 + + + id + samp_rate + + + value + 1000000 + + + + blks2_packet_decoder + + access_code + + + + alias + + + + comment + + + + affinity + + + + _enabled + 1 + + + _coordinate + (696, 584) + + + _rotation + 0 + + + id + blks2_packet_decoder_0 + + + maxoutbuf + 0 + + + minoutbuf + 0 + + + type + byte + + + threshold + -1 + + + + blks2_packet_encoder + + access_code + + + + bits_per_symbol + 1 + + + alias + + + + comment + + + + affinity + + + + _enabled + 1 + + + _coordinate + (344, 352) + + + _rotation + 0 + + + id + blks2_packet_encoder_0 + + + type + byte + + + maxoutbuf + 0 + + + minoutbuf + 0 + + + pad_for_usrp + True + + + payload_length + 1 + + + preamble + + + + samples_per_symbol + samp_per_symb + + + + blocks_multiply_const_vxx + + alias + + + + comment + + + + const + 1 + + + affinity + + + + _enabled + 1 + + + _coordinate + (776, 392) + + + _rotation + 0 + + + id + blocks_multiply_const_vxx_0 + + + type + complex + + + maxoutbuf + 0 + + + minoutbuf + 0 + + + vlen + 1 + + + + blocks_multiply_const_vxx + + alias + + + + comment + + + + const + 1 + + + affinity + + + + _enabled + 1 + + + _coordinate + (304, 824) + + + _rotation + 0 + + + id + blocks_multiply_const_vxx_0_0 + + + type + complex + + + maxoutbuf + 0 + + + minoutbuf + 0 + + + vlen + 1 + + + + blocks_pdu_to_tagged_stream + + alias + + + + comment + + + + affinity + + + + _enabled + 1 + + + _coordinate + (80, 280) + + + _rotation + 0 + + + id + blocks_pdu_to_tagged_stream_0 + + + type + byte + + + tag + packet_len + + + maxoutbuf + 0 + + + minoutbuf + 0 + + + + blocks_socket_pdu + + alias + + + + comment + + + + affinity + + + + _enabled + 1 + + + _coordinate + (112, 144) + + + _rotation + 0 + + + host + + + + id + blocks_socket_pdu_0 + + + mtu + 15000 + + + maxoutbuf + 0 + + + minoutbuf + 0 + + + port + 52002 + + + tcp_no_delay + False + + + type + "TCP_SERVER" + + + + blocks_socket_pdu + + alias + + + + comment + + + + affinity + + + + _enabled + 1 + + + _coordinate + (960, 768) + + + _rotation + 0 + + + host + localhost + + + id + blocks_socket_pdu_1 + + + mtu + 15000 + + + maxoutbuf + 0 + + + minoutbuf + 0 + + + port + 52003 + + + tcp_no_delay + False + + + type + "UDP_CLIENT" + + + + blocks_stream_to_tagged_stream + + alias + + + + comment + + + + affinity + + + + _enabled + 1 + + + _coordinate + (952, 584) + + + _rotation + 0 + + + id + blocks_stream_to_tagged_stream_0 + + + len_tag_key + packet_len + + + maxoutbuf + 0 + + + minoutbuf + 0 + + + packet_len + 1 + + + type + byte + + + vlen + 1 + + + + blocks_tag_gate + + alias + + + + comment + + + + affinity + + + + _enabled + True + + + _coordinate + (112, 392) + + + _rotation + 0 + + + id + blocks_tag_gate_0 + + + type + byte + + + maxoutbuf + 0 + + + minoutbuf + 0 + + + propagate_tags + False + + + vlen + 1 + + + + blocks_tagged_stream_to_pdu + + alias + + + + comment + + + + affinity + + + + _enabled + 1 + + + _coordinate + (960, 688) + + + _rotation + 0 + + + id + blocks_tagged_stream_to_pdu_0 + + + type + byte + + + tag + packet_len + + + maxoutbuf + 0 + + + minoutbuf + 0 + + + + digital_gmsk_demod + + alias + + + + comment + + + + affinity + + + + _enabled + 1 + + + freq_error + 0.0 + + + _coordinate + (464, 560) + + + _rotation + 0 + + + gain_mu + 0.175 + + + id + digital_gmsk_demod_0 + + + log + False + + + maxoutbuf + 0 + + + minoutbuf + 0 + + + mu + 0.5 + + + omega_relative_limit + 0.005 + + + samples_per_symbol + samp_per_symb + + + verbose + False + + + + digital_gmsk_mod + + bt + 0.35 + + + alias + + + + comment + + + + affinity + + + + _enabled + 1 + + + _coordinate + (584, 384) + + + _rotation + 0 + + + id + digital_gmsk_mod_0 + + + log + False + + + maxoutbuf + 0 + + + minoutbuf + 0 + + + samples_per_symbol + samp_per_symb + + + verbose + False + + + + low_pass_filter + + beta + 6.76 + + + alias + + + + comment + + + + affinity + + + + cutoff_freq + 200000 + + + decim + 1 + + + _enabled + 1 + + + type + fir_filter_ccf + + + _coordinate + (448, 776) + + + _rotation + 0 + + + gain + 1 + + + id + low_pass_filter_0 + + + interp + 1 + + + maxoutbuf + 0 + + + minoutbuf + 0 + + + samp_rate + samp_rate + + + width + 50000 + + + win + firdes.WIN_HAMMING + + + + qtgui_time_sink_x + + autoscale + False + + + axislabels + True + + + alias + + + + comment + + + + ctrlpanel + False + + + affinity + + + + entags + True + + + _enabled + True + + + _coordinate + (960, 264) + + + gui_hint + + + + _rotation + 0 + + + grid + False + + + id + qtgui_time_sink_x_0 + + + legend + True + + + alpha1 + 1.0 + + + color1 + "blue" + + + label1 + + + + marker1 + -1 + + + style1 + 1 + + + width1 + 1 + + + alpha10 + 1.0 + + + color10 + "blue" + + + label10 + + + + marker10 + -1 + + + style10 + 1 + + + width10 + 1 + + + alpha2 + 1.0 + + + color2 + "red" + + + label2 + + + + marker2 + -1 + + + style2 + 1 + + + width2 + 1 + + + alpha3 + 1.0 + + + color3 + "green" + + + label3 + + + + marker3 + -1 + + + style3 + 1 + + + width3 + 1 + + + alpha4 + 1.0 + + + color4 + "black" + + + label4 + + + + marker4 + -1 + + + style4 + 1 + + + width4 + 1 + + + alpha5 + 1.0 + + + color5 + "cyan" + + + label5 + + + + marker5 + -1 + + + style5 + 1 + + + width5 + 1 + + + alpha6 + 1.0 + + + color6 + "magenta" + + + label6 + + + + marker6 + -1 + + + style6 + 1 + + + width6 + 1 + + + alpha7 + 1.0 + + + color7 + "yellow" + + + label7 + + + + marker7 + -1 + + + style7 + 1 + + + width7 + 1 + + + alpha8 + 1.0 + + + color8 + "dark red" + + + label8 + + + + marker8 + -1 + + + style8 + 1 + + + width8 + 1 + + + alpha9 + 1.0 + + + color9 + "dark green" + + + label9 + + + + marker9 + -1 + + + style9 + 1 + + + width9 + 1 + + + name + "" + + + nconnections + 1 + + + size + 1024 + + + srate + samp_rate + + + tr_chan + 0 + + + tr_delay + 0 + + + tr_level + 0.0 + + + tr_mode + qtgui.TRIG_MODE_FREE + + + tr_slope + qtgui.TRIG_SLOPE_POS + + + tr_tag + "" + + + type + complex + + + update_time + 0.10 + + + ylabel + Amplitude + + + yunit + "" + + + ymax + 1 + + + ymin + -1 + + + + qtgui_time_sink_x + + autoscale + False + + + axislabels + True + + + alias + + + + comment + + + + ctrlpanel + False + + + affinity + + + + entags + True + + + _enabled + True + + + _coordinate + (704, 944) + + + gui_hint + + + + _rotation + 0 + + + grid + False + + + id + qtgui_time_sink_x_1 + + + legend + True + + + alpha1 + 1.0 + + + color1 + "blue" + + + label1 + + + + marker1 + -1 + + + style1 + 1 + + + width1 + 1 + + + alpha10 + 1.0 + + + color10 + "blue" + + + label10 + + + + marker10 + -1 + + + style10 + 1 + + + width10 + 1 + + + alpha2 + 1.0 + + + color2 + "red" + + + label2 + + + + marker2 + -1 + + + style2 + 1 + + + width2 + 1 + + + alpha3 + 1.0 + + + color3 + "green" + + + label3 + + + + marker3 + -1 + + + style3 + 1 + + + width3 + 1 + + + alpha4 + 1.0 + + + color4 + "black" + + + label4 + + + + marker4 + -1 + + + style4 + 1 + + + width4 + 1 + + + alpha5 + 1.0 + + + color5 + "cyan" + + + label5 + + + + marker5 + -1 + + + style5 + 1 + + + width5 + 1 + + + alpha6 + 1.0 + + + color6 + "magenta" + + + label6 + + + + marker6 + -1 + + + style6 + 1 + + + width6 + 1 + + + alpha7 + 1.0 + + + color7 + "yellow" + + + label7 + + + + marker7 + -1 + + + style7 + 1 + + + width7 + 1 + + + alpha8 + 1.0 + + + color8 + "dark red" + + + label8 + + + + marker8 + -1 + + + style8 + 1 + + + width8 + 1 + + + alpha9 + 1.0 + + + color9 + "dark green" + + + label9 + + + + marker9 + -1 + + + style9 + 1 + + + width9 + 1 + + + name + "" + + + nconnections + 1 + + + size + 1024 + + + srate + samp_rate + + + tr_chan + 0 + + + tr_delay + 0 + + + tr_level + 0.0 + + + tr_mode + qtgui.TRIG_MODE_FREE + + + tr_slope + qtgui.TRIG_SLOPE_POS + + + tr_tag + "" + + + type + complex + + + update_time + 0.10 + + + ylabel + Amplitude + + + yunit + "" + + + ymax + 1 + + + ymin + -1 + + + + uhd_usrp_sink + + alias + + + + ant0 + TX/RX + + + bw0 + 0 + + + center_freq0 + 2460000000 + + + norm_gain0 + True + + + gain0 + 0.9 + + + 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 + 1 + + + _coordinate + (1072, 376) + + + _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 + + + 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 + 2460000000 + + + dc_offs_enb0 + "" + + + iq_imbal_enb0 + "" + + + norm_gain0 + True + + + 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 + 1 + + + _coordinate + (80, 560) + + + _rotation + 0 + + + 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 + + + hide_cmd_port + False + + + hide_lo_controls + True + + + stream_args + + + + stream_chans + [] + + + sync + + + + otw + + + + + wxgui_fftsink2 + + avg_alpha + 0 + + + average + False + + + baseband_freq + 0 + + + alias + + + + comment + + + + affinity + + + + _enabled + 0 + + + fft_size + 1024 + + + freqvar + None + + + _coordinate + (960, 56) + + + _rotation + 0 + + + grid_pos + + + + id + wxgui_fftsink2_0 + + + notebook + + + + peak_hold + False + + + ref_level + 0 + + + ref_scale + 2.0 + + + fft_rate + 15 + + + samp_rate + samp_rate + + + title + FFT Plot + + + type + complex + + + win_size + + + + win + None + + + y_divs + 10 + + + y_per_div + 10 + + + + wxgui_fftsink2 + + avg_alpha + 0 + + + average + False + + + baseband_freq + 0 + + + alias + + + + comment + + + + affinity + + + + _enabled + 0 + + + fft_size + 1024 + + + freqvar + None + + + _coordinate + (712, 720) + + + _rotation + 0 + + + grid_pos + + + + id + wxgui_fftsink2_1 + + + notebook + + + + peak_hold + False + + + ref_level + 0 + + + ref_scale + 2.0 + + + fft_rate + 15 + + + samp_rate + samp_rate + + + title + FFT Plot + + + type + complex + + + win_size + + + + win + None + + + y_divs + 10 + + + y_per_div + 10 + + + + blks2_packet_decoder_0 + blocks_stream_to_tagged_stream_0 + 0 + 0 + + + blks2_packet_encoder_0 + digital_gmsk_mod_0 + 0 + 0 + + + blocks_multiply_const_vxx_0 + qtgui_time_sink_x_0 + 0 + 0 + + + blocks_multiply_const_vxx_0 + uhd_usrp_sink_0 + 0 + 0 + + + blocks_multiply_const_vxx_0 + wxgui_fftsink2_0 + 0 + 0 + + + blocks_multiply_const_vxx_0_0 + low_pass_filter_0 + 0 + 0 + + + blocks_pdu_to_tagged_stream_0 + blocks_tag_gate_0 + 0 + 0 + + + blocks_socket_pdu_0 + blocks_pdu_to_tagged_stream_0 + pdus + pdus + + + blocks_stream_to_tagged_stream_0 + blocks_tagged_stream_to_pdu_0 + 0 + 0 + + + blocks_tag_gate_0 + blks2_packet_encoder_0 + 0 + 0 + + + blocks_tagged_stream_to_pdu_0 + blocks_socket_pdu_1 + pdus + pdus + + + digital_gmsk_demod_0 + blks2_packet_decoder_0 + 0 + 0 + + + digital_gmsk_mod_0 + blocks_multiply_const_vxx_0 + 0 + 0 + + + low_pass_filter_0 + digital_gmsk_demod_0 + 0 + 0 + + + low_pass_filter_0 + qtgui_time_sink_x_1 + 0 + 0 + + + low_pass_filter_0 + wxgui_fftsink2_1 + 0 + 0 + + + uhd_usrp_source_0 + blocks_multiply_const_vxx_0_0 + 0 + 0 + + diff --git a/TestGraph/preamble.txt b/TestGraph/preamble.txt new file mode 100644 index 0000000..8be5b81 --- /dev/null +++ b/TestGraph/preamble.txt @@ -0,0 +1 @@ +1010101110101100000111010101011010010000100101010111010110000011101010101101001000010010101011101011000001110101010110100100001001010101110101100000111010101011010010000100101010111010110000011101010101101001000010010101011101011000001110101010110100100001001010101110101100000111010101011010010000100101010111010110000011101010101101001000010010101011101011000001110101010110100100001001010101110101100000111010101011010010000100101010111010110000011101010101101001000010010101011101011000001110101010110100100001001010101110101100000111010101011010010000100101010111010110000011101010101101001000010010101011101011000001110101010110100100001001010101110101100000111010101011010010000100 \ No newline at end of file diff --git a/TestGraph/top_block.py b/TestGraph/top_block.py new file mode 100644 index 0000000..a274dd8 --- /dev/null +++ b/TestGraph/top_block.py @@ -0,0 +1,297 @@ +#!/usr/bin/env python2 +# -*- coding: utf-8 -*- +################################################## +# GNU Radio Python Flow Graph +# Title: Top Block +# Generated: Thu May 31 10:12:56 2018 +################################################## + +if __name__ == '__main__': + import ctypes + import sys + if sys.platform.startswith('linux'): + try: + x11 = ctypes.cdll.LoadLibrary('libX11.so') + x11.XInitThreads() + except: + print "Warning: failed to XInitThreads()" + +from PyQt4 import Qt +from gnuradio import blocks +from gnuradio import digital +from gnuradio import eng_notation +from gnuradio import filter +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 grc_gnuradio import blks2 as grc_blks2 +from optparse import OptionParser +import sip +import sys +import time +from gnuradio import qtgui + + +class top_block(gr.top_block, Qt.QWidget): + + def __init__(self): + gr.top_block.__init__(self, "Top Block") + Qt.QWidget.__init__(self) + self.setWindowTitle("Top Block") + qtgui.util.check_set_qss() + try: + self.setWindowIcon(Qt.QIcon.fromTheme('gnuradio-grc')) + except: + pass + self.top_scroll_layout = Qt.QVBoxLayout() + self.setLayout(self.top_scroll_layout) + self.top_scroll = Qt.QScrollArea() + self.top_scroll.setFrameStyle(Qt.QFrame.NoFrame) + self.top_scroll_layout.addWidget(self.top_scroll) + self.top_scroll.setWidgetResizable(True) + self.top_widget = Qt.QWidget() + self.top_scroll.setWidget(self.top_widget) + self.top_layout = Qt.QVBoxLayout(self.top_widget) + self.top_grid_layout = Qt.QGridLayout() + self.top_layout.addLayout(self.top_grid_layout) + + self.settings = Qt.QSettings("GNU Radio", "top_block") + self.restoreGeometry(self.settings.value("geometry").toByteArray()) + + ################################################## + # Variables + ################################################## + self.samp_rate = samp_rate = 1000000 + self.samp_per_symb = samp_per_symb = 10 + + ################################################## + # Blocks + ################################################## + 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) + self.uhd_usrp_source_0.set_center_freq(2460000000, 0) + self.uhd_usrp_source_0.set_normalized_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) + self.uhd_usrp_sink_0.set_center_freq(2460000000, 0) + self.uhd_usrp_sink_0.set_normalized_gain(0.9, 0) + self.uhd_usrp_sink_0.set_antenna('TX/RX', 0) + self.qtgui_time_sink_x_1 = qtgui.time_sink_c( + 1024, #size + samp_rate, #samp_rate + "", #name + 1 #number of inputs + ) + self.qtgui_time_sink_x_1.set_update_time(0.10) + self.qtgui_time_sink_x_1.set_y_axis(-1, 1) + + self.qtgui_time_sink_x_1.set_y_label('Amplitude', "") + + self.qtgui_time_sink_x_1.enable_tags(-1, True) + self.qtgui_time_sink_x_1.set_trigger_mode(qtgui.TRIG_MODE_FREE, qtgui.TRIG_SLOPE_POS, 0.0, 0, 0, "") + self.qtgui_time_sink_x_1.enable_autoscale(False) + self.qtgui_time_sink_x_1.enable_grid(False) + self.qtgui_time_sink_x_1.enable_axis_labels(True) + self.qtgui_time_sink_x_1.enable_control_panel(False) + + if not True: + self.qtgui_time_sink_x_1.disable_legend() + + labels = ['', '', '', '', '', + '', '', '', '', ''] + widths = [1, 1, 1, 1, 1, + 1, 1, 1, 1, 1] + colors = ["blue", "red", "green", "black", "cyan", + "magenta", "yellow", "dark red", "dark green", "blue"] + styles = [1, 1, 1, 1, 1, + 1, 1, 1, 1, 1] + markers = [-1, -1, -1, -1, -1, + -1, -1, -1, -1, -1] + alphas = [1.0, 1.0, 1.0, 1.0, 1.0, + 1.0, 1.0, 1.0, 1.0, 1.0] + + for i in xrange(2): + if len(labels[i]) == 0: + if(i % 2 == 0): + self.qtgui_time_sink_x_1.set_line_label(i, "Re{{Data {0}}}".format(i/2)) + else: + self.qtgui_time_sink_x_1.set_line_label(i, "Im{{Data {0}}}".format(i/2)) + else: + self.qtgui_time_sink_x_1.set_line_label(i, labels[i]) + self.qtgui_time_sink_x_1.set_line_width(i, widths[i]) + self.qtgui_time_sink_x_1.set_line_color(i, colors[i]) + self.qtgui_time_sink_x_1.set_line_style(i, styles[i]) + self.qtgui_time_sink_x_1.set_line_marker(i, markers[i]) + self.qtgui_time_sink_x_1.set_line_alpha(i, alphas[i]) + + self._qtgui_time_sink_x_1_win = sip.wrapinstance(self.qtgui_time_sink_x_1.pyqwidget(), Qt.QWidget) + self.top_layout.addWidget(self._qtgui_time_sink_x_1_win) + self.qtgui_time_sink_x_0 = qtgui.time_sink_c( + 1024, #size + samp_rate, #samp_rate + "", #name + 1 #number of inputs + ) + self.qtgui_time_sink_x_0.set_update_time(0.10) + self.qtgui_time_sink_x_0.set_y_axis(-1, 1) + + self.qtgui_time_sink_x_0.set_y_label('Amplitude', "") + + self.qtgui_time_sink_x_0.enable_tags(-1, True) + self.qtgui_time_sink_x_0.set_trigger_mode(qtgui.TRIG_MODE_FREE, qtgui.TRIG_SLOPE_POS, 0.0, 0, 0, "") + self.qtgui_time_sink_x_0.enable_autoscale(False) + self.qtgui_time_sink_x_0.enable_grid(False) + self.qtgui_time_sink_x_0.enable_axis_labels(True) + self.qtgui_time_sink_x_0.enable_control_panel(False) + + if not True: + self.qtgui_time_sink_x_0.disable_legend() + + labels = ['', '', '', '', '', + '', '', '', '', ''] + widths = [1, 1, 1, 1, 1, + 1, 1, 1, 1, 1] + colors = ["blue", "red", "green", "black", "cyan", + "magenta", "yellow", "dark red", "dark green", "blue"] + styles = [1, 1, 1, 1, 1, + 1, 1, 1, 1, 1] + markers = [-1, -1, -1, -1, -1, + -1, -1, -1, -1, -1] + alphas = [1.0, 1.0, 1.0, 1.0, 1.0, + 1.0, 1.0, 1.0, 1.0, 1.0] + + for i in xrange(2): + if len(labels[i]) == 0: + if(i % 2 == 0): + self.qtgui_time_sink_x_0.set_line_label(i, "Re{{Data {0}}}".format(i/2)) + else: + self.qtgui_time_sink_x_0.set_line_label(i, "Im{{Data {0}}}".format(i/2)) + else: + self.qtgui_time_sink_x_0.set_line_label(i, labels[i]) + self.qtgui_time_sink_x_0.set_line_width(i, widths[i]) + self.qtgui_time_sink_x_0.set_line_color(i, colors[i]) + self.qtgui_time_sink_x_0.set_line_style(i, styles[i]) + self.qtgui_time_sink_x_0.set_line_marker(i, markers[i]) + self.qtgui_time_sink_x_0.set_line_alpha(i, alphas[i]) + + self._qtgui_time_sink_x_0_win = sip.wrapinstance(self.qtgui_time_sink_x_0.pyqwidget(), Qt.QWidget) + self.top_layout.addWidget(self._qtgui_time_sink_x_0_win) + self.low_pass_filter_0 = filter.fir_filter_ccf(1, firdes.low_pass( + 1, samp_rate, 200000, 50000, firdes.WIN_HAMMING, 6.76)) + self.digital_gmsk_mod_0 = digital.gmsk_mod( + samples_per_symbol=samp_per_symb, + bt=0.35, + verbose=False, + log=False, + ) + self.digital_gmsk_demod_0 = digital.gmsk_demod( + samples_per_symbol=samp_per_symb, + gain_mu=0.175, + mu=0.5, + omega_relative_limit=0.005, + freq_error=0.0, + verbose=False, + log=False, + ) + self.blocks_tagged_stream_to_pdu_0 = blocks.tagged_stream_to_pdu(blocks.byte_t, 'packet_len') + self.blocks_tag_gate_0 = blocks.tag_gate(gr.sizeof_char * 1, False) + self.blocks_stream_to_tagged_stream_0 = blocks.stream_to_tagged_stream(gr.sizeof_char, 1, 1, 'packet_len') + self.blocks_socket_pdu_1 = blocks.socket_pdu("UDP_CLIENT", 'localhost', '52003', 15000, False) + self.blocks_socket_pdu_0 = blocks.socket_pdu("TCP_SERVER", '', '52002', 15000, False) + self.blocks_pdu_to_tagged_stream_0 = blocks.pdu_to_tagged_stream(blocks.byte_t, 'packet_len') + self.blocks_multiply_const_vxx_0_0 = blocks.multiply_const_vcc((1, )) + self.blocks_multiply_const_vxx_0 = blocks.multiply_const_vcc((1, )) + self.blks2_packet_encoder_0 = grc_blks2.packet_mod_b(grc_blks2.packet_encoder( + samples_per_symbol=samp_per_symb, + bits_per_symbol=1, + preamble='', + access_code='', + pad_for_usrp=True, + ), + payload_length=1, + ) + self.blks2_packet_decoder_0 = grc_blks2.packet_demod_b(grc_blks2.packet_decoder( + access_code='', + threshold=-1, + callback=lambda ok, payload: self.blks2_packet_decoder_0.recv_pkt(ok, payload), + ), + ) + + ################################################## + # Connections + ################################################## + self.msg_connect((self.blocks_socket_pdu_0, 'pdus'), (self.blocks_pdu_to_tagged_stream_0, 'pdus')) + self.msg_connect((self.blocks_tagged_stream_to_pdu_0, 'pdus'), (self.blocks_socket_pdu_1, 'pdus')) + self.connect((self.blks2_packet_decoder_0, 0), (self.blocks_stream_to_tagged_stream_0, 0)) + self.connect((self.blks2_packet_encoder_0, 0), (self.digital_gmsk_mod_0, 0)) + self.connect((self.blocks_multiply_const_vxx_0, 0), (self.qtgui_time_sink_x_0, 0)) + self.connect((self.blocks_multiply_const_vxx_0, 0), (self.uhd_usrp_sink_0, 0)) + self.connect((self.blocks_multiply_const_vxx_0_0, 0), (self.low_pass_filter_0, 0)) + self.connect((self.blocks_pdu_to_tagged_stream_0, 0), (self.blocks_tag_gate_0, 0)) + self.connect((self.blocks_stream_to_tagged_stream_0, 0), (self.blocks_tagged_stream_to_pdu_0, 0)) + self.connect((self.blocks_tag_gate_0, 0), (self.blks2_packet_encoder_0, 0)) + self.connect((self.digital_gmsk_demod_0, 0), (self.blks2_packet_decoder_0, 0)) + self.connect((self.digital_gmsk_mod_0, 0), (self.blocks_multiply_const_vxx_0, 0)) + self.connect((self.low_pass_filter_0, 0), (self.digital_gmsk_demod_0, 0)) + self.connect((self.low_pass_filter_0, 0), (self.qtgui_time_sink_x_1, 0)) + self.connect((self.uhd_usrp_source_0, 0), (self.blocks_multiply_const_vxx_0_0, 0)) + + def closeEvent(self, event): + self.settings = Qt.QSettings("GNU Radio", "top_block") + self.settings.setValue("geometry", self.saveGeometry()) + event.accept() + + def get_samp_rate(self): + return self.samp_rate + + def set_samp_rate(self, samp_rate): + self.samp_rate = samp_rate + self.uhd_usrp_source_0.set_samp_rate(self.samp_rate) + self.uhd_usrp_sink_0.set_samp_rate(self.samp_rate) + self.qtgui_time_sink_x_1.set_samp_rate(self.samp_rate) + self.qtgui_time_sink_x_0.set_samp_rate(self.samp_rate) + self.low_pass_filter_0.set_taps(firdes.low_pass(1, self.samp_rate, 200000, 50000, firdes.WIN_HAMMING, 6.76)) + + def get_samp_per_symb(self): + return self.samp_per_symb + + def set_samp_per_symb(self, samp_per_symb): + self.samp_per_symb = samp_per_symb + + +def main(top_block_cls=top_block, options=None): + + from distutils.version import StrictVersion + if StrictVersion(Qt.qVersion()) >= StrictVersion("4.5.0"): + style = gr.prefs().get_string('qtgui', 'style', 'raster') + Qt.QApplication.setGraphicsSystem(style) + qapp = Qt.QApplication(sys.argv) + + tb = top_block_cls() + tb.start() + tb.show() + + def quitting(): + tb.stop() + tb.wait() + qapp.connect(qapp, Qt.SIGNAL("aboutToQuit()"), quitting) + qapp.exec_() + + +if __name__ == '__main__': + main()