diff options
Diffstat (limited to 'gr-fec')
123 files changed, 2347 insertions, 3412 deletions
diff --git a/gr-fec/grc/CMakeLists.txt b/gr-fec/grc/CMakeLists.txt index f61603df22..5214189b99 100644 --- a/gr-fec/grc/CMakeLists.txt +++ b/gr-fec/grc/CMakeLists.txt @@ -18,9 +18,9 @@ # Boston, MA 02110-1301, USA. ######################################################################## -file(GLOB xml_files "*.xml") +file(GLOB yml_files "*.yml") install(FILES - ${xml_files} + ${yml_files} DESTINATION ${GRC_BLOCKS_DIR} ) diff --git a/gr-fec/grc/fec.tree.yml b/gr-fec/grc/fec.tree.yml new file mode 100644 index 0000000000..e9109ba316 --- /dev/null +++ b/gr-fec/grc/fec.tree.yml @@ -0,0 +1,43 @@ +'[Core]': +- Error Coding: + - Decoders: + - variable_cc_decoder_def + - variable_repetition_decoder_def + - variable_ldpc_decoder_def + - variable_ldpc_bit_flip_decoder_def + - variable_tpc_decoder_def + - variable_dummy_decoder_def + - variable_polar_decoder_sc_def + - variable_polar_decoder_sc_list_def + - variable_polar_decoder_sc_systematic_def + - Encoders: + - variable_cc_encoder_def + - variable_ccsds_encoder_def + - variable_repetition_encoder_def + - variable_tpc_encoder_def + - variable_ldpc_encoder_def + - variable_ldpc_encoder_G_def + - variable_ldpc_encoder_H_def + - variable_polar_encoder_def + - variable_polar_encoder_systematic_def + - variable_dummy_encoder_def + - fec_extended_encoder + - fec_extended_async_encoder + - fec_extended_tagged_encoder + - fec_extended_decoder + - fec_extended_tagged_decoder + - fec_generic_encoder + - fec_generic_decoder + - fec_tagged_encoder + - fec_tagged_decoder + - fec_async_encoder + - fec_async_decoder + - fec_decode_ccsds_27_fb + - fec_encode_ccsds_27_bb + - fec_puncture_xx + - fec_depuncture_bb + - fec_ber_bf + - fec_bercurve_generator + - variable_polar_code_configurator + - variable_ldpc_H_matrix_def + - variable_ldpc_G_matrix_def diff --git a/gr-fec/grc/fec_async_decoder.block.yml b/gr-fec/grc/fec_async_decoder.block.yml new file mode 100644 index 0000000000..94c3e148fd --- /dev/null +++ b/gr-fec/grc/fec_async_decoder.block.yml @@ -0,0 +1,43 @@ +id: fec_async_decoder +label: FEC Async Decoder + +parameters: +- id: decoder + label: Decoder Obj. + dtype: raw +- id: mtu + label: MTU (bytes) + dtype: int + default: '1500' +- id: packed + label: Packed + dtype: enum + default: 'False' + options: ['False', 'True'] + option_labels: ['No', 'Yes'] + hide: part +- id: rev_pack + label: Rev. Packing + dtype: enum + default: 'True' + options: ['True', 'False'] + option_labels: ['Yes', 'No'] + hide: ${ ('part' if packed == 'True' else 'all') } + +inputs: +- domain: message + id: in + optional: true + +outputs: +- domain: message + id: out + optional: true + +templates: + imports: from gnuradio import fec + make: fec.async_decoder(${decoder}, ${packed}, ${rev_pack}, ${mtu}) + +documentation: "" + +file_format: 1 diff --git a/gr-fec/grc/fec_async_decoder.xml b/gr-fec/grc/fec_async_decoder.xml deleted file mode 100644 index 9b67d869e4..0000000000 --- a/gr-fec/grc/fec_async_decoder.xml +++ /dev/null @@ -1,68 +0,0 @@ -<?xml version="1.0"?> -<block> - <name>FEC Async Decoder</name> - <key>fec_async_decoder</key> - <import>from gnuradio import fec</import> - <make>fec.async_decoder($decoder, $packed, $rev_pack, $mtu)</make> - - <param> - <name>Decoder Obj.</name> - <key>decoder</key> - <type>raw</type> - </param> - - <param> - <name>MTU (bytes)</name> - <key>mtu</key> - <value>1500</value> - <type>int</type> - </param> - - <param> - <name>Packed</name> - <key>packed</key> - <value>False</value> - <type>enum</type> - <hide>part</hide> - <option> - <name>No</name> - <key>False</key> - </option> - <option> - <name>Yes</name> - <key>True</key> - </option> - </param> - - <param> - <name>Rev. Packing</name> - <key>rev_pack</key> - <value>True</value> - <type>enum</type> - <hide>#if $packed() == 'True' then 'part' else 'all'#</hide> - <option> - <name>Yes</name> - <key>True</key> - </option> - <option> - <name>No</name> - <key>False</key> - </option> - </param> - - <sink> - <name>in</name> - <type>message</type> - <optional>1</optional> - </sink> - - <source> - <name>out</name> - <type>message</type> - <optional>1</optional> - </source> - - <doc> - </doc> - -</block> diff --git a/gr-fec/grc/fec_async_encoder.block.yml b/gr-fec/grc/fec_async_encoder.block.yml new file mode 100644 index 0000000000..4b3902196e --- /dev/null +++ b/gr-fec/grc/fec_async_encoder.block.yml @@ -0,0 +1,50 @@ +id: fec_async_encoder +label: FEC Async Encoder + +parameters: +- id: encoder + label: Encoder Obj. + dtype: raw +- id: mtu + label: MTU (bytes) + dtype: int + default: '1500' +- id: packed + label: Packed + dtype: enum + default: 'False' + options: ['False', 'True'] + option_labels: ['No', 'Yes'] + hide: part +- id: rev_unpack + label: Rev. Unpacking + dtype: enum + default: 'True' + options: ['True', 'False'] + option_labels: ['Yes', 'No'] + hide: ${ ('part' if packed == 'True' else 'all') } +- id: rev_pack + label: Rev. Packing + dtype: enum + default: 'True' + options: ['True', 'False'] + option_labels: ['Yes', 'No'] + hide: ${ ('part' if packed == 'True' else 'all') } + +inputs: +- domain: message + id: in + optional: true + +outputs: +- domain: message + id: out + optional: true + +templates: + imports: from gnuradio import fec + make: fec.async_encoder(${encoder}, ${packed}, ${rev_unpack}, ${rev_pack}, ${mtu}) + +documentation: "" + +file_format: 1 diff --git a/gr-fec/grc/fec_async_encoder.xml b/gr-fec/grc/fec_async_encoder.xml deleted file mode 100644 index 68d516fc6d..0000000000 --- a/gr-fec/grc/fec_async_encoder.xml +++ /dev/null @@ -1,84 +0,0 @@ -<?xml version="1.0"?> -<block> - <name>FEC Async Encoder</name> - <key>fec_async_encoder</key> - <import>from gnuradio import fec</import> - <make>fec.async_encoder($encoder, $packed, $rev_unpack, $rev_pack, $mtu)</make> - - <param> - <name>Encoder Obj.</name> - <key>encoder</key> - <type>raw</type> - </param> - - <param> - <name>MTU (bytes)</name> - <key>mtu</key> - <value>1500</value> - <type>int</type> - </param> - - <param> - <name>Packed</name> - <key>packed</key> - <value>False</value> - <type>enum</type> - <hide>part</hide> - <option> - <name>No</name> - <key>False</key> - </option> - <option> - <name>Yes</name> - <key>True</key> - </option> - </param> - - <param> - <name>Rev. Unpacking</name> - <key>rev_unpack</key> - <value>True</value> - <type>enum</type> - <hide>#if $packed() == 'True' then 'part' else 'all'#</hide> - <option> - <name>Yes</name> - <key>True</key> - </option> - <option> - <name>No</name> - <key>False</key> - </option> - </param> - - <param> - <name>Rev. Packing</name> - <key>rev_pack</key> - <value>True</value> - <type>enum</type> - <hide>#if $packed() == 'True' then 'part' else 'all'#</hide> - <option> - <name>Yes</name> - <key>True</key> - </option> - <option> - <name>No</name> - <key>False</key> - </option> - </param> - - <sink> - <name>in</name> - <type>message</type> - <optional>1</optional> - </sink> - - <source> - <name>out</name> - <type>message</type> - <optional>1</optional> - </source> - - <doc> - </doc> - -</block> diff --git a/gr-fec/grc/fec_ber_bf.block.yml b/gr-fec/grc/fec_ber_bf.block.yml new file mode 100644 index 0000000000..65bb2747f0 --- /dev/null +++ b/gr-fec/grc/fec_ber_bf.block.yml @@ -0,0 +1,37 @@ +id: fec_ber_bf +label: BER + +parameters: +- id: test_mode + label: Test Mode + dtype: enum + default: 'False' + options: ['False', 'True'] +- id: berminerrors + label: BER Min. Errors + dtype: int + default: '100' + hide: ${ ('part' if test_mode else 'all') } +- id: berlimit + label: BER Limit + dtype: float + default: '-7.0' + hide: ${ ('part' if test_mode else 'all') } + +inputs: +- label: in0 + domain: stream + dtype: byte +- label: in1 + domain: stream + dtype: byte + +outputs: +- domain: stream + dtype: float + +templates: + imports: from gnuradio import fec + make: fec.ber_bf(${test_mode}, ${berminerrors}, ${berlimit}) + +file_format: 1 diff --git a/gr-fec/grc/fec_ber_bf.xml b/gr-fec/grc/fec_ber_bf.xml deleted file mode 100644 index 6d8d85e9ff..0000000000 --- a/gr-fec/grc/fec_ber_bf.xml +++ /dev/null @@ -1,54 +0,0 @@ -<?xml version="1.0"?> -<block> - <name>BER</name> - <key>fec_ber_bf</key> - <import>from gnuradio import fec</import> - <make>fec.ber_bf($test_mode, $berminerrors, $berlimit)</make> - - <param> - <name>Test Mode</name> - <key>test_mode</key> - <value>False</value> - <type>enum</type> - <option> - <name>False</name> - <key>False</key> - </option> - <option> - <name>True</name> - <key>True</key> - </option> - </param> - - <param> - <name>BER Min. Errors</name> - <key>berminerrors</key> - <value>100</value> - <type>int</type> - <hide>#if $test_mode() then 'part' else 'all'#</hide> - </param> - - <param> - <name>BER Limit</name> - <key>berlimit</key> - <value>-7.0</value> - <type>float</type> - <hide>#if $test_mode() then 'part' else 'all'#</hide> - </param> - - <sink> - <name>in0</name> - <type>byte</type> - </sink> - - <sink> - <name>in1</name> - <type>byte</type> - </sink> - - <source> - <name>out</name> - <type>float</type> - </source> - -</block>
\ No newline at end of file diff --git a/gr-fec/grc/fec_bercurve_generator.block.yml b/gr-fec/grc/fec_bercurve_generator.block.yml new file mode 100644 index 0000000000..565a0cf6cd --- /dev/null +++ b/gr-fec/grc/fec_bercurve_generator.block.yml @@ -0,0 +1,63 @@ +id: fec_bercurve_generator +label: BER Curve Gen. + +parameters: +- id: esno + label: Es/N0 + dtype: raw + default: numpy.arange(0.0, 4.0, .5) + hide: part +- id: samp_rate + label: Sample Rate + dtype: float + default: '3200000' +- id: encoder_list + label: Encoder list + dtype: raw + default: '0' +- id: decoder_list + label: Decoder list + dtype: raw + default: '0' +- id: puncpat + label: Puncture Pat. + dtype: string + default: '''11''' +- id: threadtype + label: Threading Type + dtype: enum + options: ['"capillary"', '"ordinary"', '"none"'] + option_labels: [Capillary, Ordinary, None] + hide: part +- id: seed + label: Noise Seed + dtype: int + default: '0' + hide: part + +outputs: +- domain: stream + dtype: byte + multiplicity: ${ len(esno)*2 } + +templates: + imports: |- + from gnuradio import fec + import numpy + make: "fec.bercurve_generator(\n\t${encoder_list}, \\#size\n\t${decoder_list},\ + \ \\#name\n\t${esno}, \\#range of esnos\n\t${samp_rate}, \\#throttle\n \ + \ ${threadtype}, \\#threading mode\n\t${puncpat}, \\#puncture pattern\n\ + \ ${seed} \\# noise gen. seed\n)\n " + +documentation: |- + Note that this block tries to launch many parallel codes to run simultaneously. Thus, it requires that the definitions for each encoder and decoder (specified in the "Encoder list" and "Decoder list") be configured with a parallelism > 0. If the parallelism for one of the encoder or decoder definition blocks is configured to 0, you will likely see an error like: + + generic_decoder=decoder_list[i], + TypeError: 'generic_decoder_sptr' object does not support indexing + + or + + generic_encoder=encoder_list[i], + TypeError: 'generic_encoder_sptr' object does not support indexing + +file_format: 1 diff --git a/gr-fec/grc/fec_bercurve_generator.xml b/gr-fec/grc/fec_bercurve_generator.xml deleted file mode 100644 index 5dfc7c6714..0000000000 --- a/gr-fec/grc/fec_bercurve_generator.xml +++ /dev/null @@ -1,104 +0,0 @@ -<?xml version="1.0"?> -<!-- -################################################### -## BER Curve Generator -################################################### - --> -<block> - <name>BER Curve Gen.</name> - <key>fec_bercurve_generator</key> - <import>from gnuradio import fec</import> - <import>import numpy</import> - <make>fec.bercurve_generator( - $encoder_list, \#size - $decoder_list, \#name - $esno, \#range of esnos - $samp_rate, \#throttle - $threadtype, \#threading mode - $puncpat, \#puncture pattern - $seed \# noise gen. seed -) - </make> - - <param> - <name>Es/N0</name> - <key>esno</key> - <value>numpy.arange(0.0, 4.0, .5)</value> - <type>raw</type> - </param> - - <param> - <name>Sample Rate</name> - <key>samp_rate</key> - <value>3200000</value> - <type>float</type> - </param> - - <param> - <name>Encoder list</name> - <key>encoder_list</key> - <value>0</value> - <type>raw</type> - </param> - - <param> - <name>Decoder list</name> - <key>decoder_list</key> - <value>0</value> - <type>raw</type> - </param> - - <param> - <name>Puncture Pat.</name> - <key>puncpat</key> - <value>'11'</value> - <type>string</type> - </param> - - <param> - <name>Threading Type</name> - <key>threadtype</key> - <type>enum</type> - <hide>part</hide> - <option> - <name>Capillary</name> - <key>"capillary"</key> - </option> - <option> - <name>Ordinary</name> - <key>"ordinary"</key> - </option> - <option> - <name>None</name> - <key>"none"</key> - </option> - </param> - - <param> - <name>Noise Seed</name> - <key>seed</key> - <value>0</value> - <type>int</type> - <hide>part</hide> - </param> - - <bus_source>1</bus_source> - - <source> - <name>out</name> - <type>byte</type> - <nports>len($esno)*2</nports> - </source> - - <doc> - Note that this block tries to launch many parallel codes to run simultaneously. Thus, it requires that the definitions for each encoder and decoder (specified in the "Encoder list" and "Decoder list") be configured with a parallelism > 0. If the parallelism for one of the encoder or decoder definition blocks is configured to 0, you will likely see an error like: - - generic_decoder=decoder_list[i], - TypeError: 'generic_decoder_sptr' object does not support indexing - - or - - generic_encoder=encoder_list[i], - TypeError: 'generic_encoder_sptr' object does not support indexing - </doc> -</block> diff --git a/gr-fec/grc/fec_block_tree.xml b/gr-fec/grc/fec_block_tree.xml deleted file mode 100644 index b1535e3c42..0000000000 --- a/gr-fec/grc/fec_block_tree.xml +++ /dev/null @@ -1,57 +0,0 @@ -<?xml version="1.0"?> -<!-- -################################################### -## Block Tree for gr-fec -################################################### - --> -<cat> - <name>[Core]</name> - <cat> - <name>Error Coding</name> - <cat> - <name>Decoders</name> - <block>variable_cc_decoder_def</block> - <block>variable_repetition_decoder_def</block> - <block>variable_ldpc_decoder_def</block> - <block>variable_ldpc_bit_flip_decoder_def</block> - <block>variable_tpc_decoder_def</block> - <block>variable_dummy_decoder_def</block> - <block>variable_polar_decoder_sc_def</block> - <block>variable_polar_decoder_sc_list_def</block> - <block>variable_polar_decoder_sc_systematic_def</block> - </cat> - <cat> - <name>Encoders</name> - <block>variable_cc_encoder_def</block> - <block>variable_ccsds_encoder_def</block> - <block>variable_repetition_encoder_def</block> - <block>variable_tpc_encoder_def</block> - <block>variable_ldpc_encoder_def</block> - <block>variable_ldpc_encoder_G_def</block> - <block>variable_ldpc_encoder_H_def</block> - <block>variable_polar_encoder_def</block> - <block>variable_polar_encoder_systematic_def</block> - <block>variable_dummy_encoder_def</block> - </cat> - <block>fec_extended_encoder</block> - <block>fec_extended_async_encoder</block> - <block>fec_extended_tagged_encoder</block> - <block>fec_extended_decoder</block> - <block>fec_extended_tagged_decoder</block> - <block>fec_generic_encoder</block> - <block>fec_generic_decoder</block> - <block>fec_tagged_encoder</block> - <block>fec_tagged_decoder</block> - <block>fec_async_encoder</block> - <block>fec_async_decoder</block> - <block>fec_decode_ccsds_27_fb</block> - <block>fec_encode_ccsds_27_bb</block> - <block>fec_puncture_xx</block> - <block>fec_depuncture_bb</block> - <block>fec_ber_bf</block> - <block>fec_bercurve_generator</block> - <block>variable_polar_code_configurator</block> - <block>variable_ldpc_H_matrix_def</block> - <block>variable_ldpc_G_matrix_def</block> - </cat> -</cat> diff --git a/gr-fec/grc/fec_decode_ccsds_27_bb.block.yml b/gr-fec/grc/fec_decode_ccsds_27_bb.block.yml new file mode 100644 index 0000000000..310b54e4e2 --- /dev/null +++ b/gr-fec/grc/fec_decode_ccsds_27_bb.block.yml @@ -0,0 +1,16 @@ +id: fec_encode_ccsds_27_bb +label: Encode CCSDS 27 + +inputs: +- domain: stream + dtype: byte + +outputs: +- domain: stream + dtype: byte + +templates: + imports: from gnuradio import fec + make: fec.encode_ccsds_27_bb() + +file_format: 1 diff --git a/gr-fec/grc/fec_decode_ccsds_27_bb.xml b/gr-fec/grc/fec_decode_ccsds_27_bb.xml deleted file mode 100644 index ea11837c11..0000000000 --- a/gr-fec/grc/fec_decode_ccsds_27_bb.xml +++ /dev/null @@ -1,20 +0,0 @@ -<?xml version="1.0"?> -<!-- -################################################### -##Encode CCSDS 27 -################################################### - --> -<block> - <name>Encode CCSDS 27</name> - <key>fec_encode_ccsds_27_bb</key> - <import>from gnuradio import fec</import> - <make>fec.encode_ccsds_27_bb()</make> - <sink> - <name>in</name> - <type>byte</type> - </sink> - <source> - <name>out</name> - <type>byte</type> - </source> -</block> diff --git a/gr-fec/grc/fec_decode_ccsds_27_fb.block.yml b/gr-fec/grc/fec_decode_ccsds_27_fb.block.yml new file mode 100644 index 0000000000..51eed3783d --- /dev/null +++ b/gr-fec/grc/fec_decode_ccsds_27_fb.block.yml @@ -0,0 +1,16 @@ +id: fec_decode_ccsds_27_fb +label: Decode CCSDS 27 + +inputs: +- domain: stream + dtype: float + +outputs: +- domain: stream + dtype: byte + +templates: + imports: from gnuradio import fec + make: fec.decode_ccsds_27_fb() + +file_format: 1 diff --git a/gr-fec/grc/fec_decode_ccsds_27_fb.xml b/gr-fec/grc/fec_decode_ccsds_27_fb.xml deleted file mode 100644 index f7bd9d3b5c..0000000000 --- a/gr-fec/grc/fec_decode_ccsds_27_fb.xml +++ /dev/null @@ -1,20 +0,0 @@ -<?xml version="1.0"?> -<!-- -################################################### -##Decode CCSDS 27 -################################################### - --> -<block> - <name>Decode CCSDS 27</name> - <key>fec_decode_ccsds_27_fb</key> - <import>from gnuradio import fec</import> - <make>fec.decode_ccsds_27_fb()</make> - <sink> - <name>in</name> - <type>float</type> - </sink> - <source> - <name>out</name> - <type>byte</type> - </source> -</block> diff --git a/gr-fec/grc/fec_decoder.block.yml b/gr-fec/grc/fec_decoder.block.yml new file mode 100644 index 0000000000..b90a4749c4 --- /dev/null +++ b/gr-fec/grc/fec_decoder.block.yml @@ -0,0 +1,41 @@ +id: fec_generic_decoder +label: FEC Decoder + +parameters: +- id: decoder + label: Decoder Object + dtype: raw + default: decoder_variable +- id: itype + label: Input Type + dtype: enum + options: [complex, float, int, short, byte] + option_attributes: + size: [gr.sizeof_gr_complex, gr.sizeof_float, gr.sizeof_int, gr.sizeof_short, + gr.sizeof_char] + hide: part +- id: otype + label: Output Type + dtype: enum + options: [complex, float, int, short, byte] + option_attributes: + size: [gr.sizeof_gr_complex, gr.sizeof_float, gr.sizeof_int, gr.sizeof_short, + gr.sizeof_char] + hide: part + +inputs: +- domain: stream + dtype: ${ itype } + +outputs: +- domain: stream + dtype: ${ otype } + +templates: + imports: from gnuradio import fec + make: fec.decoder(${decoder}, ${itype.size}, ${otype.size}) + +documentation: |- + This is a GNU Radio adaptor for any FEC decoder following the generic_decoder API in the fec module. Input and output are flexible to accomodate decoders that, say, modulate their encoded results into complex or float types. + +file_format: 1 diff --git a/gr-fec/grc/fec_decoder.xml b/gr-fec/grc/fec_decoder.xml deleted file mode 100644 index dd9d08d5f6..0000000000 --- a/gr-fec/grc/fec_decoder.xml +++ /dev/null @@ -1,91 +0,0 @@ -<?xml version="1.0"?> -<block> - <name>FEC Decoder</name> - <key>fec_generic_decoder</key> - <import>from gnuradio import fec</import> - <make>fec.decoder($decoder, $itype.size, $otype.size)</make> - - <param> - <name>Decoder Object</name> - <key>decoder</key> - <value>decoder_variable</value> - <type>raw</type> - </param> - - <param> - <name>Input Type</name> - <key>itype</key> - <type>enum</type> - <option> - <name>Complex</name> - <key>complex</key> - <opt>size:gr.sizeof_gr_complex</opt> - </option> - <option> - <name>Float</name> - <key>float</key> - <opt>size:gr.sizeof_float</opt> - </option> - <option> - <name>Int</name> - <key>int</key> - <opt>size:gr.sizeof_int</opt> - </option> - <option> - <name>Short</name> - <key>short</key> - <opt>size:gr.sizeof_short</opt> - </option> - <option> - <name>Byte</name> - <key>byte</key> - <opt>size:gr.sizeof_char</opt> - </option> - </param> - - <param> - <name>Output Type</name> - <key>otype</key> - <type>enum</type> - <option> - <name>Complex</name> - <key>complex</key> - <opt>size:gr.sizeof_gr_complex</opt> - </option> - <option> - <name>Float</name> - <key>float</key> - <opt>size:gr.sizeof_float</opt> - </option> - <option> - <name>Int</name> - <key>int</key> - <opt>size:gr.sizeof_int</opt> - </option> - <option> - <name>Short</name> - <key>short</key> - <opt>size:gr.sizeof_short</opt> - </option> - <option> - <name>Byte</name> - <key>byte</key> - <opt>size:gr.sizeof_char</opt> - </option> - </param> - - <sink> - <name>in</name> - <type>$itype</type> - </sink> - - <source> - <name>out</name> - <type>$otype</type> - </source> - - <doc> - This is a GNU Radio adaptor for any FEC decoder following the generic_decoder API in the fec module. Input and output are flexible to accomodate decoders that, say, modulate their encoded results into complex or float types. - </doc> - -</block>
\ No newline at end of file diff --git a/gr-fec/grc/fec_depuncture_bb.block.yml b/gr-fec/grc/fec_depuncture_bb.block.yml new file mode 100644 index 0000000000..24a3e62fcc --- /dev/null +++ b/gr-fec/grc/fec_depuncture_bb.block.yml @@ -0,0 +1,33 @@ +id: fec_depuncture_bb +label: Depuncture + +parameters: +- id: puncsize + label: Puncture Size + dtype: int +- id: puncpat + label: Puncture Pattern + dtype: int +- id: delay + label: Delay + dtype: int + default: '0' +- id: sym + label: Symbol + dtype: int + default: '127' + hide: part + +inputs: +- domain: stream + dtype: byte + +outputs: +- domain: stream + dtype: byte + +templates: + imports: from gnuradio import fec + make: fec.depuncture_bb(${puncsize}, ${puncpat}, ${delay}, ${sym}) + +file_format: 1 diff --git a/gr-fec/grc/fec_depuncture_bb.xml b/gr-fec/grc/fec_depuncture_bb.xml deleted file mode 100644 index 03dec9bd70..0000000000 --- a/gr-fec/grc/fec_depuncture_bb.xml +++ /dev/null @@ -1,45 +0,0 @@ -<?xml version="1.0"?> -<block> - <name>Depuncture</name> - <key>fec_depuncture_bb</key> - <import>from gnuradio import fec</import> - <make>fec.depuncture_bb($puncsize, $puncpat, $delay, $sym)</make> - - <param> - <name>Puncture Size</name> - <key>puncsize</key> - <type>int</type> - </param> - - <param> - <name>Puncture Pattern</name> - <key>puncpat</key> - <type>int</type> - </param> - - <param> - <name>Delay</name> - <key>delay</key> - <value>0</value> - <type>int</type> - </param> - - <param> - <name>Symbol</name> - <key>sym</key> - <value>127</value> - <type>int</type> - <hide>part</hide> - </param> - - <sink> - <name>in</name> - <type>byte</type> - </sink> - - <source> - <name>out</name> - <type>byte</type> - </source> - -</block> diff --git a/gr-fec/grc/fec_encoder.block.yml b/gr-fec/grc/fec_encoder.block.yml new file mode 100644 index 0000000000..f530d806dc --- /dev/null +++ b/gr-fec/grc/fec_encoder.block.yml @@ -0,0 +1,41 @@ +id: fec_generic_encoder +label: FEC Encoder + +parameters: +- id: encoder + label: Constituent Encoder + dtype: raw + default: encoder_variable +- id: itype + label: Input Type + dtype: enum + options: [complex, float, int, short, byte] + option_attributes: + size: [gr.sizeof_gr_complex, gr.sizeof_float, gr.sizeof_int, gr.sizeof_short, + gr.sizeof_char] + hide: part +- id: otype + label: Output Type + dtype: enum + options: [complex, float, int, short, byte] + option_attributes: + size: [gr.sizeof_gr_complex, gr.sizeof_float, gr.sizeof_int, gr.sizeof_short, + gr.sizeof_char] + hide: part + +inputs: +- domain: stream + dtype: ${ itype } + +outputs: +- domain: stream + dtype: ${ otype } + +templates: + imports: from gnuradio import fec + make: fec.encoder(${encoder}, ${itype.size}, ${otype.size}) + +documentation: |- + This is a GNU Radio adaptor for any FEC encoder following the generic_encoder API in the fec module. Input and output are flexible to accomodate encoders that, say, modulate their encoded results into complex or float types. + +file_format: 1 diff --git a/gr-fec/grc/fec_encoder.xml b/gr-fec/grc/fec_encoder.xml deleted file mode 100644 index defb7c3b46..0000000000 --- a/gr-fec/grc/fec_encoder.xml +++ /dev/null @@ -1,91 +0,0 @@ -<?xml version="1.0"?> -<block> - <name>FEC Encoder</name> - <key>fec_generic_encoder</key> - <import>from gnuradio import fec</import> - <make>fec.encoder($encoder, $itype.size, $otype.size)</make> - - <param> - <name>Constituent Encoder</name> - <key>encoder</key> - <value>encoder_variable</value> - <type>raw</type> - </param> - - <param> - <name>Input Type</name> - <key>itype</key> - <type>enum</type> - <option> - <name>Complex</name> - <key>complex</key> - <opt>size:gr.sizeof_gr_complex</opt> - </option> - <option> - <name>Float</name> - <key>float</key> - <opt>size:gr.sizeof_float</opt> - </option> - <option> - <name>Int</name> - <key>int</key> - <opt>size:gr.sizeof_int</opt> - </option> - <option> - <name>Short</name> - <key>short</key> - <opt>size:gr.sizeof_short</opt> - </option> - <option> - <name>Byte</name> - <key>byte</key> - <opt>size:gr.sizeof_char</opt> - </option> - </param> - - <param> - <name>Output Type</name> - <key>otype</key> - <type>enum</type> - <option> - <name>Complex</name> - <key>complex</key> - <opt>size:gr.sizeof_gr_complex</opt> - </option> - <option> - <name>Float</name> - <key>float</key> - <opt>size:gr.sizeof_float</opt> - </option> - <option> - <name>Int</name> - <key>int</key> - <opt>size:gr.sizeof_int</opt> - </option> - <option> - <name>Short</name> - <key>short</key> - <opt>size:gr.sizeof_short</opt> - </option> - <option> - <name>Byte</name> - <key>byte</key> - <opt>size:gr.sizeof_char</opt> - </option> - </param> - - <sink> - <name>in</name> - <type>$itype</type> - </sink> - - <source> - <name>out</name> - <type>$otype</type> - </source> - - <doc> - This is a GNU Radio adaptor for any FEC encoder following the generic_encoder API in the fec module. Input and output are flexible to accomodate encoders that, say, modulate their encoded results into complex or float types. - </doc> - -</block>
\ No newline at end of file diff --git a/gr-fec/grc/fec_extended_async_encoder.block.yml b/gr-fec/grc/fec_extended_async_encoder.block.yml new file mode 100644 index 0000000000..87fb0918ef --- /dev/null +++ b/gr-fec/grc/fec_extended_async_encoder.block.yml @@ -0,0 +1,30 @@ +id: fec_extended_async_encoder +label: FEC Extended Async Encoder + +parameters: +- id: encoder_list + label: Encoder Objects + dtype: raw + default: encoder_variable +- id: puncpat + label: Puncture Pattern + dtype: string + default: '''11''' + +inputs: +- domain: message + id: in + optional: true + +outputs: +- domain: message + id: out + optional: true + +templates: + imports: from gnuradio import fec + make: fec.extended_async_encoder(encoder_obj_list=${encoder_list}, puncpat=${puncpat}) + +documentation: "" + +file_format: 1 diff --git a/gr-fec/grc/fec_extended_async_encoder.xml b/gr-fec/grc/fec_extended_async_encoder.xml deleted file mode 100644 index e61696bcc4..0000000000 --- a/gr-fec/grc/fec_extended_async_encoder.xml +++ /dev/null @@ -1,38 +0,0 @@ -<?xml version="1.0"?> -<block> - <name>FEC Extended Async Encoder</name> - <key>fec_extended_async_encoder</key> - <import>from gnuradio import fec</import> - <make>fec.extended_async_encoder(encoder_obj_list=$encoder_list, puncpat=$puncpat)</make> - - <param> - <name>Encoder Objects</name> - <key>encoder_list</key> - <value>encoder_variable</value> - <type>raw</type> - </param> - - <param> - <name>Puncture Pattern</name> - <key>puncpat</key> - <value>'11'</value> - <type>string</type> - </param> - - <sink> - <name>in</name> - <type>message</type> - <optional>1</optional> - </sink> - - <source> - <name>out</name> - <type>message</type> - <optional>1</optional> - </source> - - <doc> - - </doc> - -</block> diff --git a/gr-fec/grc/fec_extended_decoder.block.yml b/gr-fec/grc/fec_extended_decoder.block.yml new file mode 100644 index 0000000000..6e8fb23dbb --- /dev/null +++ b/gr-fec/grc/fec_extended_decoder.block.yml @@ -0,0 +1,44 @@ +id: fec_extended_decoder +label: FEC Extended Decoder + +parameters: +- id: value + label: fake val + dtype: string + default: fec_extended_decoder + hide: all +- id: decoder_list + label: Decoder Objects + dtype: raw + default: decoder_variable +- id: threadtype + label: Threading Type + dtype: enum + options: [capillary, ordinary, none] + option_attributes: + arg: ['''capillary''', '''ordinary''', ' None'] +- id: ann + label: Annihilator + dtype: raw + default: None +- id: puncpat + label: Puncture Pattern + dtype: string + default: '''11''' + +inputs: +- domain: stream + dtype: float + +outputs: +- domain: stream + dtype: byte + +templates: + imports: from gnuradio import fec + make: fec.extended_decoder(decoder_obj_list=${decoder_list}, threading=${threadtype.arg}, + ann=${ann}, puncpat=${puncpat}, integration_period=10000) + +documentation: "" + +file_format: 1 diff --git a/gr-fec/grc/fec_extended_decoder.xml b/gr-fec/grc/fec_extended_decoder.xml deleted file mode 100644 index 9ed2f06bd0..0000000000 --- a/gr-fec/grc/fec_extended_decoder.xml +++ /dev/null @@ -1,72 +0,0 @@ -<?xml version="1.0"?> -<block> - <name>FEC Extended Decoder</name> - <key>fec_extended_decoder</key> - <import>from gnuradio import fec</import> - <make>fec.extended_decoder(decoder_obj_list=$decoder_list, threading=$threadtype.arg, ann=$ann, puncpat=$puncpat, integration_period=10000)</make> - - <param> - <name>fake val</name> - <key>value</key> - <value>fec_extended_decoder</value> - <type>string</type> - <hide>all</hide> - </param> - - <param> - <name>Decoder Objects</name> - <key>decoder_list</key> - <value>decoder_variable</value> - <type>raw</type> - </param> - - <param> - <name>Threading Type</name> - <key>threadtype</key> - <type>enum</type> - <option> - <name>Capillary</name> - <key>capillary</key> - <opt>arg:'capillary'</opt> - </option> - <option> - <name>Ordinary</name> - <key>ordinary</key> - <opt>arg:'ordinary'</opt> - </option> - <option> - <name>None</name> - <key>none</key> - <opt>arg: None</opt> - </option> - </param> - - <param> - <name>Annihilator</name> - <key>ann</key> - <value>None</value> - <type>raw</type> - </param> - - <param> - <name>Puncture Pattern</name> - <key>puncpat</key> - <value>'11'</value> - <type>string</type> - </param> - - <sink> - <name>in</name> - <type>float</type> - </sink> - - <source> - <name>out</name> - <type>byte</type> - </source> - - <doc> - - </doc> - -</block> diff --git a/gr-fec/grc/fec_extended_encoder.block.yml b/gr-fec/grc/fec_extended_encoder.block.yml new file mode 100644 index 0000000000..b478e9bbf6 --- /dev/null +++ b/gr-fec/grc/fec_extended_encoder.block.yml @@ -0,0 +1,35 @@ +id: fec_extended_encoder +label: FEC Extended Encoder + +parameters: +- id: encoder_list + label: Encoder Objects + dtype: raw + default: encoder_variable +- id: threadtype + label: Threading Type + dtype: enum + options: [capillary, ordinary, none] + option_attributes: + arg: ['''capillary''', '''ordinary''', ' None'] +- id: puncpat + label: Puncture Pattern + dtype: string + default: '''11''' + +inputs: +- domain: stream + dtype: byte + +outputs: +- domain: stream + dtype: byte + +templates: + imports: from gnuradio import fec + make: fec.extended_encoder(encoder_obj_list=${encoder_list}, threading=${threadtype.arg}, + puncpat=${puncpat}) + +documentation: "" + +file_format: 1 diff --git a/gr-fec/grc/fec_extended_encoder.xml b/gr-fec/grc/fec_extended_encoder.xml deleted file mode 100644 index d2a3ec87db..0000000000 --- a/gr-fec/grc/fec_extended_encoder.xml +++ /dev/null @@ -1,57 +0,0 @@ -<?xml version="1.0"?> -<block> - <name>FEC Extended Encoder</name> - <key>fec_extended_encoder</key> - <import>from gnuradio import fec</import> - <make>fec.extended_encoder(encoder_obj_list=$encoder_list, threading=$threadtype.arg, puncpat=$puncpat)</make> - - <param> - <name>Encoder Objects</name> - <key>encoder_list</key> - <value>encoder_variable</value> - <type>raw</type> - </param> - - <param> - <name>Threading Type</name> - <key>threadtype</key> - <type>enum</type> - <option> - <name>Capillary</name> - <key>capillary</key> - <opt>arg:'capillary'</opt> - </option> - <option> - <name>Ordinary</name> - <key>ordinary</key> - <opt>arg:'ordinary'</opt> - </option> - <option> - <name>None</name> - <key>none</key> - <opt>arg: None</opt> - </option> - </param> - - <param> - <name>Puncture Pattern</name> - <key>puncpat</key> - <value>'11'</value> - <type>string</type> - </param> - - <sink> - <name>in</name> - <type>byte</type> - </sink> - - <source> - <name>out</name> - <type>byte</type> - </source> - - <doc> - - </doc> - -</block> diff --git a/gr-fec/grc/fec_extended_tagged_decoder.block.yml b/gr-fec/grc/fec_extended_tagged_decoder.block.yml new file mode 100644 index 0000000000..7a22e092f4 --- /dev/null +++ b/gr-fec/grc/fec_extended_tagged_decoder.block.yml @@ -0,0 +1,47 @@ +id: fec_extended_tagged_decoder +label: FEC Extended Tagged Decoder + +parameters: +- id: value + label: fake val + dtype: string + default: fec_extended_decoder + hide: all +- id: decoder_list + label: Decoder Objects + dtype: raw + default: decoder_variable +- id: mtu + label: MTU (bytes) + dtype: int + default: '1500' +- id: ann + label: Annihilator + dtype: raw + default: None +- id: puncpat + label: Puncture Pattern + dtype: string + default: '''11''' +- id: lentagname + label: Length Tag Name + dtype: string + default: None + +inputs: +- domain: stream + dtype: float + +outputs: +- domain: stream + dtype: byte + +templates: + imports: from gnuradio import fec + make: self.${id} = ${id} = fec.extended_tagged_decoder(decoder_obj_list=${decoder_list}, + ann=${ann}, puncpat=${puncpat}, integration_period=10000, lentagname=${lentagname}, + mtu=${mtu}) + +documentation: "" + +file_format: 1 diff --git a/gr-fec/grc/fec_extended_tagged_decoder.xml b/gr-fec/grc/fec_extended_tagged_decoder.xml deleted file mode 100644 index 59f34d4df9..0000000000 --- a/gr-fec/grc/fec_extended_tagged_decoder.xml +++ /dev/null @@ -1,65 +0,0 @@ -<?xml version="1.0"?> -<block> - <name>FEC Extended Tagged Decoder</name> - <key>fec_extended_tagged_decoder</key> - <import>from gnuradio import fec</import> - <make>self.$(id) = $(id) = fec.extended_tagged_decoder(decoder_obj_list=$decoder_list, ann=$ann, puncpat=$puncpat, integration_period=10000, lentagname=$lentagname, mtu=$mtu)</make> - - <param> - <name>fake val</name> - <key>value</key> - <value>fec_extended_decoder</value> - <type>string</type> - <hide>all</hide> - </param> - - <param> - <name>Decoder Objects</name> - <key>decoder_list</key> - <value>decoder_variable</value> - <type>raw</type> - </param> - - <param> - <name>MTU (bytes)</name> - <key>mtu</key> - <value>1500</value> - <type>int</type> - </param> - - <param> - <name>Annihilator</name> - <key>ann</key> - <value>None</value> - <type>raw</type> - </param> - - <param> - <name>Puncture Pattern</name> - <key>puncpat</key> - <value>'11'</value> - <type>string</type> - </param> - - <param> - <name>Length Tag Name</name> - <key>lentagname</key> - <value>None</value> - <type>string</type> - </param> - - <sink> - <name>in</name> - <type>float</type> - </sink> - - <source> - <name>out</name> - <type>byte</type> - </source> - - <doc> - - </doc> - -</block> diff --git a/gr-fec/grc/fec_extended_tagged_encoder.block.yml b/gr-fec/grc/fec_extended_tagged_encoder.block.yml new file mode 100644 index 0000000000..e59ab3365d --- /dev/null +++ b/gr-fec/grc/fec_extended_tagged_encoder.block.yml @@ -0,0 +1,37 @@ +id: fec_extended_tagged_encoder +label: FEC Extended Tagged Encoder + +parameters: +- id: encoder_list + label: Encoder Objects + dtype: raw + default: encoder_variable +- id: mtu + label: MTU (bytes) + dtype: int + default: '1500' +- id: puncpat + label: Puncture Pattern + dtype: string + default: '''11''' +- id: lentagname + label: Length Tag Name + dtype: string + default: None + +inputs: +- domain: stream + dtype: byte + +outputs: +- domain: stream + dtype: byte + +templates: + imports: from gnuradio import fec + make: fec.extended_tagged_encoder(encoder_obj_list=${encoder_list}, puncpat=${puncpat}, + lentagname=${lentagname}, mtu=${mtu}) + +documentation: "" + +file_format: 1 diff --git a/gr-fec/grc/fec_extended_tagged_encoder.xml b/gr-fec/grc/fec_extended_tagged_encoder.xml deleted file mode 100644 index 92df08079a..0000000000 --- a/gr-fec/grc/fec_extended_tagged_encoder.xml +++ /dev/null @@ -1,50 +0,0 @@ -<?xml version="1.0"?> -<block> - <name>FEC Extended Tagged Encoder</name> - <key>fec_extended_tagged_encoder</key> - <import>from gnuradio import fec</import> - <make>fec.extended_tagged_encoder(encoder_obj_list=$encoder_list, puncpat=$puncpat, lentagname=$lentagname, mtu=$mtu)</make> - - <param> - <name>Encoder Objects</name> - <key>encoder_list</key> - <value>encoder_variable</value> - <type>raw</type> - </param> - - <param> - <name>MTU (bytes)</name> - <key>mtu</key> - <value>1500</value> - <type>int</type> - </param> - - <param> - <name>Puncture Pattern</name> - <key>puncpat</key> - <value>'11'</value> - <type>string</type> - </param> - - <param> - <name>Length Tag Name</name> - <key>lentagname</key> - <value>None</value> - <type>string</type> - </param> - - <sink> - <name>in</name> - <type>byte</type> - </sink> - - <source> - <name>out</name> - <type>byte</type> - </source> - - <doc> - - </doc> - -</block> diff --git a/gr-fec/grc/fec_puncture_xx.block.yml b/gr-fec/grc/fec_puncture_xx.block.yml new file mode 100644 index 0000000000..de7cf16cab --- /dev/null +++ b/gr-fec/grc/fec_puncture_xx.block.yml @@ -0,0 +1,35 @@ +id: fec_puncture_xx +label: Puncture + +parameters: +- id: type + label: Type + dtype: enum + options: [byte, float] + option_attributes: + fcn: [bb, ff] + hide: part +- id: puncsize + label: Puncture Size + dtype: int +- id: puncpat + label: Puncture Pattern + dtype: int +- id: delay + label: Delay + dtype: int + default: '0' + +inputs: +- domain: stream + dtype: ${ type } + +outputs: +- domain: stream + dtype: ${ type } + +templates: + imports: from gnuradio import fec + make: fec.puncture_${type.fcn}(${puncsize}, ${puncpat}, ${delay}) + +file_format: 1 diff --git a/gr-fec/grc/fec_puncture_xx.xml b/gr-fec/grc/fec_puncture_xx.xml deleted file mode 100644 index 1075a1c062..0000000000 --- a/gr-fec/grc/fec_puncture_xx.xml +++ /dev/null @@ -1,53 +0,0 @@ -<?xml version="1.0"?> -<block> - <name>Puncture</name> - <key>fec_puncture_xx</key> - <import>from gnuradio import fec</import> - <make>fec.puncture_$(type.fcn)($puncsize, $puncpat, $delay)</make> - - <param> - <name>Type</name> - <key>type</key> - <type>enum</type> - <option> - <name>Byte</name> - <key>byte</key> - <opt>fcn:bb</opt> - </option> - <option> - <name>Float</name> - <key>float</key> - <opt>fcn:ff</opt> - </option> - </param> - - <param> - <name>Puncture Size</name> - <key>puncsize</key> - <type>int</type> - </param> - - <param> - <name>Puncture Pattern</name> - <key>puncpat</key> - <type>int</type> - </param> - - <param> - <name>Delay</name> - <key>delay</key> - <value>0</value> - <type>int</type> - </param> - - <sink> - <name>in</name> - <type>$type</type> - </sink> - - <source> - <name>out</name> - <type>$type</type> - </source> - -</block> diff --git a/gr-fec/grc/fec_tagged_decoder.block.yml b/gr-fec/grc/fec_tagged_decoder.block.yml new file mode 100644 index 0000000000..7856bb6794 --- /dev/null +++ b/gr-fec/grc/fec_tagged_decoder.block.yml @@ -0,0 +1,47 @@ +id: fec_tagged_decoder +label: FEC Tagged Decoder + +parameters: +- id: decoder + label: Constituent Decoder + dtype: raw + default: decoder_variable +- id: mtu + label: MTU (bytes) + dtype: int + default: '1500' +- id: itype + label: Input Type + dtype: enum + options: [byte, float] + option_attributes: + size: [gr.sizeof_char, gr.sizeof_float] + hide: part +- id: otype + label: Output Type + dtype: enum + options: [byte, float] + option_attributes: + size: [gr.sizeof_char, gr.sizeof_float] + hide: part +- id: lentagname + label: Length Tag Name + dtype: string + default: '"pkt_len"' + +inputs: +- domain: stream + dtype: ${ itype } + +outputs: +- domain: stream + dtype: ${ otype } + +templates: + imports: from gnuradio import fec + make: fec.tagged_decoder(${decoder}, ${itype.size}, ${otype.size}, ${lentagname}, + ${mtu}) + +documentation: "" + +file_format: 1 diff --git a/gr-fec/grc/fec_tagged_decoder.xml b/gr-fec/grc/fec_tagged_decoder.xml deleted file mode 100644 index 1ea20bd085..0000000000 --- a/gr-fec/grc/fec_tagged_decoder.xml +++ /dev/null @@ -1,74 +0,0 @@ -<?xml version="1.0"?> -<block> - <name>FEC Tagged Decoder</name> - <key>fec_tagged_decoder</key> - <import>from gnuradio import fec</import> - <make>fec.tagged_decoder($decoder, $itype.size, $otype.size, $lentagname, $mtu)</make> - - <param> - <name>Constituent Decoder</name> - <key>decoder</key> - <value>decoder_variable</value> - <type>raw</type> - </param> - - <param> - <name>MTU (bytes)</name> - <key>mtu</key> - <value>1500</value> - <type>int</type> - </param> - - <param> - <name>Input Type</name> - <key>itype</key> - <type>enum</type> - <option> - <name>Byte</name> - <key>byte</key> - <opt>size:gr.sizeof_char</opt> - </option> - <option> - <name>Float</name> - <key>float</key> - <opt>size:gr.sizeof_float</opt> - </option> - </param> - - <param> - <name>Output Type</name> - <key>otype</key> - <type>enum</type> - <option> - <name>Byte</name> - <key>byte</key> - <opt>size:gr.sizeof_char</opt> - </option> - <option> - <name>Float</name> - <key>float</key> - <opt>size:gr.sizeof_float</opt> - </option> - </param> - - <param> - <name>Length Tag Name</name> - <key>lentagname</key> - <value>"pkt_len"</value> - <type>string</type> - </param> - - <sink> - <name>in</name> - <type>$itype</type> - </sink> - - <source> - <name>out</name> - <type>$otype</type> - </source> - - <doc> - </doc> - -</block> diff --git a/gr-fec/grc/fec_tagged_encoder.block.yml b/gr-fec/grc/fec_tagged_encoder.block.yml new file mode 100644 index 0000000000..bf675e4188 --- /dev/null +++ b/gr-fec/grc/fec_tagged_encoder.block.yml @@ -0,0 +1,47 @@ +id: fec_tagged_encoder +label: FEC Tagged Encoder + +parameters: +- id: encoder + label: Constituent Encoder + dtype: raw + default: encoder_variable +- id: mtu + label: MTU (bytes) + dtype: int + default: '1500' +- id: itype + label: Input Type + dtype: enum + options: [byte, float] + option_attributes: + size: [gr.sizeof_char, gr.sizeof_float] + hide: part +- id: otype + label: Output Type + dtype: enum + options: [byte, float] + option_attributes: + size: [gr.sizeof_char, gr.sizeof_float] + hide: part +- id: lentagname + label: Length Tag Name + dtype: string + default: '"pkt_len"' + +inputs: +- domain: stream + dtype: ${ itype } + +outputs: +- domain: stream + dtype: ${ otype } + +templates: + imports: from gnuradio import fec + make: fec.tagged_encoder(${encoder}, ${itype.size}, ${otype.size}, ${lentagname}, + ${mtu}) + +documentation: "" + +file_format: 1 diff --git a/gr-fec/grc/fec_tagged_encoder.xml b/gr-fec/grc/fec_tagged_encoder.xml deleted file mode 100644 index 30fa20e45c..0000000000 --- a/gr-fec/grc/fec_tagged_encoder.xml +++ /dev/null @@ -1,74 +0,0 @@ -<?xml version="1.0"?> -<block> - <name>FEC Tagged Encoder</name> - <key>fec_tagged_encoder</key> - <import>from gnuradio import fec</import> - <make>fec.tagged_encoder($encoder, $itype.size, $otype.size, $lentagname, $mtu)</make> - - <param> - <name>Constituent Encoder</name> - <key>encoder</key> - <value>encoder_variable</value> - <type>raw</type> - </param> - - <param> - <name>MTU (bytes)</name> - <key>mtu</key> - <value>1500</value> - <type>int</type> - </param> - - <param> - <name>Input Type</name> - <key>itype</key> - <type>enum</type> - <option> - <name>Byte</name> - <key>byte</key> - <opt>size:gr.sizeof_char</opt> - </option> - <option> - <name>Float</name> - <key>float</key> - <opt>size:gr.sizeof_float</opt> - </option> - </param> - - <param> - <name>Output Type</name> - <key>otype</key> - <type>enum</type> - <option> - <name>Byte</name> - <key>byte</key> - <opt>size:gr.sizeof_char</opt> - </option> - <option> - <name>Float</name> - <key>float</key> - <opt>size:gr.sizeof_float</opt> - </option> - </param> - - <param> - <name>Length Tag Name</name> - <key>lentagname</key> - <value>"pkt_len"</value> - <type>string</type> - </param> - - <sink> - <name>in</name> - <type>$itype</type> - </sink> - - <source> - <name>out</name> - <type>$otype</type> - </source> - - <doc> - </doc> - -</block> diff --git a/gr-fec/grc/ldpc_decoder_def_list.block.yml b/gr-fec/grc/ldpc_decoder_def_list.block.yml new file mode 100644 index 0000000000..8dc32bdc3d --- /dev/null +++ b/gr-fec/grc/ldpc_decoder_def_list.block.yml @@ -0,0 +1,53 @@ +id: variable_ldpc_decoder_def +label: LDPC Decoder Definition + +parameters: +- id: value + label: Ignore Me + dtype: raw + default: '"ok"' + hide: all +- id: ndim + label: Parallelism + dtype: enum + default: '0' + options: ['0', '1', '2'] +- id: dim1 + label: Dimension 1 + dtype: int + default: '4' + hide: ${ ('none' if (int(ndim) >= 1) else 'all') } +- id: dim2 + label: Dimension 2 + dtype: int + default: '4' + hide: ${ ('none' if (int(ndim) >= 2) else 'all') } +- id: file + label: AList File + dtype: file_open +- id: sigma + label: Sigma + dtype: float + default: '0.5' +- id: max_iter + label: Max Iterations + dtype: int + default: '50' +value: ${ value } + +templates: + imports: from gnuradio import fec + var_make: "\n% if int(ndim)==0 #:\nself.${id} = ${id} = fec.ldpc_decoder.make(${file},\ + \ ${sigma}, ${max_iter}); \n% elif int(ndim)==1 #:\nself.${id} = ${id} = map(\ + \ (lambda a: fec.ldpc_decoder.make(${file}, ${sigma}, ${max_iter})), range(0,${dim1})\ + \ ); \n% else:\nself.${id} = ${id} = map( (lambda b: map( ( lambda a: fec.ldpc_decoder.make(${file},\ + \ ${sigma}, ${max_iter})), range(0,${dim2}) ) ), range(0,${dim1})); \n% endif" + +documentation: |- + This is a soft-decision decoder that uses belief propagation (also known as message passing) that is described at: + + www.cs.toronto.edu/~radford/ftp/LDPC-2012-02-11/decoding.html + + Designed for a memoryless AWGN channel, it assumes a noise variance of the value specified for sigma. + +file_format: 1 diff --git a/gr-fec/grc/ldpc_decoder_def_list.xml b/gr-fec/grc/ldpc_decoder_def_list.xml deleted file mode 100644 index 007f85505c..0000000000 --- a/gr-fec/grc/ldpc_decoder_def_list.xml +++ /dev/null @@ -1,87 +0,0 @@ -<?xml version="1.0"?> -<block> - <name>LDPC Decoder Definition</name> - <key>variable_ldpc_decoder_def</key> - <import>from gnuradio import fec</import> - <var_make> -#if int($ndim())==0 # -self.$(id) = $(id) = fec.ldpc_decoder.make($file, $sigma, $max_iter); #slurp -#else if int($ndim())==1 # -self.$(id) = $(id) = map( (lambda a: fec.ldpc_decoder.make($file, $sigma, $max_iter)), range(0,$dim1) ); #slurp -#else -self.$(id) = $(id) = map( (lambda b: map( ( lambda a: fec.ldpc_decoder.make($file, $sigma, $max_iter)), range(0,$dim2) ) ), range(0,$dim1)); #slurp -#end if</var_make> - <make></make> - -<!-- This definition below is wierd, it seems required for the GRC to be happy, im confused --> - <param> - <name>Ignore Me</name> - <key>value</key> - <value>"ok"</value> - <type>raw</type> - <hide>all</hide> - </param> - - <param> - <name>Parallelism</name> - <key>ndim</key> - <value>0</value> - <type>enum</type> - <option> - <name>0</name> - <key>0</key> - </option> - <option> - <name>1</name> - <key>1</key> - </option> - <option> - <name>2</name> - <key>2</key> - </option> - </param> - - <param> - <name>Dimension 1</name> - <key>dim1</key> - <value>4</value> - <type>int</type> - <hide>#if (int($ndim()) >= 1) then 'none' else 'all' #</hide> - </param> - - <param> - <name>Dimension 2</name> - <key>dim2</key> - <value>4</value> - <type>int</type> - <hide>#if (int($ndim()) >= 2) then 'none' else 'all' #</hide> - </param> - - <param> - <name>AList File</name> - <key>file</key> - <type>file_open</type> - </param> - - <param> - <name>Sigma</name> - <key>sigma</key> - <value>0.5</value> - <type>float</type> - </param> - - <param> - <name>Max Iterations</name> - <key>max_iter</key> - <value>50</value> - <type>int</type> - </param> - - <doc> -This is a soft-decision decoder that uses belief propagation (also known as message passing) that is described at: - -www.cs.toronto.edu/~radford/ftp/LDPC-2012-02-11/decoding.html - -Designed for a memoryless AWGN channel, it assumes a noise variance of the value specified for sigma. - </doc> -</block> diff --git a/gr-fec/grc/ldpc_encoder_def_list.block.yml b/gr-fec/grc/ldpc_encoder_def_list.block.yml new file mode 100644 index 0000000000..cc31e960d9 --- /dev/null +++ b/gr-fec/grc/ldpc_encoder_def_list.block.yml @@ -0,0 +1,38 @@ +id: variable_ldpc_encoder_def +label: LDPC Encoder Definition + +parameters: +- id: value + label: Ignore Me + dtype: raw + default: '"ok"' + hide: all +- id: ndim + label: Parallelism + dtype: enum + default: '0' + options: ['0', '1', '2'] +- id: dim1 + label: Dimension 1 + dtype: int + default: '1' + hide: ${ ('none' if (int(ndim) >= 1) else 'all') } +- id: dim2 + label: Dimension 2 + dtype: int + default: '4' + hide: ${ ('none' if (int(ndim) >= 2) else 'all') } +- id: file + label: AList File + dtype: file_open +value: ${ fec.ldpc_encoder_make(file) } + +templates: + imports: from gnuradio import fec + var_make: "\n% if int(ndim)==0 #:\nself.${id} = ${id} = fec.ldpc_encoder_make(${file});\ + \ \n% elif int(ndim)==1 #:\nself.${id} = ${id} = map( (lambda a: fec.ldpc_encoder_make(${file})),\ + \ range(0,${dim1}) ); \n% else:\nself.${id} = ${id} = map( (lambda b: map(\ + \ ( lambda a: fec.ldpc_encoder_make(${file})), range(0,${dim2}) ) ), range(0,${dim1}));\ + \ \n% endif" + +file_format: 1 diff --git a/gr-fec/grc/ldpc_encoder_def_list.xml b/gr-fec/grc/ldpc_encoder_def_list.xml deleted file mode 100755 index 985568afc5..0000000000 --- a/gr-fec/grc/ldpc_encoder_def_list.xml +++ /dev/null @@ -1,68 +0,0 @@ -<?xml version="1.0"?> - -<block> - <name>LDPC Encoder Definition</name> - <key>variable_ldpc_encoder_def</key> - <import>from gnuradio import fec</import> - <var_make> -#if int($ndim())==0 # -self.$(id) = $(id) = fec.ldpc_encoder_make($file); #slurp -#else if int($ndim())==1 # -self.$(id) = $(id) = map( (lambda a: fec.ldpc_encoder_make($file)), range(0,$dim1) ); #slurp -#else -self.$(id) = $(id) = map( (lambda b: map( ( lambda a: fec.ldpc_encoder_make($file)), range(0,$dim2) ) ), range(0,$dim1)); #slurp -#end if</var_make> - <var_value>fec.ldpc_encoder_make($file)</var_value> - <make></make> - - <param> - <name>Ignore Me</name> - <key>value</key> - <value>"ok"</value> - <type>raw</type> - <hide>all</hide> - </param> - - <param> - <name>Parallelism</name> - <key>ndim</key> - <value>0</value> - <type>enum</type> - <option> - <name>0</name> - <key>0</key> - </option> - <option> - <name>1</name> - <key>1</key> - </option> - <option> - <name>2</name> - <key>2</key> - </option> - </param> - - <param> - <name>Dimension 1</name> - <key>dim1</key> - <value>1</value> - <type>int</type> - <hide>#if (int($ndim()) >= 1) then 'none' else 'all' #</hide> - </param> - - <param> - <name>Dimension 2</name> - <key>dim2</key> - <value>4</value> - <type>int</type> - <hide>#if (int($ndim()) >= 2) then 'none' else 'all' #</hide> - </param> - - <param> - <name>AList File</name> - <key>file</key> - <value></value> - <type>file_open</type> - </param> - -</block> diff --git a/gr-fec/grc/tpc_decoder_def_list.block.yml b/gr-fec/grc/tpc_decoder_def_list.block.yml new file mode 100644 index 0000000000..94fb55b1b9 --- /dev/null +++ b/gr-fec/grc/tpc_decoder_def_list.block.yml @@ -0,0 +1,77 @@ +id: variable_tpc_decoder_def +label: TPC Decoder Definition + +parameters: +- id: value + label: Ignore Me + dtype: raw + default: '"ok"' + hide: all +- id: ndim + label: Parallelism + dtype: enum + default: '0' + options: ['0', '1', '2'] +- id: dim1 + label: Dimension 1 + dtype: int + default: '4' + hide: ${ ('none' if (int(ndim) >= 1) else 'all') } +- id: dim2 + label: Dimension 2 + dtype: int + default: '4' + hide: ${ ('none' if (int(ndim) >= 2) else 'all') } +- id: row_poly + label: Row Encoder Polynomials + dtype: int_vector + default: '[3]' +- id: col_poly + label: Column Encoder Polynomials + dtype: int_vector + default: '[43]' +- id: krow + label: K Row + dtype: int + default: '26' +- id: kcol + label: K Col + dtype: int + default: '6' +- id: bval + label: B + dtype: int + default: '9' +- id: qval + label: Q + dtype: int + default: '3' +- id: max_iter + label: NUM Turbo Iterations + dtype: int + default: '6' +- id: decoder_type + label: Decoder Type + dtype: enum + options: ['0', '1', '2', '3', '4'] + option_labels: [Linear LOG-MAP, MAX LOG-MAP, Constant LOG-MAP, LOG-MAP (LUT Correction + Factor), LOG-MAP (C Correction Factor)] +value: ${ value } + +templates: + imports: from gnuradio import fec + var_make: "\n% if int(ndim)==0 #:\nself.${id} = ${id} = fec.tpc_decoder_make(${row_poly},\ + \ ${col_poly}, ${krow}, ${kcol}, ${bval}, ${qval}, ${max_iter}, ${decoder_type});\ + \ \n% elif int(ndim)==1 #:\nself.${id} = ${id} = map( (lambda a: fec.tpc_decoder_make(${row_poly},\ + \ ${col_poly}, ${krow}, ${kcol}, ${bval}, ${qval}, ${max_iter}, ${decoder_type})),\ + \ range(0,${dim1}) ); \n% else:\nself.${id} = ${id} = map( (lambda b: map(\ + \ ( lambda a: fec.tpc_decoder_make(${row_poly}, ${col_poly}, ${krow}, ${kcol},\ + \ ${bval}, ${qval}, ${max_iter}, ${decoder_type})), range(0,${dim2}) ) ),\ + \ range(0,${dim1})); \n% endif" + +documentation: |- + This instantiates a 1-dim array or 2-dim array fo Turbo Product Encoders (TPC). + Restrictions: B and Q must be carefully chosen such that when the matrices are setup, + and the first B outputs are removed, they (the first B outputs) are all 0's. + +file_format: 1 diff --git a/gr-fec/grc/tpc_decoder_def_list.xml b/gr-fec/grc/tpc_decoder_def_list.xml deleted file mode 100644 index aac08dbb76..0000000000 --- a/gr-fec/grc/tpc_decoder_def_list.xml +++ /dev/null @@ -1,142 +0,0 @@ -<?xml version="1.0"?> -<block> - <name>TPC Decoder Definition</name> - <key>variable_tpc_decoder_def</key> - <import>from gnuradio import fec</import> - <var_make> -#if int($ndim())==0 # -self.$(id) = $(id) = fec.tpc_decoder_make($row_poly, $col_poly, $krow, $kcol, $bval, $qval, $max_iter, $decoder_type); #slurp -#else if int($ndim())==1 # -self.$(id) = $(id) = map( (lambda a: fec.tpc_decoder_make($row_poly, $col_poly, $krow, $kcol, $bval, $qval, $max_iter, $decoder_type)), range(0,$dim1) ); #slurp -#else -self.$(id) = $(id) = map( (lambda b: map( ( lambda a: fec.tpc_decoder_make($row_poly, $col_poly, $krow, $kcol, $bval, $qval, $max_iter, $decoder_type)), range(0,$dim2) ) ), range(0,$dim1)); #slurp -#end if</var_make> - <make></make> - -<!-- This definition below is wierd, it seems required for the GRC to be happy, im confused --> - <param> - <name>Ignore Me</name> - <key>value</key> - <value>"ok"</value> - <type>raw</type> - <hide>all</hide> - </param> - - <param> - <name>Parallelism</name> - <key>ndim</key> - <value>0</value> - <type>enum</type> - <option> - <name>0</name> - <key>0</key> - </option> - <option> - <name>1</name> - <key>1</key> - </option> - <option> - <name>2</name> - <key>2</key> - </option> - </param> - - <param> - <name>Dimension 1</name> - <key>dim1</key> - <value>4</value> - <type>int</type> - <hide>#if (int($ndim()) >= 1) then 'none' else 'all' #</hide> - </param> - - <param> - <name>Dimension 2</name> - <key>dim2</key> - <value>4</value> - <type>int</type> - <hide>#if (int($ndim()) >= 2) then 'none' else 'all' #</hide> - </param> - - <param> - <name>Row Encoder Polynomials</name> - <key>row_poly</key> - <value>[3]</value> - <type>int_vector</type> - </param> - - <param> - <name>Column Encoder Polynomials</name> - <key>col_poly</key> - <value>[43]</value> - <type>int_vector</type> - </param> - - <param> - <name>K Row</name> - <key>krow</key> - <value>26</value> - <type>int</type> - </param> - - <param> - <name>K Col</name> - <key>kcol</key> - <value>6</value> - <type>int</type> - </param> - - <param> - <name>B</name> - <key>bval</key> - <value>9</value> - <type>int</type> - </param> - - <param> - <name>Q</name> - <key>qval</key> - <value>3</value> - <type>int</type> - </param> - - <param> - <name>NUM Turbo Iterations</name> - <key>max_iter</key> - <value>6</value> - <type>int</type> - </param> - - <param> - <name>Decoder Type</name> - <key>decoder_type</key> - <value></value> - <type>enum</type> - <option> - <name>Linear LOG-MAP</name> - <key>0</key> - </option> - <option> - <name>MAX LOG-MAP</name> - <key>1</key> - </option> - <option> - <name>Constant LOG-MAP</name> - <key>2</key> - </option> - <option> - <name>LOG-MAP (LUT Correction Factor)</name> - <key>3</key> - </option> - <option> - <name>LOG-MAP (C Correction Factor)</name> - <key>4</key> - </option> - </param> - - - <doc> - This instantiates a 1-dim array or 2-dim array fo Turbo Product Encoders (TPC). - Restrictions: B and Q must be carefully chosen such that when the matrices are setup, - and the first B outputs are removed, they (the first B outputs) are all 0's. - </doc> -</block> diff --git a/gr-fec/grc/tpc_encoder_def_list.block.yml b/gr-fec/grc/tpc_encoder_def_list.block.yml new file mode 100644 index 0000000000..9e47207750 --- /dev/null +++ b/gr-fec/grc/tpc_encoder_def_list.block.yml @@ -0,0 +1,66 @@ +id: variable_tpc_encoder_def +label: TPC Encoder Definition + +parameters: +- id: value + label: Ignore Me + dtype: raw + default: '"ok"' + hide: all +- id: ndim + label: Parallelism + dtype: enum + default: '0' + options: ['0', '1', '2'] +- id: dim1 + label: Dimension 1 + dtype: int + default: '4' + hide: ${ ('none' if (int(ndim) >= 1) else 'all') } +- id: dim2 + label: Dimension 2 + dtype: int + default: '4' + hide: ${ ('none' if (int(ndim) >= 2) else 'all') } +- id: row_poly + label: Row Encoder Polynomials + dtype: int_vector + default: '[3]' +- id: col_poly + label: Column Encoder Polynomials + dtype: int_vector + default: '[43]' +- id: krow + label: K Row + dtype: int + default: '26' +- id: kcol + label: K Col + dtype: int + default: '6' +- id: bval + label: B + dtype: int + default: '9' +- id: qval + label: Q + dtype: int + default: '3' +value: ${ value } + +templates: + imports: from gnuradio import fec + var_make: "\n% if int(ndim)==0 #:\nself.${id} = ${id} = fec.tpc_encoder_make(${row_poly},\ + \ ${col_poly}, ${krow}, ${kcol}, ${bval}, ${qval}); \n% elif int(ndim)==1\ + \ #:\nself.${id} = ${id} = map( (lambda a: fec.tpc_encoder_make(${row_poly},\ + \ ${col_poly}, ${krow}, ${kcol}, ${bval}, ${qval})), range(0,${dim1}) ); \n\ + % else:\nself.${id} = ${id} = map( (lambda b: map( ( lambda a: fec.tpc_encoder_make(${row_poly},\ + \ ${col_poly}, ${krow}, ${kcol}, ${bval}, ${qval})), range(0,${dim2}) ) ),\ + \ range(0,${dim1})); \n% endif" + +documentation: |- + This instantiates a 1-dim array or 2-dim array fo Turbo Product Encoders (TPC). + Restrictions: B and Q must be carefully chosen such that when the matrices are setup, + and the first B outputs are removed, they (the first B outputs) are all 0's. + +file_format: 1 diff --git a/gr-fec/grc/tpc_encoder_def_list.xml b/gr-fec/grc/tpc_encoder_def_list.xml deleted file mode 100755 index c035795b58..0000000000 --- a/gr-fec/grc/tpc_encoder_def_list.xml +++ /dev/null @@ -1,107 +0,0 @@ -<?xml version="1.0"?> -<block> - <name>TPC Encoder Definition</name> - <key>variable_tpc_encoder_def</key> - <import>from gnuradio import fec</import> - <var_make> -#if int($ndim())==0 # -self.$(id) = $(id) = fec.tpc_encoder_make($row_poly, $col_poly, $krow, $kcol, $bval, $qval); #slurp -#else if int($ndim())==1 # -self.$(id) = $(id) = map( (lambda a: fec.tpc_encoder_make($row_poly, $col_poly, $krow, $kcol, $bval, $qval)), range(0,$dim1) ); #slurp -#else -self.$(id) = $(id) = map( (lambda b: map( ( lambda a: fec.tpc_encoder_make($row_poly, $col_poly, $krow, $kcol, $bval, $qval)), range(0,$dim2) ) ), range(0,$dim1)); #slurp -#end if</var_make> - <make></make> - -<!-- This definition below is wierd, it seems required for the GRC to be happy, im confused --> - <param> - <name>Ignore Me</name> - <key>value</key> - <value>"ok"</value> - <type>raw</type> - <hide>all</hide> - </param> - - <param> - <name>Parallelism</name> - <key>ndim</key> - <value>0</value> - <type>enum</type> - <option> - <name>0</name> - <key>0</key> - </option> - <option> - <name>1</name> - <key>1</key> - </option> - <option> - <name>2</name> - <key>2</key> - </option> - </param> - - <param> - <name>Dimension 1</name> - <key>dim1</key> - <value>4</value> - <type>int</type> - <hide>#if (int($ndim()) >= 1) then 'none' else 'all' #</hide> - </param> - - <param> - <name>Dimension 2</name> - <key>dim2</key> - <value>4</value> - <type>int</type> - <hide>#if (int($ndim()) >= 2) then 'none' else 'all' #</hide> - </param> - - <param> - <name>Row Encoder Polynomials</name> - <key>row_poly</key> - <value>[3]</value> - <type>int_vector</type> - </param> - - <param> - <name>Column Encoder Polynomials</name> - <key>col_poly</key> - <value>[43]</value> - <type>int_vector</type> - </param> - - <param> - <name>K Row</name> - <key>krow</key> - <value>26</value> - <type>int</type> - </param> - - <param> - <name>K Col</name> - <key>kcol</key> - <value>6</value> - <type>int</type> - </param> - - <param> - <name>B</name> - <key>bval</key> - <value>9</value> - <type>int</type> - </param> - - <param> - <name>Q</name> - <key>qval</key> - <value>3</value> - <type>int</type> - </param> - - <doc> - This instantiates a 1-dim array or 2-dim array fo Turbo Product Encoders (TPC). - Restrictions: B and Q must be carefully chosen such that when the matrices are setup, - and the first B outputs are removed, they (the first B outputs) are all 0's. - </doc> -</block> diff --git a/gr-fec/grc/variable_cc_decoder_def_list.block.yml b/gr-fec/grc/variable_cc_decoder_def_list.block.yml new file mode 100644 index 0000000000..0dd4aa86b2 --- /dev/null +++ b/gr-fec/grc/variable_cc_decoder_def_list.block.yml @@ -0,0 +1,76 @@ +id: variable_cc_decoder_def +label: CC Decoder Definition + +parameters: +- id: value + label: Ignore Me + dtype: raw + default: '"ok"' + hide: all +- id: ndim + label: Parallelism + dtype: enum + default: '0' + options: ['0', '1', '2'] +- id: dim1 + label: Dimension 1 + dtype: int + default: '1' + hide: ${ ('none' if (int(ndim) >= 1) else 'all') } +- id: dim2 + label: Dimension 2 + dtype: int + default: '1' + hide: ${ ('none' if (int(ndim) >= 2) else 'all') } +- id: framebits + label: Frame Bits + dtype: int + default: '2048' +- id: k + label: Constraint Length (K) + dtype: int + default: '7' +- id: rate + label: Rate Inverse (1/R) (1/2) --> 2 + dtype: int + default: '2' +- id: polys + label: Polynomials + dtype: int_vector + default: '[79,109]' +- id: state_start + label: Start State + dtype: int + default: '0' +- id: state_end + label: End State + dtype: int + default: '-1' +- id: mode + label: Streaming Behavior + dtype: enum + options: [fec.CC_STREAMING, fec.CC_TERMINATED, fec.CC_TAILBITING, fec.CC_TRUNCATED] + option_labels: [Streaming, Terminated, Tailbiting, Truncated] +- id: padding + label: Byte Padding + dtype: enum + default: 'False' + options: ['False', 'True'] + option_labels: ['No', 'Yes'] +value: ${ fec.cc_decoder.make(framebits, k, rate, polys, state_start, state_end, mode, + padding) } + +templates: + imports: from gnuradio import fec + var_make: "\n% if int(ndim)==0 #:\nself.${id} = ${id} = fec.cc_decoder.make(${framebits},\ + \ ${k}, ${rate}, ${polys}, ${state_start}, ${state_end}, ${mode}, ${padding})\n\ + % elif int(ndim)==1 #:\nself.${id} = ${id} = map( (lambda a: fec.cc_decoder.make(${framebits},\ + \ ${k}, ${rate}, ${polys}, ${state_start}, ${state_end}, ${mode}, ${padding})),\ + \ range(0,${dim1}) ); \n% else:\nself.${id} = ${id} = map( (lambda b: map(\ + \ ( lambda a: fec.cc_decoder.make(${framebits}, ${k}, ${rate}, ${polys}, ${state_start},\ + \ ${state_end}, ${mode}, ${padding})), range(0,${dim2}) ) ), range(0,${dim1}));\ + \ \n% endif\n " + +documentation: "" + +file_format: 1 diff --git a/gr-fec/grc/variable_cc_decoder_def_list.xml b/gr-fec/grc/variable_cc_decoder_def_list.xml deleted file mode 100644 index daa7c73ef4..0000000000 --- a/gr-fec/grc/variable_cc_decoder_def_list.xml +++ /dev/null @@ -1,148 +0,0 @@ -<?xml version="1.0"?> -<!-- -################################################### -# FEC CC DECODER -################################################### - --> -<block> - <name>CC Decoder Definition</name> - <key>variable_cc_decoder_def</key> - <import>from gnuradio import fec</import> - <var_make> -#if int($ndim())==0 # -self.$(id) = $(id) = fec.cc_decoder.make($framebits, $k, $rate, $polys, $state_start, $state_end, $mode, $padding) -#else if int($ndim())==1 # -self.$(id) = $(id) = map( (lambda a: fec.cc_decoder.make($framebits, $k, $rate, $polys, $state_start, $state_end, $mode, $padding)), range(0,$dim1) ); #slurp -#else -self.$(id) = $(id) = map( (lambda b: map( ( lambda a: fec.cc_decoder.make($framebits, $k, $rate, $polys, $state_start, $state_end, $mode, $padding)), range(0,$dim2) ) ), range(0,$dim1)); #slurp -#end if - </var_make> - <var_value>fec.cc_decoder.make($framebits, $k, $rate, $polys, $state_start, $state_end, $mode, $padding)</var_value> - <make></make> - - <param> - <name>Ignore Me</name> - <key>value</key> - <value>"ok"</value> - <type>raw</type> - <hide>all</hide> - </param> - - <param> - <name>Parallelism</name> - <key>ndim</key> - <value>0</value> - <type>enum</type> - <option> - <name>0</name> - <key>0</key> - </option> - <option> - <name>1</name> - <key>1</key> - </option> - <option> - <name>2</name> - <key>2</key> - </option> - </param> - - <param> - <name>Dimension 1</name> - <key>dim1</key> - <value>1</value> - <type>int</type> - <hide>#if (int($ndim()) >= 1) then 'none' else 'all' #</hide> - </param> - - <param> - <name>Dimension 2</name> - <key>dim2</key> - <value>1</value> - <type>int</type> - <hide>#if (int($ndim()) >= 2) then 'none' else 'all' #</hide> - </param> - - <param> - <name>Frame Bits</name> - <key>framebits</key> - <value>2048</value> - <type>int</type> - </param> - - <param> - <name>Constraint Length (K)</name> - <key>k</key> - <value>7</value> - <type>int</type> - </param> - - <param> - <name>Rate Inverse (1/R) (1/2) --> 2</name> - <key>rate</key> - <value>2</value> - <type>int</type> - </param> - - <param> - <name>Polynomials</name> - <key>polys</key> - <value>[79,109]</value> - <type>int_vector</type> - </param> - - <param> - <name>Start State</name> - <key>state_start</key> - <value>0</value> - <type>int</type> - </param> - - <param> - <name>End State</name> - <key>state_end</key> - <value>-1</value> - <type>int</type> - </param> - - <param> - <name>Streaming Behavior</name> - <key>mode</key> - <value></value> - <type>enum</type> - <option> - <name>Streaming</name> - <key>fec.CC_STREAMING</key> - </option> - <option> - <name>Terminated</name> - <key>fec.CC_TERMINATED</key> - </option> - <option> - <name>Tailbiting</name> - <key>fec.CC_TAILBITING</key> - </option> - <option> - <name>Truncated</name> - <key>fec.CC_TRUNCATED</key> - </option> - </param> - - <param> - <name>Byte Padding</name> - <key>padding</key> - <value>False</value> - <type>enum</type> - <option> - <name>No</name> - <key>False</key> - </option> - <option> - <name>Yes</name> - <key>True</key> - </option> - </param> - - <doc> - </doc> -</block> diff --git a/gr-fec/grc/variable_cc_encoder_def_list.block.yml b/gr-fec/grc/variable_cc_encoder_def_list.block.yml new file mode 100644 index 0000000000..43f330a617 --- /dev/null +++ b/gr-fec/grc/variable_cc_encoder_def_list.block.yml @@ -0,0 +1,66 @@ +id: variable_cc_encoder_def +label: CC Encoder Definition + +parameters: +- id: ndim + label: Parallelism + dtype: enum + default: '0' + options: ['0', '1', '2'] +- id: dim1 + label: Dimension 1 + dtype: int + default: '1' + hide: ${ ('none' if (int(ndim) >= 1) else 'all') } +- id: dim2 + label: Dimension 2 + dtype: int + default: '1' + hide: ${ ('none' if (int(ndim) >= 2) else 'all') } +- id: framebits + label: Frame Bits + dtype: int + default: '2048' +- id: k + label: Constraint Length (K) + dtype: int + default: '7' +- id: rate + label: Rate Inverse (1/R) (1/2) --> 2 + dtype: int + default: '2' +- id: polys + label: Polynomials + dtype: int_vector + default: '[79,109]' +- id: state_start + label: Start State + dtype: int + default: '0' +- id: mode + label: Streaming Behavior + dtype: enum + options: [fec.CC_STREAMING, fec.CC_TERMINATED, fec.CC_TAILBITING, fec.CC_TRUNCATED] + option_labels: [Streaming, Terminated, Tailbiting, Truncated] +- id: padding + label: Byte Padding + dtype: enum + default: 'False' + options: ['False', 'True'] + option_labels: ['No', 'Yes'] +value: ${ fec.cc_encoder_make(framebits, k, rate, polys, state_start, mode, padding) + } + +templates: + imports: from gnuradio import fec + var_make: "\n% if int(ndim)==0 #:\nself.${id} = ${id} = fec.cc_encoder_make(${framebits},\ + \ ${k}, ${rate}, ${polys}, ${state_start}, ${mode}, ${padding})\n% elif int(ndim)==1\ + \ #:\nself.${id} = ${id} = map( (lambda a: fec.cc_encoder_make(${framebits},\ + \ ${k}, ${rate}, ${polys}, ${state_start}, ${mode}, ${padding})), range(0,${dim1})\ + \ ); \n% else:\nself.${id} = ${id} = map( (lambda b: map( ( lambda a: fec.cc_encoder_make(${framebits},\ + \ ${k}, ${rate}, ${polys}, ${state_start}, ${mode}, ${padding})), range(0,${dim2})\ + \ ) ), range(0,${dim1})); \n% endif\n " + +documentation: "" + +file_format: 1 diff --git a/gr-fec/grc/variable_cc_encoder_def_list.xml b/gr-fec/grc/variable_cc_encoder_def_list.xml deleted file mode 100644 index 92965204d1..0000000000 --- a/gr-fec/grc/variable_cc_encoder_def_list.xml +++ /dev/null @@ -1,133 +0,0 @@ -<?xml version="1.0"?> -<!-- -################################################### -# FEC MAKING FOR GREAT JUSTICE -################################################### - --> -<block> - <name>CC Encoder Definition</name> - <key>variable_cc_encoder_def</key> - <import>from gnuradio import fec</import> - <var_make> -#if int($ndim())==0 # -self.$(id) = $(id) = fec.cc_encoder_make($framebits, $k, $rate, $polys, $state_start, $mode, $padding) -#else if int($ndim())==1 # -self.$(id) = $(id) = map( (lambda a: fec.cc_encoder_make($framebits, $k, $rate, $polys, $state_start, $mode, $padding)), range(0,$dim1) ); #slurp -#else -self.$(id) = $(id) = map( (lambda b: map( ( lambda a: fec.cc_encoder_make($framebits, $k, $rate, $polys, $state_start, $mode, $padding)), range(0,$dim2) ) ), range(0,$dim1)); #slurp -#end if - </var_make> - <var_value>fec.cc_encoder_make($framebits, $k, $rate, $polys, $state_start, $mode, $padding)</var_value> - <make></make> - - <param> - <name>Parallelism</name> - <key>ndim</key> - <value>0</value> - <type>enum</type> - <option> - <name>0</name> - <key>0</key> - </option> - <option> - <name>1</name> - <key>1</key> - </option> - <option> - <name>2</name> - <key>2</key> - </option> - </param> - - <param> - <name>Dimension 1</name> - <key>dim1</key> - <value>1</value> - <type>int</type> - <hide>#if (int($ndim()) >= 1) then 'none' else 'all' #</hide> - </param> - - <param> - <name>Dimension 2</name> - <key>dim2</key> - <value>1</value> - <type>int</type> - <hide>#if (int($ndim()) >= 2) then 'none' else 'all' #</hide> - </param> - - <param> - <name>Frame Bits</name> - <key>framebits</key> - <value>2048</value> - <type>int</type> - </param> - - <param> - <name>Constraint Length (K)</name> - <key>k</key> - <value>7</value> - <type>int</type> - </param> - - <param> - <name>Rate Inverse (1/R) (1/2) --> 2</name> - <key>rate</key> - <value>2</value> - <type>int</type> - </param> - - <param> - <name>Polynomials</name> - <key>polys</key> - <value>[79,109]</value> - <type>int_vector</type> - </param> - - <param> - <name>Start State</name> - <key>state_start</key> - <value>0</value> - <type>int</type> - </param> - - <param> - <name>Streaming Behavior</name> - <key>mode</key> - <value></value> - <type>enum</type> - <option> - <name>Streaming</name> - <key>fec.CC_STREAMING</key> - </option> - <option> - <name>Terminated</name> - <key>fec.CC_TERMINATED</key> - </option> - <option> - <name>Tailbiting</name> - <key>fec.CC_TAILBITING</key> - </option> - <option> - <name>Truncated</name> - <key>fec.CC_TRUNCATED</key> - </option> - </param> - - <param> - <name>Byte Padding</name> - <key>padding</key> - <value>False</value> - <type>enum</type> - <option> - <name>No</name> - <key>False</key> - </option> - <option> - <name>Yes</name> - <key>True</key> - </option> - </param> - - <doc> - </doc> -</block> diff --git a/gr-fec/grc/variable_ccsds_encoder_def_list.block.yml b/gr-fec/grc/variable_ccsds_encoder_def_list.block.yml new file mode 100644 index 0000000000..7a412dde96 --- /dev/null +++ b/gr-fec/grc/variable_ccsds_encoder_def_list.block.yml @@ -0,0 +1,46 @@ +id: variable_ccsds_encoder_def +label: CCSDS Encoder Definition + +parameters: +- id: ndim + label: Parallelism + dtype: enum + default: '0' + options: ['0', '1', '2'] +- id: dim1 + label: Dimension 1 + dtype: int + default: '1' + hide: ${ ('none' if (int(ndim) >= 1) else 'all') } +- id: dim2 + label: Dimension 2 + dtype: int + default: '1' + hide: ${ ('none' if (int(ndim) >= 2) else 'all') } +- id: framebits + label: Frame Bits + dtype: int + default: '2048' +- id: state_start + label: Start State + dtype: int + default: '0' +- id: mode + label: Streaming Behavior + dtype: enum + options: [fec.CC_STREAMING, fec.CC_TERMINATED, fec.CC_TAILBITING, fec.CC_TRUNCATED] + option_labels: [Streaming, Terminated, Tailbiting, Truncated] +value: ${ fec.ccsds_encoder_make(framebits, state_start, mode) } + +templates: + imports: from gnuradio import fec + var_make: "\n% if int(ndim)==0 #:\nself.${id} = ${id} = fec.ccsds_encoder_make(${framebits},\ + \ ${state_start}, ${mode})\n% elif int(ndim)==1 #:\nself.${id} = ${id} = map(\ + \ (lambda a: fec.ccsds_encoder_make(${framebits}, ${state_start}, ${mode})),\ + \ range(0,${dim1}) ); \n% else:\nself.${id} = ${id} = map( (lambda b: map(\ + \ ( lambda a: fec.ccsds_encoder_make(${framebits}, ${state_start}, ${mode})),\ + \ range(0,${dim2}) ) ), range(0,${dim1})); \n% endif\n " + +documentation: "" + +file_format: 1 diff --git a/gr-fec/grc/variable_ccsds_encoder_def_list.xml b/gr-fec/grc/variable_ccsds_encoder_def_list.xml deleted file mode 100644 index d925fd1a7e..0000000000 --- a/gr-fec/grc/variable_ccsds_encoder_def_list.xml +++ /dev/null @@ -1,97 +0,0 @@ -<?xml version="1.0"?> -<!-- -################################################### -# FEC MAKING FOR GREAT JUSTICE -################################################### - --> -<block> - <name>CCSDS Encoder Definition</name> - <key>variable_ccsds_encoder_def</key> - <import>from gnuradio import fec</import> - <var_make> -#if int($ndim())==0 # -self.$(id) = $(id) = fec.ccsds_encoder_make($framebits, $state_start, $mode) -#else if int($ndim())==1 # -self.$(id) = $(id) = map( (lambda a: fec.ccsds_encoder_make($framebits, $state_start, $mode)), range(0,$dim1) ); #slurp -#else -self.$(id) = $(id) = map( (lambda b: map( ( lambda a: fec.ccsds_encoder_make($framebits, $state_start, $mode)), range(0,$dim2) ) ), range(0,$dim1)); #slurp -#end if - </var_make> - <var_value>fec.ccsds_encoder_make($framebits, $state_start, $mode)</var_value> - <make></make> - - <param> - <name>Parallelism</name> - <key>ndim</key> - <value>0</value> - <type>enum</type> - <option> - <name>0</name> - <key>0</key> - </option> - <option> - <name>1</name> - <key>1</key> - </option> - <option> - <name>2</name> - <key>2</key> - </option> - </param> - - <param> - <name>Dimension 1</name> - <key>dim1</key> - <value>1</value> - <type>int</type> - <hide>#if (int($ndim()) >= 1) then 'none' else 'all' #</hide> - </param> - - <param> - <name>Dimension 2</name> - <key>dim2</key> - <value>1</value> - <type>int</type> - <hide>#if (int($ndim()) >= 2) then 'none' else 'all' #</hide> - </param> - - <param> - <name>Frame Bits</name> - <key>framebits</key> - <value>2048</value> - <type>int</type> - </param> - - <param> - <name>Start State</name> - <key>state_start</key> - <value>0</value> - <type>int</type> - </param> - - <param> - <name>Streaming Behavior</name> - <key>mode</key> - <value></value> - <type>enum</type> - <option> - <name>Streaming</name> - <key>fec.CC_STREAMING</key> - </option> - <option> - <name>Terminated</name> - <key>fec.CC_TERMINATED</key> - </option> - <option> - <name>Tailbiting</name> - <key>fec.CC_TAILBITING</key> - </option> - <option> - <name>Truncated</name> - <key>fec.CC_TRUNCATED</key> - </option> - </param> - - <doc> - </doc> -</block> diff --git a/gr-fec/grc/variable_dummy_decoder_def_list.block.yml b/gr-fec/grc/variable_dummy_decoder_def_list.block.yml new file mode 100644 index 0000000000..14d0ff42d9 --- /dev/null +++ b/gr-fec/grc/variable_dummy_decoder_def_list.block.yml @@ -0,0 +1,40 @@ +id: variable_dummy_decoder_def +label: Dummy Decoder Definition + +parameters: +- id: value + label: Ignore Me + dtype: raw + default: '"ok"' + hide: all +- id: ndim + label: Parallelism + dtype: enum + options: ['0', '1', '2'] +- id: dim1 + label: Dimension 1 + dtype: int + default: '1' + hide: ${ ('none' if (int(ndim) >= 1) else 'all') } +- id: dim2 + label: Dimension 2 + dtype: int + default: '1' + hide: ${ ('none' if (int(ndim) >= 2) else 'all') } +- id: framebits + label: Frame Bits + dtype: int + default: '2048' +value: ${ fec.dummy_decoder.make(framebits) } + +templates: + imports: from gnuradio import fec + var_make: "\n% if int(ndim)==0 #:\nself.${id} = ${id} = fec.dummy_decoder.make(${framebits})\n\ + % elif int(ndim)==1 #:\nself.${id} = ${id} = map((lambda a: fec.dummy_decoder.make(${framebits})),\ + \ range(0,${dim1})) \n% else:\nself.${id} = ${id} = map((lambda b: map((lambda\ + \ a: fec.dummy_decoder.make(${framebits})), range(0,${dim2}))), range(0,${dim1}))\ + \ \n% endif\n " + +documentation: "" + +file_format: 1 diff --git a/gr-fec/grc/variable_dummy_decoder_def_list.xml b/gr-fec/grc/variable_dummy_decoder_def_list.xml deleted file mode 100644 index 4a27971c87..0000000000 --- a/gr-fec/grc/variable_dummy_decoder_def_list.xml +++ /dev/null @@ -1,75 +0,0 @@ -<?xml version="1.0"?> -<!-- -################################################### -# FEC DUMMY DECODER -################################################### - --> -<block> - <name>Dummy Decoder Definition</name> - <key>variable_dummy_decoder_def</key> - <import>from gnuradio import fec</import> - <var_make> -#if int($ndim())==0 # -self.$(id) = $(id) = fec.dummy_decoder.make($framebits) -#else if int($ndim())==1 # -self.$(id) = $(id) = map((lambda a: fec.dummy_decoder.make($framebits)), range(0,$dim1)) #slurp -#else -self.$(id) = $(id) = map((lambda b: map((lambda a: fec.dummy_decoder.make($framebits)), range(0,$dim2))), range(0,$dim1)) #slurp -#end if - </var_make> - <var_value>fec.dummy_decoder.make($framebits)</var_value> - <make></make> - - <param> - <name>Ignore Me</name> - <key>value</key> - <value>"ok"</value> - <type>raw</type> - <hide>all</hide> - </param> - - <param> - <name>Parallelism</name> - <key>ndim</key> - <value></value> - <type>enum</type> - <option> - <name>0</name> - <key>0</key> - </option> - <option> - <name>1</name> - <key>1</key> - </option> - <option> - <name>2</name> - <key>2</key> - </option> - </param> - - <param> - <name>Dimension 1</name> - <key>dim1</key> - <value>1</value> - <type>int</type> - <hide>#if (int($ndim()) >= 1) then 'none' else 'all' #</hide> - </param> - - <param> - <name>Dimension 2</name> - <key>dim2</key> - <value>1</value> - <type>int</type> - <hide>#if (int($ndim()) >= 2) then 'none' else 'all' #</hide> - </param> - - <param> - <name>Frame Bits</name> - <key>framebits</key> - <value>2048</value> - <type>int</type> - </param> - - <doc> - </doc> -</block> diff --git a/gr-fec/grc/variable_dummy_encoder_def_list.block.yml b/gr-fec/grc/variable_dummy_encoder_def_list.block.yml new file mode 100644 index 0000000000..cb9181bcd6 --- /dev/null +++ b/gr-fec/grc/variable_dummy_encoder_def_list.block.yml @@ -0,0 +1,36 @@ +id: variable_dummy_encoder_def +label: Dummy Encoder Definition + +parameters: +- id: ndim + label: Parallelism + dtype: enum + default: '0' + options: ['0', '1', '2'] +- id: dim1 + label: Dimension 1 + dtype: int + default: '1' + hide: ${ ('none' if (int(ndim) >= 1) else 'all') } +- id: dim2 + label: Dimension 2 + dtype: int + default: '1' + hide: ${ ('none' if (int(ndim) >= 2) else 'all') } +- id: framebits + label: Frame Bits + dtype: int + default: '2048' +value: ${ fec.dummy_encoder_make(framebits) } + +templates: + imports: from gnuradio import fec + var_make: "\n% if int(ndim)==0 #:\nself.${id} = ${id} = fec.dummy_encoder_make(${framebits})\n\ + % elif int(ndim)==1 #:\nself.${id} = ${id} = map((lambda a: fec.dummy_encoder_make(${framebits})),\ + \ range(0,${dim1})) \n% else:\nself.${id} = ${id} = map((lambda b: map((lambda\ + \ a: fec.dummy_encoder_make(${framebits})), range(0,${dim2}))), range(0,${dim1}))\ + \ \n% endif\n " + +documentation: "" + +file_format: 1 diff --git a/gr-fec/grc/variable_dummy_encoder_def_list.xml b/gr-fec/grc/variable_dummy_encoder_def_list.xml deleted file mode 100644 index 351fddadaf..0000000000 --- a/gr-fec/grc/variable_dummy_encoder_def_list.xml +++ /dev/null @@ -1,67 +0,0 @@ -<?xml version="1.0"?> -<!-- -################################################### -# FEC DUMMY ENCODER -################################################### - --> -<block> - <name>Dummy Encoder Definition</name> - <key>variable_dummy_encoder_def</key> - <import>from gnuradio import fec</import> - <var_make> -#if int($ndim())==0 # -self.$(id) = $(id) = fec.dummy_encoder_make($framebits) -#else if int($ndim())==1 # -self.$(id) = $(id) = map((lambda a: fec.dummy_encoder_make($framebits)), range(0,$dim1)) #slurp -#else -self.$(id) = $(id) = map((lambda b: map((lambda a: fec.dummy_encoder_make($framebits)), range(0,$dim2))), range(0,$dim1)) #slurp -#end if - </var_make> - <var_value>fec.dummy_encoder_make($framebits)</var_value> - <make></make> - - <param> - <name>Parallelism</name> - <key>ndim</key> - <value>0</value> - <type>enum</type> - <option> - <name>0</name> - <key>0</key> - </option> - <option> - <name>1</name> - <key>1</key> - </option> - <option> - <name>2</name> - <key>2</key> - </option> - </param> - - <param> - <name>Dimension 1</name> - <key>dim1</key> - <value>1</value> - <type>int</type> - <hide>#if (int($ndim()) >= 1) then 'none' else 'all' #</hide> - </param> - - <param> - <name>Dimension 2</name> - <key>dim2</key> - <value>1</value> - <type>int</type> - <hide>#if (int($ndim()) >= 2) then 'none' else 'all' #</hide> - </param> - - <param> - <name>Frame Bits</name> - <key>framebits</key> - <value>2048</value> - <type>int</type> - </param> - - <doc> - </doc> -</block> diff --git a/gr-fec/grc/variable_ldpc_G_matrix_object.block.yml b/gr-fec/grc/variable_ldpc_G_matrix_object.block.yml new file mode 100644 index 0000000000..24f0cb3cbe --- /dev/null +++ b/gr-fec/grc/variable_ldpc_G_matrix_object.block.yml @@ -0,0 +1,31 @@ +id: variable_ldpc_G_matrix_def +label: LDPC Generator Matrix + +parameters: +- id: value + label: Ignore Me + dtype: raw + default: '"ok"' + hide: all +- id: filename + label: File + dtype: file_open +value: ${ value } + +templates: + imports: from gnuradio import fec + var_make: self.${id} = ${id} = fec.ldpc_G_matrix(${filename}) + +documentation: |- + This block creates a LDPC Generator Matrix variable. + + This variable can be used by: + 1) LDPC Encoder Definition (via Generator) block + 2) LDPC Bit Flip Decoder Definition block + + Provide an alist file, which contains a Generator matrix, G, in the standard format G = [I P], where I is an identity matrix and P is the parity submatrix. + + The format of alist files is described at: + http://www.inference.phy.cam.ac.uk/mackay/codes/alist.html + +file_format: 1 diff --git a/gr-fec/grc/variable_ldpc_G_matrix_object.xml b/gr-fec/grc/variable_ldpc_G_matrix_object.xml deleted file mode 100644 index cd9360c7f7..0000000000 --- a/gr-fec/grc/variable_ldpc_G_matrix_object.xml +++ /dev/null @@ -1,43 +0,0 @@ -<?xml version="1.0"?> -<!-- -################################################### -# FEC LDPC MATRIX OBJECT -################################################### - --> - -<block> - <name>LDPC Generator Matrix</name> - <key>variable_ldpc_G_matrix_def</key> - <import>from gnuradio import fec</import> - <var_make>self.$(id) = $(id) = fec.ldpc_G_matrix($filename)</var_make> - - <make></make> - - <param> - <name>Ignore Me</name> - <key>value</key> - <value>"ok"</value> - <type>raw</type> - <hide>all</hide> - </param> - - <param> - <name>File</name> - <key>filename</key> - <value></value> - <type>file_open</type> - </param> - - <doc> -This block creates a LDPC Generator Matrix variable. - -This variable can be used by: - 1) LDPC Encoder Definition (via Generator) block - 2) LDPC Bit Flip Decoder Definition block - -Provide an alist file, which contains a Generator matrix, G, in the standard format G = [I P], where I is an identity matrix and P is the parity submatrix. - -The format of alist files is described at: -http://www.inference.phy.cam.ac.uk/mackay/codes/alist.html - </doc> -</block> diff --git a/gr-fec/grc/variable_ldpc_H_matrix_object.block.yml b/gr-fec/grc/variable_ldpc_H_matrix_object.block.yml new file mode 100644 index 0000000000..f2d1a640bd --- /dev/null +++ b/gr-fec/grc/variable_ldpc_H_matrix_object.block.yml @@ -0,0 +1,40 @@ +id: variable_ldpc_H_matrix_def +label: LDPC Parity Check Matrix + +parameters: +- id: value + label: Ignore Me + dtype: raw + default: '"ok"' + hide: all +- id: filename + label: File + dtype: file_open +- id: gap + label: Gap + dtype: int +value: ${ value } + +templates: + imports: from gnuradio import fec + var_make: self.${id} = ${id} = fec.ldpc_H_matrix(${filename}, ${gap}) + +documentation: |- + This block creates a FEC LDPC Parity Check Matrix variable. + + This variable can be used by: + 1) LDPC Encoder Definition (via Parity Check) block + 2) LDPC Bit Flip Decoder Definition block + + The format of alist files is described at: + http://www.inference.phy.cam.ac.uk/mackay/codes/alist.html + + The specific format of this parity check matrix is described by Richardson and Urbanke in Appendix A of their book: Modern Coding Theory (ISBN 978-0-521-85229-6). + + As an example, see the file {$target}/share/gnuradio/fec/ldpc/n_1800_k_0902_gap_28.alist, which is used by the FEC example flowgraph ber_curve_gen_ldpc.grc. + + There is a small library of encoding-ready alist files at {$target}/share/gnuradio/fec/ldpc. + + To convert a parity check matrix to the appropriate format required for this encoder, use the python functions in {$target}/lib/python2.7/dist-packages/gnuradio/fec/LDPC/Generate_LDPC_matrix.py. + +file_format: 1 diff --git a/gr-fec/grc/variable_ldpc_H_matrix_object.xml b/gr-fec/grc/variable_ldpc_H_matrix_object.xml deleted file mode 100644 index 1bfb6be060..0000000000 --- a/gr-fec/grc/variable_ldpc_H_matrix_object.xml +++ /dev/null @@ -1,55 +0,0 @@ -<?xml version="1.0"?> -<!-- -################################################### -# FEC LDPC PARITY CHECK MATRIX OBJECT -################################################### - --> -<block> - <name>LDPC Parity Check Matrix</name> - <key>variable_ldpc_H_matrix_def</key> - <import>from gnuradio import fec</import> - <var_make>self.$(id) = $(id) = fec.ldpc_H_matrix($filename, $gap)</var_make> - - <make></make> - - <param> - <name>Ignore Me</name> - <key>value</key> - <value>"ok"</value> - <type>raw</type> - <hide>all</hide> - </param> - - <param> - <name>File</name> - <key>filename</key> - <value></value> - <type>file_open</type> - </param> - - <param> - <name>Gap</name> - <key>gap</key> - <value></value> - <type>int</type> - </param> - - <doc> -This block creates a FEC LDPC Parity Check Matrix variable. - -This variable can be used by: - 1) LDPC Encoder Definition (via Parity Check) block - 2) LDPC Bit Flip Decoder Definition block - -The format of alist files is described at: -http://www.inference.phy.cam.ac.uk/mackay/codes/alist.html - -The specific format of this parity check matrix is described by Richardson and Urbanke in Appendix A of their book: Modern Coding Theory (ISBN 978-0-521-85229-6). - -As an example, see the file {$target}/share/gnuradio/fec/ldpc/n_1800_k_0902_gap_28.alist, which is used by the FEC example flowgraph ber_curve_gen_ldpc.grc. - -There is a small library of encoding-ready alist files at {$target}/share/gnuradio/fec/ldpc. - -To convert a parity check matrix to the appropriate format required for this encoder, use the python functions in {$target}/lib/python2.7/dist-packages/gnuradio/fec/LDPC/Generate_LDPC_matrix.py. - </doc> -</block> diff --git a/gr-fec/grc/variable_ldpc_bit_flip_decoder.block.yml b/gr-fec/grc/variable_ldpc_bit_flip_decoder.block.yml new file mode 100644 index 0000000000..4f66f07307 --- /dev/null +++ b/gr-fec/grc/variable_ldpc_bit_flip_decoder.block.yml @@ -0,0 +1,51 @@ +id: variable_ldpc_bit_flip_decoder_def +label: LDPC Bit Flip Decoder Definition + +parameters: +- id: value + label: Ignore Me + dtype: raw + default: '"ok"' + hide: all +- id: ndim + label: Parallelism + dtype: enum + options: ['0', '1', '2'] +- id: dim1 + label: Dimension 1 + dtype: int + default: '1' + hide: ${ ('none' if (int(ndim) >= 1) else 'all') } +- id: dim2 + label: Dimension 2 + dtype: int + default: '1' + hide: ${ ('none' if (int(ndim) >= 2) else 'all') } +- id: max_iterations + label: Max Iterations + dtype: int + default: '100' +- id: matrix_object + label: LDPC FEC Matrix ID + dtype: raw +value: ${ value } + +templates: + imports: from gnuradio import fec + var_make: "\n% if int(ndim)==0 #:\nself.${id} = ${id} = fec.ldpc_bit_flip_decoder.make(${matrix_object}.get_base_sptr(),\ + \ ${max_iterations})\n% elif int(ndim)==1 #:\nself.${id} = ${id} = map((lambda\ + \ a: fec.ldpc_bit_flip_decoder.make(${matrix_object}.get_base_sptr(), ${max_iterations})),\ + \ range(0,${dim1})) \n% else:\nself.${id} = ${id} = map((lambda b: map((lambda\ + \ a: fec.ldpc_bit_flip_decoder.make(${matrix_object}.get_base_sptr(), ${max_iterations})),\ + \ range(0,${dim2}))), range(0,${dim1})) \n% endif" + +documentation: |- + This block creates a LDPC Bit Flip Decoder Definition variable. + + The decoder requires knowledge of the matrix used to create (encode) the codewords. In the LDPC FEC Matrix ID field, input the ID of either a: + 1) LDPC Generator Matrix variable, or + 2) LDPC Parity Check Matrix variable + + Max iterations may be increased from 100 for possibly better performance, but significantly higher number of iterations may slow things down. + +file_format: 1 diff --git a/gr-fec/grc/variable_ldpc_bit_flip_decoder.xml b/gr-fec/grc/variable_ldpc_bit_flip_decoder.xml deleted file mode 100644 index d905ce27fb..0000000000 --- a/gr-fec/grc/variable_ldpc_bit_flip_decoder.xml +++ /dev/null @@ -1,86 +0,0 @@ -<?xml version="1.0"?> -<!-- -################################################### -# FEC LDPC BIT FLIP DECODER -################################################### - --> -<block> - <name>LDPC Bit Flip Decoder Definition</name> - <key>variable_ldpc_bit_flip_decoder_def</key> - <import>from gnuradio import fec</import> - <var_make> -#if int($ndim())==0 # -self.$(id) = $(id) = fec.ldpc_bit_flip_decoder.make(${matrix_object}.get_base_sptr(), $max_iterations) -#else if int($ndim())==1 # -self.$(id) = $(id) = map((lambda a: fec.ldpc_bit_flip_decoder.make(${matrix_object}.get_base_sptr(), $max_iterations)), range(0,$dim1)) #slurp -#else -self.$(id) = $(id) = map((lambda b: map((lambda a: fec.ldpc_bit_flip_decoder.make(${matrix_object}.get_base_sptr(), $max_iterations)), range(0,$dim2))), range(0,$dim1)) #slurp -#end if</var_make> - <make></make> - - <param> - <name>Ignore Me</name> - <key>value</key> - <value>"ok"</value> - <type>raw</type> - <hide>all</hide> - </param> - - <param> - <name>Parallelism</name> - <key>ndim</key> - <value></value> - <type>enum</type> - <option> - <name>0</name> - <key>0</key> - </option> - <option> - <name>1</name> - <key>1</key> - </option> - <option> - <name>2</name> - <key>2</key> - </option> - </param> - - <param> - <name>Dimension 1</name> - <key>dim1</key> - <value>1</value> - <type>int</type> - <hide>#if (int($ndim()) >= 1) then 'none' else 'all' #</hide> - </param> - - <param> - <name>Dimension 2</name> - <key>dim2</key> - <value>1</value> - <type>int</type> - <hide>#if (int($ndim()) >= 2) then 'none' else 'all' #</hide> - </param> - - <param> - <name>Max Iterations</name> - <key>max_iterations</key> - <value>100</value> - <type>int</type> - </param> - - <param> - <name>LDPC FEC Matrix ID</name> - <key>matrix_object</key> - <type>raw</type> - </param> - - <doc> -This block creates a LDPC Bit Flip Decoder Definition variable. - -The decoder requires knowledge of the matrix used to create (encode) the codewords. In the LDPC FEC Matrix ID field, input the ID of either a: - 1) LDPC Generator Matrix variable, or - 2) LDPC Parity Check Matrix variable - -Max iterations may be increased from 100 for possibly better performance, but significantly higher number of iterations may slow things down. - </doc> -</block> diff --git a/gr-fec/grc/variable_ldpc_encoder_G.block.yml b/gr-fec/grc/variable_ldpc_encoder_G.block.yml new file mode 100644 index 0000000000..f35f473705 --- /dev/null +++ b/gr-fec/grc/variable_ldpc_encoder_G.block.yml @@ -0,0 +1,42 @@ +id: variable_ldpc_encoder_G_def +label: LDPC Encoder Definition (via Generator) + +parameters: +- id: value + label: Ignore Me + dtype: raw + default: '"ok"' + hide: all +- id: ndim + label: Parallelism + dtype: enum + options: ['0', '1', '2'] +- id: dim1 + label: Dimension 1 + dtype: int + default: '1' + hide: ${ ('none' if (int(ndim) >= 1) else 'all') } +- id: dim2 + label: Dimension 2 + dtype: int + default: '1' + hide: ${ ('none' if (int(ndim) >= 2) else 'all') } +- id: G + label: LDPC Generator Matrix + dtype: raw +value: ${ value } + +templates: + imports: from gnuradio import fec + var_make: "\n% if int(ndim)==0 #:\nself.${id} = ${id} = fec.ldpc_gen_mtrx_encoder_make(${G})\n\ + % elif int(ndim)==1 #:\nself.${id} = ${id} = map((lambda a: fec.ldpc_gen_mtrx_encoder_make(${G})),\ + \ range(0,${dim1})) \n% else:\nself.${id} = ${id} = map((lambda b: map((lambda\ + \ a: fec.ldpc_gen_mtrx_encoder_make(${G})), range(0,${dim2}))), range(0,${dim1}))\ + \ \n% endif" + +documentation: |- + Given a generator matrix in systematic form, G = [I|P], where I is the identity matrix and P is the parity submatrix, the information word s is encoded into a codeword x via: + + x = G'*s + +file_format: 1 diff --git a/gr-fec/grc/variable_ldpc_encoder_G.xml b/gr-fec/grc/variable_ldpc_encoder_G.xml deleted file mode 100644 index 3b4dbeee25..0000000000 --- a/gr-fec/grc/variable_ldpc_encoder_G.xml +++ /dev/null @@ -1,77 +0,0 @@ -<?xml version="1.0"?> -<!-- -################################################### -# FEC LDPC ENCODER DEFINITION (VIA GENERATOR) -################################################### - --> - -<block> - <name>LDPC Encoder Definition (via Generator)</name> - <key>variable_ldpc_encoder_G_def</key> - <import>from gnuradio import fec</import> - <var_make> -#if int($ndim())==0 # -self.$(id) = $(id) = fec.ldpc_gen_mtrx_encoder_make($G) -#else if int($ndim())==1 # -self.$(id) = $(id) = map((lambda a: fec.ldpc_gen_mtrx_encoder_make($G)), range(0,$dim1)) #slurp -#else -self.$(id) = $(id) = map((lambda b: map((lambda a: fec.ldpc_gen_mtrx_encoder_make($G)), range(0,$dim2))), range(0,$dim1)) #slurp -#end if</var_make> - <make></make> - - <param> - <name>Ignore Me</name> - <key>value</key> - <value>"ok"</value> - <type>raw</type> - <hide>all</hide> - </param> - - <param> - <name>Parallelism</name> - <key>ndim</key> - <value></value> - <type>enum</type> - <option> - <name>0</name> - <key>0</key> - </option> - <option> - <name>1</name> - <key>1</key> - </option> - <option> - <name>2</name> - <key>2</key> - </option> - </param> - - <param> - <name>Dimension 1</name> - <key>dim1</key> - <value>1</value> - <type>int</type> - <hide>#if (int($ndim()) >= 1) then 'none' else 'all' #</hide> - </param> - - <param> - <name>Dimension 2</name> - <key>dim2</key> - <value>1</value> - <type>int</type> - <hide>#if (int($ndim()) >= 2) then 'none' else 'all' #</hide> - </param> - - <param> - <name>LDPC Generator Matrix</name> - <key>G</key> - <value></value> - <type>raw</type> - </param> - - <doc> -Given a generator matrix in systematic form, G = [I|P], where I is the identity matrix and P is the parity submatrix, the information word s is encoded into a codeword x via: - -x = G'*s - </doc> -</block> diff --git a/gr-fec/grc/variable_ldpc_encoder_H.block.yml b/gr-fec/grc/variable_ldpc_encoder_H.block.yml new file mode 100644 index 0000000000..3fba6c7dbf --- /dev/null +++ b/gr-fec/grc/variable_ldpc_encoder_H.block.yml @@ -0,0 +1,42 @@ +id: variable_ldpc_encoder_H_def +label: LDPC Encoder Definition (via Parity Check) + +parameters: +- id: value + label: Ignore Me + dtype: raw + default: '"ok"' + hide: all +- id: ndim + label: Parallelism + dtype: enum + options: ['0', '1', '2'] +- id: dim1 + label: Dimension 1 + dtype: int + default: '1' + hide: ${ ('none' if (int(ndim) >= 1) else 'all') } +- id: dim2 + label: Dimension 2 + dtype: int + default: '1' + hide: ${ ('none' if (int(ndim) >= 2) else 'all') } +- id: H + label: Parity Check Matrix + dtype: raw +value: ${ value } + +templates: + imports: from gnuradio import fec + var_make: "\n% if int(ndim)==0 #:\nself.${id} = ${id} = fec.ldpc_par_mtrx_encoder_make_H(${H})\n\ + % elif int(ndim)==1 #:\nself.${id} = ${id} = map((lambda a: fec.ldpc_par_mtrx_encoder_make_H(${H})),\ + \ range(0,${dim1})) \n% else:\nself.${id} = ${id} = map((lambda b: map((lambda\ + \ a: fec.ldpc_par_mtrx_encoder_make_H(${H})), range(0,${dim2}))), range(0,${dim1}))\ + \ \n% endif" + +documentation: |- + This block creates a LDPC Encoder Definition variable. + + This encoder performs a reduced complexity algorithm described by Richardson and Urbanke in Appendix A of their book: Modern Coding Theory. Compared to the block "LDPC Encoder Definition (via Generator)," this encoder requires orders of magnitude fewer operations to create each codeword. This is accomplished by completing a significant amount of the complex matrix manipulation (including inverse, multiplication, and Gaussian elimination operations) during preprocessing. The disadvantage of this encoder is that it requires a specially formatted matrix. However, GNU Radio includes python scripts to format a standard parity check matrix appropriately for this encoder, as well as a small library of encoding-ready matrices for use. + +file_format: 1 diff --git a/gr-fec/grc/variable_ldpc_encoder_H.xml b/gr-fec/grc/variable_ldpc_encoder_H.xml deleted file mode 100644 index 555891b095..0000000000 --- a/gr-fec/grc/variable_ldpc_encoder_H.xml +++ /dev/null @@ -1,75 +0,0 @@ -<?xml version="1.0"?> -<!-- -################################################### -# FEC LDPC ENCODER DEFINITION (PARITY CHECK) -################################################### - --> -<block> - <name>LDPC Encoder Definition (via Parity Check)</name> - <key>variable_ldpc_encoder_H_def</key> - <import>from gnuradio import fec</import> - <var_make> -#if int($ndim())==0 # -self.$(id) = $(id) = fec.ldpc_par_mtrx_encoder_make_H($H) -#else if int($ndim())==1 # -self.$(id) = $(id) = map((lambda a: fec.ldpc_par_mtrx_encoder_make_H($H)), range(0,$dim1)) #slurp -#else -self.$(id) = $(id) = map((lambda b: map((lambda a: fec.ldpc_par_mtrx_encoder_make_H($H)), range(0,$dim2))), range(0,$dim1)) #slurp -#end if</var_make> - <make></make> - - <param> - <name>Ignore Me</name> - <key>value</key> - <value>"ok"</value> - <type>raw</type> - <hide>all</hide> - </param> - - <param> - <name>Parallelism</name> - <key>ndim</key> - <value></value> - <type>enum</type> - <option> - <name>0</name> - <key>0</key> - </option> - <option> - <name>1</name> - <key>1</key> - </option> - <option> - <name>2</name> - <key>2</key> - </option> - </param> - - <param> - <name>Dimension 1</name> - <key>dim1</key> - <value>1</value> - <type>int</type> - <hide>#if (int($ndim()) >= 1) then 'none' else 'all' #</hide> - </param> - - <param> - <name>Dimension 2</name> - <key>dim2</key> - <value>1</value> - <type>int</type> - <hide>#if (int($ndim()) >= 2) then 'none' else 'all' #</hide> - </param> - - <param> - <name>Parity Check Matrix</name> - <key>H</key> - <value></value> - <type>raw</type> - </param> - <doc> -This block creates a LDPC Encoder Definition variable. - -This encoder performs a reduced complexity algorithm described by Richardson and Urbanke in Appendix A of their book: Modern Coding Theory. Compared to the block "LDPC Encoder Definition (via Generator)," this encoder requires orders of magnitude fewer operations to create each codeword. This is accomplished by completing a significant amount of the complex matrix manipulation (including inverse, multiplication, and Gaussian elimination operations) during preprocessing. The disadvantage of this encoder is that it requires a specially formatted matrix. However, GNU Radio includes python scripts to format a standard parity check matrix appropriately for this encoder, as well as a small library of encoding-ready matrices for use. - </doc> -</block> diff --git a/gr-fec/grc/variable_polar_code_configurator.block.yml b/gr-fec/grc/variable_polar_code_configurator.block.yml new file mode 100644 index 0000000000..2c07822c23 --- /dev/null +++ b/gr-fec/grc/variable_polar_code_configurator.block.yml @@ -0,0 +1,42 @@ +id: variable_polar_code_configurator +label: POLAR code Configurator + +parameters: +- id: channel + label: Channel + dtype: string + default: polar.CHANNEL_TYPE_BEC + options: [polar.CHANNEL_TYPE_BEC, polar.CHANNEL_TYPE_AWGN] + option_labels: [BEC, AWGN] +- id: block_size + label: Block size (N) + dtype: int + default: '32' +- id: num_info_bits + label: Info Bits (K) + dtype: int + default: '16' +- id: design_snr + label: design SNR + dtype: float + default: '0.0' +- id: mu + label: mu + dtype: int + default: '16' +value: ${ polar.load_frozen_bits_info(True, channel, block_size, num_info_bits, design_snr, + mu) } + +templates: + imports: from gnuradio.fec import polar + var_make: self.${id} = ${id} = polar.load_frozen_bits_info(False, ${channel}, + ${block_size}, ${num_info_bits}, ${design_snr}, ${mu}) + +documentation: "This block serves as an interface to the underlying Python functions\ + \ for channel construction.\n \n Current channel types are: BEC/AWGN\n Block\ + \ size must be a power of 2!\n Info Bits must be 0 smaller K smaller N\n Design\ + \ SNR does affect the target transmission SNR and thus performance.\n The parameter\ + \ mu is only relevant for AWGN channels. It is passed on to the corresponding\ + \ Channel construction algorithm." + +file_format: 1 diff --git a/gr-fec/grc/variable_polar_code_configurator.xml b/gr-fec/grc/variable_polar_code_configurator.xml deleted file mode 100644 index ee145b16f7..0000000000 --- a/gr-fec/grc/variable_polar_code_configurator.xml +++ /dev/null @@ -1,59 +0,0 @@ -<?xml version="1.0"?> -<block> - <name>POLAR code Configurator</name> - <key>variable_polar_code_configurator</key> - <import>from gnuradio.fec import polar</import> - <var_make>self.$(id) = $(id) = polar.load_frozen_bits_info(False, $channel, $block_size, $num_info_bits, $design_snr, $mu)</var_make> - <var_value>polar.load_frozen_bits_info(True, $channel, $block_size, $num_info_bits, $design_snr, $mu)</var_value> - <make></make> - - <param> - <name>Channel</name> - <key>channel</key> - <value>polar.CHANNEL_TYPE_BEC</value> - <type>string</type> - <option> - <name>BEC</name> - <key>polar.CHANNEL_TYPE_BEC</key> - </option> - <option> - <name>AWGN</name> - <key>polar.CHANNEL_TYPE_AWGN</key> - </option> - </param> - - <param> - <name>Block size (N)</name> - <key>block_size</key> - <value>32</value> - <type>int</type> - </param> - - <param> - <name>Info Bits (K)</name> - <key>num_info_bits</key> - <value>16</value> - <type>int</type> - </param> - - <param> - <name>design SNR</name> - <key>design_snr</key> - <value>0.0</value> - <type>float</type> - </param> - - <param> - <name>mu</name> - <key>mu</key> - <value>16</value> - <type>int</type> - </param> - <doc>This block serves as an interface to the underlying Python functions for channel construction. - - Current channel types are: BEC/AWGN - Block size must be a power of 2! - Info Bits must be 0 smaller K smaller N - Design SNR does affect the target transmission SNR and thus performance. - The parameter mu is only relevant for AWGN channels. It is passed on to the corresponding Channel construction algorithm.</doc> -</block> diff --git a/gr-fec/grc/variable_polar_decoder_sc.block.yml b/gr-fec/grc/variable_polar_decoder_sc.block.yml new file mode 100644 index 0000000000..00120a65db --- /dev/null +++ b/gr-fec/grc/variable_polar_decoder_sc.block.yml @@ -0,0 +1,45 @@ +id: variable_polar_decoder_sc_def +label: POLAR Decoder SC Definition + +parameters: +- id: ndim + label: Parallelism + dtype: enum + default: '0' + options: ['0', '1', '2'] +- id: dim1 + label: Dimension 1 + dtype: int + default: '1' + hide: ${ ('none' if (int(ndim) >= 1) else 'all') } +- id: dim2 + label: Dimension 2 + dtype: int + default: '4' + hide: ${ ('none' if (int(ndim) >= 2) else 'all') } +- id: block_size + label: Block size (N) + dtype: int +- id: num_info_bits + label: '#Info Bits (K)' + dtype: int +- id: frozen_bit_positions + label: Frozen Bit Positions + dtype: int_vector +- id: frozen_bit_values + label: Frozen Bit Values + dtype: int_vector +value: ${ fec.polar_decoder_sc.make(block_size, num_info_bits, frozen_bit_positions, + frozen_bit_values) } + +templates: + imports: from gnuradio import fec + var_make: "% if int(ndim)==0 #:\nself.${id} = ${id} = fec.polar_decoder_sc.make(${block_size},\ + \ ${num_info_bits}, ${frozen_bit_positions}, ${frozen_bit_values}) \n% elif\ + \ int(ndim)==1 #:\nself.${id} = ${id} = map((lambda a: fec.polar_decoder_sc.make(${block_size},\ + \ ${num_info_bits}, ${frozen_bit_positions}, ${frozen_bit_values})), range(0,\ + \ ${dim1}) ) \n% else:\nself.${id} = ${id} = map((lambda b: map((lambda a:\ + \ fec.polar_decoder_sc.make(${block_size}, ${num_info_bits}, ${frozen_bit_positions},\ + \ ${frozen_bit_values})), range(0, ${dim2}))), range(0, ${dim1})) \n% endif" + +file_format: 1 diff --git a/gr-fec/grc/variable_polar_decoder_sc.xml b/gr-fec/grc/variable_polar_decoder_sc.xml deleted file mode 100644 index 4976afb4b6..0000000000 --- a/gr-fec/grc/variable_polar_decoder_sc.xml +++ /dev/null @@ -1,74 +0,0 @@ -<?xml version="1.0"?> -<block> - <name>POLAR Decoder SC Definition</name> - <key>variable_polar_decoder_sc_def</key> - <import>from gnuradio import fec</import> - <var_make>#if int($ndim())==0 # -self.$(id) = $(id) = fec.polar_decoder_sc.make($block_size, $num_info_bits, $frozen_bit_positions, $frozen_bit_values) #slurp -#else if int($ndim())==1 # -self.$(id) = $(id) = map((lambda a: fec.polar_decoder_sc.make($block_size, $num_info_bits, $frozen_bit_positions, $frozen_bit_values)), range(0, $dim1) ) #slurp -#else -self.$(id) = $(id) = map((lambda b: map((lambda a: fec.polar_decoder_sc.make($block_size, $num_info_bits, $frozen_bit_positions, $frozen_bit_values)), range(0, $dim2))), range(0, $dim1)) #slurp -#end if</var_make> - <var_value>fec.polar_decoder_sc.make($block_size, $num_info_bits, $frozen_bit_positions, $frozen_bit_values)</var_value> - <make></make> - - <param> - <name>Parallelism</name> - <key>ndim</key> - <value>0</value> - <type>enum</type> - <option> - <name>0</name> - <key>0</key> - </option> - <option> - <name>1</name> - <key>1</key> - </option> - <option> - <name>2</name> - <key>2</key> - </option> - </param> - - <param> - <name>Dimension 1</name> - <key>dim1</key> - <value>1</value> - <type>int</type> - <hide>#if (int($ndim()) >= 1) then 'none' else 'all' #</hide> - </param> - - <param> - <name>Dimension 2</name> - <key>dim2</key> - <value>4</value> - <type>int</type> - <hide>#if (int($ndim()) >= 2) then 'none' else 'all' #</hide> - </param> - - <param> - <name>Block size (N)</name> - <key>block_size</key> - <type>int</type> - </param> - - <param> - <name>#Info Bits (K)</name> - <key>num_info_bits</key> - <type>int</type> - </param> - - <param> - <name>Frozen Bit Positions</name> - <key>frozen_bit_positions</key> - <type>int_vector</type> - </param> - - <param> - <name>Frozen Bit Values</name> - <key>frozen_bit_values</key> - <type>int_vector</type> - </param> -</block> diff --git a/gr-fec/grc/variable_polar_decoder_sc_list.block.yml b/gr-fec/grc/variable_polar_decoder_sc_list.block.yml new file mode 100644 index 0000000000..7c9de3240f --- /dev/null +++ b/gr-fec/grc/variable_polar_decoder_sc_list.block.yml @@ -0,0 +1,49 @@ +id: variable_polar_decoder_sc_list_def +label: POLAR Decoder SC List Definition + +parameters: +- id: ndim + label: Parallelism + dtype: enum + default: '0' + options: ['0', '1', '2'] +- id: dim1 + label: Dimension 1 + dtype: int + default: '1' + hide: ${ ('none' if (int(ndim) >= 1) else 'all') } +- id: dim2 + label: Dimension 2 + dtype: int + default: '4' + hide: ${ ('none' if (int(ndim) >= 2) else 'all') } +- id: max_list_size + label: Maximum List Size (L) + dtype: int +- id: block_size + label: Block size (N) + dtype: int +- id: num_info_bits + label: '#Info Bits (K)' + dtype: int +- id: frozen_bit_positions + label: Frozen Bit Positions + dtype: int_vector +- id: frozen_bit_values + label: Frozen Bit Values + dtype: int_vector +value: ${ fec.polar_decoder_sc_list.make(max_list_size, block_size, num_info_bits, + frozen_bit_positions, frozen_bit_values) } + +templates: + imports: from gnuradio import fec + var_make: "% if int(ndim)==0 #:\nself.${id} = ${id} = fec.polar_decoder_sc_list.make(${max_list_size},\ + \ ${block_size}, ${num_info_bits}, ${frozen_bit_positions}, ${frozen_bit_values})\ + \ \n% elif int(ndim)==1 #:\nself.${id} = ${id} = map((lambda a: fec.polar_decoder_sc_list.make(${max_list_size},\ + \ ${block_size}, ${num_info_bits}, ${frozen_bit_positions}, ${frozen_bit_values})),\ + \ range(0, ${dim1})) \n% else:\nself.${id} = ${id} = map((lambda b: map((lambda\ + \ a: fec.polar_decoder_sc_list.make(${max_list_size}, ${block_size}, ${num_info_bits},\ + \ ${frozen_bit_positions}, ${frozen_bit_values})), range(0, ${dim2}))), range(0,\ + \ ${dim1})) \n% endif" + +file_format: 1 diff --git a/gr-fec/grc/variable_polar_decoder_sc_list.xml b/gr-fec/grc/variable_polar_decoder_sc_list.xml deleted file mode 100644 index 2128110ad4..0000000000 --- a/gr-fec/grc/variable_polar_decoder_sc_list.xml +++ /dev/null @@ -1,80 +0,0 @@ -<?xml version="1.0"?> -<block> - <name>POLAR Decoder SC List Definition</name> - <key>variable_polar_decoder_sc_list_def</key> - <import>from gnuradio import fec</import> - <var_make>#if int($ndim())==0 # -self.$(id) = $(id) = fec.polar_decoder_sc_list.make($max_list_size, $block_size, $num_info_bits, $frozen_bit_positions, $frozen_bit_values) #slurp -#else if int($ndim())==1 # -self.$(id) = $(id) = map((lambda a: fec.polar_decoder_sc_list.make($max_list_size, $block_size, $num_info_bits, $frozen_bit_positions, $frozen_bit_values)), range(0, $dim1)) #slurp -#else -self.$(id) = $(id) = map((lambda b: map((lambda a: fec.polar_decoder_sc_list.make($max_list_size, $block_size, $num_info_bits, $frozen_bit_positions, $frozen_bit_values)), range(0, $dim2))), range(0, $dim1)) #slurp -#end if</var_make> - <var_value>fec.polar_decoder_sc_list.make($max_list_size, $block_size, $num_info_bits, $frozen_bit_positions, $frozen_bit_values)</var_value> - <make></make> - - <param> - <name>Parallelism</name> - <key>ndim</key> - <value>0</value> - <type>enum</type> - <option> - <name>0</name> - <key>0</key> - </option> - <option> - <name>1</name> - <key>1</key> - </option> - <option> - <name>2</name> - <key>2</key> - </option> - </param> - - <param> - <name>Dimension 1</name> - <key>dim1</key> - <value>1</value> - <type>int</type> - <hide>#if (int($ndim()) >= 1) then 'none' else 'all' #</hide> - </param> - - <param> - <name>Dimension 2</name> - <key>dim2</key> - <value>4</value> - <type>int</type> - <hide>#if (int($ndim()) >= 2) then 'none' else 'all' #</hide> - </param> - - <param> - <name>Maximum List Size (L)</name> - <key>max_list_size</key> - <type>int</type> - </param> - - <param> - <name>Block size (N)</name> - <key>block_size</key> - <type>int</type> - </param> - - <param> - <name>#Info Bits (K)</name> - <key>num_info_bits</key> - <type>int</type> - </param> - - <param> - <name>Frozen Bit Positions</name> - <key>frozen_bit_positions</key> - <type>int_vector</type> - </param> - - <param> - <name>Frozen Bit Values</name> - <key>frozen_bit_values</key> - <type>int_vector</type> - </param> -</block> diff --git a/gr-fec/grc/variable_polar_decoder_sc_systematic.block.yml b/gr-fec/grc/variable_polar_decoder_sc_systematic.block.yml new file mode 100644 index 0000000000..b730b20068 --- /dev/null +++ b/gr-fec/grc/variable_polar_decoder_sc_systematic.block.yml @@ -0,0 +1,42 @@ +id: variable_polar_decoder_sc_systematic_def +label: systematic POLAR Decoder SC Definition + +parameters: +- id: ndim + label: Parallelism + dtype: enum + default: '0' + options: ['0', '1', '2'] +- id: dim1 + label: Dimension 1 + dtype: int + default: '1' + hide: ${ ('none' if (int(ndim) >= 1) else 'all') } +- id: dim2 + label: Dimension 2 + dtype: int + default: '4' + hide: ${ ('none' if (int(ndim) >= 2) else 'all') } +- id: block_size + label: Block size (N) + dtype: int +- id: num_info_bits + label: '#Info Bits (K)' + dtype: int +- id: frozen_bit_positions + label: Frozen Bit Positions + dtype: int_vector +value: ${ fec.polar_decoder_sc_systematic.make(block_size, num_info_bits, frozen_bit_positions) + } + +templates: + imports: from gnuradio import fec + var_make: "% if int(ndim)==0 #:\nself.${id} = ${id} = fec.polar_decoder_sc_systematic.make(${block_size},\ + \ ${num_info_bits}, ${frozen_bit_positions}) \n% elif int(ndim)==1 #:\nself.${id}\ + \ = ${id} = map((lambda a: fec.polar_decoder_sc_systematic.make(${block_size},\ + \ ${num_info_bits}, ${frozen_bit_positions})), range(0, ${dim1}) ) \n% else:\n\ + self.${id} = ${id} = map((lambda b: map((lambda a: fec.polar_decoder_sc_systematic.make(${block_size},\ + \ ${num_info_bits}, ${frozen_bit_positions})), range(0, ${dim2}))), range(0,\ + \ ${dim1})) \n% endif" + +file_format: 1 diff --git a/gr-fec/grc/variable_polar_decoder_sc_systematic.xml b/gr-fec/grc/variable_polar_decoder_sc_systematic.xml deleted file mode 100644 index cefc7e237d..0000000000 --- a/gr-fec/grc/variable_polar_decoder_sc_systematic.xml +++ /dev/null @@ -1,68 +0,0 @@ -<?xml version="1.0"?> -<block> - <name>systematic POLAR Decoder SC Definition</name> - <key>variable_polar_decoder_sc_systematic_def</key> - <import>from gnuradio import fec</import> - <var_make>#if int($ndim())==0 # -self.$(id) = $(id) = fec.polar_decoder_sc_systematic.make($block_size, $num_info_bits, $frozen_bit_positions) #slurp -#else if int($ndim())==1 # -self.$(id) = $(id) = map((lambda a: fec.polar_decoder_sc_systematic.make($block_size, $num_info_bits, $frozen_bit_positions)), range(0, $dim1) ) #slurp -#else -self.$(id) = $(id) = map((lambda b: map((lambda a: fec.polar_decoder_sc_systematic.make($block_size, $num_info_bits, $frozen_bit_positions)), range(0, $dim2))), range(0, $dim1)) #slurp -#end if</var_make> - <var_value>fec.polar_decoder_sc_systematic.make($block_size, $num_info_bits, $frozen_bit_positions)</var_value> - <make></make> - - <param> - <name>Parallelism</name> - <key>ndim</key> - <value>0</value> - <type>enum</type> - <option> - <name>0</name> - <key>0</key> - </option> - <option> - <name>1</name> - <key>1</key> - </option> - <option> - <name>2</name> - <key>2</key> - </option> - </param> - - <param> - <name>Dimension 1</name> - <key>dim1</key> - <value>1</value> - <type>int</type> - <hide>#if (int($ndim()) >= 1) then 'none' else 'all' #</hide> - </param> - - <param> - <name>Dimension 2</name> - <key>dim2</key> - <value>4</value> - <type>int</type> - <hide>#if (int($ndim()) >= 2) then 'none' else 'all' #</hide> - </param> - - <param> - <name>Block size (N)</name> - <key>block_size</key> - <type>int</type> - </param> - - <param> - <name>#Info Bits (K)</name> - <key>num_info_bits</key> - <type>int</type> - </param> - - <param> - <name>Frozen Bit Positions</name> - <key>frozen_bit_positions</key> - <type>int_vector</type> - </param> -</block> diff --git a/gr-fec/grc/variable_polar_encoder.block.yml b/gr-fec/grc/variable_polar_encoder.block.yml new file mode 100644 index 0000000000..7979a71f43 --- /dev/null +++ b/gr-fec/grc/variable_polar_encoder.block.yml @@ -0,0 +1,52 @@ +id: variable_polar_encoder_def +label: POLAR Encoder Definition + +parameters: +- id: is_packed + label: Packed Bits + dtype: enum + default: 'False' + options: ['False', 'True'] + option_labels: ['No', 'Yes'] +- id: ndim + label: Parallelism + dtype: enum + default: '0' + options: ['0', '1', '2'] +- id: dim1 + label: Dimension 1 + dtype: int + default: '1' + hide: ${ ('none' if (int(ndim) >= 1) else 'all') } +- id: dim2 + label: Dimension 2 + dtype: int + default: '4' + hide: ${ ('none' if (int(ndim) >= 2) else 'all') } +- id: block_size + label: Block size (N) + dtype: int +- id: num_info_bits + label: '#Info Bits (K)' + dtype: int +- id: frozen_bit_positions + label: Frozen Bit Positions + dtype: int_vector +- id: frozen_bit_values + label: Frozen Bit Values + dtype: int_vector +value: ${ fec.polar_encoder.make(block_size, num_info_bits, frozen_bit_positions, + frozen_bit_values, is_packed) } + +templates: + imports: from gnuradio import fec + var_make: "% if int(ndim)==0 #:\nself.${id} = ${id} = fec.polar_encoder.make(${block_size},\ + \ ${num_info_bits}, ${frozen_bit_positions}, ${frozen_bit_values}, ${is_packed})\ + \ \n% elif int(ndim)==1 #:\nself.${id} = ${id} = map((lambda a: fec.polar_encoder.make(${block_size},\ + \ ${num_info_bits}, ${frozen_bit_positions}, ${frozen_bit_values}, ${is_packed})),\ + \ range(0, ${dim1})) \n% else:\nself.${id} = ${id} = map((lambda b: map((lambda\ + \ a: fec.polar_encoder.make(${block_size}, ${num_info_bits}, ${frozen_bit_positions},\ + \ ${frozen_bit_values}, ${is_packed})), range(0, ${dim2}))), range(0, ${dim1}))\ + \ \n% endif" + +file_format: 1 diff --git a/gr-fec/grc/variable_polar_encoder.xml b/gr-fec/grc/variable_polar_encoder.xml deleted file mode 100644 index 4147cf1edf..0000000000 --- a/gr-fec/grc/variable_polar_encoder.xml +++ /dev/null @@ -1,89 +0,0 @@ -<?xml version="1.0"?> -<block> - <name>POLAR Encoder Definition</name> - <key>variable_polar_encoder_def</key> - <import>from gnuradio import fec</import> - <var_make>#if int($ndim())==0 # -self.$(id) = $(id) = fec.polar_encoder.make($block_size, $num_info_bits, $frozen_bit_positions, $frozen_bit_values, $is_packed) #slurp -#else if int($ndim())==1 # -self.$(id) = $(id) = map((lambda a: fec.polar_encoder.make($block_size, $num_info_bits, $frozen_bit_positions, $frozen_bit_values, $is_packed)), range(0, $dim1)) #slurp -#else -self.$(id) = $(id) = map((lambda b: map((lambda a: fec.polar_encoder.make($block_size, $num_info_bits, $frozen_bit_positions, $frozen_bit_values, $is_packed)), range(0, $dim2))), range(0, $dim1)) #slurp -#end if</var_make> - <var_value>fec.polar_encoder.make($block_size, $num_info_bits, $frozen_bit_positions, $frozen_bit_values, $is_packed)</var_value> - <make></make> - - <param> - <name>Packed Bits</name> - <key>is_packed</key> - <value>False</value> - <type>enum</type> - <option> - <name>No</name> - <key>False</key> - </option> - <option> - <name>Yes</name> - <key>True</key> - </option> - </param> - - <param> - <name>Parallelism</name> - <key>ndim</key> - <value>0</value> - <type>enum</type> - <option> - <name>0</name> - <key>0</key> - </option> - <option> - <name>1</name> - <key>1</key> - </option> - <option> - <name>2</name> - <key>2</key> - </option> - </param> - - <param> - <name>Dimension 1</name> - <key>dim1</key> - <value>1</value> - <type>int</type> - <hide>#if (int($ndim()) >= 1) then 'none' else 'all' #</hide> - </param> - - <param> - <name>Dimension 2</name> - <key>dim2</key> - <value>4</value> - <type>int</type> - <hide>#if (int($ndim()) >= 2) then 'none' else 'all' #</hide> - </param> - - <param> - <name>Block size (N)</name> - <key>block_size</key> - <type>int</type> - </param> - - <param> - <name>#Info Bits (K)</name> - <key>num_info_bits</key> - <type>int</type> - </param> - - <param> - <name>Frozen Bit Positions</name> - <key>frozen_bit_positions</key> - <type>int_vector</type> - </param> - - <param> - <name>Frozen Bit Values</name> - <key>frozen_bit_values</key> - <type>int_vector</type> - </param> -</block> diff --git a/gr-fec/grc/variable_polar_encoder_systematic.block.yml b/gr-fec/grc/variable_polar_encoder_systematic.block.yml new file mode 100644 index 0000000000..0f4c5f23a3 --- /dev/null +++ b/gr-fec/grc/variable_polar_encoder_systematic.block.yml @@ -0,0 +1,42 @@ +id: variable_polar_encoder_systematic_def +label: systematic POLAR Encoder Definition + +parameters: +- id: ndim + label: Parallelism + dtype: enum + default: '0' + options: ['0', '1', '2'] +- id: dim1 + label: Dimension 1 + dtype: int + default: '1' + hide: ${ ('none' if (int(ndim) >= 1) else 'all') } +- id: dim2 + label: Dimension 2 + dtype: int + default: '4' + hide: ${ ('none' if (int(ndim) >= 2) else 'all') } +- id: block_size + label: Block size (N) + dtype: int +- id: num_info_bits + label: '#Info Bits (K)' + dtype: int +- id: frozen_bit_positions + label: Frozen Bit Positions + dtype: int_vector +value: ${ fec.polar_encoder_systematic.make(block_size, num_info_bits, frozen_bit_positions) + } + +templates: + imports: from gnuradio import fec + var_make: "% if int(ndim)==0 #:\nself.${id} = ${id} = fec.polar_encoder_systematic.make(${block_size},\ + \ ${num_info_bits}, ${frozen_bit_positions}) \n% elif int(ndim)==1 #:\nself.${id}\ + \ = ${id} = map((lambda a: fec.polar_encoder_systematic.make(${block_size},\ + \ ${num_info_bits}, ${frozen_bit_positions})), range(0, ${dim1})) \n% else:\n\ + self.${id} = ${id} = map((lambda b: map((lambda a: fec.polar_encoder_systematic.make(${block_size},\ + \ ${num_info_bits}, ${frozen_bit_positions})), range(0, ${dim2}))), range(0,\ + \ ${dim1})) \n% endif" + +file_format: 1 diff --git a/gr-fec/grc/variable_polar_encoder_systematic.xml b/gr-fec/grc/variable_polar_encoder_systematic.xml deleted file mode 100644 index 0d9bcd96ab..0000000000 --- a/gr-fec/grc/variable_polar_encoder_systematic.xml +++ /dev/null @@ -1,68 +0,0 @@ -<?xml version="1.0"?> -<block> - <name>systematic POLAR Encoder Definition</name> - <key>variable_polar_encoder_systematic_def</key> - <import>from gnuradio import fec</import> - <var_make>#if int($ndim())==0 # -self.$(id) = $(id) = fec.polar_encoder_systematic.make($block_size, $num_info_bits, $frozen_bit_positions) #slurp -#else if int($ndim())==1 # -self.$(id) = $(id) = map((lambda a: fec.polar_encoder_systematic.make($block_size, $num_info_bits, $frozen_bit_positions)), range(0, $dim1)) #slurp -#else -self.$(id) = $(id) = map((lambda b: map((lambda a: fec.polar_encoder_systematic.make($block_size, $num_info_bits, $frozen_bit_positions)), range(0, $dim2))), range(0, $dim1)) #slurp -#end if</var_make> - <var_value>fec.polar_encoder_systematic.make($block_size, $num_info_bits, $frozen_bit_positions)</var_value> - <make></make> - - <param> - <name>Parallelism</name> - <key>ndim</key> - <value>0</value> - <type>enum</type> - <option> - <name>0</name> - <key>0</key> - </option> - <option> - <name>1</name> - <key>1</key> - </option> - <option> - <name>2</name> - <key>2</key> - </option> - </param> - - <param> - <name>Dimension 1</name> - <key>dim1</key> - <value>1</value> - <type>int</type> - <hide>#if (int($ndim()) >= 1) then 'none' else 'all' #</hide> - </param> - - <param> - <name>Dimension 2</name> - <key>dim2</key> - <value>4</value> - <type>int</type> - <hide>#if (int($ndim()) >= 2) then 'none' else 'all' #</hide> - </param> - - <param> - <name>Block size (N)</name> - <key>block_size</key> - <type>int</type> - </param> - - <param> - <name>#Info Bits (K)</name> - <key>num_info_bits</key> - <type>int</type> - </param> - - <param> - <name>Frozen Bit Positions</name> - <key>frozen_bit_positions</key> - <type>int_vector</type> - </param> -</block> diff --git a/gr-fec/grc/variable_repetition_decoder_def_list.block.yml b/gr-fec/grc/variable_repetition_decoder_def_list.block.yml new file mode 100644 index 0000000000..50590038e5 --- /dev/null +++ b/gr-fec/grc/variable_repetition_decoder_def_list.block.yml @@ -0,0 +1,49 @@ +id: variable_repetition_decoder_def +label: Repetition Decoder Definition + +parameters: +- id: value + label: Ignore Me + dtype: raw + default: '"ok"' + hide: all +- id: ndim + label: Parallelism + dtype: enum + options: ['0', '1', '2'] +- id: dim1 + label: Dimension 1 + dtype: int + default: '1' + hide: ${ ('none' if (int(ndim) >= 1) else 'all') } +- id: dim2 + label: Dimension 2 + dtype: int + default: '1' + hide: ${ ('none' if (int(ndim) >= 2) else 'all') } +- id: framebits + label: Frame Bits + dtype: int + default: '2048' +- id: rep + label: Repetitions + dtype: int + default: '3' +- id: prob + label: a prior prob + dtype: float + default: '0.5' +value: ${ fec.repetition_decoder.make(framebits, rep, prob) } + +templates: + imports: from gnuradio import fec + var_make: "\n% if int(ndim)==0 #:\nself.${id} = ${id} = fec.repetition_decoder.make(${framebits},\ + \ ${rep}, ${prob})\n% elif int(ndim)==1 #:\nself.${id} = ${id} = map( (lambda\ + \ a: fec.repetition_decoder.make(${framebits}, ${rep}, ${prob})), range(0,${dim1})\ + \ ) \n% else:\nself.${id} = ${id} = map( (lambda b: map( ( lambda a: fec.repetition_decoder.make(${framebits},\ + \ ${rep}, ${prob})), range(0,${dim2}) ) ), range(0,${dim1})) \n% endif\n \ + \ " + +documentation: "" + +file_format: 1 diff --git a/gr-fec/grc/variable_repetition_decoder_def_list.xml b/gr-fec/grc/variable_repetition_decoder_def_list.xml deleted file mode 100644 index cbeef445fa..0000000000 --- a/gr-fec/grc/variable_repetition_decoder_def_list.xml +++ /dev/null @@ -1,89 +0,0 @@ -<?xml version="1.0"?> -<!-- -################################################### -# FEC REPETITION DECODER -################################################### - --> -<block> - <name>Repetition Decoder Definition</name> - <key>variable_repetition_decoder_def</key> - <import>from gnuradio import fec</import> - <var_make> -#if int($ndim())==0 # -self.$(id) = $(id) = fec.repetition_decoder.make($framebits, $rep, $prob) -#else if int($ndim())==1 # -self.$(id) = $(id) = map( (lambda a: fec.repetition_decoder.make($framebits, $rep, $prob)), range(0,$dim1) ) #slurp -#else -self.$(id) = $(id) = map( (lambda b: map( ( lambda a: fec.repetition_decoder.make($framebits, $rep, $prob)), range(0,$dim2) ) ), range(0,$dim1)) #slurp -#end if - </var_make> - <var_value>fec.repetition_decoder.make($framebits, $rep, $prob)</var_value> - <make></make> - - <param> - <name>Ignore Me</name> - <key>value</key> - <value>"ok"</value> - <type>raw</type> - <hide>all</hide> - </param> - - <param> - <name>Parallelism</name> - <key>ndim</key> - <value></value> - <type>enum</type> - <option> - <name>0</name> - <key>0</key> - </option> - <option> - <name>1</name> - <key>1</key> - </option> - <option> - <name>2</name> - <key>2</key> - </option> - </param> - - <param> - <name>Dimension 1</name> - <key>dim1</key> - <value>1</value> - <type>int</type> - <hide>#if (int($ndim()) >= 1) then 'none' else 'all' #</hide> - </param> - - <param> - <name>Dimension 2</name> - <key>dim2</key> - <value>1</value> - <type>int</type> - <hide>#if (int($ndim()) >= 2) then 'none' else 'all' #</hide> - </param> - - <param> - <name>Frame Bits</name> - <key>framebits</key> - <value>2048</value> - <type>int</type> - </param> - - <param> - <name>Repetitions</name> - <key>rep</key> - <value>3</value> - <type>int</type> - </param> - - <param> - <name>a prior prob</name> - <key>prob</key> - <value>0.5</value> - <type>float</type> - </param> - - <doc> - </doc> -</block> diff --git a/gr-fec/grc/variable_repetition_encoder_def_list.block.yml b/gr-fec/grc/variable_repetition_encoder_def_list.block.yml new file mode 100644 index 0000000000..3e86966e72 --- /dev/null +++ b/gr-fec/grc/variable_repetition_encoder_def_list.block.yml @@ -0,0 +1,39 @@ +id: variable_repetition_encoder_def +label: Repetition Encoder Definition + +parameters: +- id: ndim + label: Parallelism + dtype: enum + options: ['0', '1', '2'] +- id: dim1 + label: Dimension 1 + dtype: int + default: '1' + hide: ${ ('none' if (int(ndim) >= 1) else 'all') } +- id: dim2 + label: Dimension 2 + dtype: int + default: '1' + hide: ${ ('none' if (int(ndim) >= 2) else 'all') } +- id: framebits + label: Frame Bits + dtype: int + default: '2048' +- id: rep + label: Repetitions + dtype: int + default: '3' +value: ${ fec.repetition_encoder_make(framebits, rep) } + +templates: + imports: from gnuradio import fec + var_make: "\n% if int(ndim)==0 #:\nself.${id} = ${id} = fec.repetition_encoder_make(${framebits},\ + \ ${rep})\n% elif int(ndim)==1 #:\nself.${id} = ${id} = map((lambda a: fec.repetition_encoder_make(${framebits},\ + \ ${rep})), range(0,${dim1})) \n% else:\nself.${id} = ${id} = map((lambda\ + \ b: map((lambda a: fec.repetition_encoder_make(${framebits}, ${rep})), range(0,${dim2}))),\ + \ range(0,${dim1})) \n% endif\n " + +documentation: "" + +file_format: 1 diff --git a/gr-fec/grc/variable_repetition_encoder_def_list.xml b/gr-fec/grc/variable_repetition_encoder_def_list.xml deleted file mode 100644 index e8554189cc..0000000000 --- a/gr-fec/grc/variable_repetition_encoder_def_list.xml +++ /dev/null @@ -1,74 +0,0 @@ -<?xml version="1.0"?> -<!-- -################################################### -# FEC REPETITION ENCODER -################################################### - --> -<block> - <name>Repetition Encoder Definition</name> - <key>variable_repetition_encoder_def</key> - <import>from gnuradio import fec</import> - <var_make> -#if int($ndim())==0 # -self.$(id) = $(id) = fec.repetition_encoder_make($framebits, $rep) -#else if int($ndim())==1 # -self.$(id) = $(id) = map((lambda a: fec.repetition_encoder_make($framebits, $rep)), range(0,$dim1)) #slurp -#else -self.$(id) = $(id) = map((lambda b: map((lambda a: fec.repetition_encoder_make($framebits, $rep)), range(0,$dim2))), range(0,$dim1)) #slurp -#end if - </var_make> - <var_value>fec.repetition_encoder_make($framebits, $rep)</var_value> - <make></make> - - <param> - <name>Parallelism</name> - <key>ndim</key> - <value></value> - <type>enum</type> - <option> - <name>0</name> - <key>0</key> - </option> - <option> - <name>1</name> - <key>1</key> - </option> - <option> - <name>2</name> - <key>2</key> - </option> - </param> - - <param> - <name>Dimension 1</name> - <key>dim1</key> - <value>1</value> - <type>int</type> - <hide>#if (int($ndim()) >= 1) then 'none' else 'all' #</hide> - </param> - - <param> - <name>Dimension 2</name> - <key>dim2</key> - <value>1</value> - <type>int</type> - <hide>#if (int($ndim()) >= 2) then 'none' else 'all' #</hide> - </param> - - <param> - <name>Frame Bits</name> - <key>framebits</key> - <value>2048</value> - <type>int</type> - </param> - - <param> - <name>Repetitions</name> - <key>rep</key> - <value>3</value> - <type>int</type> - </param> - - <doc> - </doc> -</block> diff --git a/gr-fec/include/gnuradio/fec/polar_common.h b/gr-fec/include/gnuradio/fec/polar_common.h index 79272cb308..c36995b59e 100644 --- a/gr-fec/include/gnuradio/fec/polar_common.h +++ b/gr-fec/include/gnuradio/fec/polar_common.h @@ -24,6 +24,8 @@ #ifndef INCLUDED_FEC_POLAR_COMMON_H #define INCLUDED_FEC_POLAR_COMMON_H +#include <vector> + #include <gnuradio/fec/api.h> #include <vector> diff --git a/gr-fec/python/fec/CMakeLists.txt b/gr-fec/python/fec/CMakeLists.txt index 9d170b0423..013b3521a9 100644 --- a/gr-fec/python/fec/CMakeLists.txt +++ b/gr-fec/python/fec/CMakeLists.txt @@ -67,7 +67,7 @@ endif(NOT GSL_FOUND) foreach(py_qa_test_file ${py_qa_test_files}) get_filename_component(py_qa_test_name ${py_qa_test_file} NAME_WE) - GR_ADD_TEST(${py_qa_test_name} ${QA_PYTHON_EXECUTABLE} ${PYTHON_DASH_B} ${py_qa_test_file}) + GR_ADD_TEST(${py_qa_test_name} ${QA_PYTHON_EXECUTABLE} -B ${py_qa_test_file}) endforeach(py_qa_test_file) endif(ENABLE_TESTING) diff --git a/gr-fec/python/fec/LDPC/Generate_LDPC_matrix.py b/gr-fec/python/fec/LDPC/Generate_LDPC_matrix.py index a3862a6fda..8c5b17bc43 100644 --- a/gr-fec/python/fec/LDPC/Generate_LDPC_matrix.py +++ b/gr-fec/python/fec/LDPC/Generate_LDPC_matrix.py @@ -20,7 +20,12 @@ # Boston, MA 02110-1301, USA. # -from Generate_LDPC_matrix_functions import * +from __future__ import print_function +from __future__ import absolute_import +from __future__ import division +from __future__ import unicode_literals + +from .Generate_LDPC_matrix_functions import * # This is an example of how to generate a parity check matrix for # use with the LDPC Richardson Urbanke encoder. A significant amount @@ -62,18 +67,18 @@ newH = get_full_rank_H_matrix(parity_check_matrix.H) # can take a while... [bestH,g] = get_best_matrix(newH,100) -# Print out some of the resulting properties. +# Print(out some of the resulting properties.) n = bestH.shape[1] k = n - bestH.shape[0] -print "Parity check matrix properties:" -print "\tSize :", bestH.shape -print "\tRank :", linalg.matrix_rank(bestH) -print "\tRate : %.3f" % ((k*1.0)/n) -print "\tn :", n, " (codeword length)" -print "\tk :", k, " (info word length)" -print "\tgap : %i" % g +print("Parity check matrix properties:") +print("\tSize :", bestH.shape) +print("\tRank :", linalg.matrix_rank(bestH)) +print("\tRate : %.3f" % ((k*1.0) / n)) +print("\tn :", n, " (codeword length)") +print("\tk :", k, " (info word length)") +print("\tgap : %i" % g) # Save the matrix to an alist file for future use: alist_filename = "n_%04i_k_%04i_gap_%02i.alist" % (n,k,g) write_alist_file(alist_filename,bestH) -print '\nMatrix saved to alist file:', alist_filename, "\n" +print('\nMatrix saved to alist file:', alist_filename, "\n") diff --git a/gr-fec/python/fec/LDPC/Generate_LDPC_matrix_functions.py b/gr-fec/python/fec/LDPC/Generate_LDPC_matrix_functions.py index 589595bbd5..6cf0dee09e 100644 --- a/gr-fec/python/fec/LDPC/Generate_LDPC_matrix_functions.py +++ b/gr-fec/python/fec/LDPC/Generate_LDPC_matrix_functions.py @@ -20,6 +20,10 @@ # Boston, MA 02110-1301, USA. # +from __future__ import print_function +from __future__ import division +from __future__ import unicode_literals + import string, sys from numpy import * from numpy.random import shuffle, randint @@ -46,9 +50,9 @@ def read_alist_file(filename): indices = string.split(data[lineNumber]) for index in indices: H[int(index)-1,lineNumber-4] = 1 - # The subsequent lines in the file list the indices for where - # the 1s are in the rows, but this is redundant - # information. + # The subsequent lines in the file list the indices for where + # the 1s are in the rows, but this is redundant + # information. return H @@ -68,7 +72,7 @@ def write_alist_file(filename, H, verbose=0): numRows = H.shape[0] numCols = H.shape[1] - tempstring = `numCols` + ' ' + `numRows` + '\n' + tempstring = repr(numCols) + ' ' + repr(numRows) + '\n' myfile.write(tempstring) tempstring1 = '' @@ -79,12 +83,12 @@ def write_alist_file(filename, H, verbose=0): rowWeight = nonzeros.shape[1] if rowWeight > maxRowWeight: maxRowWeight = rowWeight - tempstring1 = tempstring1 + `rowWeight` + ' ' + tempstring1 = tempstring1 + repr(rowWeight) + ' ' for tempArray in nonzeros: for index in tempArray: - tempstring2 = tempstring2 + `index+1` + ' ' - tempstring2 = tempstring2 + '\n' - tempstring1 = tempstring1 + '\n' + tempstring2 = tempstring2 + repr(index+1) + ' ' + tempstring2 = tempstring2 + '\n' + tempstring1 = tempstring1 + '\n' tempstring3 = '' tempstring4 = '' @@ -94,14 +98,14 @@ def write_alist_file(filename, H, verbose=0): colWeight = nonzeros.shape[1] if colWeight > maxColWeight: maxColWeight = colWeight - tempstring3 = tempstring3 + `colWeight` + ' ' + tempstring3 = tempstring3 + repr(colWeight) + ' ' for tempArray in nonzeros: for index in tempArray: - tempstring4 = tempstring4 + `index+1` + ' ' - tempstring4 = tempstring4 + '\n' - tempstring3 = tempstring3 + '\n' + tempstring4 = tempstring4 + repr(index+1) + ' ' + tempstring4 = tempstring4 + '\n' + tempstring3 = tempstring3 + '\n' - tempstring = `maxColWeight` + ' ' + `maxRowWeight` + '\n' + tempstring = repr(maxColWeight) + ' ' + repr(maxRowWeight) + '\n' # write out max column and row weights myfile.write(tempstring) # write out all of the column weights @@ -116,11 +120,11 @@ def write_alist_file(filename, H, verbose=0): myfile.close() -class LDPC_matrix: +class LDPC_matrix(object): """ Class for a LDPC parity check matrix """ def __init__(self, alist_filename = None, - n_p_q = None, - H_matrix = None): + n_p_q = None, + H_matrix = None): if (alist_filename != None): self.H = self.read_alist_file(alist_filename) elif (n_p_q != None): @@ -128,9 +132,9 @@ class LDPC_matrix: elif (H_matrix != None): self.H = H_matrix else: - print 'Error: provide either an alist filename,', - print 'parameters for constructing regular LDPC parity', - print 'check matrix, or a numpy array.' + print('Error: provide either an alist filename, ', end='') + print('parameters for constructing regular LDPC parity, ', end='') + print('check matrix, or a numpy array.') self.rank = linalg.matrix_rank(self.H) self.numRows = self.H.shape[0] @@ -159,31 +163,31 @@ class LDPC_matrix: # For this algorithm, n/p must be an integer, because the # number of rows in each submatrix must be a whole number. - ratioTest = (n*1.0)/q + ratioTest = (n*1.0) / q if ratioTest%1 != 0: - print '\nError in regular_LDPC_code_contructor: The' - print 'ratio of inputs n/q must be a whole number.\n' + print('\nError in regular_LDPC_code_contructor: The ', end='') + print('ratio of inputs n/q must be a whole number.\n') return # First submatrix first: - m = (n*p)/q # number of rows in H matrix - submatrix1 = zeros((m/p,n)) - for row in arange(m/p): + m = (n*p) / q # number of rows in H matrix + submatrix1 = zeros((m / p,n)) + for row in arange(m / p): range1 = row*q range2 = (row+1)*q submatrix1[row,range1:range2] = 1 - H = submatrix1 + H = submatrix1 # Create the other submatrices and vertically stack them on. submatrixNum = 2 newColumnOrder = arange(n) while submatrixNum <= p: - submatrix = zeros((m/p,n)) + submatrix = zeros((m / p,n)) shuffle(newColumnOrder) for columnNum in arange(n): submatrix[:,columnNum] = \ - submatrix1[:,newColumnOrder[columnNum]] + submatrix1[:,newColumnOrder[columnNum]] H = vstack((H,submatrix)) submatrixNum = submatrixNum + 1 @@ -197,14 +201,14 @@ class LDPC_matrix: for rowNum in arange(rows): nonzeros = array(H[rowNum,:].nonzero()) if nonzeros.shape[1] != q: - print 'Row', rowNum, 'has incorrect weight!' + print('Row', rowNum, 'has incorrect weight!') return # Check the column weights for columnNum in arange(cols): nonzeros = array(H[:,columnNum].nonzero()) if nonzeros.shape[1] != p: - print 'Row', columnNum, 'has incorrect weight!' + print('Row', columnNum, 'has incorrect weight!') return return H @@ -221,10 +225,10 @@ def greedy_upper_triangulation(H, verbose=0): # Per email from Dr. Urbanke, author of this textbook, this # algorithm requires H to be full rank if linalg.matrix_rank(H_t) != H_t.shape[0]: - print 'Rank of H:', linalg.matrix_rank(tempArray) - print 'H has', H_t.shape[0], 'rows' - print 'Error: H must be full rank.' - return + print('Rank of H:', linalg.matrix_rank(tempArray)) + print('H has', H_t.shape[0], 'rows') + print('Error: H must be full rank.') + return size = H_t.shape n = size[1] @@ -253,7 +257,7 @@ def greedy_upper_triangulation(H, verbose=0): # equal to the min positive residual degree, then pick a # random column c. indices = (minResidualDegrees == minimumResidualDegree)\ - .nonzero()[1] + .nonzero()[1] indices = indices + t if indices.shape[0] == 1: columnC = indices[0] @@ -282,7 +286,7 @@ def greedy_upper_triangulation(H, verbose=0): else: # This is the 'choose' case. rowsThatContainNonZeros = H_residual[:,columnC-t]\ - .nonzero()[0] + .nonzero()[0] # Swap column c with column t. (Book says t+1 but we # index from 0, not 1.) @@ -315,8 +319,8 @@ def greedy_upper_triangulation(H, verbose=0): while sub_index < (m - rowInH_t): Htemp[m-sub_index-1,:] = H_t[m-sub_index,:] sub_index = sub_index+1 - H_t = Htemp.copy() - Htemp = H_t.copy() + H_t = Htemp.copy() + Htemp = H_t.copy() # Save temp H as new H_t. H_t = Htemp.copy() @@ -327,7 +331,7 @@ def greedy_upper_triangulation(H, verbose=0): if g == 0: if verbose: - print 'Error: gap is 0.' + print('Error: gap is 0.') return # We need to ensure phi is nonsingular. @@ -348,22 +352,22 @@ def greedy_upper_triangulation(H, verbose=0): except linalg.linalg.LinAlgError: # Phi is singular if verbose > 1: - print 'Initial phi is singular' + print('Initial phi is singular') else: # Phi is nonsingular, so we need to use this version of H. if verbose > 1: - print 'Initial phi is nonsingular' + print('Initial phi is nonsingular') return [H_t, g, t] else: if verbose: - print 'Initial phi is all zeros:\n', phi + print('Initial phi is all zeros:\n', phi) # If the C and D submatrices are all zeros, there is no point in # shuffling them around in an attempt to find a good phi. if not (C.any() or D.any()): if verbose: - print 'C and D are all zeros. There is no hope in', - print 'finding a nonsingular phi matrix. ' + print('C and D are all zeros. There is no hope in',) + print('finding a nonsingular phi matrix. ') return # We can't look at every row/column permutation possibility @@ -378,8 +382,8 @@ def greedy_upper_triangulation(H, verbose=0): while iterationCount < maxIterations: if verbose > 1: - print 'iterationCount:', iterationCount - tempH = H_t.copy() + print('iterationCount:', iterationCount) + tempH = H_t.copy() shuffle(columnsToShuffle) shuffle(rowsToShuffle) @@ -387,7 +391,7 @@ def greedy_upper_triangulation(H, verbose=0): for newDestinationColumnNumber in arange(t,n): oldColumnNumber = columnsToShuffle[index] tempH[:,newDestinationColumnNumber] = \ - H_t[:,oldColumnNumber] + H_t[:,oldColumnNumber] index +=1 tempH2 = tempH.copy() @@ -414,23 +418,23 @@ def greedy_upper_triangulation(H, verbose=0): except linalg.linalg.LinAlgError: # Phi is singular if verbose > 1: - print 'Phi is still singular' + print('Phi is still singular') else: # Phi is nonsingular, so we're done. if verbose: - print 'Found a nonsingular phi on', - print 'iterationCount = ', iterationCount + print('Found a nonsingular phi on',) + print('iterationCount = ', iterationCount) return [H_t, g, t] else: if verbose > 1: - print 'phi is all zeros' + print('phi is all zeros') iterationCount +=1 # If we've reached this point, then we haven't found a # version of H that has a nonsingular phi. if verbose: - print '--- Error: nonsingular phi matrix not found.' + print('--- Error: nonsingular phi matrix not found.') def inv_mod2(squareMatrix, verbose=0): """ @@ -468,16 +472,16 @@ def inv_mod2(squareMatrix, verbose=0): tempTest[rowNum,colNum] = 0 else: if verbose > 1: - print 'In inv_mod2. Rounding error on this', - print 'value? Mod 2 has already been done.', - print 'value:', value + print('In inv_mod2. Rounding error on this',) + print('value? Mod 2 has already been done.',) + print('value:', value) test = tempTest.copy() if (test - eye(t,t) % 2).any(): if verbose: - print 'Error in inv_mod2: did not find inverse.' - # TODO is this the most appropriate error to raise? + print('Error in inv_mod2: did not find inverse.') + # TODO is this the most appropriate error to raise? raise linalg.linalg.LinAlgError else: return C @@ -520,7 +524,7 @@ def get_full_rank_H_matrix(H, verbose=False): tempArray = H.copy() if linalg.matrix_rank(tempArray) == tempArray.shape[0]: if verbose: - print 'Returning H; it is already full rank.' + print('Returning H; it is already full rank.') return tempArray numRows = tempArray.shape[0] @@ -538,8 +542,8 @@ def get_full_rank_H_matrix(H, verbose=False): while i < limit: if verbose: - print 'In get_full_rank_H_matrix; i:', i - # Flag indicating that the row contains a non-zero entry + print('In get_full_rank_H_matrix; i:', i) + # Flag indicating that the row contains a non-zero entry found = False for j in arange(i, numColumns): if tempArray[i, j] == 1: @@ -588,8 +592,8 @@ def get_full_rank_H_matrix(H, verbose=False): newH[:,index] = tempHarray[:,columnOrder[0,index]] if verbose: - print 'original H.shape:', H.shape - print 'newH.shape:', newH.shape + print('original H.shape:', H.shape) + print('newH.shape:', newH.shape) return newH @@ -604,13 +608,13 @@ def get_best_matrix(H, numIterations=100, verbose=False): index = 1 while index <= numIterations: if verbose: - print '--- In get_best_matrix, iteration:', index - index += 1 + print('--- In get_best_matrix, iteration:', index) + index += 1 try: ret = greedy_upper_triangulation(H, verbose) - except ValueError, e: + except ValueError as e: if verbose > 1: - print 'greedy_upper_triangulation error: ', e + print('greedy_upper_triangulation error: ', e) else: if ret: [betterH, gap, t] = ret @@ -632,8 +636,8 @@ def get_best_matrix(H, numIterations=100, verbose=False): return [bestH, bestGap] else: if verbose: - print 'Error: Could not find appropriate H form', - print 'for encoding.' + print('Error: Could not find appropriate H form',) + print('for encoding.') return def getSystematicGmatrix(GenMatrix): @@ -643,7 +647,7 @@ def getSystematicGmatrix(GenMatrix): matrix and P is the parity submatrix. If the GenMatrix matrix provided is not full rank, then dependent rows will be deleted. - This function does not convert parity check (H) matrices to the + This function does not convert parity check (H) matrices to the generator matrix format. Use the function getSystematicGmatrixFromH for that purpose. """ @@ -682,7 +686,7 @@ def getSystematicGmatrix(GenMatrix): tempArray = move_row_to_bottom(i,tempArray) # decrease limit since we just found a row of 0s limit -= 1 - # the rows below i are the dependent rows, which we discard + # the rows below i are the dependent rows, which we discard G = tempArray[0:i,:] return G @@ -696,7 +700,7 @@ def getSystematicGmatrixFromH(H, verbose=False): will be deleted first. """ if verbose: - print 'received H with size: ', H.shape + print('received H with size: ', H.shape) # First, put the H matrix into the form H = [I|m] where: # I is (n-k) x (n-k) identity matrix @@ -716,5 +720,5 @@ def getSystematicGmatrixFromH(H, verbose=False): k = m.shape[1] G = concatenate((identity(k),m.T),axis=1) if verbose: - print 'returning G with size: ', G.shape - return G
\ No newline at end of file + print('returning G with size: ', G.shape) + return G diff --git a/gr-fec/python/fec/LDPC/__init__.py b/gr-fec/python/fec/LDPC/__init__.py index 173171a24f..7ee9196d12 100644 --- a/gr-fec/python/fec/LDPC/__init__.py +++ b/gr-fec/python/fec/LDPC/__init__.py @@ -1,3 +1,5 @@ +from __future__ import absolute_import +from __future__ import unicode_literals # # Copyright 2015 Free Software Foundation, Inc. # @@ -19,4 +21,4 @@ # Boston, MA 02110-1301, USA. # -from Generate_LDPC_matrix_functions import * +from .Generate_LDPC_matrix_functions import * diff --git a/gr-fec/python/fec/__init__.py b/gr-fec/python/fec/__init__.py index 6c82232d4f..e5458686dc 100644 --- a/gr-fec/python/fec/__init__.py +++ b/gr-fec/python/fec/__init__.py @@ -23,25 +23,28 @@ Blocks for forward error correction. ''' +from __future__ import absolute_import +from __future__ import unicode_literals + try: - from fec_swig import * + from .fec_swig import * except ImportError: import os dirname, filename = os.path.split(os.path.abspath(__file__)) __path__.append(os.path.join(dirname, "..", "..", "swig")) - from fec_swig import * + from .fec_swig import * -from bitflip import * -from extended_encoder import extended_encoder -from extended_decoder import extended_decoder -from threaded_encoder import threaded_encoder -from threaded_decoder import threaded_decoder -from capillary_threaded_decoder import capillary_threaded_decoder -from capillary_threaded_encoder import capillary_threaded_encoder -from extended_async_encoder import extended_async_encoder -from extended_tagged_encoder import extended_tagged_encoder -from extended_tagged_decoder import extended_tagged_decoder +from .bitflip import * +from .extended_encoder import extended_encoder +from .extended_decoder import extended_decoder +from .threaded_encoder import threaded_encoder +from .threaded_decoder import threaded_decoder +from .capillary_threaded_decoder import capillary_threaded_decoder +from .capillary_threaded_encoder import capillary_threaded_encoder +from .extended_async_encoder import extended_async_encoder +from .extended_tagged_encoder import extended_tagged_encoder +from .extended_tagged_decoder import extended_tagged_decoder -from fec_test import fec_test -from bercurve_generator import bercurve_generator +from .fec_test import fec_test +from .bercurve_generator import bercurve_generator diff --git a/gr-fec/python/fec/_qa_helper.py b/gr-fec/python/fec/_qa_helper.py index 8722453441..85a19ed7c5 100755..100644 --- a/gr-fec/python/fec/_qa_helper.py +++ b/gr-fec/python/fec/_qa_helper.py @@ -20,12 +20,19 @@ # Boston, MA 02110-1301, USA. # -from gnuradio import blocks -from gnuradio import gr -import sys, numpy +from __future__ import print_function +from __future__ import absolute_import +from __future__ import unicode_literals + + +import numpy + +from gnuradio import gr, blocks +# Must use absolute import here because this file is not installed as part +# of the module +from gnuradio.fec import extended_encoder +from gnuradio.fec import extended_decoder -from extended_encoder import extended_encoder -from extended_decoder import extended_decoder class map_bb(gr.sync_block): def __init__(self, bitmap): @@ -37,7 +44,7 @@ class map_bb(gr.sync_block): self.bitmap = bitmap def work(self, input_items, output_items): - output_items[0][:] = map(lambda x: self.bitmap[x], input_items[0]) + output_items[0][:] = [self.bitmap[x] for x in input_items[0]] return len(output_items[0]) @@ -85,6 +92,6 @@ if __name__ == '__main__': errs += 1 if errs == 0: - print "Decoded properly" + print("Decoded properly") else: - print "Problem Decoding" + print("Problem Decoding") diff --git a/gr-fec/python/fec/bercurve_generator.py b/gr-fec/python/fec/bercurve_generator.py index 3221a683ce..29a02c135a 100644 --- a/gr-fec/python/fec/bercurve_generator.py +++ b/gr-fec/python/fec/bercurve_generator.py @@ -20,10 +20,12 @@ # Boston, MA 02110-1301, USA. # +from __future__ import absolute_import +from __future__ import unicode_literals from gnuradio import gr, blocks import numpy -from fec_test import fec_test +from .fec_test import fec_test class bercurve_generator(gr.hier_block2): @@ -40,7 +42,7 @@ class bercurve_generator(gr.hier_block2): self.decoder_list = decoder_list self.puncpat = puncpat - self.random_gen_b_0 = blocks.vector_source_b(map(int, numpy.random.randint(0, 256, 100000)), True) + self.random_gen_b_0 = blocks.vector_source_b(list(map(int, numpy.random.randint(0, 256, 100000))), True) self.deinterleave = blocks.deinterleave(gr.sizeof_char*1) self.connect(self.random_gen_b_0, self.deinterleave) self.ber_generators = [] diff --git a/gr-fec/python/fec/bitflip.py b/gr-fec/python/fec/bitflip.py index 235dc19a05..332a288e7e 100644 --- a/gr-fec/python/fec/bitflip.py +++ b/gr-fec/python/fec/bitflip.py @@ -20,6 +20,11 @@ # Boston, MA 02110-1301, USA. # +from __future__ import division +from __future__ import unicode_literals + + + def bitreverse(mint): res = 0; while mint != 0: @@ -51,7 +56,7 @@ def read_bitlist(bitlist): def read_big_bitlist(bitlist): ret = [] - for j in range(0, len(bitlist)/64): + for j in range(0, len(bitlist) / 64): res = 0; for i in range(0, 64): if int(bitlist[j*64+i]) == 1: @@ -72,9 +77,9 @@ def generate_symmetries(symlist): for i in range(len(symlist[0])): retlist.append(symlist[0][i:] + symlist[0][0:i]); invlist = symlist[0]; - for i in range(1, len(symlist[0])/2): - invlist[i] = symlist[0][i + len(symlist[0])/2]; - invlist[i + len(symlist[0])/2] = symlist[0][i]; + for i in range(1, len(symlist[0]) / 2): + invlist[i] = symlist[0][i + len(symlist[0]) / 2]; + invlist[i + len(symlist[0]) / 2] = symlist[0][i]; for i in range(len(symlist[0])): retlist.append(symlist[0][i:] + symlist[0][0:i]); return retlist; diff --git a/gr-fec/python/fec/capillary_threaded_decoder.py b/gr-fec/python/fec/capillary_threaded_decoder.py index 9a00cde192..821e3cf92a 100644 --- a/gr-fec/python/fec/capillary_threaded_decoder.py +++ b/gr-fec/python/fec/capillary_threaded_decoder.py @@ -20,10 +20,15 @@ # Boston, MA 02110-1301, USA. # -from gnuradio import gr, blocks -import fec_swig as fec +from __future__ import division +from __future__ import unicode_literals + import math +from gnuradio import gr, blocks +from . import fec_swig as fec + + class capillary_threaded_decoder(gr.hier_block2): def __init__(self, decoder_list_0, input_size, output_size): gr.hier_block2.__init__( @@ -64,7 +69,7 @@ class capillary_threaded_decoder(gr.hier_block2): branchcount += 2 codercount = 0 - for i in range(len(decoder_list_0)/2): + for i in range(len(decoder_list_0) // 2): self.connect((self.deinterleaves_0[rootcount], 0), (self.generic_decoders_0[codercount], 0)) self.connect((self.deinterleaves_0[rootcount], 1), (self.generic_decoders_0[codercount + 1], 0)) rootcount += 1 @@ -80,7 +85,7 @@ class capillary_threaded_decoder(gr.hier_block2): branchcount += 2 codercount = 0 - for i in range(len(decoder_list_0)/2): + for i in range(len(decoder_list_0) // 2): self.connect((self.generic_decoders_0[codercount], 0), (self.interleaves_0[rootcount], 0)) self.connect((self.generic_decoders_0[codercount + 1], 0), (self.interleaves_0[rootcount], 1)) rootcount += 1 diff --git a/gr-fec/python/fec/capillary_threaded_encoder.py b/gr-fec/python/fec/capillary_threaded_encoder.py index 21d4af62ca..899d10c3b7 100644 --- a/gr-fec/python/fec/capillary_threaded_encoder.py +++ b/gr-fec/python/fec/capillary_threaded_encoder.py @@ -20,10 +20,15 @@ # Boston, MA 02110-1301, USA. # -from gnuradio import gr, blocks -import fec_swig as fec +from __future__ import division +from __future__ import unicode_literals + import math +from gnuradio import gr, blocks +from . import fec_swig as fec + + class capillary_threaded_encoder(gr.hier_block2): def __init__(self, encoder_list_0, input_size=gr.sizeof_char, output_size=gr.sizeof_char): gr.hier_block2.__init__(self, "Capillary Threaded Encoder", @@ -43,7 +48,7 @@ class capillary_threaded_encoder(gr.hier_block2): self.deinterleaves_0.append(blocks.deinterleave(input_size, fec.get_encoder_input_size(encoder_list_0[0]))) - self.generic_encoders_0 = []; + self.generic_encoders_0 = []; for i in range(len(encoder_list_0)): self.generic_encoders_0.append(fec.encoder(encoder_list_0[i], input_size, output_size)) @@ -64,7 +69,7 @@ class capillary_threaded_encoder(gr.hier_block2): branchcount += 2; codercount = 0; - for i in range(len(encoder_list_0)/2): + for i in range(len(encoder_list_0) // 2): self.connect((self.deinterleaves_0[rootcount], 0), (self.generic_encoders_0[codercount], 0)) self.connect((self.deinterleaves_0[rootcount], 1), (self.generic_encoders_0[codercount + 1], 0)) rootcount += 1; @@ -82,13 +87,13 @@ class capillary_threaded_encoder(gr.hier_block2): codercount = 0; - for i in range(len(encoder_list_0)/2): + for i in range(len(encoder_list_0) // 2): self.connect((self.generic_encoders_0[codercount], 0), (self.interleaves_0[rootcount], 0)) self.connect((self.generic_encoders_0[codercount + 1], 0), (self.interleaves_0[rootcount], 1)) rootcount += 1; codercount += 2; - if((len(self.encoder_list_0)) > 1): + if((len(self.encoder_list_0)) > 1): self.connect((self, 0), (self.deinterleaves_0[0], 0)) self.connect((self.interleaves_0[0], 0), (self, 0)) else: diff --git a/gr-fec/python/fec/extended_async_encoder.py b/gr-fec/python/fec/extended_async_encoder.py index fffe64aeb8..cebd5c652b 100644 --- a/gr-fec/python/fec/extended_async_encoder.py +++ b/gr-fec/python/fec/extended_async_encoder.py @@ -20,11 +20,18 @@ # Boston, MA 02110-1301, USA. # -from gnuradio import gr -import fec_swig as fec -from bitflip import read_bitlist +from __future__ import print_function +from __future__ import absolute_import +from __future__ import unicode_literals + import weakref +from gnuradio import gr + +from . import fec_swig as fec +from .bitflip import read_bitlist + + class extended_async_encoder(gr.hier_block2): def __init__(self, encoder_obj_list, puncpat=None): gr.hier_block2.__init__(self, "extended_async_encoder", diff --git a/gr-fec/python/fec/extended_decoder.py b/gr-fec/python/fec/extended_decoder.py index 7e6cf452f9..3c7ebefb49 100644 --- a/gr-fec/python/fec/extended_decoder.py +++ b/gr-fec/python/fec/extended_decoder.py @@ -20,24 +20,25 @@ # Boston, MA 02110-1301, USA. # -from gnuradio import gr, blocks -import fec_swig as fec -from bitflip import * -import sys +from __future__ import print_function +from __future__ import absolute_import +from __future__ import division +from __future__ import unicode_literals -if sys.modules.has_key("gnuradio.digital"): - digital = sys.modules["gnuradio.digital"] -else: - from gnuradio import digital +from gnuradio import gr, blocks, digital + +from . import fec_swig as fec + +from .bitflip import * +from .threaded_decoder import threaded_decoder +from .capillary_threaded_decoder import capillary_threaded_decoder -from threaded_decoder import threaded_decoder -from capillary_threaded_decoder import capillary_threaded_decoder class extended_decoder(gr.hier_block2): #solution to log_(1-2*t)(1-2*.0335) = 1/taps where t is thresh (syndrome density) #for i in numpy.arange(.1, .499, .01): - #print str(log((1-(2 * .035)), (1-(2 * i)))) + ':' + str(i); + #print(str(log((1-(2 * .035)), (1-(2 * i)))) + ':' + str(i);) garbletable = { 0.310786835319:0.1, 0.279118162802:0.11, @@ -127,13 +128,13 @@ class extended_decoder(gr.hier_block2): cat.append(i); synd_garble = .49 - idx_list = self.garbletable.keys() + idx_list = list(self.garbletable.keys()) idx_list.sort() for i in idx_list: - if 1.0/self.ann.count('1') >= i: + if 1.0 / self.ann.count('1') >= i: synd_garble = self.garbletable[i] - print 'using syndrom garble threshold ' + str(synd_garble) + 'for conv_bit_corr_bb' - print 'ceiling: .0335 data garble rate' + print('using syndrom garble threshold ' + str(synd_garble) + 'for conv_bit_corr_bb') + print('ceiling: .0335 data garble rate') self.blocks.append(fec.conv_bit_corr_bb(cat, len(puncpat) - puncpat.count('0'), len(ann), integration_period, flush, synd_garble)) diff --git a/gr-fec/python/fec/extended_encoder.py b/gr-fec/python/fec/extended_encoder.py index 1c6da0ecb1..992c2bdad4 100644 --- a/gr-fec/python/fec/extended_encoder.py +++ b/gr-fec/python/fec/extended_encoder.py @@ -20,12 +20,16 @@ # Boston, MA 02110-1301, USA. # +from __future__ import absolute_import +from __future__ import unicode_literals + from gnuradio import gr, blocks -import fec_swig as fec -from threaded_encoder import threaded_encoder -from capillary_threaded_encoder import capillary_threaded_encoder -from bitflip import read_bitlist +from . import fec_swig as fec +from .threaded_encoder import threaded_encoder +from .capillary_threaded_encoder import capillary_threaded_encoder +from .bitflip import read_bitlist + class extended_encoder(gr.hier_block2): def __init__(self, encoder_obj_list, threading, puncpat=None): diff --git a/gr-fec/python/fec/extended_tagged_decoder.py b/gr-fec/python/fec/extended_tagged_decoder.py index 9713907712..c119bf9938 100644 --- a/gr-fec/python/fec/extended_tagged_decoder.py +++ b/gr-fec/python/fec/extended_tagged_decoder.py @@ -20,21 +20,23 @@ # Boston, MA 02110-1301, USA. # -from gnuradio import gr, blocks -import fec_swig as fec -from bitflip import * -import sys +from __future__ import print_function +from __future__ import absolute_import +from __future__ import division +from __future__ import unicode_literals + +from gnuradio import gr, blocks, digital + +from . import fec_swig as fec + +from .bitflip import * -if sys.modules.has_key("gnuradio.digital"): - digital = sys.modules["gnuradio.digital"] -else: - from gnuradio import digital class extended_tagged_decoder(gr.hier_block2): #solution to log_(1-2*t)(1-2*.0335) = 1/taps where t is thresh (syndrome density) #for i in numpy.arange(.1, .499, .01): - #print str(log((1-(2 * .035)), (1-(2 * i)))) + ':' + str(i); + #print(str(log((1-(2 * .035)), (1-(2 * i)))) + ':' + str(i);) garbletable = { 0.310786835319:0.1, 0.279118162802:0.11, @@ -136,13 +138,13 @@ class extended_tagged_decoder(gr.hier_block2): cat.append(i); synd_garble = .49 - idx_list = self.garbletable.keys() + idx_list = list(self.garbletable.keys()) idx_list.sort() for i in idx_list: - if 1.0/self.ann.count('1') >= i: + if 1.0 / self.ann.count('1') >= i: synd_garble = self.garbletable[i] - print 'using syndrom garble threshold ' + str(synd_garble) + 'for conv_bit_corr_bb' - print 'ceiling: .0335 data garble rate' + print('using syndrom garble threshold ' + str(synd_garble) + 'for conv_bit_corr_bb') + print('ceiling: .0335 data garble rate') self.blocks.append(fec.conv_bit_corr_bb(cat, len(puncpat) - puncpat.count('0'), len(ann), integration_period, flush, synd_garble)) diff --git a/gr-fec/python/fec/extended_tagged_encoder.py b/gr-fec/python/fec/extended_tagged_encoder.py index d3cf1d80d2..9f4a684c4a 100644 --- a/gr-fec/python/fec/extended_tagged_encoder.py +++ b/gr-fec/python/fec/extended_tagged_encoder.py @@ -20,10 +20,16 @@ # Boston, MA 02110-1301, USA. # +from __future__ import absolute_import +from __future__ import unicode_literals + + from gnuradio import gr, blocks -import fec_swig as fec -from bitflip import read_bitlist +from . import fec_swig as fec + +from .bitflip import read_bitlist + class extended_tagged_encoder(gr.hier_block2): def __init__(self, encoder_obj_list, puncpat=None, lentagname=None, mtu=1500): diff --git a/gr-fec/python/fec/fec_test.py b/gr-fec/python/fec/fec_test.py index 6466a0bcb4..dfb5b1b28e 100644 --- a/gr-fec/python/fec/fec_test.py +++ b/gr-fec/python/fec/fec_test.py @@ -20,18 +20,21 @@ # Boston, MA 02110-1301, USA. # +from __future__ import absolute_import +from __future__ import division +from __future__ import unicode_literals from gnuradio.fec.bitflip import read_bitlist from gnuradio import gr, blocks, analog import math import sys -if sys.modules.has_key("gnuradio.digital"): +if "gnuradio.digital" in sys.modules: digital = sys.modules["gnuradio.digital"] else: from gnuradio import digital -from extended_encoder import extended_encoder -from extended_decoder import extended_decoder +from .extended_encoder import extended_encoder +from .extended_decoder import extended_decoder class fec_test(gr.hier_block2): @@ -64,7 +67,7 @@ class fec_test(gr.hier_block2): ann=None, puncpat=puncpat, integration_period=10000, rotator=None) - noise = math.sqrt((10.0**(-esno/10.0))/2.0) + noise = math.sqrt((10.0**(old_div(-esno / 10.0)),2.0)) #self.fastnoise = analog.fastnoise_source_f(analog.GR_GAUSSIAN, noise, seed, 8192) self.fastnoise = analog.noise_source_f(analog.GR_GAUSSIAN, noise, seed) self.addnoise = blocks.add_ff(1) diff --git a/gr-fec/python/fec/polar/CMakeLists.txt b/gr-fec/python/fec/polar/CMakeLists.txt index 1efed062ff..2c126746e7 100644 --- a/gr-fec/python/fec/polar/CMakeLists.txt +++ b/gr-fec/python/fec/polar/CMakeLists.txt @@ -27,6 +27,9 @@ GR_PYTHON_INSTALL( channel_construction_awgn.py channel_construction_bec.py helper_functions.py + encoder.py + decoder.py + common.py DESTINATION ${GR_PYTHON_DIR}/gnuradio/fec/polar ) diff --git a/gr-fec/python/fec/polar/__init__.py b/gr-fec/python/fec/polar/__init__.py index ce1b1459fb..e06020b886 100644 --- a/gr-fec/python/fec/polar/__init__.py +++ b/gr-fec/python/fec/polar/__init__.py @@ -21,9 +21,12 @@ # turn this folder into a Python module -import channel_construction as cc -from channel_construction_bec import bhattacharyya_bounds -from helper_functions import is_power_of_two +from __future__ import print_function +from __future__ import absolute_import +from __future__ import unicode_literals +from . import channel_construction as cc +from .channel_construction_bec import bhattacharyya_bounds +from .helper_functions import is_power_of_two CHANNEL_TYPE_AWGN = 'AWGN' diff --git a/gr-fec/python/fec/polar/channel_construction.py b/gr-fec/python/fec/polar/channel_construction.py index b7a3dee3bd..d3b33fe3ac 100644 --- a/gr-fec/python/fec/polar/channel_construction.py +++ b/gr-fec/python/fec/polar/channel_construction.py @@ -23,12 +23,14 @@ foundational paper for polar codes. ''' +from __future__ import print_function +from __future__ import absolute_import -from channel_construction_bec import calculate_bec_channel_capacities -from channel_construction_bec import design_snr_to_bec_eta -from channel_construction_bec import bhattacharyya_bounds -from channel_construction_awgn import tal_vardy_tpm_algorithm -from helper_functions import * +from .channel_construction_bec import calculate_bec_channel_capacities +from .channel_construction_bec import design_snr_to_bec_eta +from .channel_construction_bec import bhattacharyya_bounds +from .channel_construction_awgn import tal_vardy_tpm_algorithm +from .helper_functions import * Z_PARAM_FIRST_HEADER_LINE = "Bhattacharyya parameters (Z-parameters) for a polar code" @@ -117,7 +119,7 @@ def load_z_parameters(block_size, design_snr, mu): def main(): np.set_printoptions(precision=3, linewidth=150) - print 'channel construction Bhattacharyya bounds by Arikan' + print('channel construction Bhattacharyya bounds by Arikan') n = 10 m = 2 ** n k = m // 2 diff --git a/gr-fec/python/fec/polar/channel_construction_awgn.py b/gr-fec/python/fec/polar/channel_construction_awgn.py index 7d820b2883..c75f3d1c44 100755..100644 --- a/gr-fec/python/fec/polar/channel_construction_awgn.py +++ b/gr-fec/python/fec/polar/channel_construction_awgn.py @@ -18,6 +18,11 @@ # Boston, MA 02110-1301, USA. # +from __future__ import print_function +from __future__ import absolute_import +from __future__ import division +from __future__ import unicode_literals + ''' Based on 2 papers: [1] Ido Tal, Alexander Vardy: 'How To Construct Polar Codes', 2013 @@ -27,11 +32,10 @@ for an in-depth description of a widely used algorithm for channel construction. for an overview of different approaches ''' - from scipy.optimize import fsolve from scipy.special import erfc -from helper_functions import * -from channel_construction_bec import bhattacharyya_bounds +from .helper_functions import * +from .channel_construction_bec import bhattacharyya_bounds def solver_equation(val, s): @@ -190,7 +194,7 @@ def upper_convolve(tpm, mu): idx = -1 for i in range(mu): idx += 1 - q[0, idx] = (tpm[0, i] ** 2 + tpm[1, i] ** 2) / 2 + q[0, idx] = (tpm[0 / i] ** 2 + tpm[1, i] ** 2, 2) q[1, idx] = tpm[0, i] * tpm[1, i] for j in range(i + 1, mu): idx += 1 @@ -211,8 +215,8 @@ def lower_convolve(tpm, mu): idx = -1 for i in range(0, mu): idx += 1 - q[0, idx] = (tpm[0, i] ** 2) / 2 - q[1, idx] = (tpm[1, i] ** 2) / 2 + q[0, idx] = (tpm[0 / i] ** 2, 2) + q[1, idx] = (tpm[1 / i] ** 2, 2) if q[0, idx] < q[1, idx]: q[0, idx], q[1, idx] = swap_values(q[0, idx], q[1, idx]) idx += 1 @@ -249,7 +253,7 @@ def normalize_q(q, tpm): def main(): - print 'channel construction AWGN main' + print('channel construction AWGN main') n = 8 m = 2 ** n design_snr = 0.0 diff --git a/gr-fec/python/fec/polar/channel_construction_bec.py b/gr-fec/python/fec/polar/channel_construction_bec.py index acad720036..d0ca4f84ed 100644 --- a/gr-fec/python/fec/polar/channel_construction_bec.py +++ b/gr-fec/python/fec/polar/channel_construction_bec.py @@ -18,8 +18,13 @@ # Boston, MA 02110-1301, USA. # +from __future__ import print_function +from __future__ import absolute_import +from __future__ import division +from __future__ import unicode_literals + import numpy as np -import helper_functions as hf +from . import helper_functions as hf def bec_channel(eta): @@ -220,7 +225,7 @@ def plot_capacity_histogram(design_snr, save_file=None): def main(): - print 'channel construction main' + print('channel construction main') n = 11 block_size = int(2 ** n) design_snr = -1.59 diff --git a/gr-fec/python/fec/polar/common.py b/gr-fec/python/fec/polar/common.py index fa5987b6d2..8604f05ba1 100644 --- a/gr-fec/python/fec/polar/common.py +++ b/gr-fec/python/fec/polar/common.py @@ -18,16 +18,20 @@ # Boston, MA 02110-1301, USA. # +from __future__ import print_function +from __future__ import absolute_import +from __future__ import unicode_literals + import numpy as np -from helper_functions import * +from .helper_functions import * ''' PolarCommon holds value checks and common initializer code for both Encoder and Decoder. ''' -class PolarCommon: +class PolarCommon(object): def __init__(self, n, k, frozen_bit_position, frozenbits=None): if not is_power_of_two(n): raise ValueError("n={0} is not a power of 2!".format(n)) @@ -81,4 +85,4 @@ class PolarCommon: return self._encode_efficient(vec) def info_print(self): - print "POLAR code ({0}, {1})".format(self.N, self.K) + print("POLAR code ({0}, {1})".format(self.N, self.K)) diff --git a/gr-fec/python/fec/polar/decoder.py b/gr-fec/python/fec/polar/decoder.py index 8748d284f7..5acd04aa72 100644 --- a/gr-fec/python/fec/polar/decoder.py +++ b/gr-fec/python/fec/polar/decoder.py @@ -18,11 +18,16 @@ # Boston, MA 02110-1301, USA. # +from __future__ import print_function +from __future__ import absolute_import +from __future__ import division +from __future__ import unicode_literals + import numpy as np -from common import PolarCommon +from .common import PolarCommon # for dev -from encoder import PolarEncoder +from .encoder import PolarEncoder from matplotlib import pyplot as plt @@ -239,31 +244,31 @@ def test_reverse_enc_dec(): encoder = PolarEncoder(n, k, frozenbitposition, frozenbits) decoder = PolarDecoder(n, k, frozenbitposition, frozenbits) encoded = encoder.encode(bits) - print 'encoded:', encoded + print('encoded:', encoded) rx = decoder.decode(encoded) - print 'bits:', bits - print 'rx :', rx - print (bits == rx).all() + print('bits:', bits) + print('rx :', rx) + print((bits == rx).all()) def compare_decoder_impls(): - print '\nthis is decoder test' + print('\nthis is decoder test') n = 8 k = 4 frozenbits = np.zeros(n - k) # frozenbitposition16 = np.array((0, 1, 2, 3, 4, 5, 8, 9), dtype=int) frozenbitposition = np.array((0, 1, 2, 4), dtype=int) bits = np.random.randint(2, size=k) - print 'bits:', bits + print('bits:', bits) encoder = PolarEncoder(n, k, frozenbitposition, frozenbits) decoder = PolarDecoder(n, k, frozenbitposition, frozenbits) encoded = encoder.encode(bits) - print 'encoded:', encoded + print('encoded:', encoded) rx_st = decoder._lr_sc_decoder(encoded) rx_eff = decoder._lr_sc_decoder_efficient(encoded) - print 'standard :', rx_st - print 'efficient:', rx_eff - print (rx_st == rx_eff).all() + print('standard :', rx_st) + print('efficient:', rx_eff) + print((rx_st == rx_eff).all()) def main(): @@ -279,14 +284,14 @@ def main(): # decoder = PolarDecoder(n, k, frozenbitposition, frozenbits) # # bits = np.ones(k, dtype=int) - # print "bits: ", bits + # print("bits: ", bits) # evec = encoder.encode(bits) - # print "froz: ", encoder._insert_frozen_bits(bits) - # print "evec: ", evec + # print("froz: ", encoder._insert_frozen_bits(bits)) + # print("evec: ", evec) # # evec[1] = 0 # deced = decoder._lr_sc_decoder(evec) - # print 'SC decoded:', deced + # print('SC decoded:', deced) # # test_reverse_enc_dec() # compare_decoder_impls() diff --git a/gr-fec/python/fec/polar/encoder.py b/gr-fec/python/fec/polar/encoder.py index cc8fda2d1b..c5c7c05d5b 100644 --- a/gr-fec/python/fec/polar/encoder.py +++ b/gr-fec/python/fec/polar/encoder.py @@ -18,9 +18,13 @@ # Boston, MA 02110-1301, USA. # +from __future__ import print_function +from __future__ import absolute_import +from __future__ import unicode_literals + import numpy as np -from common import PolarCommon -import helper_functions as hf +from .common import PolarCommon +from . import helper_functions as hf class PolarEncoder(PolarCommon): @@ -99,8 +103,8 @@ def test_pseudo_rate_1_encoder(encoder, ntests, k): u_hat = encoder._encode_efficient(fenc) if not (u_hat == u).all(): print('rate-1 encoder/decoder failed') - print u - print u_hat + print(u) + print(u_hat) return False return True @@ -114,11 +118,11 @@ def test_encoder_impls(): # frozenbitposition8 = np.array((0, 1, 2, 4), dtype=int) # keep it! frozenbitposition = np.array((0, 1, 2, 3, 4, 5, 8, 9), dtype=int) encoder = PolarEncoder(n, k, frozenbitposition) #, frozenbits) - print 'result:', compare_results(encoder, ntests, k) + print('result:', compare_results(encoder, ntests, k)) print('Test rate-1 encoder/decoder chain results') r1_test = test_pseudo_rate_1_encoder(encoder, ntests, k) - print 'Test rate-1 encoder/decoder:', r1_test + print('Test rate-1 encoder/decoder:', r1_test) test_systematic_encoder(encoder, ntests, k) diff --git a/gr-fec/python/fec/polar/helper_functions.py b/gr-fec/python/fec/polar/helper_functions.py index a4ecb1f0ff..147023a593 100644 --- a/gr-fec/python/fec/polar/helper_functions.py +++ b/gr-fec/python/fec/polar/helper_functions.py @@ -18,6 +18,10 @@ # Boston, MA 02110-1301, USA. # +from __future__ import print_function +from __future__ import division +from __future__ import unicode_literals + import numpy as np import time, sys import copy @@ -33,7 +37,7 @@ def bsc_channel(p): p denotes an erroneous transition ''' if not (p >= 0.0 and p <= 1.0): - print "given p is out of range!" + print("given p is out of range!") return np.array([], dtype=float) # 0 -> 0, 0 -> 1, 1 -> 0, 1 -> 1 @@ -99,7 +103,7 @@ def get_Fn(n): def get_Gn(n): # this matrix is called generator matrix if not is_power_of_two(n): - print "invalid input" + print("invalid input") return None if n == 1: return np.array([1, ]) @@ -177,7 +181,7 @@ def bhattacharyya_parameter(w): def main(): - print 'helper functions' + print('helper functions') for i in range(9): print(i, 'is power of 2: ', is_power_of_two(i)) diff --git a/gr-fec/python/fec/polar/testbed.py b/gr-fec/python/fec/polar/testbed.py index 3f8e814e4f..08ef0de558 100755..100644 --- a/gr-fec/python/fec/polar/testbed.py +++ b/gr-fec/python/fec/polar/testbed.py @@ -18,11 +18,16 @@ # Boston, MA 02110-1301, USA. # +from __future__ import print_function +from __future__ import absolute_import +from __future__ import division +from __future__ import unicode_literals -from encoder import PolarEncoder -from decoder import PolarDecoder -import channel_construction as cc -from helper_functions import * + +from .encoder import PolarEncoder +from .decoder import PolarDecoder +from . import channel_construction as cc +from .helper_functions import * import matplotlib.pyplot as plt @@ -58,13 +63,13 @@ def is_equal(first, second): if not (first == second).all(): result = first == second for i in range(len(result)): - print '{0:4}: {1:2} == {2:1} = {3}'.format(i, first[i], second[i], result[i]) + print('{0:4}: {1:2} == {2:1} = {3}'.format(i, first[i], second[i], result[i])) return False return True def exact_value(la, lb): - return np.log((np.exp(la + lb) + 1) / (np.exp(la) + np.exp(lb))) + return np.log((np.exp(la + lb) + 1) / (np.exp(la + np.exp(lb)))) def approx_value(la, lb): @@ -112,7 +117,7 @@ def test_1024_rate_1_code(): recv = decoder.decode(rx) channel_counter += (bits == recv) - print channel_counter + print(channel_counter) print(np.min(channel_counter), np.max(channel_counter)) np.save('channel_counter_' + str(ntests) + '.npy', channel_counter) @@ -330,7 +335,7 @@ def main(): # frozenbits = np.zeros(n - k) # frozenbitposition8 = np.array((0, 1, 2, 4), dtype=int) # frozenbitposition = np.array((0, 1, 2, 3, 4, 5, 8, 9), dtype=int) - # print frozenbitposition + # print(frozenbitposition) # test_enc_dec_chain() # test_1024_rate_1_code() diff --git a/gr-fec/python/fec/qa_ber_bf.py b/gr-fec/python/fec/qa_ber_bf.py index 5d1734de0c..0d720988cb 100644 --- a/gr-fec/python/fec/qa_ber_bf.py +++ b/gr-fec/python/fec/qa_ber_bf.py @@ -20,11 +20,15 @@ # Boston, MA 02110-1301, USA. # -from gnuradio import gr, gr_unittest, blocks -import fec_swig as fec +from __future__ import print_function + + import numpy import copy +from gnuradio import gr, gr_unittest, blocks +from gnuradio import fec + class test_ber_bf(gr_unittest.TestCase): def setUp(self): @@ -132,8 +136,8 @@ class test_ber_bf(gr_unittest.TestCase): data = dst.data() expected_result = [-2.0, ] - print data - print expected_result + print(data) + print(expected_result) self.assertFloatTuplesAlmostEqual(expected_result, data, 5) diff --git a/gr-fec/python/fec/qa_depuncture.py b/gr-fec/python/fec/qa_depuncture.py index 5566e83a25..9ec57bfc41 100644 --- a/gr-fec/python/fec/qa_depuncture.py +++ b/gr-fec/python/fec/qa_depuncture.py @@ -20,11 +20,14 @@ # Boston, MA 02110-1301, USA. # -from gnuradio import gr, gr_unittest -import fec_swig as fec -import blocks_swig as blocks +from __future__ import division + from collections import deque +from gnuradio import gr, gr_unittest, blocks +from gnuradio import fec + + class test_depuncture (gr_unittest.TestCase): def depuncture_setup(self): @@ -37,7 +40,7 @@ class test_depuncture (gr_unittest.TestCase): k = 0 self.expected = [] - for n in range(len(self.src_data)/(self.puncsize - self.puncholes)): + for n in range(len(self.src_data) // (self.puncsize - self.puncholes)): for i in range(self.puncsize): if _puncpat[i] == 1: self.expected.append(self.src_data[k]); @@ -46,7 +49,7 @@ class test_depuncture (gr_unittest.TestCase): self.expected.append(self.sym) def setUp(self): - self.src_data = 2000*range(64) + self.src_data = 2000*list(range(64)) self.tb = gr.top_block () def tearDown(self): @@ -64,15 +67,15 @@ class test_depuncture (gr_unittest.TestCase): self.depuncture_setup() src = blocks.vector_source_b(self.src_data) - op = fec.depuncture_bb(self.puncsize, self.puncpat, + op = fec.depuncture_bb(self.puncsize, self.puncpat, self.delay, self.sym) - dst = blocks.vector_sink_b() + dst = blocks.vector_sink_b() - self.tb.connect(src, op, dst) - self.tb.run() + self.tb.connect(src, op, dst) + self.tb.run() - dst_data = list(dst.data()) - for i in xrange(len(dst_data)): + dst_data = list(dst.data()) + for i in range(len(dst_data)): dst_data[i] = int(dst_data[i]) self.assertEqual(self.expected, dst_data) @@ -89,15 +92,15 @@ class test_depuncture (gr_unittest.TestCase): self.depuncture_setup() src = blocks.vector_source_b(self.src_data) - op = fec.depuncture_bb(self.puncsize, self.puncpat, + op = fec.depuncture_bb(self.puncsize, self.puncpat, self.delay, self.sym) - dst = blocks.vector_sink_b() + dst = blocks.vector_sink_b() - self.tb.connect(src, op, dst) - self.tb.run() + self.tb.connect(src, op, dst) + self.tb.run() - dst_data = list(dst.data()) - for i in xrange(len(dst_data)): + dst_data = list(dst.data()) + for i in range(len(dst_data)): dst_data[i] = int(dst_data[i]) self.assertEqual(self.expected, dst_data) @@ -115,15 +118,15 @@ class test_depuncture (gr_unittest.TestCase): self.depuncture_setup() src = blocks.vector_source_b(self.src_data) - op = fec.depuncture_bb(self.puncsize, self.puncpat, + op = fec.depuncture_bb(self.puncsize, self.puncpat, self.delay, self.sym) - dst = blocks.vector_sink_b() + dst = blocks.vector_sink_b() - self.tb.connect(src, op, dst) - self.tb.run() + self.tb.connect(src, op, dst) + self.tb.run() - dst_data = list(dst.data()) - for i in xrange(len(dst_data)): + dst_data = list(dst.data()) + for i in range(len(dst_data)): dst_data[i] = int(dst_data[i]) self.assertEqual(self.expected, dst_data) @@ -141,23 +144,23 @@ class test_depuncture (gr_unittest.TestCase): self.sym = 0 src = blocks.vector_source_b(self.src_data) - op0 = fec.depuncture_bb(self.puncsize, self.puncpat0, + op0 = fec.depuncture_bb(self.puncsize, self.puncpat0, self.delay, self.sym) - op1 = fec.depuncture_bb(self.puncsize, self.puncpat1, + op1 = fec.depuncture_bb(self.puncsize, self.puncpat1, self.delay, self.sym) - dst0 = blocks.vector_sink_b() - dst1 = blocks.vector_sink_b() + dst0 = blocks.vector_sink_b() + dst1 = blocks.vector_sink_b() - self.tb.connect(src, op0, dst0) - self.tb.connect(src, op1, dst1) - self.tb.run() + self.tb.connect(src, op0, dst0) + self.tb.connect(src, op1, dst1) + self.tb.run() - dst_data0 = list(dst0.data()) - for i in xrange(len(dst_data0)): + dst_data0 = list(dst0.data()) + for i in range(len(dst_data0)): dst_data0[i] = int(dst_data0[i]) - dst_data1 = list(dst1.data()) - for i in xrange(len(dst_data1)): + dst_data1 = list(dst1.data()) + for i in range(len(dst_data1)): dst_data1[i] = int(dst_data1[i]) self.assertEqual(dst_data1, dst_data0) @@ -175,15 +178,15 @@ class test_depuncture (gr_unittest.TestCase): self.depuncture_setup() src = blocks.vector_source_b(self.src_data) - op = fec.depuncture_bb(self.puncsize, self.puncpat, + op = fec.depuncture_bb(self.puncsize, self.puncpat, self.delay) - dst = blocks.vector_sink_b() + dst = blocks.vector_sink_b() - self.tb.connect(src, op, dst) - self.tb.run() + self.tb.connect(src, op, dst) + self.tb.run() - dst_data = list(dst.data()) - for i in xrange(len(dst_data)): + dst_data = list(dst.data()) + for i in range(len(dst_data)): dst_data[i] = int(dst_data[i]) self.assertEqual(self.expected, dst_data) diff --git a/gr-fec/python/fec/qa_ecc_ccsds_27.py b/gr-fec/python/fec/qa_ecc_ccsds_27.py index 895e683345..6656c9d3ac 100755..100644 --- a/gr-fec/python/fec/qa_ecc_ccsds_27.py +++ b/gr-fec/python/fec/qa_ecc_ccsds_27.py @@ -20,9 +20,10 @@ # Boston, MA 02110-1301, USA. # -from gnuradio import gr, gr_unittest -import fec_swig as fec -import blocks_swig as blocks + +from gnuradio import gr, gr_unittest, blocks +from gnuradio import fec + class test_ccsds_27 (gr_unittest.TestCase): @@ -34,17 +35,17 @@ class test_ccsds_27 (gr_unittest.TestCase): def xtest_ccsds_27 (self): src_data = (1, 2, 3, 4, 5, 6, 7, 8, 9, 10) - expected = (0, 0, 0, 0, 1, 2, 3, 4, 5, 6) + expected = (0, 0, 0, 0, 1, 2, 3, 4, 5, 6) src = blocks.vector_source_b(src_data) - enc = fec.encode_ccsds_27_bb() - b2f = blocks.char_to_float() - add = blocks.add_const_ff(-0.5) - mul = blocks.multiply_const_ff(2.0) - dec = fec.decode_ccsds_27_fb() - dst = blocks.vector_sink_b() - self.tb.connect(src, enc, b2f, add, mul, dec, dst) - self.tb.run() - dst_data = dst.data() + enc = fec.encode_ccsds_27_bb() + b2f = blocks.char_to_float() + add = blocks.add_const_ff(-0.5) + mul = blocks.multiply_const_ff(2.0) + dec = fec.decode_ccsds_27_fb() + dst = blocks.vector_sink_b() + self.tb.connect(src, enc, b2f, add, mul, dec, dst) + self.tb.run() + dst_data = dst.data() self.assertEqual(expected, dst_data) diff --git a/gr-fec/python/fec/qa_fecapi_cc.py b/gr-fec/python/fec/qa_fecapi_cc.py index bbd500161e..053f671a0e 100644 --- a/gr-fec/python/fec/qa_fecapi_cc.py +++ b/gr-fec/python/fec/qa_fecapi_cc.py @@ -20,12 +20,14 @@ # Boston, MA 02110-1301, USA. # +from __future__ import absolute_import + + from gnuradio import gr, gr_unittest -import fec_swig as fec +from gnuradio import fec + from _qa_helper import _qa_helper -from extended_encoder import extended_encoder -from extended_decoder import extended_decoder class test_fecapi_cc(gr_unittest.TestCase): @@ -91,8 +93,8 @@ class test_fecapi_cc(gr_unittest.TestCase): k = 7 rate = 2 polys = [109,79] - enc = map((lambda a: fec.cc_encoder_make(frame_size*8, k, rate, polys)), range(0,1)) - dec = map((lambda a: fec.cc_decoder.make(frame_size*8, k, rate, polys)), range(0,1)) + enc = list(map((lambda a: fec.cc_encoder_make(frame_size*8, k, rate, polys)), list(range(0,1)))) + dec = list(map((lambda a: fec.cc_decoder.make(frame_size*8, k, rate, polys)), list(range(0,1)))) threading = None self.test = _qa_helper(5*frame_size, enc, dec, threading) self.tb.connect(self.test) @@ -108,8 +110,8 @@ class test_fecapi_cc(gr_unittest.TestCase): k = 7 rate = 2 polys = [109,79] - enc = map((lambda a: fec.cc_encoder_make(frame_size*8, k, rate, polys)), range(0,1)) - dec = map((lambda a: fec.cc_decoder.make(frame_size*8, k, rate, polys)), range(0,1)) + enc = list(map((lambda a: fec.cc_encoder_make(frame_size*8, k, rate, polys)), list(range(0,1)))) + dec = list(map((lambda a: fec.cc_decoder.make(frame_size*8, k, rate, polys)), list(range(0,1)))) threading = 'ordinary' self.test = _qa_helper(5*frame_size, enc, dec, threading) self.tb.connect(self.test) @@ -125,8 +127,8 @@ class test_fecapi_cc(gr_unittest.TestCase): k = 7 rate = 2 polys = [109,79] - enc = map((lambda a: fec.cc_encoder_make(frame_size*8, k, rate, polys)), range(0,1)) - dec = map((lambda a: fec.cc_decoder.make(frame_size*8, k, rate, polys)), range(0,1)) + enc = list(map((lambda a: fec.cc_encoder_make(frame_size*8, k, rate, polys)), list(range(0,1)))) + dec = list(map((lambda a: fec.cc_decoder.make(frame_size*8, k, rate, polys)), list(range(0,1)))) threading = 'capillary' self.test = _qa_helper(5*frame_size, enc, dec, threading) self.tb.connect(self.test) @@ -143,8 +145,8 @@ class test_fecapi_cc(gr_unittest.TestCase): rate = 2 polys = [109,79] mode = fec.CC_TERMINATED - enc = map((lambda a: fec.cc_encoder_make(frame_size*8, k, rate, polys, mode=mode)), range(0,4)) - dec = map((lambda a: fec.cc_decoder.make(frame_size*8, k, rate, polys, mode=mode)), range(0,4)) + enc = list(map((lambda a: fec.cc_encoder_make(frame_size*8, k, rate, polys, mode=mode)), list(range(0,4)))) + dec = list(map((lambda a: fec.cc_decoder.make(frame_size*8, k, rate, polys, mode=mode)), list(range(0,4)))) threading = 'capillary' self.test = _qa_helper(4*frame_size, enc, dec, threading) self.tb.connect(self.test) @@ -161,8 +163,8 @@ class test_fecapi_cc(gr_unittest.TestCase): rate = 2 polys = [109,79] mode = fec.CC_TRUNCATED - enc = map((lambda a: fec.cc_encoder_make(frame_size*8, k, rate, polys, mode=mode)), range(0,4)) - dec = map((lambda a: fec.cc_decoder.make(frame_size*8, k, rate, polys, mode=mode)), range(0,4)) + enc = list(map((lambda a: fec.cc_encoder_make(frame_size*8, k, rate, polys, mode=mode)), list(range(0,4)))) + dec = list(map((lambda a: fec.cc_decoder.make(frame_size*8, k, rate, polys, mode=mode)), list(range(0,4)))) threading = 'capillary' self.test = _qa_helper(4*frame_size, enc, dec, threading) self.tb.connect(self.test) @@ -179,8 +181,8 @@ class test_fecapi_cc(gr_unittest.TestCase): rate = 2 polys = [109,79] mode = fec.CC_TAILBITING - enc = map((lambda a: fec.cc_encoder_make(frame_size*8, k, rate, polys, mode=mode)), range(0,4)) - dec = map((lambda a: fec.cc_decoder.make(frame_size*8, k, rate, polys, mode=mode)), range(0,4)) + enc = list(map((lambda a: fec.cc_encoder_make(frame_size*8, k, rate, polys, mode=mode)), list(range(0,4)))) + dec = list(map((lambda a: fec.cc_decoder.make(frame_size*8, k, rate, polys, mode=mode)), list(range(0,4)))) threading = 'capillary' self.test = _qa_helper(4*frame_size, enc, dec, threading) self.tb.connect(self.test) diff --git a/gr-fec/python/fec/qa_fecapi_dummy.py b/gr-fec/python/fec/qa_fecapi_dummy.py index 9471c71d74..368014d890 100644 --- a/gr-fec/python/fec/qa_fecapi_dummy.py +++ b/gr-fec/python/fec/qa_fecapi_dummy.py @@ -20,13 +20,17 @@ # Boston, MA 02110-1301, USA. # +from __future__ import absolute_import + +import numpy as np + from gnuradio import gr, gr_unittest, blocks -import fec_swig as fec +from gnuradio import fec +from fec import extended_encoder +from fec import extended_decoder + from _qa_helper import _qa_helper -import numpy as np -from extended_encoder import extended_encoder -from extended_decoder import extended_decoder class test_fecapi_dummy(gr_unittest.TestCase): @@ -80,8 +84,8 @@ class test_fecapi_dummy(gr_unittest.TestCase): def test_parallelism1_00(self): frame_size = 30 - enc = map((lambda a: fec.dummy_encoder_make(frame_size*8)), range(0,1)) - dec = map((lambda a: fec.dummy_decoder.make(frame_size*8)), range(0,1)) + enc = list(map((lambda a: fec.dummy_encoder_make(frame_size*8)), list(range(0,1)))) + dec = list(map((lambda a: fec.dummy_decoder.make(frame_size*8)), list(range(0,1)))) threading = None self.test = _qa_helper(10*frame_size, enc, dec, threading) self.tb.connect(self.test) @@ -94,8 +98,8 @@ class test_fecapi_dummy(gr_unittest.TestCase): def test_parallelism1_01(self): frame_size = 30 - enc = map((lambda a: fec.dummy_encoder_make(frame_size*8)), range(0,1)) - dec = map((lambda a: fec.dummy_decoder.make(frame_size*8)), range(0,1)) + enc = list(map((lambda a: fec.dummy_encoder_make(frame_size*8)), list(range(0,1)))) + dec = list(map((lambda a: fec.dummy_decoder.make(frame_size*8)), list(range(0,1)))) threading = 'ordinary' self.test = _qa_helper(10*frame_size, enc, dec, threading) self.tb.connect(self.test) @@ -108,8 +112,8 @@ class test_fecapi_dummy(gr_unittest.TestCase): def test_parallelism1_02(self): frame_size = 300 - enc = map((lambda a: fec.dummy_encoder_make(frame_size*8)), range(0,1)) - dec = map((lambda a: fec.dummy_decoder.make(frame_size*8)), range(0,1)) + enc = list(map((lambda a: fec.dummy_encoder_make(frame_size*8)), list(range(0,1)))) + dec = list(map((lambda a: fec.dummy_decoder.make(frame_size*8)), list(range(0,1)))) threading = 'capillary' self.test = _qa_helper(10*frame_size, enc, dec, threading) self.tb.connect(self.test) @@ -123,8 +127,8 @@ class test_fecapi_dummy(gr_unittest.TestCase): def test_parallelism1_03(self): frame_size = 30 dims = 10 - enc = map((lambda a: fec.dummy_encoder_make(frame_size*8)), range(0,dims)) - dec = map((lambda a: fec.dummy_decoder.make(frame_size*8)), range(0,dims)) + enc = list(map((lambda a: fec.dummy_encoder_make(frame_size*8)), list(range(0,dims)))) + dec = list(map((lambda a: fec.dummy_decoder.make(frame_size*8)), list(range(0,dims)))) threading = 'ordinary' self.test = _qa_helper(dims*frame_size, enc, dec, threading) self.tb.connect(self.test) @@ -138,8 +142,8 @@ class test_fecapi_dummy(gr_unittest.TestCase): def test_parallelism1_04(self): frame_size = 30 dims = 16 - enc = map((lambda a: fec.dummy_encoder_make(frame_size*8)), range(0,dims)) - dec = map((lambda a: fec.dummy_decoder.make(frame_size*8)), range(0,dims)) + enc = list(map((lambda a: fec.dummy_encoder_make(frame_size*8)), list(range(0,dims)))) + dec = list(map((lambda a: fec.dummy_decoder.make(frame_size*8)), list(range(0,dims)))) threading = 'capillary' self.test = _qa_helper(dims*frame_size, enc, dec, threading) self.tb.connect(self.test) @@ -153,7 +157,7 @@ class test_fecapi_dummy(gr_unittest.TestCase): def test_parallelism1_05(self): frame_size = 30 dims = 5 - enc = map((lambda a: fec.dummy_encoder_make(frame_size*8)), range(0,dims)) + enc = list(map((lambda a: fec.dummy_encoder_make(frame_size*8)), list(range(0,dims)))) #dec = map((lambda a: fec.dummy_decoder.make(frame_size*8)), range(0,dims)) threading = 'capillary' @@ -163,7 +167,7 @@ class test_fecapi_dummy(gr_unittest.TestCase): frame_size = 30 dims = 5 #enc = map((lambda a: fec.dummy_encoder_make(frame_size*8)), range(0,dims)) - dec = map((lambda a: fec.dummy_decoder.make(frame_size*8)), range(0,dims)) + dec = list(map((lambda a: fec.dummy_decoder.make(frame_size*8)), list(range(0,dims)))) threading = 'capillary' self.assertRaises(AttributeError, lambda: extended_decoder(dec, threading=threading, puncpat="11")) @@ -172,7 +176,7 @@ class test_fecapi_dummy(gr_unittest.TestCase): frame_size = 30 dims1 = 16 dims2 = 16 - enc = map((lambda b: map((lambda a: fec.dummy_encoder_make(frame_size*8)), range(0,dims1))), range(0,dims2)) + enc = list(map((lambda b: list(map((lambda a: fec.dummy_encoder_make(frame_size*8)), list(range(0,dims1))))), list(range(0,dims2)))) #dec = map((lambda b: map((lambda a: fec.dummy_decoder_make(frame_size*8)), range(0,dims1))), range(0,dims2)) threading = 'capillary' @@ -182,7 +186,7 @@ class test_fecapi_dummy(gr_unittest.TestCase): frame_size = 30 dims1 = 16 dims2 = 16 - dec = map((lambda b: map((lambda a: fec.dummy_decoder_make(frame_size*8)), range(0,dims1))), range(0,dims2)) + dec = list(map((lambda b: list(map((lambda a: fec.dummy_decoder_make(frame_size*8)), list(range(0,dims1))))), list(range(0,dims2)))) threading = 'capillary' self.assertRaises(AttributeError, lambda: extended_decoder(dec, threading=threading, puncpat="11")) @@ -193,6 +197,7 @@ class test_fecapi_dummy(gr_unittest.TestCase): frame_size = 32 data = np.random.randint(0, 2, n_frames * frame_size) + data.dtype = np.uint8 packed_data = np.packbits(data) tb = gr.top_block() diff --git a/gr-fec/python/fec/qa_fecapi_ldpc.py b/gr-fec/python/fec/qa_fecapi_ldpc.py index b45ce0ee19..758a26469e 100644 --- a/gr-fec/python/fec/qa_fecapi_ldpc.py +++ b/gr-fec/python/fec/qa_fecapi_ldpc.py @@ -20,15 +20,19 @@ # Boston, MA 02110-1301, USA. # -from gnuradio import gr, gr_unittest -import fec_swig as fec -from _qa_helper import _qa_helper +from __future__ import absolute_import -from extended_encoder import extended_encoder -from extended_decoder import extended_decoder import os +from gnuradio import gr, gr_unittest +from gnuradio import fec +from fec import extended_encoder +from fec import extended_decoder + +from _qa_helper import _qa_helper + + # Get location of the alist files. If run in 'ctest' or 'make test', # the shell script sets srcdir. Otherwise, we assume we're running # from the current directory and know where to go. @@ -131,8 +135,8 @@ class test_fecapi_ldpc(gr_unittest.TestCase): gap = 4 LDPC_matrix_object = fec.ldpc_H_matrix(filename, gap) k = LDPC_matrix_object.k() - enc = map((lambda a: fec.ldpc_par_mtrx_encoder.make_H(LDPC_matrix_object)), range(0,1)) - dec = map((lambda a: fec.ldpc_bit_flip_decoder.make(LDPC_matrix_object.get_base_sptr())), range(0,1)) + enc = list(map((lambda a: fec.ldpc_par_mtrx_encoder.make_H(LDPC_matrix_object)), list(range(0,1)))) + dec = list(map((lambda a: fec.ldpc_bit_flip_decoder.make(LDPC_matrix_object.get_base_sptr())), list(range(0,1)))) threading = None self.test = _qa_helper(10*k, enc, dec, threading) self.tb.connect(self.test) @@ -148,8 +152,8 @@ class test_fecapi_ldpc(gr_unittest.TestCase): gap = 4 LDPC_matrix_object = fec.ldpc_H_matrix(filename, gap) k = LDPC_matrix_object.k() - enc = map((lambda a: fec.ldpc_par_mtrx_encoder.make_H(LDPC_matrix_object)), range(0,1)) - dec = map((lambda a: fec.ldpc_bit_flip_decoder.make(LDPC_matrix_object.get_base_sptr())), range(0,1)) + enc = list(map((lambda a: fec.ldpc_par_mtrx_encoder.make_H(LDPC_matrix_object)), list(range(0,1)))) + dec = list(map((lambda a: fec.ldpc_bit_flip_decoder.make(LDPC_matrix_object.get_base_sptr())), list(range(0,1)))) threading = 'ordinary' self.test = _qa_helper(10*k, enc, dec, threading) self.tb.connect(self.test) @@ -165,8 +169,8 @@ class test_fecapi_ldpc(gr_unittest.TestCase): gap = 4 LDPC_matrix_object = fec.ldpc_H_matrix(filename, gap) k = LDPC_matrix_object.k() - enc = map((lambda a: fec.ldpc_par_mtrx_encoder.make_H(LDPC_matrix_object)), range(0,1)) - dec = map((lambda a: fec.ldpc_bit_flip_decoder.make(LDPC_matrix_object.get_base_sptr())), range(0,1)) + enc = list(map((lambda a: fec.ldpc_par_mtrx_encoder.make_H(LDPC_matrix_object)), list(range(0,1)))) + dec = list(map((lambda a: fec.ldpc_bit_flip_decoder.make(LDPC_matrix_object.get_base_sptr())), list(range(0,1)))) threading = 'capillary' self.test = _qa_helper(10*k, enc, dec, threading) self.tb.connect(self.test) @@ -255,7 +259,7 @@ class test_fecapi_ldpc(gr_unittest.TestCase): dims = 5 LDPC_matrix_object = fec.ldpc_H_matrix(filename, gap) k = LDPC_matrix_object.k() - dec = map((lambda a: fec.ldpc_bit_flip_decoder.make(LDPC_matrix_object.get_base_sptr())), range(0,dims)) + dec = list(map((lambda a: fec.ldpc_bit_flip_decoder.make(LDPC_matrix_object.get_base_sptr())), list(range(0,dims)))) threading = 'capillary' self.assertRaises(AttributeError, lambda: extended_decoder(dec, threading=threading, puncpat="11")) @@ -267,8 +271,8 @@ class test_fecapi_ldpc(gr_unittest.TestCase): k = LDPC_matrix_object.k() dims1 = 16 dims2 = 16 - enc = map((lambda b: map((lambda a: fec.ldpc_par_mtrx_encoder.make_H(LDPC_matrix_object)), - range(0,dims1))), range(0,dims2)) + enc = list(map((lambda b: list(map((lambda a: fec.ldpc_par_mtrx_encoder.make_H(LDPC_matrix_object)), + list(range(0,dims1))))), list(range(0,dims2)))) threading = 'capillary' self.assertRaises(AttributeError, lambda: extended_encoder(enc, threading=threading, puncpat="11")) @@ -281,8 +285,8 @@ class test_fecapi_ldpc(gr_unittest.TestCase): k = LDPC_matrix_object.k() dims1 = 16 dims2 = 16 - enc = map((lambda b: map((lambda a: fec.ldpc_par_mtrx_encoder.make_H(LDPC_matrix_object)), - range(0,dims1))), range(0,dims2)) + enc = list(map((lambda b: list(map((lambda a: fec.ldpc_par_mtrx_encoder.make_H(LDPC_matrix_object)), + list(range(0,dims1))))), list(range(0,dims2)))) threading = 'capillary' self.assertRaises(AttributeError, lambda: extended_encoder(enc, threading=threading, puncpat="11")) @@ -295,8 +299,8 @@ class test_fecapi_ldpc(gr_unittest.TestCase): k = LDPC_matrix_object.k() dims1 = 16 dims2 = 16 - dec = map((lambda b: map((lambda a: fec.ldpc_bit_flip_decoder.make(LDPC_matrix_object.get_base_sptr())), - range(0,dims1))), range(0,dims2)) + dec = list(map((lambda b: list(map((lambda a: fec.ldpc_bit_flip_decoder.make(LDPC_matrix_object.get_base_sptr())), + list(range(0,dims1))))), list(range(0,dims2)))) threading = 'capillary' self.assertRaises(AttributeError, lambda: extended_decoder(dec, threading=threading, puncpat="11")) diff --git a/gr-fec/python/fec/qa_fecapi_repetition.py b/gr-fec/python/fec/qa_fecapi_repetition.py index 7998d61bd1..650aab7010 100644 --- a/gr-fec/python/fec/qa_fecapi_repetition.py +++ b/gr-fec/python/fec/qa_fecapi_repetition.py @@ -20,12 +20,15 @@ # Boston, MA 02110-1301, USA. # +from __future__ import absolute_import + + + from gnuradio import gr, gr_unittest -import fec_swig as fec +from gnuradio import fec + from _qa_helper import _qa_helper -from extended_encoder import extended_encoder -from extended_decoder import extended_decoder class test_fecapi_repetition(gr_unittest.TestCase): @@ -83,8 +86,8 @@ class test_fecapi_repetition(gr_unittest.TestCase): def test_parallelism1_00(self): frame_size = 30 rep = 3 - enc = map((lambda a: fec.repetition_encoder_make(frame_size*8, rep)), range(0,1)) - dec = map((lambda a: fec.repetition_decoder.make(frame_size*8, rep)), range(0,1)) + enc = list(map((lambda a: fec.repetition_encoder_make(frame_size*8, rep)), list(range(0,1)))) + dec = list(map((lambda a: fec.repetition_decoder.make(frame_size*8, rep)), list(range(0,1)))) threading = None self.test = _qa_helper(10*frame_size, enc, dec, threading) self.tb.connect(self.test) @@ -98,8 +101,8 @@ class test_fecapi_repetition(gr_unittest.TestCase): def test_parallelism1_01(self): frame_size = 30 rep = 3 - enc = map((lambda a: fec.repetition_encoder_make(frame_size*8, rep)), range(0,1)) - dec = map((lambda a: fec.repetition_decoder.make(frame_size*8, rep)), range(0,1)) + enc = list(map((lambda a: fec.repetition_encoder_make(frame_size*8, rep)), list(range(0,1)))) + dec = list(map((lambda a: fec.repetition_decoder.make(frame_size*8, rep)), list(range(0,1)))) threading = 'ordinary' self.test = _qa_helper(10*frame_size, enc, dec, threading) self.tb.connect(self.test) @@ -113,8 +116,8 @@ class test_fecapi_repetition(gr_unittest.TestCase): def test_parallelism1_02(self): frame_size = 300 rep = 3 - enc = map((lambda a: fec.repetition_encoder_make(frame_size*8, rep)), range(0,1)) - dec = map((lambda a: fec.repetition_decoder.make(frame_size*8, rep)), range(0,1)) + enc = list(map((lambda a: fec.repetition_encoder_make(frame_size*8, rep)), list(range(0,1)))) + dec = list(map((lambda a: fec.repetition_decoder.make(frame_size*8, rep)), list(range(0,1)))) threading = 'capillary' self.test = _qa_helper(10*frame_size, enc, dec, threading) self.tb.connect(self.test) @@ -129,8 +132,8 @@ class test_fecapi_repetition(gr_unittest.TestCase): frame_size = 30 rep = 3 dims = 10 - enc = map((lambda a: fec.repetition_encoder_make(frame_size*8, rep)), range(0,dims)) - dec = map((lambda a: fec.repetition_decoder.make(frame_size*8, rep)), range(0,dims)) + enc = list(map((lambda a: fec.repetition_encoder_make(frame_size*8, rep)), list(range(0,dims)))) + dec = list(map((lambda a: fec.repetition_decoder.make(frame_size*8, rep)), list(range(0,dims)))) threading = 'ordinary' self.test = _qa_helper(dims*frame_size, enc, dec, threading) self.tb.connect(self.test) @@ -145,8 +148,8 @@ class test_fecapi_repetition(gr_unittest.TestCase): frame_size = 30 rep = 3 dims = 16 - enc = map((lambda a: fec.repetition_encoder_make(frame_size*8, rep)), range(0,dims)) - dec = map((lambda a: fec.repetition_decoder.make(frame_size*8, rep)), range(0,dims)) + enc = list(map((lambda a: fec.repetition_encoder_make(frame_size*8, rep)), list(range(0,dims)))) + dec = list(map((lambda a: fec.repetition_decoder.make(frame_size*8, rep)), list(range(0,dims)))) threading = 'capillary' self.test = _qa_helper(dims*frame_size, enc, dec, threading) self.tb.connect(self.test) diff --git a/gr-fec/python/fec/qa_polar_decoder_sc.py b/gr-fec/python/fec/qa_polar_decoder_sc.py index 6dd1e8e481..c8d956328e 100644 --- a/gr-fec/python/fec/qa_polar_decoder_sc.py +++ b/gr-fec/python/fec/qa_polar_decoder_sc.py @@ -20,13 +20,18 @@ # Boston, MA 02110-1301, USA. # -from gnuradio import gr, gr_unittest, blocks -import fec_swig as fec +from __future__ import print_function +from __future__ import absolute_import +from __future__ import division + import numpy as np -from extended_decoder import extended_decoder -from polar.encoder import PolarEncoder -import polar.channel_construction as cc + +from gnuradio import gr, gr_unittest, blocks +from gnuradio import fec +from fec import extended_decoder +from fec.polar.encoder import PolarEncoder +from fec.polar import channel_construction as cc # import os # print('PID:', os.getpid()) diff --git a/gr-fec/python/fec/qa_polar_decoder_sc_list.py b/gr-fec/python/fec/qa_polar_decoder_sc_list.py index 36819b396f..13a8e9bc32 100644 --- a/gr-fec/python/fec/qa_polar_decoder_sc_list.py +++ b/gr-fec/python/fec/qa_polar_decoder_sc_list.py @@ -20,13 +20,17 @@ # Boston, MA 02110-1301, USA. # -from gnuradio import gr, gr_unittest, blocks -import fec_swig as fec +from __future__ import print_function +from __future__ import absolute_import +from __future__ import division + + import numpy as np -from extended_decoder import extended_decoder -from polar.encoder import PolarEncoder -import polar.channel_construction as cc +from gnuradio import gr, gr_unittest, blocks, fec +from gnuradio.fec import extended_decoder +from gnuradio.fec.polar.encoder import PolarEncoder +from gnuradio.fec.polar import channel_construction as cc # import os # print('PID:', os.getpid()) @@ -56,7 +60,7 @@ class test_polar_decoder_sc_list(gr_unittest.TestCase): self.assertFalse(polar_decoder.set_frame_size(10)) def test_002_one_vector(self): - print "test_002_one_vector" + print("test_002_one_vector") expo = 6 block_size = 2 ** expo num_info_bits = 2 ** (expo - 1) @@ -89,7 +93,7 @@ class test_polar_decoder_sc_list(gr_unittest.TestCase): self.assertTupleEqual(tuple(res), tuple(bits)) def test_003_stream(self): - print "test_003_stream" + print("test_003_stream") nframes = 5 expo = 8 block_size = 2 ** expo diff --git a/gr-fec/python/fec/qa_polar_decoder_sc_systematic.py b/gr-fec/python/fec/qa_polar_decoder_sc_systematic.py index fb2381e069..525ebbc76c 100644 --- a/gr-fec/python/fec/qa_polar_decoder_sc_systematic.py +++ b/gr-fec/python/fec/qa_polar_decoder_sc_systematic.py @@ -20,13 +20,16 @@ # Boston, MA 02110-1301, USA. # -from gnuradio import gr, gr_unittest, blocks -import fec_swig as fec +from __future__ import absolute_import +from __future__ import division import numpy as np -from extended_decoder import extended_decoder -from polar.encoder import PolarEncoder -import polar.channel_construction as cc + +from gnuradio import gr, gr_unittest, blocks, fec + +from gnuradio.fec.extended_decoder import extended_decoder +from gnuradio.fec.polar.encoder import PolarEncoder +from gnuradio.fec.polar import channel_construction as cc # import os # print('PID:', os.getpid()) @@ -113,5 +116,3 @@ class test_polar_decoder_sc_systematic(gr_unittest.TestCase): if __name__ == '__main__': gr_unittest.run(test_polar_decoder_sc_systematic) - - diff --git a/gr-fec/python/fec/qa_polar_encoder.py b/gr-fec/python/fec/qa_polar_encoder.py index d7362b6dc4..ba003d9070 100644 --- a/gr-fec/python/fec/qa_polar_encoder.py +++ b/gr-fec/python/fec/qa_polar_encoder.py @@ -20,13 +20,16 @@ # Boston, MA 02110-1301, USA. # -from gnuradio import gr, gr_unittest, blocks -import fec_swig as fec +from __future__ import absolute_import +from __future__ import division + + import numpy as np -from extended_encoder import extended_encoder -from polar.encoder import PolarEncoder -import polar.channel_construction as cc +from gnuradio import gr, gr_unittest, blocks, fec +from gnuradio.fec.extended_encoder import extended_encoder +from gnuradio.fec.polar.encoder import PolarEncoder +from gnuradio.fec.polar import channel_construction as cc # import os # print('PID:', os.getpid()) diff --git a/gr-fec/python/fec/qa_polar_encoder_systematic.py b/gr-fec/python/fec/qa_polar_encoder_systematic.py index 015a31b3cb..18b918ddab 100644 --- a/gr-fec/python/fec/qa_polar_encoder_systematic.py +++ b/gr-fec/python/fec/qa_polar_encoder_systematic.py @@ -20,13 +20,15 @@ # Boston, MA 02110-1301, USA. # -from gnuradio import gr, gr_unittest, blocks -import fec_swig as fec +from __future__ import absolute_import +from __future__ import division + import numpy as np -from extended_encoder import extended_encoder -from polar.encoder import PolarEncoder -import polar.channel_construction as cc +from gnuradio import gr, gr_unittest, blocks, fec +from gnuradio.fec.extended_encoder import extended_encoder +from gnuradio.fec.polar.encoder import PolarEncoder +from gnuradio.fec.polar import channel_construction as cc # import os # print('PID:', os.getpid()) @@ -103,5 +105,3 @@ class test_polar_encoder_systematic(gr_unittest.TestCase): if __name__ == '__main__': gr_unittest.run(test_polar_encoder_systematic) - - diff --git a/gr-fec/python/fec/qa_puncture.py b/gr-fec/python/fec/qa_puncture.py index fdd15c9a08..f4e0ba8556 100644 --- a/gr-fec/python/fec/qa_puncture.py +++ b/gr-fec/python/fec/qa_puncture.py @@ -20,11 +20,13 @@ # Boston, MA 02110-1301, USA. # -from gnuradio import gr, gr_unittest -import fec_swig as fec -import blocks_swig as blocks +from __future__ import division + from collections import deque +from gnuradio import gr, gr_unittest, blocks, fec + + class test_puncture (gr_unittest.TestCase): def puncture_setup(self): @@ -36,13 +38,13 @@ class test_puncture (gr_unittest.TestCase): _puncpat = list(d) self.expected = [] - for n in range(len(self.src_data)/self.puncsize): + for n in range(len(self.src_data) // self.puncsize): for i in range(self.puncsize): if _puncpat[i] == 1: self.expected.append(self.src_data[n*self.puncsize+i]); def setUp(self): - self.src_data = 10000*range(64) + self.src_data = 10000*list(range(64)) self.tb = gr.top_block() def tearDown(self): @@ -58,14 +60,14 @@ class test_puncture (gr_unittest.TestCase): self.puncture_setup() src = blocks.vector_source_b(self.src_data) - op = fec.puncture_bb(self.puncsize, self.puncpat, self.delay) - dst = blocks.vector_sink_b() + op = fec.puncture_bb(self.puncsize, self.puncpat, self.delay) + dst = blocks.vector_sink_b() - self.tb.connect(src, op, dst) - self.tb.run() + self.tb.connect(src, op, dst) + self.tb.run() - dst_data = list(dst.data()) - for i in xrange(len(dst_data)): + dst_data = list(dst.data()) + for i in range(len(dst_data)): dst_data[i] = int(dst_data[i]) self.assertEqual(self.expected, dst_data) @@ -78,19 +80,19 @@ class test_puncture (gr_unittest.TestCase): self.puncpat = 0xEE self.delay = 1 - self.src_data = range(16) + self.src_data = list(range(16)) self.puncture_setup() src = blocks.vector_source_b(self.src_data) - op = fec.puncture_bb(self.puncsize, self.puncpat, self.delay) - dst = blocks.vector_sink_b() + op = fec.puncture_bb(self.puncsize, self.puncpat, self.delay) + dst = blocks.vector_sink_b() - self.tb.connect(src, op, dst) - self.tb.run() + self.tb.connect(src, op, dst) + self.tb.run() - dst_data = list(dst.data()) - for i in xrange(len(dst_data)): + dst_data = list(dst.data()) + for i in range(len(dst_data)): dst_data[i] = int(dst_data[i]) self.assertEqual(self.expected, dst_data) @@ -107,14 +109,14 @@ class test_puncture (gr_unittest.TestCase): self.puncture_setup() src = blocks.vector_source_b(self.src_data) - op = fec.puncture_bb(self.puncsize, self.puncpat, self.delay) - dst = blocks.vector_sink_b() + op = fec.puncture_bb(self.puncsize, self.puncpat, self.delay) + dst = blocks.vector_sink_b() - self.tb.connect(src, op, dst) - self.tb.run() + self.tb.connect(src, op, dst) + self.tb.run() - dst_data = list(dst.data()) - for i in xrange(len(dst_data)): + dst_data = list(dst.data()) + for i in range(len(dst_data)): dst_data[i] = int(dst_data[i]) self.assertEqual(self.expected, dst_data) @@ -131,21 +133,21 @@ class test_puncture (gr_unittest.TestCase): self.delay = 1 src = blocks.vector_source_b(self.src_data) - op0 = fec.puncture_bb(self.puncsize, self.puncpat0, self.delay) - op1 = fec.puncture_bb(self.puncsize, self.puncpat1, self.delay) - dst0 = blocks.vector_sink_b() - dst1 = blocks.vector_sink_b() + op0 = fec.puncture_bb(self.puncsize, self.puncpat0, self.delay) + op1 = fec.puncture_bb(self.puncsize, self.puncpat1, self.delay) + dst0 = blocks.vector_sink_b() + dst1 = blocks.vector_sink_b() - self.tb.connect(src, op0, dst0) - self.tb.connect(src, op1, dst1) - self.tb.run() + self.tb.connect(src, op0, dst0) + self.tb.connect(src, op1, dst1) + self.tb.run() - dst_data0 = list(dst0.data()) - for i in xrange(len(dst_data0)): + dst_data0 = list(dst0.data()) + for i in range(len(dst_data0)): dst_data0[i] = int(dst_data0[i]) - dst_data1 = list(dst1.data()) - for i in xrange(len(dst_data1)): + dst_data1 = list(dst1.data()) + for i in range(len(dst_data1)): dst_data1[i] = int(dst_data1[i]) self.assertEqual(dst_data1, dst_data0) @@ -162,13 +164,13 @@ class test_puncture (gr_unittest.TestCase): self.puncture_setup() src = blocks.vector_source_f(self.src_data) - op = fec.puncture_ff(self.puncsize, self.puncpat, self.delay) - dst = blocks.vector_sink_f() + op = fec.puncture_ff(self.puncsize, self.puncpat, self.delay) + dst = blocks.vector_sink_f() - self.tb.connect(src, op, dst) - self.tb.run() + self.tb.connect(src, op, dst) + self.tb.run() - dst_data = list(dst.data()) + dst_data = list(dst.data()) self.assertEqual(self.expected, dst_data) @@ -179,18 +181,18 @@ class test_puncture (gr_unittest.TestCase): self.puncpat = 0xEE self.delay = 1 - self.src_data = range(16) + self.src_data = list(range(16)) self.puncture_setup() src = blocks.vector_source_f(self.src_data) - op = fec.puncture_ff(self.puncsize, self.puncpat, self.delay) - dst = blocks.vector_sink_f() + op = fec.puncture_ff(self.puncsize, self.puncpat, self.delay) + dst = blocks.vector_sink_f() - self.tb.connect(src, op, dst) - self.tb.run() + self.tb.connect(src, op, dst) + self.tb.run() - dst_data = list(dst.data()) + dst_data = list(dst.data()) self.assertEqual(self.expected, dst_data) @@ -205,13 +207,13 @@ class test_puncture (gr_unittest.TestCase): self.puncture_setup() src = blocks.vector_source_f(self.src_data) - op = fec.puncture_ff(self.puncsize, self.puncpat, self.delay) - dst = blocks.vector_sink_f() + op = fec.puncture_ff(self.puncsize, self.puncpat, self.delay) + dst = blocks.vector_sink_f() - self.tb.connect(src, op, dst) - self.tb.run() + self.tb.connect(src, op, dst) + self.tb.run() - dst_data = list(dst.data()) + dst_data = list(dst.data()) self.assertEqual(self.expected, dst_data) def test_f_003(self): @@ -226,17 +228,17 @@ class test_puncture (gr_unittest.TestCase): self.delay = 1 src = blocks.vector_source_f(self.src_data) - op0 = fec.puncture_ff(self.puncsize, self.puncpat0, self.delay) - op1 = fec.puncture_ff(self.puncsize, self.puncpat1, self.delay) - dst0 = blocks.vector_sink_f() - dst1 = blocks.vector_sink_f() + op0 = fec.puncture_ff(self.puncsize, self.puncpat0, self.delay) + op1 = fec.puncture_ff(self.puncsize, self.puncpat1, self.delay) + dst0 = blocks.vector_sink_f() + dst1 = blocks.vector_sink_f() - self.tb.connect(src, op0, dst0) - self.tb.connect(src, op1, dst1) - self.tb.run() + self.tb.connect(src, op0, dst0) + self.tb.connect(src, op1, dst1) + self.tb.run() - dst_data0 = list(dst0.data()) - dst_data1 = list(dst1.data()) + dst_data0 = list(dst0.data()) + dst_data1 = list(dst1.data()) self.assertEqual(dst_data1, dst_data0) diff --git a/gr-fec/python/fec/threaded_decoder.py b/gr-fec/python/fec/threaded_decoder.py index 115ad7b5d3..adf4abfe22 100644 --- a/gr-fec/python/fec/threaded_decoder.py +++ b/gr-fec/python/fec/threaded_decoder.py @@ -20,8 +20,10 @@ # Boston, MA 02110-1301, USA. # +from __future__ import unicode_literals from gnuradio import gr, blocks -import fec_swig as fec +from . import fec_swig as fec + class threaded_decoder(gr.hier_block2): def __init__(self, decoder_list_0, input_size, output_size): diff --git a/gr-fec/python/fec/threaded_encoder.py b/gr-fec/python/fec/threaded_encoder.py index 391baa5442..254b4d39d8 100644 --- a/gr-fec/python/fec/threaded_encoder.py +++ b/gr-fec/python/fec/threaded_encoder.py @@ -20,8 +20,11 @@ # Boston, MA 02110-1301, USA. # +from __future__ import unicode_literals from gnuradio import gr, blocks -import fec_swig as fec + +from . import fec_swig as fec + class threaded_encoder(gr.hier_block2): def __init__(self, encoder_list_0, input_size, output_size): |