From 4aea63699904613f2eedf118013084eb46a07a48 Mon Sep 17 00:00:00 2001 From: Thomas Kolb Date: Tue, 30 Jul 2019 23:49:54 +0200 Subject: [PATCH] Test flowgraphs: completed TX-RX chain Now the receiver test flowgraph can demodulate the signal generated by the TX, including synchronization, error correction and CRC checking. --- grc/hamnet70_mod_sc16qam.grc | 63 +- tmp/test_sc16qam.grc | 2121 ++++++++++++++++++++++++++++++++-- 2 files changed, 2072 insertions(+), 112 deletions(-) diff --git a/grc/hamnet70_mod_sc16qam.grc b/grc/hamnet70_mod_sc16qam.grc index 5b52eab..2f2ae91 100644 --- a/grc/hamnet70_mod_sc16qam.grc +++ b/grc/hamnet70_mod_sc16qam.grc @@ -147,7 +147,7 @@ variable_cc_encoder_def padding - False + True comment @@ -272,7 +272,7 @@ _coordinate - (816, 343) + (998, 347) _rotation @@ -602,33 +602,6 @@ 150e3 - - variable - - comment - - - - _enabled - True - - - _coordinate - (477, 20) - - - _rotation - 0 - - - id - scramble - - - value - True - - variable @@ -703,7 +676,7 @@ _coordinate - (574, 497) + (575, 499) _rotation @@ -762,7 +735,7 @@ _coordinate - (1035, 489) + (790, 491) _rotation @@ -821,7 +794,7 @@ _coordinate - (1035, 408) + (1206, 411) _rotation @@ -868,7 +841,7 @@ _coordinate - (1725, 423) + (1765, 423) _rotation @@ -927,7 +900,7 @@ _coordinate - (1437, 283) + (1525, 283) _rotation @@ -990,7 +963,7 @@ _coordinate - (1480, 489) + (1517, 491) _rotation @@ -1049,7 +1022,7 @@ _coordinate - (1480, 408) + (1509, 411) _rotation @@ -1104,7 +1077,7 @@ _coordinate - (202, 497) + (191, 499) _rotation @@ -1147,7 +1120,7 @@ _coordinate - (1237, 497) + (1389, 499) _rotation @@ -1190,7 +1163,7 @@ _coordinate - (1237, 416) + (1389, 419) _rotation @@ -1237,7 +1210,7 @@ _coordinate - (816, 408) + (998, 411) _rotation @@ -1284,7 +1257,7 @@ _coordinate - (372, 489) + (367, 491) _rotation @@ -1550,7 +1523,7 @@ _coordinate - (1940, 451) + (1972, 451) _rotation @@ -1599,14 +1572,14 @@ 0 - blocks_pdu_to_tagged_stream_0 - digital_packet_headergenerator_bb_0 + blocks_repack_bits_bb_0 + digital_map_bb_0 0 0 blocks_repack_bits_bb_0 - digital_map_bb_0 + digital_packet_headergenerator_bb_0 0 0 diff --git a/tmp/test_sc16qam.grc b/tmp/test_sc16qam.grc index b37b819..71c9608 100644 --- a/tmp/test_sc16qam.grc +++ b/tmp/test_sc16qam.grc @@ -89,6 +89,33 @@ (0,0) + + variable + + comment + + + + _enabled + True + + + _coordinate + (1725, 954) + + + _rotation + 0 + + + id + MTU + + + value + 1000 + + variable @@ -160,7 +187,7 @@ start - -50e3 + -2e3 step @@ -168,7 +195,7 @@ stop - 50e3 + 2e3 rangeType @@ -179,6 +206,92 @@ counter_slider + + variable + + comment + + + + _enabled + 1 + + + _coordinate + (726, 1114) + + + _rotation + 0 + + + id + header_format + + + value + digital.packet_header_default(64) + + + + variable_constellation_rect + + comment + + + + const_points + [1, -1] + + + _enabled + True + + + _coordinate + (854, 131) + + + _rotation + 0 + + + id + header_mod + + + imag_sect + 2 + + + real_sect + 2 + + + rot_sym + 2 + + + soft_dec_lut + None + + + precision + 8 + + + sym_map + [0, 1] + + + w_imag_sect + 1 + + + w_real_sect + 1 + + variable @@ -258,7 +371,7 @@ stop - 1 + 0.25 rangeType @@ -269,6 +382,128 @@ counter_slider + + variable_cc_decoder_def + + padding + True + + + comment + + + + k + 7 + + + dim1 + 1 + + + dim2 + 1 + + + _enabled + True + + + state_end + -1 + + + framebits + 8*(MTU+4)*2 + + + _coordinate + (2244, 1050) + + + _rotation + 0 + + + id + payload_dec + + + value + "ok" + + + ndim + 0 + + + polys + [79,109] + + + rate + 2 + + + state_start + 0 + + + mode + fec.CC_TERMINATED + + + + variable_constellation + + comment + + + + const_points + [-1-1j, -1+1j, 1+1j, 1-1j] + + + type + 16qam + + + dims + 1 + + + _enabled + True + + + _coordinate + (686, 131) + + + _rotation + 0 + + + id + payload_mod + + + rot_sym + 4 + + + soft_dec_lut + None + + + precision + 8 + + + sym_map + [0, 1, 3, 2] + + variable @@ -463,6 +698,65 @@ 150e3 + + analog_agc_xx + + alias + + + + comment + + + + affinity + + + + _enabled + True + + + _coordinate + (918, 818) + + + _rotation + 0 + + + gain + 1.0 + + + id + analog_agc_xx_0 + + + max_gain + 65536 + + + maxoutbuf + 0 + + + minoutbuf + 0 + + + rate + 1e-4 + + + reference + 1.0 + + + type + complex + + analog_sig_source_x @@ -526,6 +820,104 @@ analog.GR_COS_WAVE + + blocks_add_const_vxx + + alias + + + + comment + + + + const + -1 + + + affinity + + + + _enabled + 1 + + + _coordinate + (1637, 1321) + + + _rotation + 0 + + + id + blocks_add_const_vxx_0 + + + type + float + + + maxoutbuf + 0 + + + minoutbuf + 0 + + + vlen + 1 + + + + blocks_char_to_float + + alias + + + + comment + + + + affinity + + + + _enabled + 1 + + + _coordinate + (1477, 1321) + + + _rotation + 0 + + + id + blocks_char_to_float_0 + + + maxoutbuf + 0 + + + minoutbuf + 0 + + + scale + 0.5 + + + vlen + 1 + + blocks_complex_to_float @@ -628,11 +1020,11 @@ _enabled - 0 + 1 _coordinate - (1357, 686) + (2723, 1262) _rotation @@ -640,11 +1032,11 @@ id - blocks_message_debug_0_0 + blocks_message_debug_0 - blocks_message_strobe + blocks_message_debug alias @@ -663,7 +1055,7 @@ _coordinate - (31, 267) + (1357, 686) _rotation @@ -671,23 +1063,7 @@ id - blocks_message_strobe_0 - - - maxoutbuf - 0 - - - msg - pmt.intern("TEST") - - - minoutbuf - 0 - - - period - 10 + blocks_message_debug_0_0 @@ -742,15 +1118,19 @@ - blocks_random_pdu + blocks_repack_bits_bb + + k + payload_mod.bits_per_symbol() + + + l + 1 + alias - - mask - 0xFF - comment @@ -761,11 +1141,15 @@ _enabled - 0 + 1 + + + endianness + gr.GR_LSB_FIRST _coordinate - (191, 251) + (1277, 1313) _rotation @@ -773,28 +1157,138 @@ id - blocks_random_pdu_0 + blocks_repack_bits_bb_0 - length_modulo - 2 - - - maxsize - 1000 + len_tag_key + packet_len maxoutbuf 0 - minsize - 50 + minoutbuf + 0 + + + align_output + False + + + + blocks_repack_bits_bb + + k + 1 + + + l + 8 + + + alias + + + + comment + + + + affinity + + + + _enabled + 1 + + + endianness + gr.GR_LSB_FIRST + + + _coordinate + (2156, 1313) + + + _rotation + 0 + + + id + blocks_repack_bits_bb_0_0 + + + len_tag_key + packet_len + + + maxoutbuf + 0 minoutbuf 0 + + align_output + False + + + + blocks_tag_debug + + alias + + + + comment + + + + affinity + + + + display + True + + + _enabled + 0 + + + _coordinate + (2164, 1425) + + + _rotation + 0 + + + id + blocks_tag_debug_0 + + + type + byte + + + filter + "" + + + name + + + + num_inputs + 1 + + + vlen + 1 + blocks_tag_gate @@ -851,6 +1345,61 @@ 1 + + blocks_tagged_stream_multiply_length + + alias + + + + comment + + + + affinity + + + + _enabled + 0 + + + _coordinate + (1254, 1405) + + + _rotation + 0 + + + id + blocks_tagged_stream_multiply_length_0 + + + type + float + + + c + payload_mod.bits_per_symbol() + + + lengthtagname + packet_len + + + maxoutbuf + 0 + + + minoutbuf + 0 + + + vlen + 1 + + blocks_tagged_stream_to_pdu @@ -871,7 +1420,7 @@ _coordinate - (439, 171) + (375, 275) _rotation @@ -898,6 +1447,53 @@ 0 + + blocks_tagged_stream_to_pdu + + alias + + + + comment + + + + affinity + + + + _enabled + 1 + + + _coordinate + (2340, 1321) + + + _rotation + 0 + + + id + blocks_tagged_stream_to_pdu_1_0_0 + + + type + byte + + + tag + packet_len + + + maxoutbuf + 0 + + + minoutbuf + 0 + + blocks_throttle @@ -973,7 +1569,7 @@ _coordinate - (287, 171) + (223, 275) _rotation @@ -1024,11 +1620,11 @@ _enabled - True + 0 _coordinate - (87, 155) + (23, 259) _rotation @@ -1067,6 +1663,65 @@ [random.randint(0,255) for i in range(400)] + + blocks_vector_source_x + + alias + + + + comment + + + + affinity + + + + _enabled + True + + + _coordinate + (23, 171) + + + _rotation + 0 + + + id + blocks_vector_source_x_0_0_0 + + + maxoutbuf + 0 + + + minoutbuf + 0 + + + type + byte + + + repeat + True + + + tags + tagged_streams.make_lengthtags((256,), (0,), "packet_len") + + + vlen + 1 + + + vector + list(range(256)) + + channels_channel_model @@ -1127,7 +1782,136 @@ taps - (1.0 + 1.0j)*0.7 + [(1.0 + 1.0j)*0.7, 0.1] + + + + digital_constellation_decoder_cb + + alias + + + + comment + + + + constellation + payload_mod + + + affinity + + + + _enabled + 1 + + + _coordinate + (926, 1321) + + + _rotation + 0 + + + id + digital_constellation_decoder_cb_0 + + + maxoutbuf + 0 + + + minoutbuf + 0 + + + + digital_constellation_decoder_cb + + alias + + + + comment + + + + constellation + header_mod + + + affinity + + + + _enabled + True + + + _coordinate + (926, 1273) + + + _rotation + 0 + + + id + digital_constellation_decoder_cb_0_0 + + + maxoutbuf + 0 + + + minoutbuf + 0 + + + + digital_constellation_soft_decoder_cf + + alias + + + + comment + + + + constellation + payload_mod + + + affinity + + + + _enabled + 0 + + + _coordinate + (926, 1401) + + + _rotation + 0 + + + id + digital_constellation_soft_decoder_cf_0 + + + maxoutbuf + 0 + + + minoutbuf + 0 @@ -1185,6 +1969,175 @@ 0.995 + + digital_crc32_async_bb + + alias + + + + comment + + + + affinity + + + + _enabled + 1 + + + _coordinate + (2555, 1321) + + + _rotation + 0 + + + id + digital_crc32_async_bb_0 + + + maxoutbuf + 0 + + + minoutbuf + 0 + + + check + True + + + + digital_header_payload_demux + + alias + + + + comment + + + + affinity + + + + _enabled + True + + + _coordinate + (559, 1242) + + + _rotation + 0 + + + guard_interval + 0 + + + header_len + 64 + + + header_padding + 0 + + + id + digital_header_payload_demux_0 + + + type + complex + + + items_per_symbol + 1 + + + length_tag_key + "packet_len" + + + maxoutbuf + 0 + + + minoutbuf + 0 + + + output_symbols + False + + + samp_rate + int(sym_rate) + + + special_tags + () + + + timing_tag_key + "rx_time" + + + trigger_tag_key + "data_start" + + + + digital_packet_headerparser_b + + alias + + + + comment + + + + affinity + + + + _enabled + True + + + header_formatter + header_format + + + _coordinate + (718, 1178) + + + _rotation + 180 + + + id + digital_packet_headerparser_b_0 + + + maxoutbuf + 0 + + + minoutbuf + 0 + + digital_pfb_clock_sync_xxx @@ -1256,6 +2209,69 @@ ccf + + fec_extended_tagged_decoder + + ann + None + + + alias + + + + comment + + + + affinity + + + + decoder_list + payload_dec + + + _enabled + True + + + _coordinate + (1916, 1289) + + + _rotation + 0 + + + id + fec_extended_tagged_decoder_0 + + + lentagname + packet_len + + + mtu + 8*(MTU+4)*2 + + + maxoutbuf + 0 + + + minoutbuf + 0 + + + puncpat + '11' + + + value + fec_extended_decoder + + hamnet70_correct_phase_from_tag @@ -1276,7 +2292,7 @@ _coordinate - (1206, 794) + (686, 794) _rotation @@ -1319,7 +2335,7 @@ _coordinate - (766, 742) + (766, 710) _rotation @@ -1346,6 +2362,57 @@ preamble + + hamnet70_insert_delayed_tag + + alias + + + + comment + + + + affinity + + + + delay + len(preamble)+1 + + + _enabled + True + + + _coordinate + (255, 1258) + + + _rotation + 0 + + + id + hamnet70_insert_delayed_tag_0 + + + insert_tag + data_start + + + maxoutbuf + 0 + + + minoutbuf + 0 + + + trigger_tag + corr_est + + hamnet70_mod_sc16qam @@ -1413,7 +2480,7 @@ _coordinate - (998, 706) + (998, 674) _rotation @@ -1421,7 +2488,7 @@ i - 0.02 + 0.03 id @@ -1437,7 +2504,7 @@ p - 0.1 + 0.001 post_gain @@ -1569,7 +2636,7 @@ _coordinate - (1493, 882) + (1246, 906) gui_hint @@ -2485,11 +3552,11 @@ _enabled - True + 1 _coordinate - (1493, 778) + (1246, 802) gui_hint @@ -2854,6 +3921,373 @@ _enabled True + + _coordinate + (487, 1433) + + + gui_hint + + + + _rotation + 0 + + + grid + False + + + id + qtgui_time_sink_x_1_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 + "After Tagging" + + + nconnections + 1 + + + size + 1024 + + + srate + sym_rate + + + stemplot + False + + + tr_chan + 0 + + + tr_delay + 100/sym_rate + + + tr_level + 0.0 + + + tr_mode + qtgui.TRIG_MODE_TAG + + + tr_slope + qtgui.TRIG_SLOPE_POS + + + tr_tag + "data_start" + + + 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 + 0 + _coordinate (599, 858) @@ -3187,6 +4621,373 @@ -1 + + qtgui_time_sink_x + + autoscale + False + + + axislabels + True + + + alias + + + + comment + + + + ctrlpanel + False + + + affinity + + + + entags + True + + + _enabled + 0 + + + _coordinate + (2028, 1098) + + + gui_hint + + + + _rotation + 0 + + + grid + False + + + id + qtgui_time_sink_x_1_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 + "RX Bits" + + + nconnections + 1 + + + size + 8*(MTU+4)*2 + + + srate + sym_rate + + + stemplot + False + + + tr_chan + 0 + + + tr_delay + 100/sym_rate + + + tr_level + 0.0 + + + tr_mode + qtgui.TRIG_MODE_TAG + + + tr_slope + qtgui.TRIG_SLOPE_POS + + + tr_tag + "packet_len" + + + type + float + + + update_time + 0.10 + + + ylabel + Amplitude + + + yunit + "" + + + ymax + 1 + + + ymin + -1 + + rational_resampler_xxx @@ -3246,12 +5047,102 @@ ccc + + virtual_sink + + comment + + + + _enabled + True + + + _coordinate + (1246, 994) + + + _rotation + 0 + + + id + virtual_sink_0 + + + stream_id + synced_symbols + + + + virtual_source + + comment + + + + _enabled + True + + + _coordinate + (39, 1273) + + + _rotation + 0 + + + id + virtual_source_0 + + + stream_id + synced_symbols + + + + analog_agc_xx_0 + qtgui_const_sink_x_0 + 0 + 0 + + + analog_agc_xx_0 + qtgui_time_sink_x_1 + 0 + 0 + + + analog_agc_xx_0 + virtual_sink_0 + 0 + 0 + analog_sig_source_x_0 blocks_multiply_xx_0 0 1 + + blocks_add_const_vxx_0 + fec_extended_tagged_decoder_0 + 0 + 0 + + + blocks_add_const_vxx_0 + qtgui_time_sink_x_1_1 + 0 + 0 + + + blocks_char_to_float_0 + blocks_add_const_vxx_0 + 0 + 0 + blocks_complex_to_float_0 qtgui_time_sink_x_0 @@ -3270,12 +5161,6 @@ 0 0 - - blocks_message_strobe_0 - blocks_random_pdu_0 - strobe - generate - blocks_multiply_xx_0 digital_corr_est_cc_0 @@ -3283,10 +5168,16 @@ 0 - blocks_random_pdu_0 - hamnet70_mod_sc16qam_0 - pdus - packet_in + blocks_repack_bits_bb_0 + blocks_char_to_float_0 + 0 + 0 + + + blocks_repack_bits_bb_0_0 + blocks_tagged_stream_to_pdu_1_0_0 + 0 + 0 blocks_tag_gate_0 @@ -3294,12 +5185,30 @@ 0 0 + + blocks_tagged_stream_multiply_length_0 + fec_extended_tagged_decoder_0 + 0 + 0 + + + blocks_tagged_stream_multiply_length_0 + qtgui_time_sink_x_1_1 + 0 + 0 + blocks_tagged_stream_to_pdu_0 hamnet70_mod_sc16qam_0 pdus packet_in + + blocks_tagged_stream_to_pdu_1_0_0 + digital_crc32_async_bb_0 + pdus + in + blocks_throttle_0 blocks_tag_gate_0 @@ -3324,6 +5233,12 @@ 0 0 + + blocks_vector_source_x_0_0_0 + blocks_throttle_0_0 + 0 + 0 + channels_channel_model_0 blocks_multiply_xx_0 @@ -3336,6 +5251,24 @@ 0 0 + + digital_constellation_decoder_cb_0 + blocks_repack_bits_bb_0 + 0 + 0 + + + digital_constellation_decoder_cb_0_0 + digital_packet_headerparser_b_0 + 0 + 0 + + + digital_constellation_soft_decoder_cf_0 + blocks_tagged_stream_multiply_length_0 + 0 + 0 + digital_corr_est_cc_0 blocks_complex_to_float_0 @@ -3354,6 +5287,36 @@ 0 0 + + digital_crc32_async_bb_0 + blocks_message_debug_0 + out + print_pdu + + + digital_header_payload_demux_0 + digital_constellation_decoder_cb_0_0 + 0 + 0 + + + digital_header_payload_demux_0 + digital_constellation_decoder_cb_0 + 1 + 0 + + + digital_header_payload_demux_0 + digital_constellation_soft_decoder_cf_0 + 1 + 0 + + + digital_packet_headerparser_b_0 + digital_header_payload_demux_0 + header_data + header_data + digital_pfb_clock_sync_xxx_0 hamnet70_correct_phase_from_tag_0 @@ -3373,14 +5336,20 @@ 0 - hamnet70_correct_phase_from_tag_0 - qtgui_const_sink_x_0 + fec_extended_tagged_decoder_0 + blocks_repack_bits_bb_0_0 + 0 + 0 + + + fec_extended_tagged_decoder_0 + blocks_tag_debug_0 0 0 hamnet70_correct_phase_from_tag_0 - qtgui_time_sink_x_1 + analog_agc_xx_0 0 0 @@ -3390,6 +5359,18 @@ 0 0 + + hamnet70_insert_delayed_tag_0 + digital_header_payload_demux_0 + 0 + 0 + + + hamnet70_insert_delayed_tag_0 + qtgui_time_sink_x_1_0 + 0 + 0 + hamnet70_mod_sc16qam_0 blocks_throttle_0 @@ -3414,4 +5395,10 @@ 0 0 + + virtual_source_0 + hamnet70_insert_delayed_tag_0 + 0 + 0 +