diff options
author | Tom Rondeau <tom@trondeau.com> | 2015-09-22 15:06:30 -0400 |
---|---|---|
committer | Tom Rondeau <tom@trondeau.com> | 2015-09-22 15:06:30 -0400 |
commit | aa47616d7569f3ad00b38e39d71e3364efd123b3 (patch) | |
tree | 36f02912cde7d7c07a1534dae60ec847618f6343 | |
parent | fa027dd7040dff34835052b1d19326d2e8aa3bf3 (diff) |
fec: polar: moving polar codes into ::code:: namespace like the others.
-rw-r--r-- | gr-fec/doc/fec.dox | 3 | ||||
-rw-r--r-- | gr-fec/examples/polar_code_example.grc | 1561 | ||||
-rw-r--r-- | gr-fec/include/gnuradio/fec/polar_common.h | 52 | ||||
-rw-r--r-- | gr-fec/include/gnuradio/fec/polar_decoder_common.h | 41 | ||||
-rw-r--r-- | gr-fec/include/gnuradio/fec/polar_decoder_sc.h | 38 | ||||
-rw-r--r-- | gr-fec/include/gnuradio/fec/polar_decoder_sc_list.h | 49 | ||||
-rw-r--r-- | gr-fec/include/gnuradio/fec/polar_encoder.h | 57 | ||||
-rw-r--r-- | gr-fec/lib/polar_common.cc | 18 | ||||
-rw-r--r-- | gr-fec/lib/polar_decoder_common.cc | 16 | ||||
-rw-r--r-- | gr-fec/lib/polar_decoder_sc.cc | 30 | ||||
-rw-r--r-- | gr-fec/lib/polar_decoder_sc_list.cc | 26 | ||||
-rw-r--r-- | gr-fec/lib/polar_encoder.cc | 30 | ||||
-rw-r--r-- | gr-fec/lib/scl_list.cc | 17 | ||||
-rw-r--r-- | gr-fec/lib/scl_list.h | 10 |
14 files changed, 1769 insertions, 179 deletions
diff --git a/gr-fec/doc/fec.dox b/gr-fec/doc/fec.dox index 5a3d12d14e..1c50c81ddc 100644 --- a/gr-fec/doc/fec.dox +++ b/gr-fec/doc/fec.dox @@ -233,11 +233,14 @@ Coders: \li gr::fec::code::repetition_encoder \li gr::fec::code::cc_encoder \li gr::fec::code::ccsds_encoder +\li gr::fec::code::polar_encoder Decoders: \li gr::fec::code::dummy_decoder \li gr::fec::code::repetition_decoder \li gr::fec::code::cc_decoder +\li gr::fec::code::polar_decoder_sc +\li gr::fec::code::polar_decoder_sc_list When building a new FECAPI encoder or decoder variable, the dummy diff --git a/gr-fec/examples/polar_code_example.grc b/gr-fec/examples/polar_code_example.grc index 6ea290c6ca..1aa1e85a02 100644 --- a/gr-fec/examples/polar_code_example.grc +++ b/gr-fec/examples/polar_code_example.grc @@ -85,7 +85,7 @@ </param> <param> <key>_coordinate</key> - <value>(312, 219)</value> + <value>(192, 11)</value> </param> <param> <key>_rotation</key> @@ -112,7 +112,7 @@ </param> <param> <key>_coordinate</key> - <value>(312, 283)</value> + <value>(192, 75)</value> </param> <param> <key>_rotation</key> @@ -128,6 +128,69 @@ </param> </block> <block> + <key>variable_qtgui_range</key> + <param> + <key>comment</key> + <value></value> + </param> + <param> + <key>value</key> + <value>0.1</value> + </param> + <param> + <key>_enabled</key> + <value>True</value> + </param> + <param> + <key>_coordinate</key> + <value>(24, 283)</value> + </param> + <param> + <key>gui_hint</key> + <value>0,0,1,2</value> + </param> + <param> + <key>_rotation</key> + <value>0</value> + </param> + <param> + <key>id</key> + <value>noise</value> + </param> + <param> + <key>label</key> + <value>Noive Voltage</value> + </param> + <param> + <key>min_len</key> + <value>200</value> + </param> + <param> + <key>orient</key> + <value>Qt.Horizontal</value> + </param> + <param> + <key>start</key> + <value>0</value> + </param> + <param> + <key>step</key> + <value>0.01</value> + </param> + <param> + <key>stop</key> + <value>2</value> + </param> + <param> + <key>rangeType</key> + <value>float</value> + </param> + <param> + <key>widget</key> + <value>counter_slider</value> + </param> + </block> + <block> <key>variable_polar_code_configurator</key> <param> <key>num_info_bits</key> @@ -151,7 +214,7 @@ </param> <param> <key>_coordinate</key> - <value>(416, 219)</value> + <value>(296, 11)</value> </param> <param> <key>_rotation</key> @@ -206,7 +269,7 @@ </param> <param> <key>_coordinate</key> - <value>(792, 219)</value> + <value>(680, 11)</value> </param> <param> <key>_rotation</key> @@ -257,7 +320,7 @@ </param> <param> <key>_coordinate</key> - <value>(624, 219)</value> + <value>(504, 11)</value> </param> <param> <key>_rotation</key> @@ -312,7 +375,7 @@ </param> <param> <key>_coordinate</key> - <value>(712, 11)</value> + <value>(896, 11)</value> </param> <param> <key>_rotation</key> @@ -359,6 +422,124 @@ </param> </block> <block> + <key>analog_fastnoise_source_x</key> + <param> + <key>amp</key> + <value>noise</value> + </param> + <param> + <key>alias</key> + <value></value> + </param> + <param> + <key>comment</key> + <value></value> + </param> + <param> + <key>affinity</key> + <value></value> + </param> + <param> + <key>_enabled</key> + <value>True</value> + </param> + <param> + <key>_coordinate</key> + <value>(16, 411)</value> + </param> + <param> + <key>_rotation</key> + <value>0</value> + </param> + <param> + <key>id</key> + <value>analog_fastnoise_source_x_0</value> + </param> + <param> + <key>maxoutbuf</key> + <value>0</value> + </param> + <param> + <key>minoutbuf</key> + <value>0</value> + </param> + <param> + <key>noise_type</key> + <value>analog.GR_GAUSSIAN</value> + </param> + <param> + <key>type</key> + <value>short</value> + </param> + <param> + <key>seed</key> + <value>0</value> + </param> + <param> + <key>samples</key> + <value>8192</value> + </param> + </block> + <block> + <key>analog_fastnoise_source_x</key> + <param> + <key>amp</key> + <value>noise</value> + </param> + <param> + <key>alias</key> + <value></value> + </param> + <param> + <key>comment</key> + <value></value> + </param> + <param> + <key>affinity</key> + <value></value> + </param> + <param> + <key>_enabled</key> + <value>True</value> + </param> + <param> + <key>_coordinate</key> + <value>(224, 907)</value> + </param> + <param> + <key>_rotation</key> + <value>0</value> + </param> + <param> + <key>id</key> + <value>analog_fastnoise_source_x_0_0</value> + </param> + <param> + <key>maxoutbuf</key> + <value>0</value> + </param> + <param> + <key>minoutbuf</key> + <value>0</value> + </param> + <param> + <key>noise_type</key> + <value>analog.GR_GAUSSIAN</value> + </param> + <param> + <key>type</key> + <value>short</value> + </param> + <param> + <key>seed</key> + <value>0</value> + </param> + <param> + <key>samples</key> + <value>8192</value> + </param> + </block> + <block> <key>analog_random_source_x</key> <param> <key>alias</key> @@ -378,7 +559,7 @@ </param> <param> <key>_coordinate</key> - <value>(264, 371)</value> + <value>(24, 171)</value> </param> <param> <key>_rotation</key> @@ -418,6 +599,108 @@ </param> </block> <block> + <key>blocks_add_xx</key> + <param> + <key>alias</key> + <value></value> + </param> + <param> + <key>comment</key> + <value></value> + </param> + <param> + <key>affinity</key> + <value></value> + </param> + <param> + <key>_enabled</key> + <value>True</value> + </param> + <param> + <key>_coordinate</key> + <value>(480, 393)</value> + </param> + <param> + <key>_rotation</key> + <value>0</value> + </param> + <param> + <key>id</key> + <value>blocks_add_xx_0</value> + </param> + <param> + <key>type</key> + <value>short</value> + </param> + <param> + <key>maxoutbuf</key> + <value>0</value> + </param> + <param> + <key>minoutbuf</key> + <value>0</value> + </param> + <param> + <key>num_inputs</key> + <value>2</value> + </param> + <param> + <key>vlen</key> + <value>1</value> + </param> + </block> + <block> + <key>blocks_add_xx</key> + <param> + <key>alias</key> + <value></value> + </param> + <param> + <key>comment</key> + <value></value> + </param> + <param> + <key>affinity</key> + <value></value> + </param> + <param> + <key>_enabled</key> + <value>True</value> + </param> + <param> + <key>_coordinate</key> + <value>(480, 897)</value> + </param> + <param> + <key>_rotation</key> + <value>0</value> + </param> + <param> + <key>id</key> + <value>blocks_add_xx_0_0</value> + </param> + <param> + <key>type</key> + <value>short</value> + </param> + <param> + <key>maxoutbuf</key> + <value>0</value> + </param> + <param> + <key>minoutbuf</key> + <value>0</value> + </param> + <param> + <key>num_inputs</key> + <value>2</value> + </param> + <param> + <key>vlen</key> + <value>1</value> + </param> + </block> + <block> <key>blocks_char_to_float</key> <param> <key>alias</key> @@ -437,7 +720,7 @@ </param> <param> <key>_coordinate</key> - <value>(704, 427)</value> + <value>(1096, 507)</value> </param> <param> <key>_rotation</key> @@ -484,7 +767,54 @@ </param> <param> <key>_coordinate</key> - <value>(704, 395)</value> + <value>(448, 675)</value> + </param> + <param> + <key>_rotation</key> + <value>0</value> + </param> + <param> + <key>id</key> + <value>blocks_char_to_float_0_0</value> + </param> + <param> + <key>maxoutbuf</key> + <value>0</value> + </param> + <param> + <key>minoutbuf</key> + <value>0</value> + </param> + <param> + <key>scale</key> + <value>1.0</value> + </param> + <param> + <key>vlen</key> + <value>1</value> + </param> + </block> + <block> + <key>blocks_char_to_float</key> + <param> + <key>alias</key> + <value></value> + </param> + <param> + <key>comment</key> + <value></value> + </param> + <param> + <key>affinity</key> + <value></value> + </param> + <param> + <key>_enabled</key> + <value>True</value> + </param> + <param> + <key>_coordinate</key> + <value>(1096, 451)</value> </param> <param> <key>_rotation</key> @@ -531,7 +861,54 @@ </param> <param> <key>_coordinate</key> - <value>(192, 603)</value> + <value>(552, 635)</value> + </param> + <param> + <key>_rotation</key> + <value>0</value> + </param> + <param> + <key>id</key> + <value>blocks_char_to_float_0_1_0</value> + </param> + <param> + <key>maxoutbuf</key> + <value>0</value> + </param> + <param> + <key>minoutbuf</key> + <value>0</value> + </param> + <param> + <key>scale</key> + <value>1.0</value> + </param> + <param> + <key>vlen</key> + <value>1</value> + </param> + </block> + <block> + <key>blocks_char_to_float</key> + <param> + <key>alias</key> + <value></value> + </param> + <param> + <key>comment</key> + <value></value> + </param> + <param> + <key>affinity</key> + <value></value> + </param> + <param> + <key>_enabled</key> + <value>True</value> + </param> + <param> + <key>_coordinate</key> + <value>(488, 507)</value> </param> <param> <key>_rotation</key> @@ -559,6 +936,92 @@ </param> </block> <block> + <key>blocks_char_to_short</key> + <param> + <key>alias</key> + <value></value> + </param> + <param> + <key>comment</key> + <value></value> + </param> + <param> + <key>affinity</key> + <value></value> + </param> + <param> + <key>_enabled</key> + <value>True</value> + </param> + <param> + <key>_coordinate</key> + <value>(296, 385)</value> + </param> + <param> + <key>_rotation</key> + <value>0</value> + </param> + <param> + <key>id</key> + <value>blocks_char_to_short_0</value> + </param> + <param> + <key>maxoutbuf</key> + <value>0</value> + </param> + <param> + <key>minoutbuf</key> + <value>0</value> + </param> + <param> + <key>vlen</key> + <value>1</value> + </param> + </block> + <block> + <key>blocks_char_to_short</key> + <param> + <key>alias</key> + <value></value> + </param> + <param> + <key>comment</key> + <value></value> + </param> + <param> + <key>affinity</key> + <value></value> + </param> + <param> + <key>_enabled</key> + <value>True</value> + </param> + <param> + <key>_coordinate</key> + <value>(256, 865)</value> + </param> + <param> + <key>_rotation</key> + <value>0</value> + </param> + <param> + <key>id</key> + <value>blocks_char_to_short_0_0</value> + </param> + <param> + <key>maxoutbuf</key> + <value>0</value> + </param> + <param> + <key>minoutbuf</key> + <value>0</value> + </param> + <param> + <key>vlen</key> + <value>1</value> + </param> + </block> + <block> <key>blocks_pack_k_bits_bb</key> <param> <key>alias</key> @@ -578,7 +1041,7 @@ </param> <param> <key>_coordinate</key> - <value>(560, 603)</value> + <value>(912, 507)</value> </param> <param> <key>_rotation</key> @@ -602,6 +1065,135 @@ </param> </block> <block> + <key>blocks_pack_k_bits_bb</key> + <param> + <key>alias</key> + <value></value> + </param> + <param> + <key>comment</key> + <value></value> + </param> + <param> + <key>affinity</key> + <value></value> + </param> + <param> + <key>_enabled</key> + <value>True</value> + </param> + <param> + <key>_coordinate</key> + <value>(464, 827)</value> + </param> + <param> + <key>_rotation</key> + <value>180</value> + </param> + <param> + <key>id</key> + <value>blocks_pack_k_bits_bb_0_0</value> + </param> + <param> + <key>k</key> + <value>8</value> + </param> + <param> + <key>maxoutbuf</key> + <value>0</value> + </param> + <param> + <key>minoutbuf</key> + <value>0</value> + </param> + </block> + <block> + <key>blocks_short_to_char</key> + <param> + <key>alias</key> + <value></value> + </param> + <param> + <key>comment</key> + <value></value> + </param> + <param> + <key>affinity</key> + <value></value> + </param> + <param> + <key>_enabled</key> + <value>True</value> + </param> + <param> + <key>_coordinate</key> + <value>(608, 401)</value> + </param> + <param> + <key>_rotation</key> + <value>0</value> + </param> + <param> + <key>id</key> + <value>blocks_short_to_char_0</value> + </param> + <param> + <key>maxoutbuf</key> + <value>0</value> + </param> + <param> + <key>minoutbuf</key> + <value>0</value> + </param> + <param> + <key>vlen</key> + <value>1</value> + </param> + </block> + <block> + <key>blocks_short_to_char</key> + <param> + <key>alias</key> + <value></value> + </param> + <param> + <key>comment</key> + <value></value> + </param> + <param> + <key>affinity</key> + <value></value> + </param> + <param> + <key>_enabled</key> + <value>True</value> + </param> + <param> + <key>_coordinate</key> + <value>(592, 913)</value> + </param> + <param> + <key>_rotation</key> + <value>0</value> + </param> + <param> + <key>id</key> + <value>blocks_short_to_char_0_0</value> + </param> + <param> + <key>maxoutbuf</key> + <value>0</value> + </param> + <param> + <key>minoutbuf</key> + <value>0</value> + </param> + <param> + <key>vlen</key> + <value>1</value> + </param> + </block> + <block> <key>blocks_unpack_k_bits_bb</key> <param> <key>alias</key> @@ -621,7 +1213,7 @@ </param> <param> <key>_coordinate</key> - <value>(184, 499)</value> + <value>(240, 227)</value> </param> <param> <key>_rotation</key> @@ -664,7 +1256,7 @@ </param> <param> <key>_coordinate</key> - <value>(80, 603)</value> + <value>(344, 507)</value> </param> <param> <key>_rotation</key> @@ -715,7 +1307,7 @@ </param> <param> <key>_coordinate</key> - <value>(704, 577)</value> + <value>(824, 201)</value> </param> <param> <key>_rotation</key> @@ -739,6 +1331,57 @@ </param> </block> <block> + <key>fec_ber_bf</key> + <param> + <key>berlimit</key> + <value>-7.0</value> + </param> + <param> + <key>berminerrors</key> + <value>10000</value> + </param> + <param> + <key>alias</key> + <value></value> + </param> + <param> + <key>comment</key> + <value></value> + </param> + <param> + <key>affinity</key> + <value></value> + </param> + <param> + <key>_enabled</key> + <value>True</value> + </param> + <param> + <key>_coordinate</key> + <value>(264, 745)</value> + </param> + <param> + <key>_rotation</key> + <value>0</value> + </param> + <param> + <key>id</key> + <value>fec_ber_bf_0_0</value> + </param> + <param> + <key>maxoutbuf</key> + <value>0</value> + </param> + <param> + <key>minoutbuf</key> + <value>0</value> + </param> + <param> + <key>test_mode</key> + <value>False</value> + </param> + </block> + <block> <key>fec_extended_decoder</key> <param> <key>ann</key> @@ -766,7 +1409,7 @@ </param> <param> <key>_coordinate</key> - <value>(328, 579)</value> + <value>(656, 483)</value> </param> <param> <key>_rotation</key> @@ -821,7 +1464,7 @@ </param> <param> <key>_coordinate</key> - <value>(328, 483)</value> + <value>(424, 275)</value> </param> <param> <key>_rotation</key> @@ -876,11 +1519,11 @@ </param> <param> <key>_coordinate</key> - <value>(848, 571)</value> + <value>(1016, 187)</value> </param> <param> <key>gui_hint</key> - <value></value> + <value>2,0,1,1</value> </param> <param> <key>_rotation</key> @@ -908,7 +1551,7 @@ </param> <param> <key>label1</key> - <value></value> + <value>BER</value> </param> <param> <key>unit1</key> @@ -1068,7 +1711,238 @@ </param> <param> <key>name</key> - <value>""</value> + <value>Coded</value> + </param> + <param> + <key>nconnections</key> + <value>1</value> + </param> + <param> + <key>update_time</key> + <value>0.10</value> + </param> + </block> + <block> + <key>qtgui_number_sink</key> + <param> + <key>autoscale</key> + <value>False</value> + </param> + <param> + <key>avg</key> + <value>0</value> + </param> + <param> + <key>alias</key> + <value></value> + </param> + <param> + <key>comment</key> + <value></value> + </param> + <param> + <key>affinity</key> + <value></value> + </param> + <param> + <key>_enabled</key> + <value>True</value> + </param> + <param> + <key>_coordinate</key> + <value>(448, 731)</value> + </param> + <param> + <key>gui_hint</key> + <value>2,1,1,1</value> + </param> + <param> + <key>_rotation</key> + <value>0</value> + </param> + <param> + <key>graph_type</key> + <value>qtgui.NUM_GRAPH_HORIZ</value> + </param> + <param> + <key>id</key> + <value>qtgui_number_sink_0_0</value> + </param> + <param> + <key>type</key> + <value>float</value> + </param> + <param> + <key>color1</key> + <value>("black", "black")</value> + </param> + <param> + <key>factor1</key> + <value>1</value> + </param> + <param> + <key>label1</key> + <value>BER</value> + </param> + <param> + <key>unit1</key> + <value></value> + </param> + <param> + <key>color10</key> + <value>("black", "black")</value> + </param> + <param> + <key>factor10</key> + <value>1</value> + </param> + <param> + <key>label10</key> + <value></value> + </param> + <param> + <key>unit10</key> + <value></value> + </param> + <param> + <key>color2</key> + <value>("black", "black")</value> + </param> + <param> + <key>factor2</key> + <value>1</value> + </param> + <param> + <key>label2</key> + <value></value> + </param> + <param> + <key>unit2</key> + <value></value> + </param> + <param> + <key>color3</key> + <value>("black", "black")</value> + </param> + <param> + <key>factor3</key> + <value>1</value> + </param> + <param> + <key>label3</key> + <value></value> + </param> + <param> + <key>unit3</key> + <value></value> + </param> + <param> + <key>color4</key> + <value>("black", "black")</value> + </param> + <param> + <key>factor4</key> + <value>1</value> + </param> + <param> + <key>label4</key> + <value></value> + </param> + <param> + <key>unit4</key> + <value></value> + </param> + <param> + <key>color5</key> + <value>("black", "black")</value> + </param> + <param> + <key>factor5</key> + <value>1</value> + </param> + <param> + <key>label5</key> + <value></value> + </param> + <param> + <key>unit5</key> + <value></value> + </param> + <param> + <key>color6</key> + <value>("black", "black")</value> + </param> + <param> + <key>factor6</key> + <value>1</value> + </param> + <param> + <key>label6</key> + <value></value> + </param> + <param> + <key>unit6</key> + <value></value> + </param> + <param> + <key>color7</key> + <value>("black", "black")</value> + </param> + <param> + <key>factor7</key> + <value>1</value> + </param> + <param> + <key>label7</key> + <value></value> + </param> + <param> + <key>unit7</key> + <value></value> + </param> + <param> + <key>color8</key> + <value>("black", "black")</value> + </param> + <param> + <key>factor8</key> + <value>1</value> + </param> + <param> + <key>label8</key> + <value></value> + </param> + <param> + <key>unit8</key> + <value></value> + </param> + <param> + <key>color9</key> + <value>("black", "black")</value> + </param> + <param> + <key>factor9</key> + <value>1</value> + </param> + <param> + <key>label9</key> + <value></value> + </param> + <param> + <key>unit9</key> + <value></value> + </param> + <param> + <key>max</key> + <value>0</value> + </param> + <param> + <key>min</key> + <value>-10</value> + </param> + <param> + <key>name</key> + <value>Uncoded</value> </param> <param> <key>nconnections</key> @@ -1111,11 +1985,11 @@ </param> <param> <key>_coordinate</key> - <value>(840, 395)</value> + <value>(1288, 459)</value> </param> <param> <key>gui_hint</key> - <value></value> + <value>1,0,1,1</value> </param> <param> <key>_rotation</key> @@ -1143,7 +2017,7 @@ </param> <param> <key>label1</key> - <value></value> + <value>Transmitted</value> </param> <param> <key>marker1</key> @@ -1191,7 +2065,7 @@ </param> <param> <key>label2</key> - <value></value> + <value>Received</value> </param> <param> <key>marker2</key> @@ -1375,15 +2249,374 @@ </param> <param> <key>name</key> + <value>Coded</value> + </param> + <param> + <key>nconnections</key> + <value>2</value> + </param> + <param> + <key>size</key> + <value>1024</value> + </param> + <param> + <key>srate</key> + <value>samp_rate</value> + </param> + <param> + <key>tr_chan</key> + <value>0</value> + </param> + <param> + <key>tr_delay</key> + <value>0</value> + </param> + <param> + <key>tr_level</key> + <value>0.0</value> + </param> + <param> + <key>tr_mode</key> + <value>qtgui.TRIG_MODE_FREE</value> + </param> + <param> + <key>tr_slope</key> + <value>qtgui.TRIG_SLOPE_POS</value> + </param> + <param> + <key>tr_tag</key> + <value>""</value> + </param> + <param> + <key>type</key> + <value>float</value> + </param> + <param> + <key>update_time</key> + <value>0.10</value> + </param> + <param> + <key>ylabel</key> + <value>Amplitude</value> + </param> + <param> + <key>yunit</key> <value>""</value> </param> <param> + <key>ymax</key> + <value>0</value> + </param> + <param> + <key>ymin</key> + <value>-10</value> + </param> + </block> + <block> + <key>qtgui_time_sink_x</key> + <param> + <key>autoscale</key> + <value>True</value> + </param> + <param> + <key>alias</key> + <value></value> + </param> + <param> + <key>comment</key> + <value></value> + </param> + <param> + <key>ctrlpanel</key> + <value>False</value> + </param> + <param> + <key>affinity</key> + <value></value> + </param> + <param> + <key>entags</key> + <value>True</value> + </param> + <param> + <key>_enabled</key> + <value>True</value> + </param> + <param> + <key>_coordinate</key> + <value>(736, 643)</value> + </param> + <param> + <key>gui_hint</key> + <value>1,1,1,1</value> + </param> + <param> + <key>_rotation</key> + <value>0</value> + </param> + <param> + <key>grid</key> + <value>False</value> + </param> + <param> + <key>id</key> + <value>qtgui_time_sink_x_0_0</value> + </param> + <param> + <key>legend</key> + <value>True</value> + </param> + <param> + <key>alpha1</key> + <value>1.0</value> + </param> + <param> + <key>color1</key> + <value>"blue"</value> + </param> + <param> + <key>label1</key> + <value>Transmitted</value> + </param> + <param> + <key>marker1</key> + <value>-1</value> + </param> + <param> + <key>style1</key> + <value>1</value> + </param> + <param> + <key>width1</key> + <value>1</value> + </param> + <param> + <key>alpha10</key> + <value>1.0</value> + </param> + <param> + <key>color10</key> + <value>"blue"</value> + </param> + <param> + <key>label10</key> + <value></value> + </param> + <param> + <key>marker10</key> + <value>-1</value> + </param> + <param> + <key>style10</key> + <value>1</value> + </param> + <param> + <key>width10</key> + <value>1</value> + </param> + <param> + <key>alpha2</key> + <value>1.0</value> + </param> + <param> + <key>color2</key> + <value>"red"</value> + </param> + <param> + <key>label2</key> + <value>Received</value> + </param> + <param> + <key>marker2</key> + <value>-1</value> + </param> + <param> + <key>style2</key> + <value>1</value> + </param> + <param> + <key>width2</key> + <value>1</value> + </param> + <param> + <key>alpha3</key> + <value>1.0</value> + </param> + <param> + <key>color3</key> + <value>"green"</value> + </param> + <param> + <key>label3</key> + <value></value> + </param> + <param> + <key>marker3</key> + <value>-1</value> + </param> + <param> + <key>style3</key> + <value>1</value> + </param> + <param> + <key>width3</key> + <value>1</value> + </param> + <param> + <key>alpha4</key> + <value>1.0</value> + </param> + <param> + <key>color4</key> + <value>"black"</value> + </param> + <param> + <key>label4</key> + <value></value> + </param> + <param> + <key>marker4</key> + <value>-1</value> + </param> + <param> + <key>style4</key> + <value>1</value> + </param> + <param> + <key>width4</key> + <value>1</value> + </param> + <param> + <key>alpha5</key> + <value>1.0</value> + </param> + <param> + <key>color5</key> + <value>"cyan"</value> + </param> + <param> + <key>label5</key> + <value></value> + </param> + <param> + <key>marker5</key> + <value>-1</value> + </param> + <param> + <key>style5</key> + <value>1</value> + </param> + <param> + <key>width5</key> + <value>1</value> + </param> + <param> + <key>alpha6</key> + <value>1.0</value> + </param> + <param> + <key>color6</key> + <value>"magenta"</value> + </param> + <param> + <key>label6</key> + <value></value> + </param> + <param> + <key>marker6</key> + <value>-1</value> + </param> + <param> + <key>style6</key> + <value>1</value> + </param> + <param> + <key>width6</key> + <value>1</value> + </param> + <param> + <key>alpha7</key> + <value>1.0</value> + </param> + <param> + <key>color7</key> + <value>"yellow"</value> + </param> + <param> + <key>label7</key> + <value></value> + </param> + <param> + <key>marker7</key> + <value>-1</value> + </param> + <param> + <key>style7</key> + <value>1</value> + </param> + <param> + <key>width7</key> + <value>1</value> + </param> + <param> + <key>alpha8</key> + <value>1.0</value> + </param> + <param> + <key>color8</key> + <value>"dark red"</value> + </param> + <param> + <key>label8</key> + <value></value> + </param> + <param> + <key>marker8</key> + <value>-1</value> + </param> + <param> + <key>style8</key> + <value>1</value> + </param> + <param> + <key>width8</key> + <value>1</value> + </param> + <param> + <key>alpha9</key> + <value>1.0</value> + </param> + <param> + <key>color9</key> + <value>"dark green"</value> + </param> + <param> + <key>label9</key> + <value></value> + </param> + <param> + <key>marker9</key> + <value>-1</value> + </param> + <param> + <key>style9</key> + <value>1</value> + </param> + <param> + <key>width9</key> + <value>1</value> + </param> + <param> + <key>name</key> + <value>Uncoded</value> + </param> + <param> <key>nconnections</key> <value>2</value> </param> <param> <key>size</key> - <value>2048</value> + <value>1024</value> </param> <param> <key>srate</key> @@ -1438,11 +2671,179 @@ <value>-1</value> </param> </block> + <block> + <key>virtual_sink</key> + <param> + <key>comment</key> + <value></value> + </param> + <param> + <key>_enabled</key> + <value>True</value> + </param> + <param> + <key>_coordinate</key> + <value>(240, 155)</value> + </param> + <param> + <key>_rotation</key> + <value>0</value> + </param> + <param> + <key>id</key> + <value>virtual_sink_0</value> + </param> + <param> + <key>stream_id</key> + <value>input_packed</value> + </param> + </block> + <block> + <key>virtual_sink</key> + <param> + <key>comment</key> + <value></value> + </param> + <param> + <key>_enabled</key> + <value>True</value> + </param> + <param> + <key>_coordinate</key> + <value>(424, 227)</value> + </param> + <param> + <key>_rotation</key> + <value>0</value> + </param> + <param> + <key>id</key> + <value>virtual_sink_0_0</value> + </param> + <param> + <key>stream_id</key> + <value>input_unpacked</value> + </param> + </block> + <block> + <key>virtual_source</key> + <param> + <key>comment</key> + <value></value> + </param> + <param> + <key>_enabled</key> + <value>True</value> + </param> + <param> + <key>_coordinate</key> + <value>(32, 739)</value> + </param> + <param> + <key>_rotation</key> + <value>0</value> + </param> + <param> + <key>id</key> + <value>virtual_source_0</value> + </param> + <param> + <key>stream_id</key> + <value>input_packed</value> + </param> + </block> + <block> + <key>virtual_source</key> + <param> + <key>comment</key> + <value></value> + </param> + <param> + <key>_enabled</key> + <value>True</value> + </param> + <param> + <key>_coordinate</key> + <value>(1080, 395)</value> + </param> + <param> + <key>_rotation</key> + <value>180</value> + </param> + <param> + <key>id</key> + <value>virtual_source_0_0</value> + </param> + <param> + <key>stream_id</key> + <value>input_packed</value> + </param> + </block> + <block> + <key>virtual_source</key> + <param> + <key>comment</key> + <value></value> + </param> + <param> + <key>_enabled</key> + <value>True</value> + </param> + <param> + <key>_coordinate</key> + <value>(504, 587)</value> + </param> + <param> + <key>_rotation</key> + <value>180</value> + </param> + <param> + <key>id</key> + <value>virtual_source_0_0_0</value> + </param> + <param> + <key>stream_id</key> + <value>input_packed</value> + </param> + </block> + <block> + <key>virtual_source</key> + <param> + <key>comment</key> + <value></value> + </param> + <param> + <key>_enabled</key> + <value>True</value> + </param> + <param> + <key>_coordinate</key> + <value>(8, 827)</value> + </param> + <param> + <key>_rotation</key> + <value>0</value> + </param> + <param> + <key>id</key> + <value>virtual_source_0_1</value> + </param> + <param> + <key>stream_id</key> + <value>input_unpacked</value> + </param> + </block> <connection> - <source_block_id>analog_random_source_x_0</source_block_id> - <sink_block_id>blocks_char_to_float_0_1</sink_block_id> + <source_block_id>analog_fastnoise_source_x_0</source_block_id> + <sink_block_id>blocks_add_xx_0</sink_block_id> <source_key>0</source_key> - <sink_key>0</sink_key> + <sink_key>1</sink_key> + </connection> + <connection> + <source_block_id>analog_fastnoise_source_x_0_0</source_block_id> + <sink_block_id>blocks_add_xx_0_0</sink_block_id> + <source_key>0</source_key> + <sink_key>1</sink_key> </connection> <connection> <source_block_id>analog_random_source_x_0</source_block_id> @@ -1457,24 +2858,66 @@ <sink_key>0</sink_key> </connection> <connection> + <source_block_id>analog_random_source_x_0</source_block_id> + <sink_block_id>virtual_sink_0</sink_block_id> + <source_key>0</source_key> + <sink_key>0</sink_key> + </connection> + <connection> + <source_block_id>blocks_add_xx_0</source_block_id> + <sink_block_id>blocks_short_to_char_0</sink_block_id> + <source_key>0</source_key> + <sink_key>0</sink_key> + </connection> + <connection> + <source_block_id>blocks_add_xx_0_0</source_block_id> + <sink_block_id>blocks_short_to_char_0_0</sink_block_id> + <source_key>0</source_key> + <sink_key>0</sink_key> + </connection> + <connection> <source_block_id>blocks_char_to_float_0</source_block_id> <sink_block_id>qtgui_time_sink_x_0</sink_block_id> <source_key>0</source_key> <sink_key>1</sink_key> </connection> <connection> + <source_block_id>blocks_char_to_float_0_0</source_block_id> + <sink_block_id>qtgui_time_sink_x_0_0</sink_block_id> + <source_key>0</source_key> + <sink_key>1</sink_key> + </connection> + <connection> <source_block_id>blocks_char_to_float_0_1</source_block_id> <sink_block_id>qtgui_time_sink_x_0</sink_block_id> <source_key>0</source_key> <sink_key>0</sink_key> </connection> <connection> + <source_block_id>blocks_char_to_float_0_1_0</source_block_id> + <sink_block_id>qtgui_time_sink_x_0_0</sink_block_id> + <source_key>0</source_key> + <sink_key>0</sink_key> + </connection> + <connection> <source_block_id>blocks_char_to_float_0_2</source_block_id> <sink_block_id>fec_extended_decoder_0</sink_block_id> <source_key>0</source_key> <sink_key>0</sink_key> </connection> <connection> + <source_block_id>blocks_char_to_short_0</source_block_id> + <sink_block_id>blocks_add_xx_0</sink_block_id> + <source_key>0</source_key> + <sink_key>0</sink_key> + </connection> + <connection> + <source_block_id>blocks_char_to_short_0_0</source_block_id> + <sink_block_id>blocks_add_xx_0_0</sink_block_id> + <source_key>0</source_key> + <sink_key>0</sink_key> + </connection> + <connection> <source_block_id>blocks_pack_k_bits_bb_0</source_block_id> <sink_block_id>blocks_char_to_float_0</sink_block_id> <source_key>0</source_key> @@ -1487,12 +2930,42 @@ <sink_key>1</sink_key> </connection> <connection> + <source_block_id>blocks_pack_k_bits_bb_0_0</source_block_id> + <sink_block_id>blocks_char_to_float_0_0</sink_block_id> + <source_key>0</source_key> + <sink_key>0</sink_key> + </connection> + <connection> + <source_block_id>blocks_pack_k_bits_bb_0_0</source_block_id> + <sink_block_id>fec_ber_bf_0_0</sink_block_id> + <source_key>0</source_key> + <sink_key>1</sink_key> + </connection> + <connection> + <source_block_id>blocks_short_to_char_0</source_block_id> + <sink_block_id>digital_map_bb_0</sink_block_id> + <source_key>0</source_key> + <sink_key>0</sink_key> + </connection> + <connection> + <source_block_id>blocks_short_to_char_0_0</source_block_id> + <sink_block_id>blocks_pack_k_bits_bb_0_0</sink_block_id> + <source_key>0</source_key> + <sink_key>0</sink_key> + </connection> + <connection> <source_block_id>blocks_unpack_k_bits_bb_0</source_block_id> <sink_block_id>fec_extended_encoder_0</sink_block_id> <source_key>0</source_key> <sink_key>0</sink_key> </connection> <connection> + <source_block_id>blocks_unpack_k_bits_bb_0</source_block_id> + <sink_block_id>virtual_sink_0_0</sink_block_id> + <source_key>0</source_key> + <sink_key>0</sink_key> + </connection> + <connection> <source_block_id>digital_map_bb_0</source_block_id> <sink_block_id>blocks_char_to_float_0_2</sink_block_id> <source_key>0</source_key> @@ -1505,6 +2978,12 @@ <sink_key>0</sink_key> </connection> <connection> + <source_block_id>fec_ber_bf_0_0</source_block_id> + <sink_block_id>qtgui_number_sink_0_0</sink_block_id> + <source_key>0</source_key> + <sink_key>0</sink_key> + </connection> + <connection> <source_block_id>fec_extended_decoder_0</source_block_id> <sink_block_id>blocks_pack_k_bits_bb_0</sink_block_id> <source_key>0</source_key> @@ -1512,7 +2991,31 @@ </connection> <connection> <source_block_id>fec_extended_encoder_0</source_block_id> - <sink_block_id>digital_map_bb_0</sink_block_id> + <sink_block_id>blocks_char_to_short_0</sink_block_id> + <source_key>0</source_key> + <sink_key>0</sink_key> + </connection> + <connection> + <source_block_id>virtual_source_0</source_block_id> + <sink_block_id>fec_ber_bf_0_0</sink_block_id> + <source_key>0</source_key> + <sink_key>0</sink_key> + </connection> + <connection> + <source_block_id>virtual_source_0_0</source_block_id> + <sink_block_id>blocks_char_to_float_0_1</sink_block_id> + <source_key>0</source_key> + <sink_key>0</sink_key> + </connection> + <connection> + <source_block_id>virtual_source_0_0_0</source_block_id> + <sink_block_id>blocks_char_to_float_0_1_0</sink_block_id> + <source_key>0</source_key> + <sink_key>0</sink_key> + </connection> + <connection> + <source_block_id>virtual_source_0_1</source_block_id> + <sink_block_id>blocks_char_to_short_0_0</sink_block_id> <source_key>0</source_key> <sink_key>0</sink_key> </connection> diff --git a/gr-fec/include/gnuradio/fec/polar_common.h b/gr-fec/include/gnuradio/fec/polar_common.h index 66392ccbb2..3ee7815008 100644 --- a/gr-fec/include/gnuradio/fec/polar_common.h +++ b/gr-fec/include/gnuradio/fec/polar_common.h @@ -1,19 +1,19 @@ /* -*- c++ -*- */ -/* +/* * Copyright 2015 Free Software Foundation, Inc. - * + * * This file is part of GNU Radio - * + * * GNU Radio is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 3, or (at your option) * any later version. - * + * * GNU Radio is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - * + * * You should have received a copy of the GNU General Public License * along with GNU Radio; see the file COPYING. If not, write to * the Free Software Foundation, Inc., 51 Franklin Street, @@ -37,30 +37,40 @@ namespace gr { namespace gr { namespace fec { + namespace code { /*! * \brief POLAR code common operations and attributes - * Erdal Arikan "Channel Polarization: A Method for Contructing Capacity-Achieving Codes for Symmetric Binary-Input Memoryless Channels", 2009 * \ingroup error_coding_blk * * \details - * polar codes are based on this paper by Erdal Arikan - * "Channel Polarization: A Method for Contructing Capacity-Achieving Codes for Symmetric Binary-Input Memoryless Channels", 2009 - * block holds common information for encoders and decoders. All polar encoder/decoders inherit from polar_common. + * Polar codes are based on this paper by Erdal Arikan "Channel + * Polarization: A Method for Contructing Capacity-Achieving Codes + * for Symmetric Binary-Input Memoryless Channels", 2009 block + * holds common information for encoders and decoders. All polar + * encoder/decoders inherit from polar_common. * * class holds common info. It is common to all encoders and decoders. - * \param block_size codeword size. MUST be a power of 2. - * \param num_info_bits represents the number of information bits in a block. Also called frame_size. <= block_size - * \param frozen_bit_positions is an integer vector which defines the position of all frozen bits in a block. - * Its size MUST be equal to block_size - num_info_bits. - * Also it must be sorted and every position must only occur once. - * \param frozen_bit_values holds an unpacked byte for every frozen bit position. - * It defines if a frozen bit is fixed to '0' or '1'. Defaults to all ZERO. */ class FEC_API polar_common { public: - polar_common(int block_size, int num_info_bits, std::vector<int> frozen_bit_positions, std::vector<char> frozen_bit_values); + /*! + * \param block_size codeword size. MUST be a power of 2. + * \param num_info_bits represents the number of information + * bits in a block. Also called frame_size. <= block_size + * \param frozen_bit_positions is an integer vector which + * defines the position of all frozen bits in a block. + * Its size MUST be equal to block_size - num_info_bits. + * Also it must be sorted and every position must only + * occur once. + * \param frozen_bit_values holds an unpacked byte for every + * frozen bit position. It defines if a frozen bit is + * fixed to '0' or '1'. Defaults to all ZERO. + */ + polar_common(int block_size, int num_info_bits, + std::vector<int> frozen_bit_positions, + std::vector<char> frozen_bit_values); ~polar_common(); protected: @@ -70,8 +80,10 @@ namespace gr { // helper functions long bit_reverse(long value, int active_bits) const; - void print_packed_bit_array(const unsigned char* printed_array, const int num_bytes) const; - void print_unpacked_bit_array(const unsigned char* bits, const unsigned int num_bytes) const; + void print_packed_bit_array(const unsigned char* printed_array, + const int num_bytes) const; + void print_unpacked_bit_array(const unsigned char* bits, + const unsigned int num_bytes) const; std::vector<int> d_frozen_bit_positions; std::vector<char> d_frozen_bit_values; @@ -87,8 +99,8 @@ namespace gr { gr::blocks::kernel::unpack_k_bits *d_unpacker; // convenience for 'print_packed_bit_array' function. }; + } //namespace code } // namespace fec } // namespace gr #endif /* INCLUDED_FEC_POLAR_COMMON_H */ - diff --git a/gr-fec/include/gnuradio/fec/polar_decoder_common.h b/gr-fec/include/gnuradio/fec/polar_decoder_common.h index 2376e8f089..7a18ba873c 100644 --- a/gr-fec/include/gnuradio/fec/polar_decoder_common.h +++ b/gr-fec/include/gnuradio/fec/polar_decoder_common.h @@ -1,19 +1,19 @@ /* -*- c++ -*- */ -/* +/* * Copyright 2015 Free Software Foundation, Inc. - * + * * This file is part of GNU Radio - * + * * GNU Radio is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 3, or (at your option) * any later version. - * + * * GNU Radio is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - * + * * You should have received a copy of the GNU General Public License * along with GNU Radio; see the file COPYING. If not, write to * the Free Software Foundation, Inc., 51 Franklin Street, @@ -30,22 +30,31 @@ namespace gr { namespace fec { + namespace code { /*! - * \brief Class holds common methods and attributes for different decoder implementations - * - * \param block_size codeword size. MUST be a power of 2. - * \param num_info_bits represents the number of information bits in a block. Also called frame_size. <= block_size - * \param frozen_bit_positions is an integer vector which defines the position of all frozen bits in a block. - * Its size MUST be equal to block_size - num_info_bits. - * Also it must be sorted and every position must only occur once. - * \param frozen_bit_values holds an unpacked byte for every frozen bit position. - * It defines if a frozen bit is fixed to '0' or '1'. Defaults to all ZERO. + * \brief Class holds common methods and attributes for different + * decoder implementations */ class FEC_API polar_decoder_common : public generic_decoder, public polar_common { public: - polar_decoder_common(int block_size, int num_info_bits, std::vector<int> frozen_bit_positions, std::vector<char> frozen_bit_values); + /*! + * + * \param block_size codeword size. MUST be a power of 2. + * \param num_info_bits represents the number of information bits + * in a block. Also called frame_size. <= block_size + * \param frozen_bit_positions is an integer vector which defines + * the position of all frozen bits in a block. Its size + * MUST be equal to block_size - num_info_bits. Also it + * must be sorted and every position must only occur once. + * \param frozen_bit_values holds an unpacked byte for every + * frozen bit position. It defines if a frozen bit is + * fixed to '0' or '1'. Defaults to all ZERO. + */ + polar_decoder_common(int block_size, int num_info_bits, + std::vector<int> frozen_bit_positions, + std::vector<char> frozen_bit_values); ~polar_decoder_common(); // FECAPI @@ -84,8 +93,8 @@ namespace gr { }; + } // namespace code } // namespace fec } // namespace gr #endif /* INCLUDED_FEC_POLAR_DECODER_COMMON_H */ - diff --git a/gr-fec/include/gnuradio/fec/polar_decoder_sc.h b/gr-fec/include/gnuradio/fec/polar_decoder_sc.h index d32c1c93af..295e930e5a 100644 --- a/gr-fec/include/gnuradio/fec/polar_decoder_sc.h +++ b/gr-fec/include/gnuradio/fec/polar_decoder_sc.h @@ -1,19 +1,19 @@ /* -*- c++ -*- */ -/* +/* * Copyright 2015 Free Software Foundation, Inc. - * + * * This file is part of GNU Radio - * + * * GNU Radio is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 3, or (at your option) * any later version. - * + * * GNU Radio is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - * + * * You should have received a copy of the GNU General Public License * along with GNU Radio; see the file COPYING. If not, write to * the Free Software Foundation, Inc., 51 Franklin Street, @@ -30,6 +30,7 @@ namespace gr { namespace fec { + namespace code { /*! * \brief Standard successive cancellation (SC) decoder for POLAR codes @@ -42,23 +43,32 @@ namespace gr { class FEC_API polar_decoder_sc : public polar_decoder_common { public: + /*! * \param block_size codeword size. MUST be a power of 2. - * \param num_info_bits represents the number of information bits in a block. Also called frame_size. <= block_size - * \param frozen_bit_positions is an integer vector which defines the position of all frozen bits in a block. - * Its size MUST be equal to block_size - num_info_bits. - * Also it must be sorted and every position must only occur once. - * \param frozen_bit_values holds an unpacked byte for every frozen bit position. - * It defines if a frozen bit is fixed to '0' or '1'. Defaults to all ZERO. + * \param num_info_bits represents the number of information + * bits in a block. Also called frame_size. <= block_size + * \param frozen_bit_positions is an integer vector which + * defines the position of all frozen bits in a block. + * Its size MUST be equal to block_size - num_info_bits. + * Also it must be sorted and every position must only + * occur once. + * \param frozen_bit_values holds an unpacked byte for every + * frozen bit position. It defines if a frozen bit is + * fixed to '0' or '1'. Defaults to all ZERO. */ - static generic_decoder::sptr make(int block_size, int num_info_bits, std::vector<int> frozen_bit_positions, std::vector<char> frozen_bit_values); + static generic_decoder::sptr make(int block_size, int num_info_bits, + std::vector<int> frozen_bit_positions, + std::vector<char> frozen_bit_values); ~polar_decoder_sc(); // FECAPI void generic_work(void *in_buffer, void *out_buffer); private: - polar_decoder_sc(int block_size, int num_info_bits, std::vector<int> frozen_bit_positions, std::vector<char> frozen_bit_values); + polar_decoder_sc(int block_size, int num_info_bits, + std::vector<int> frozen_bit_positions, + std::vector<char> frozen_bit_values); float* d_llr_vec; unsigned char* d_u_hat_vec; @@ -67,8 +77,8 @@ namespace gr { void sc_decode(float* llrs, unsigned char* u); }; + } // namespace code } // namespace fec } // namespace gr #endif /* INCLUDED_FEC_POLAR_DECODER_SC_H */ - diff --git a/gr-fec/include/gnuradio/fec/polar_decoder_sc_list.h b/gr-fec/include/gnuradio/fec/polar_decoder_sc_list.h index 1bd9d9185a..6f7033b9f6 100644 --- a/gr-fec/include/gnuradio/fec/polar_decoder_sc_list.h +++ b/gr-fec/include/gnuradio/fec/polar_decoder_sc_list.h @@ -1,19 +1,19 @@ /* -*- c++ -*- */ -/* +/* * Copyright 2015 Free Software Foundation, Inc. - * + * * This file is part of GNU Radio - * + * * GNU Radio is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 3, or (at your option) * any later version. - * + * * GNU Radio is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - * + * * You should have received a copy of the GNU General Public License * along with GNU Radio; see the file COPYING. If not, write to * the Free Software Foundation, Inc., 51 Franklin Street, @@ -29,19 +29,21 @@ namespace gr { namespace fec { + namespace code { + namespace polar { class scl_list; class path; } /*! - * \brief Successive cancellation list (SCL) decoder for polar codes - * decoder is based on Tal, Vardy "List Decoding of Polar Codes", 2012 - * LLR version: Balatsoukas-Stimming, Parizi, Burg "LLR-based Successive Cancellation List Decoding of Polar Codes", 2015 + * \brief Successive cancellation list (SCL) decoder for polar + * codes. * * \details - * decoder is based on Tal, Vardy "List Decoding of Polar Codes", 2012 - * LLR version: Balatsoukas-Stimming, Parizi, Burg "LLR-based Successive Cancellation List Decoding of Polar Codes", 2015 + * Decoder is based on Tal, Vardy "List Decoding of Polar Codes", + * 2012 LLR version: Balatsoukas-Stimming, Parizi, Burg "LLR-based + * Successive Cancellation List Decoding of Polar Codes", 2015. * * Block expects float input with bits mapped 1 --> 1, 0 --> -1 * Or: f = 2.0 * bit - 1.0 @@ -52,21 +54,29 @@ namespace gr { /*! * \param max_list_size caps number of followed decoding paths. * \param block_size codeword size. MUST be a power of 2. - * \param num_info_bits represents the number of information bits in a block. Also called frame_size. <= block_size - * \param frozen_bit_positions is an integer vector which defines the position of all frozen bits in a block. - * Its size MUST be equal to block_size - num_info_bits. - * Also it must be sorted and every position must only occur once. - * \param frozen_bit_values holds an unpacked byte for every frozen bit position. - * It defines if a frozen bit is fixed to '0' or '1'. Defaults to all ZERO. + * \param num_info_bits represents the number of information + * bits in a block. Also called frame_size. <= block_size + * \param frozen_bit_positions is an integer vector which + * defines the position of all frozen bits in a block. + * Its size MUST be equal to block_size - num_info_bits. + * Also it must be sorted and every position must only + * occur once. + * \param frozen_bit_values holds an unpacked byte for every + * frozen bit position. It defines if a frozen bit is + * fixed to '0' or '1'. Defaults to all ZERO. */ - static generic_decoder::sptr make(int max_list_size, int block_size, int num_info_bits, std::vector<int> frozen_bit_positions, std::vector<char> frozen_bit_values); + static generic_decoder::sptr make(int max_list_size, int block_size, + int num_info_bits, std::vector<int> frozen_bit_positions, + std::vector<char> frozen_bit_values); ~polar_decoder_sc_list(); // FECAPI void generic_work(void *in_buffer, void *out_buffer); private: - polar_decoder_sc_list(int max_list_size, int block_size, int num_info_bits, std::vector<int> frozen_bit_positions, std::vector<char> frozen_bit_values); + polar_decoder_sc_list(int max_list_size, int block_size, + int num_info_bits, std::vector<int> frozen_bit_positions, + std::vector<char> frozen_bit_values); polar::scl_list* d_scl; @@ -76,8 +86,9 @@ namespace gr { void calculate_llrs_for_list(const int u_num); void set_bit_in_list(const int u_num); }; + + } // namespace code } // namespace fec } // namespace gr #endif /* INCLUDED_POLAR_FEC_DECODER_SC_LIST_H */ - diff --git a/gr-fec/include/gnuradio/fec/polar_encoder.h b/gr-fec/include/gnuradio/fec/polar_encoder.h index 4ce1b11d39..e3b4557c9b 100644 --- a/gr-fec/include/gnuradio/fec/polar_encoder.h +++ b/gr-fec/include/gnuradio/fec/polar_encoder.h @@ -1,19 +1,19 @@ /* -*- c++ -*- */ -/* +/* * Copyright 2015 Free Software Foundation, Inc. - * + * * This file is part of GNU Radio - * + * * GNU Radio is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 3, or (at your option) * any later version. - * + * * GNU Radio is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - * + * * You should have received a copy of the GNU General Public License * along with GNU Radio; see the file COPYING. If not, write to * the Free Software Foundation, Inc., 51 Franklin Street, @@ -30,6 +30,7 @@ namespace gr { namespace fec { + namespace code { /*! * \brief POLAR encoder @@ -46,16 +47,25 @@ namespace gr { /*! * Factory for a polar code encoder object. * - * \param block_size defines the codeword size. It MUST be a power of 2. - * \param num_info_bits represents the number of information bits in a block. Also called frame_size. - * \param frozen_bit_positions is an integer vector which defines the position of all frozen bits in a block. - * Its size MUST be equal to block_size - num_info_bits. - * Also it must be sorted and every position must only occur once. - * \param frozen_bit_values holds an unpacked byte for every frozen bit position. - * It defines if a frozen bit is fixed to '0' or '1'. Defaults to all ZERO. - * \param is_packed, choose 1 active bit/byte or 8 active bit/byte. if false, VOLK polar encoder is used. + * \param block_size defines the codeword size. It MUST be a + * power of 2. + * \param num_info_bits represents the number of information + * bits in a block. Also called frame_size. + * \param frozen_bit_positions is an integer vector which + * defines the position of all frozen bits in a block. + * Its size MUST be equal to block_size - num_info_bits. + * Also it must be sorted and every position must only + * occur once. + * \param frozen_bit_values holds an unpacked byte for every + * frozen bit position. It defines if a frozen bit is + * fixed to '0' or '1'. Defaults to all ZERO. + * \param is_packed choose 1 active bit/byte or 8 active + * bit/byte. if false, VOLK polar encoder is used. */ - static generic_encoder::sptr make(int block_size, int num_info_bits, std::vector<int> frozen_bit_positions, std::vector<char> frozen_bit_values, bool is_packed = false); + static generic_encoder::sptr make(int block_size, int num_info_bits, + std::vector<int> frozen_bit_positions, + std::vector<char> frozen_bit_values, + bool is_packed = false); ~polar_encoder(); // FECAPI @@ -68,7 +78,9 @@ namespace gr { const char* get_output_conversion(){return d_is_packed ? "packed_bits" : "none";}; private: - polar_encoder(int block_size, int num_info_bits, std::vector<int>& frozen_bit_positions, std::vector<char>& frozen_bit_values, bool is_packed); + polar_encoder(int block_size, int num_info_bits, + std::vector<int>& frozen_bit_positions, + std::vector<char>& frozen_bit_values, bool is_packed); std::vector<int> d_info_bit_reversed_positions; bool d_is_packed; @@ -77,9 +89,15 @@ namespace gr { // methods insert input bits and frozen bits into packed array for encoding unsigned char* d_frozen_bit_prototype; // packed frozen bits are written onto it and later copies are used. - void insert_packed_frozen_bits_and_reverse(unsigned char* target, const unsigned char* input) const; - void insert_unpacked_bit_into_packed_array_at_position(unsigned char* target, const unsigned char bit, const int pos) const; - void insert_packet_bit_into_packed_array_at_position(unsigned char* target, const unsigned char bit, const int target_pos, const int bit_pos) const; + void insert_packed_frozen_bits_and_reverse(unsigned char* target, + const unsigned char* input) const; + void insert_unpacked_bit_into_packed_array_at_position(unsigned char* target, + const unsigned char bit, + const int pos) const; + void insert_packet_bit_into_packed_array_at_position(unsigned char* target, + const unsigned char bit, + const int target_pos, + const int bit_pos) const; // packed encoding methods void encode_vector_packed(unsigned char* target) const; @@ -94,8 +112,9 @@ namespace gr { unsigned char* d_frozen_bit_mask; unsigned char* d_frozen_bits; }; + + } // namespace code } // namespace fec } // namespace gr #endif /* INCLUDED_FEC_POLAR_ENCODER_H */ - diff --git a/gr-fec/lib/polar_common.cc b/gr-fec/lib/polar_common.cc index 3138aa5088..9952ba0ea3 100644 --- a/gr-fec/lib/polar_common.cc +++ b/gr-fec/lib/polar_common.cc @@ -1,19 +1,19 @@ /* -*- c++ -*- */ -/* +/* * Copyright 2015 Free Software Foundation, Inc. - * + * * This file is part of GNU Radio - * + * * GNU Radio is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 3, or (at your option) * any later version. - * + * * GNU Radio is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - * + * * You should have received a copy of the GNU General Public License * along with GNU Radio; see the file COPYING. If not, write to * the Free Software Foundation, Inc., 51 Franklin Street, @@ -35,10 +35,9 @@ #include <iostream> #include <vector> -namespace gr -{ - namespace fec - { +namespace gr { + namespace fec { + namespace code { polar_common::polar_common(int block_size, int num_info_bits, std::vector<int> frozen_bit_positions, @@ -132,5 +131,6 @@ namespace gr std::cout << ")" << std::endl; } + } /* namespace code */ } /* namespace fec */ } /* namespace gr */ diff --git a/gr-fec/lib/polar_decoder_common.cc b/gr-fec/lib/polar_decoder_common.cc index e9138aad59..cb5a6dbf51 100644 --- a/gr-fec/lib/polar_decoder_common.cc +++ b/gr-fec/lib/polar_decoder_common.cc @@ -1,19 +1,19 @@ /* -*- c++ -*- */ -/* +/* * Copyright 2015 Free Software Foundation, Inc. - * + * * This file is part of GNU Radio - * + * * GNU Radio is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 3, or (at your option) * any later version. - * + * * GNU Radio is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - * + * * You should have received a copy of the GNU General Public License * along with GNU Radio; see the file COPYING. If not, write to * the Free Software Foundation, Inc., 51 Franklin Street, @@ -32,12 +32,13 @@ namespace gr { namespace fec { + namespace code { polar_decoder_common::polar_decoder_common(int block_size, int num_info_bits, std::vector<int> frozen_bit_positions, std::vector<char> frozen_bit_values) : - polar_common(block_size, num_info_bits, frozen_bit_positions, frozen_bit_values), - d_frozen_bit_counter(0) + polar_common(block_size, num_info_bits, frozen_bit_positions, frozen_bit_values), + d_frozen_bit_counter(0) { } @@ -187,5 +188,6 @@ namespace gr { } } + } /* namespace code */ } /* namespace fec */ } /* namespace gr */ diff --git a/gr-fec/lib/polar_decoder_sc.cc b/gr-fec/lib/polar_decoder_sc.cc index 1b872d0c2a..1412946b0b 100644 --- a/gr-fec/lib/polar_decoder_sc.cc +++ b/gr-fec/lib/polar_decoder_sc.cc @@ -1,19 +1,19 @@ /* -*- c++ -*- */ -/* +/* * Copyright 2015 Free Software Foundation, Inc. - * + * * This file is part of GNU Radio - * + * * GNU Radio is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 3, or (at your option) * any later version. - * + * * GNU Radio is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - * + * * You should have received a copy of the GNU General Public License * along with GNU Radio; see the file COPYING. If not, write to * the Free Software Foundation, Inc., 51 Franklin Street, @@ -31,23 +31,25 @@ #include <cmath> #include <cstdio> -namespace gr -{ - namespace fec - { +namespace gr { + namespace fec { + namespace code { generic_decoder::sptr - polar_decoder_sc::make(int block_size, int num_info_bits, std::vector<int> frozen_bit_positions, + polar_decoder_sc::make(int block_size, int num_info_bits, + std::vector<int> frozen_bit_positions, std::vector<char> frozen_bit_values) { - return generic_decoder::sptr( - new polar_decoder_sc(block_size, num_info_bits, frozen_bit_positions, frozen_bit_values)); + return generic_decoder::sptr + (new polar_decoder_sc(block_size, num_info_bits, + frozen_bit_positions, + frozen_bit_values)); } polar_decoder_sc::polar_decoder_sc(int block_size, int num_info_bits, std::vector<int> frozen_bit_positions, std::vector<char> frozen_bit_values) : - polar_decoder_common(block_size, num_info_bits, frozen_bit_positions, frozen_bit_values) + polar_decoder_common(block_size, num_info_bits, frozen_bit_positions, frozen_bit_values) { d_llr_vec = (float*) volk_malloc(sizeof(float) * block_size * (block_power() + 1), volk_get_alignment()); memset(d_llr_vec, 0, sizeof(float) * block_size * (block_power() + 1)); @@ -89,5 +91,7 @@ namespace gr } return llr_bit_decision(llr); } + + } /* namespace code */ } /* namespace fec */ } /* namespace gr */ diff --git a/gr-fec/lib/polar_decoder_sc_list.cc b/gr-fec/lib/polar_decoder_sc_list.cc index 30659973b9..041cd89fad 100644 --- a/gr-fec/lib/polar_decoder_sc_list.cc +++ b/gr-fec/lib/polar_decoder_sc_list.cc @@ -1,19 +1,19 @@ /* -*- c++ -*- */ -/* +/* * Copyright 2015 Free Software Foundation, Inc. - * + * * This file is part of GNU Radio - * + * * GNU Radio is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 3, or (at your option) * any later version. - * + * * GNU Radio is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - * + * * You should have received a copy of the GNU General Public License * along with GNU Radio; see the file COPYING. If not, write to * the Free Software Foundation, Inc., 51 Franklin Street, @@ -32,10 +32,9 @@ #include <cmath> #include <algorithm> -namespace gr -{ - namespace fec - { +namespace gr { + namespace fec { + namespace code { generic_decoder::sptr polar_decoder_sc_list::make(int max_list_size, int block_size, int num_info_bits, @@ -43,7 +42,8 @@ namespace gr std::vector<char> frozen_bit_values) { return generic_decoder::sptr( - new polar_decoder_sc_list(max_list_size, block_size, num_info_bits, frozen_bit_positions, + new polar_decoder_sc_list(max_list_size, block_size, num_info_bits, + frozen_bit_positions, frozen_bit_values)); } @@ -51,7 +51,7 @@ namespace gr int num_info_bits, std::vector<int> frozen_bit_positions, std::vector<char> frozen_bit_values) : - polar_decoder_common(block_size, num_info_bits, frozen_bit_positions, frozen_bit_values) + polar_decoder_common(block_size, num_info_bits, frozen_bit_positions, frozen_bit_values) { d_scl = new polar::scl_list(max_list_size, block_size, block_power()); } @@ -117,7 +117,7 @@ namespace gr d_scl->set_info_bit(u_num); } } + + } /* namespace code */ } /* namespace fec */ } /* namespace gr */ - - diff --git a/gr-fec/lib/polar_encoder.cc b/gr-fec/lib/polar_encoder.cc index eeb283e4b4..ed5288bfd2 100644 --- a/gr-fec/lib/polar_encoder.cc +++ b/gr-fec/lib/polar_encoder.cc @@ -1,19 +1,19 @@ /* -*- c++ -*- */ -/* +/* * Copyright 2015 Free Software Foundation, Inc. - * + * * This file is part of GNU Radio - * + * * GNU Radio is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 3, or (at your option) * any later version. - * + * * GNU Radio is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - * + * * You should have received a copy of the GNU General Public License * along with GNU Radio; see the file COPYING. If not, write to * the Free Software Foundation, Inc., 51 Franklin Street, @@ -33,18 +33,20 @@ #include <gnuradio/blocks/pack_k_bits.h> #include <gnuradio/blocks/unpack_k_bits.h> -namespace gr -{ - namespace fec - { +namespace gr { + namespace fec { + namespace code { generic_encoder::sptr - polar_encoder::make(int block_size, int num_info_bits, std::vector<int> frozen_bit_positions, + polar_encoder::make(int block_size, int num_info_bits, + std::vector<int> frozen_bit_positions, std::vector<char> frozen_bit_values, bool is_packed) { - return generic_encoder::sptr( - new polar_encoder(block_size, num_info_bits, frozen_bit_positions, frozen_bit_values, - is_packed)); + return generic_encoder::sptr + (new polar_encoder(block_size, num_info_bits, + frozen_bit_positions, + frozen_bit_values, + is_packed)); } polar_encoder::polar_encoder(int block_size, int num_info_bits, @@ -226,5 +228,7 @@ namespace gr insert_unpacked_bit_into_packed_array_at_position(target, (bit >> (7 - bit_pos)) & 0x01, target_pos); } + + } /* namespace code */ } /* namespace fec */ } /* namespace gr */ diff --git a/gr-fec/lib/scl_list.cc b/gr-fec/lib/scl_list.cc index f36c48f475..5ad80376bc 100644 --- a/gr-fec/lib/scl_list.cc +++ b/gr-fec/lib/scl_list.cc @@ -28,10 +28,14 @@ namespace gr { namespace fec { - namespace polar { - - scl_list::scl_list(const unsigned int size, const unsigned int block_size, const unsigned int block_power): - d_list_size(size), d_block_size(block_size), d_block_power(block_power), d_num_buff_elements(block_size * (block_power + 1)) + namespace code { + namespace polar { + + scl_list::scl_list(const unsigned int size, + const unsigned int block_size, + const unsigned int block_power): + d_list_size(size), d_block_size(block_size), d_block_power(block_power), + d_num_buff_elements(block_size * (block_power + 1)) { for(unsigned int i = 0; i < 2 * size; i++){ d_path_list.push_back(new path()); @@ -164,7 +168,9 @@ namespace gr { { for(unsigned int i = 0; i < d_active_path_counter; i++){ d_path_list[i]->u_vec[bit_pos] = frozen_bit; - d_path_list[i]->path_metric = update_path_metric(d_path_list[i]->path_metric, d_path_list[i]->llr_vec[bit_pos], frozen_bit); + d_path_list[i]->path_metric = update_path_metric(d_path_list[i]->path_metric, + d_path_list[i]->llr_vec[bit_pos], + frozen_bit); } d_active_pos = 0; } @@ -182,5 +188,6 @@ namespace gr { } } /* namespace polar */ + } /* namespace code */ } /* namespace fec */ } /* namespace gr */ diff --git a/gr-fec/lib/scl_list.h b/gr-fec/lib/scl_list.h index 5a93db2525..d0f62f2b9b 100644 --- a/gr-fec/lib/scl_list.h +++ b/gr-fec/lib/scl_list.h @@ -27,6 +27,8 @@ namespace gr { namespace fec { + namespace code { + namespace polar { struct path { path(); @@ -58,10 +60,13 @@ namespace gr { void reset(); // comparator for std::sort - static bool path_compare(path* first, path* second){return first->path_metric < second->path_metric;}; + static bool path_compare(path* first, path* second) { + return first->path_metric < second->path_metric; + }; public: - scl_list(const unsigned int list_size, const unsigned int block_size, const unsigned int block_power); + scl_list(const unsigned int list_size, const unsigned int block_size, + const unsigned int block_power); virtual ~scl_list(); const unsigned int size() const {return d_list_size;}; @@ -75,6 +80,7 @@ namespace gr { }; } /* namespace polar */ + } /* namespace code */ } /* namespace fec */ } /* namespace gr */ |