diff options
Diffstat (limited to 'gr-trellis/grc')
27 files changed, 921 insertions, 1510 deletions
diff --git a/gr-trellis/grc/CMakeLists.txt b/gr-trellis/grc/CMakeLists.txt index 9fbadd50d8..f727da92d4 100644 --- a/gr-trellis/grc/CMakeLists.txt +++ b/gr-trellis/grc/CMakeLists.txt @@ -18,18 +18,18 @@ # Boston, MA 02110-1301, USA. install(FILES - trellis_encoder_xx.xml - trellis_siso_combined_f.xml - trellis_viterbi_x.xml - trellis_metrics_x.xml - trellis_siso_f.xml - trellis_permutation.xml - trellis_viterbi_combined_xx.xml - trellis_sccc_encoder_xx.xml - trellis_sccc_decoder_x.xml - trellis_sccc_decoder_combined_xx.xml - trellis_pccc_encoder_xx.xml - trellis_pccc_decoder_x.xml - trellis_pccc_decoder_combined_xx.xml + trellis_encoder_xx.block.yml + trellis_siso_combined_f.block.yml + trellis_viterbi_x.block.yml + trellis_metrics_x.block.yml + trellis_siso_f.block.yml + trellis_permutation.block.yml + trellis_viterbi_combined_xx.block.yml + trellis_sccc_encoder_xx.block.yml + trellis_sccc_decoder_x.block.yml + trellis_sccc_decoder_combined_xx.block.yml + trellis_pccc_encoder_xx.block.yml + trellis_pccc_decoder_x.block.yml + trellis_pccc_decoder_combined_xx.block.yml DESTINATION ${GRC_BLOCKS_DIR} ) diff --git a/gr-trellis/grc/trellis_encoder_xx.block.yml b/gr-trellis/grc/trellis_encoder_xx.block.yml new file mode 100644 index 0000000000..d437c16119 --- /dev/null +++ b/gr-trellis/grc/trellis_encoder_xx.block.yml @@ -0,0 +1,59 @@ +id: trellis_encoder_xx +label: Trellis Encoder +category: '[Core]/Trellis Coding' + +parameters: +- id: type + label: Type + dtype: enum + options: [bb, bs, bi, ss, si, ii] + option_labels: [Byte->Byte, Byte->Short, Byte->Int, Short->Short, Short->Int, + Int->Int] + option_attributes: + input: [byte, byte, byte, short, short, int] + output: [byte, short, int, short, int, int] + hide: part +- id: fsm_args + label: FSM Args + dtype: raw +- id: init_state + label: Initial State + dtype: int + default: '0' +- id: blockwise + label: Blockwise + dtype: enum + default: 'False' + options: ['True', 'False'] + option_labels: ['On', 'Off'] + hide: part +- id: blocklength + label: Block length + dtype: int + default: '0' + hide: ${ ('none' if blockwise == 'True' else 'all') } + +inputs: +- domain: stream + dtype: ${ type.input } + +outputs: +- domain: stream + dtype: ${ type.output } + +asserts: +- ${ (isinstance(eval(""" fsm_args """[1:-1], locals(),globals()), str) and open(fsm_args).close()) or True } + +templates: + imports: from gnuradio import trellis + make: ' trellis.encoder_${type}(trellis.fsm(${fsm_args}), ${init_state}, ${blocklength}) + if ${blockwise} else trellis.encoder_${type}(trellis.fsm(${fsm_args}), ${init_state}) ' + callbacks: + - set_FSM(trellis.fsm(${fsm_args})) + - set_ST(${init_state}) + - set_K(${blocklength}) + +documentation: |- + The fsm arguments are passed directly to the trellis.fsm() constructor. + +file_format: 1 diff --git a/gr-trellis/grc/trellis_encoder_xx.xml b/gr-trellis/grc/trellis_encoder_xx.xml deleted file mode 100644 index ab7d5226e9..0000000000 --- a/gr-trellis/grc/trellis_encoder_xx.xml +++ /dev/null @@ -1,103 +0,0 @@ -<?xml version="1.0"?> -<!-- -################################################### -##Trellis Encoder -################################################### - --> - -<block> - <name>Trellis Encoder</name> - <key>trellis_encoder_xx</key> - <category>[Core]/Trellis Coding</category> - <import>from gnuradio import trellis</import> - <make> trellis.encoder_$(type)(trellis.fsm($fsm_args), $init_state, $blocklength) if $blockwise else trellis.encoder_$(type)(trellis.fsm($fsm_args), $init_state) </make> - <callback>set_FSM(trellis.fsm($fsm_args))</callback> - <callback>set_ST($init_state)</callback> - <callback>set_K($blocklength)</callback> - <param> - <name>Type</name> - <key>type</key> - <type>enum</type> - <option> - <name>Byte->Byte</name> - <key>bb</key> - <opt>input:byte</opt> - <opt>output:byte</opt> - </option> - <option> - <name>Byte->Short</name> - <key>bs</key> - <opt>input:byte</opt> - <opt>output:short</opt> - </option> - <option> - <name>Byte->Int</name> - <key>bi</key> - <opt>input:byte</opt> - <opt>output:int</opt> - </option> - <option> - <name>Short->Short</name> - <key>ss</key> - <opt>input:short</opt> - <opt>output:short</opt> - </option> - <option> - <name>Short->Int</name> - <key>si</key> - <opt>input:short</opt> - <opt>output:int</opt> - </option> - <option> - <name>Int->Int</name> - <key>ii</key> - <opt>input:int</opt> - <opt>output:int</opt> - </option> - </param> - <param> - <name>FSM Args</name> - <key>fsm_args</key> - <type>raw</type> - </param> - <param> - <name>Initial State</name> - <key>init_state</key> - <value>0</value> - <type>int</type> - </param> - <param> - <name>Blockwise</name> - <key>blockwise</key> - <value>False</value> - <type>enum</type> - <hide>part</hide> - <option> - <name>On</name> - <key>True</key> - </option> - <option> - <name>Off</name> - <key>False</key> - </option> - </param> - <param> - <name>Block length</name> - <key>blocklength</key> - <value>0</value> - <type>int</type> - <hide>#if $blockwise() == 'True' then 'none' else 'all'#</hide> - </param> - <check>(isinstance(eval(""" $fsm_args """[1:-1], locals(),globals()), str) and open($fsm_args).close()) or True</check> - <sink> - <name>in</name> - <type>$type.input</type> - </sink> - <source> - <name>out</name> - <type>$type.output</type> - </source> - <doc> -The fsm arguments are passed directly to the trellis.fsm() constructor. - </doc> -</block> diff --git a/gr-trellis/grc/trellis_metrics_x.block.yml b/gr-trellis/grc/trellis_metrics_x.block.yml new file mode 100644 index 0000000000..e4559ea15c --- /dev/null +++ b/gr-trellis/grc/trellis_metrics_x.block.yml @@ -0,0 +1,50 @@ +id: trellis_metrics_x +label: Trellis Metrics +category: '[Core]/Trellis Coding' + +parameters: +- id: type + label: Type + dtype: enum + options: [c, f, i, s] + option_labels: [Complex, Float, Int, Short] + option_attributes: + io: [complex, float, int, short] + table: [complex_vector, real_vector, int_vector, int_vector] + hide: part +- id: card + label: Output Cardinality + dtype: int +- id: dim + label: Dimensionality + dtype: int +- id: table + label: Constellation + dtype: ${ type.table } +- id: metric_type + label: Metric Type + dtype: enum + options: [digital.TRELLIS_EUCLIDEAN, digital.TRELLIS_HARD_SYMBOL, digital.TRELLIS_HARD_BIT] + option_labels: [Euclidean, Hard Symbol, Hard Bit] + +inputs: +- domain: stream + dtype: ${ type.io } + +outputs: +- domain: stream + dtype: float + +templates: + imports: from gnuradio import trellis, digital + make: trellis.metrics_${type}(${card}, ${dim}, ${table}, ${metric_type}) + callbacks: + - set_O(${card}) + - set_D(${dim}) + - set_TYPE(${metric_type}) + - set_TABLE(${table}) + +documentation: |- + Generate metrics required for Viterbi or SISO algorithms. + +file_format: 1 diff --git a/gr-trellis/grc/trellis_metrics_x.xml b/gr-trellis/grc/trellis_metrics_x.xml deleted file mode 100644 index 15e7338098..0000000000 --- a/gr-trellis/grc/trellis_metrics_x.xml +++ /dev/null @@ -1,91 +0,0 @@ -<?xml version="1.0"?> -<!-- -################################################### -##Trellis Metrics -################################################### - --> - - -<block> - <name>Trellis Metrics</name> - <key>trellis_metrics_x</key> - <category>[Core]/Trellis Coding</category> - <import>from gnuradio import trellis, digital</import> - <make>trellis.metrics_$(type)($card, $dim, $table, $metric_type)</make> - <callback>set_O($card)</callback> - <callback>set_D($dim)</callback> - <callback>set_TYPE($metric_type)</callback> - <callback>set_TABLE($table)</callback> - <param> - <name>Type</name> - <key>type</key> - <type>enum</type> - <option> - <name>Complex</name> - <key>c</key> - <opt>io:complex</opt> - <opt>table:complex_vector</opt> - </option> - <option> - <name>Float</name> - <key>f</key> - <opt>io:float</opt> - <opt>table:real_vector</opt> - </option> - <option> - <name>Int</name> - <key>i</key> - <opt>io:int</opt> - <opt>table:int_vector</opt> - </option> - <option> - <name>Short</name> - <key>s</key> - <opt>io:short</opt> - <opt>table:int_vector</opt> - </option> - </param> - <param> - <name>Output Cardinality</name> - <key>card</key> - <type>int</type> - </param> - <param> - <name>Dimensionality</name> - <key>dim</key> - <type>int</type> - </param> - <param> - <name>Constellation</name> - <key>table</key> - <type>$type.table</type> - </param> - <param> - <name>Metric Type</name> - <key>metric_type</key> - <type>enum</type> - <option> - <name>Euclidean</name> - <key>digital.TRELLIS_EUCLIDEAN</key> - </option> - <option> - <name>Hard Symbol</name> - <key>digital.TRELLIS_HARD_SYMBOL</key> - </option> - <option> - <name>Hard Bit</name> - <key>digital.TRELLIS_HARD_BIT</key> - </option> - </param> - <sink> - <name>in</name> - <type>$type.io</type> - </sink> - <source> - <name>out</name> - <type>float</type> - </source> - <doc> -Generate metrics required for Viterbi or SISO algorithms. - </doc> -</block> diff --git a/gr-trellis/grc/trellis_pccc_decoder_combined_xx.block.yml b/gr-trellis/grc/trellis_pccc_decoder_combined_xx.block.yml new file mode 100644 index 0000000000..dbfe1ec31d --- /dev/null +++ b/gr-trellis/grc/trellis_pccc_decoder_combined_xx.block.yml @@ -0,0 +1,102 @@ +id: trellis_pccc_decoder_combined_xx +label: PCCC Decoder Combo +category: '[Core]/Trellis Coding' + +parameters: +- id: type + label: Input Type + dtype: enum + options: [c, f] + option_labels: [Complex, Float] + option_attributes: + io: [complex, float] + table: [complex_vector, real_vector] + hide: part +- id: out_type + label: Output Type + dtype: enum + options: [i, s, b] + option_labels: [Int, Short, Byte] + option_attributes: + io: [int, short, byte] + hide: part +- id: o_fsm_args + label: FSM 1 + dtype: raw +- id: o_init_state + label: Initial State 1 + dtype: int + default: '0' +- id: o_final_state + label: Final State 1 + dtype: int + default: '-1' +- id: i_fsm_args + label: FSM 2 + dtype: raw +- id: i_init_state + label: Initial State 2 + dtype: int + default: '0' +- id: i_final_state + label: Final State 2 + dtype: int + default: '-1' +- id: interleaver + label: Interleaver + dtype: raw +- id: block_size + label: Block Size + dtype: int +- id: iterations + label: Iterations + dtype: int + default: '10' +- id: dim + label: Dimensionality + dtype: int +- id: table + label: Constellation + dtype: ${ type.table } +- id: metric_type + label: Metric Type + dtype: enum + options: [digital.TRELLIS_EUCLIDEAN, digital.TRELLIS_HARD_SYMBOL, digital.TRELLIS_HARD_BIT] + option_labels: [Euclidean, Hard Symbol, Hard Bit] +- id: siso_type + label: SISO Type + dtype: enum + options: [trellis.TRELLIS_MIN_SUM, trellis.TRELLIS_SUM_PRODUCT] + option_labels: [Min Sum, Sum Product] +- id: scaling + label: Scaling + dtype: real + default: '1.0' + +inputs: +- domain: stream + dtype: ${ type.io } + +outputs: +- domain: stream + dtype: ${ out_type.io } + +asserts: +- ${ (isinstance(eval(""" o_fsm_args """[1:-1], locals(),globals()), str) and open(o_fsm_args).close()) or True } +- ${ (isinstance(eval(""" i_fsm_args """[1:-1], locals(),globals()), str) and open(i_fsm_args).close()) or True } + +templates: + imports: from gnuradio import trellis, digital + make: "trellis.pccc_decoder_combined_${type}${out_type}(\n trellis.fsm(${o_fsm_args}),\ + \ ${o_init_state}, ${o_final_state},\n trellis.fsm(${i_fsm_args}), ${i_init_state},\ + \ ${i_final_state},\n trellis.interleaver(${interleaver}),\n ${block_size},\n\ + \ ${iterations},\n ${siso_type},\n ${dim}, ${table}, ${metric_type},\n\ + \ ${scaling})\n " + callbacks: + - set_scaling(${scaling}) + +documentation: |- + PCCC turbo Decoder combined with metric calculation. + The fsm arguments are passed directly to the trellis.fsm() constructor. + +file_format: 1 diff --git a/gr-trellis/grc/trellis_pccc_decoder_combined_xx.xml b/gr-trellis/grc/trellis_pccc_decoder_combined_xx.xml deleted file mode 100644 index 7bb38db893..0000000000 --- a/gr-trellis/grc/trellis_pccc_decoder_combined_xx.xml +++ /dev/null @@ -1,172 +0,0 @@ -<?xml version="1.0"?> -<!-- -################################################### -## PCCC Decoder Combined -################################################### - --> - - -<block> - <name>PCCC Decoder Combo</name> - <key>trellis_pccc_decoder_combined_xx</key> - <category>[Core]/Trellis Coding</category> - <import>from gnuradio import trellis, digital</import> - <make>trellis.pccc_decoder_combined_$(type)$(out_type)( - trellis.fsm($o_fsm_args), $o_init_state, $o_final_state, - trellis.fsm($i_fsm_args), $i_init_state, $i_final_state, - trellis.interleaver($interleaver), - $block_size, - $iterations, - $siso_type, - $dim, $table, $metric_type, - $scaling) - </make> - <callback>set_scaling($scaling)</callback> - <param> - <name>Input Type</name> - <key>type</key> - <type>enum</type> - <option> - <name>Complex</name> - <key>c</key> - <opt>io:complex</opt> - <opt>table:complex_vector</opt> - </option> - <option> - <name>Float</name> - <key>f</key> - <opt>io:float</opt> - <opt>table:real_vector</opt> - </option> - </param> - <param> - <name>Output Type</name> - <key>out_type</key> - <type>enum</type> - <option> - <name>Int</name> - <key>i</key> - <opt>io:int</opt> - </option> - <option> - <name>Short</name> - <key>s</key> - <opt>io:short</opt> - </option> - <option> - <name>Byte</name> - <key>b</key> - <opt>io:byte</opt> - </option> - </param> - <param> - <name>FSM 1</name> - <key>o_fsm_args</key> - <type>raw</type> - </param> - <param> - <name>Initial State 1</name> - <key>o_init_state</key> - <value>0</value> - <type>int</type> - </param> - <param> - <name>Final State 1</name> - <key>o_final_state</key> - <value>-1</value> - <type>int</type> - </param> - <param> - <name>FSM 2</name> - <key>i_fsm_args</key> - <type>raw</type> - </param> - <param> - <name>Initial State 2</name> - <key>i_init_state</key> - <value>0</value> - <type>int</type> - </param> - <param> - <name>Final State 2</name> - <key>i_final_state</key> - <value>-1</value> - <type>int</type> - </param> - <param> - <name>Interleaver</name> - <key>interleaver</key> - <type>raw</type> - </param> - <param> - <name>Block Size</name> - <key>block_size</key> - <type>int</type> - </param> - <param> - <name>Iterations</name> - <key>iterations</key> - <value>10</value> - <type>int</type> - </param> - <param> - <name>Dimensionality</name> - <key>dim</key> - <type>int</type> - </param> - <param> - <name>Constellation</name> - <key>table</key> - <type>$type.table</type> - </param> - <param> - <name>Metric Type</name> - <key>metric_type</key> - <type>enum</type> - <option> - <name>Euclidean</name> - <key>digital.TRELLIS_EUCLIDEAN</key> - </option> - <option> - <name>Hard Symbol</name> - <key>digital.TRELLIS_HARD_SYMBOL</key> - </option> - <option> - <name>Hard Bit</name> - <key>digital.TRELLIS_HARD_BIT</key> - </option> - </param> - <param> - <name>SISO Type</name> - <key>siso_type</key> - <type>enum</type> - <option> - <name>Min Sum</name> - <key>trellis.TRELLIS_MIN_SUM</key> - </option> - <option> - <name>Sum Product</name> - <key>trellis.TRELLIS_SUM_PRODUCT</key> - </option> - </param> - <param> - <name>Scaling</name> - <key>scaling</key> - <value>1.0</value> - <type>real</type> - </param> - <check>(isinstance(eval(""" $o_fsm_args """[1:-1], locals(),globals()), str) and open($o_fsm_args).close()) or True</check> - <check>(isinstance(eval(""" $i_fsm_args """[1:-1], locals(),globals()), str) and open($i_fsm_args).close()) or True </check> - <sink> - <name>in</name> - <type>$type.io</type> - </sink> - <source> - <name>out</name> - <type>$out_type.io</type> - </source> - <doc> -PCCC turbo Decoder combined with metric calculation. -The fsm arguments are passed directly to the trellis.fsm() constructor. - </doc> -</block> diff --git a/gr-trellis/grc/trellis_pccc_decoder_x.block.yml b/gr-trellis/grc/trellis_pccc_decoder_x.block.yml new file mode 100644 index 0000000000..f49ec91a70 --- /dev/null +++ b/gr-trellis/grc/trellis_pccc_decoder_x.block.yml @@ -0,0 +1,75 @@ +id: trellis_pccc_decoder_x +label: PCCC Decoder +category: '[Core]/Trellis Coding' + +parameters: +- id: out_type + label: Output Type + dtype: enum + options: [i, s, b] + option_labels: [Int, Short, Byte] + option_attributes: + io: [int, short, byte] + hide: part +- id: o_fsm_args + label: FSM 1 + dtype: raw +- id: o_init_state + label: Initial State 1 + dtype: int + default: '0' +- id: o_final_state + label: Final State 1 + dtype: int + default: '-1' +- id: i_fsm_args + label: FSM 2 + dtype: raw +- id: i_init_state + label: Initial State 2 + dtype: int + default: '0' +- id: i_final_state + label: Final State 2 + dtype: int + default: '-1' +- id: interleaver + label: Interleaver + dtype: raw +- id: block_size + label: Block Size + dtype: int +- id: iterations + label: Iterations + dtype: int + default: '10' +- id: siso_type + label: SISO Type + dtype: enum + options: [trellis.TRELLIS_MIN_SUM, trellis.TRELLIS_SUM_PRODUCT] + option_labels: [Min Sum, Sum Product] + +inputs: +- domain: stream + dtype: float + +outputs: +- domain: stream + dtype: ${ out_type.io } + +asserts: +- ${ (isinstance(eval(""" o_fsm_args """[1:-1], locals(),globals()), str) and open(o_fsm_args).close()) or True } +- ${ (isinstance(eval(""" i_fsm_args """[1:-1], locals(),globals()), str) and open(i_fsm_args).close()) or True } + +templates: + imports: from gnuradio import trellis + make: "trellis.pccc_decoder_${out_type}(\n trellis.fsm(${o_fsm_args}), ${o_init_state},\ + \ ${o_final_state},\n trellis.fsm(${i_fsm_args}), ${i_init_state}, ${i_final_state},\n\ + \ trellis.interleaver(${interleaver}),\n ${block_size},\n ${iterations},\n\ + \ ${siso_type})\n " + +documentation: |- + PCCC turbo Decoder. + The fsm and interleaver arguments are passed directly to the trellis.fsm() and trellis.interleaver() constructors. + +file_format: 1 diff --git a/gr-trellis/grc/trellis_pccc_decoder_x.xml b/gr-trellis/grc/trellis_pccc_decoder_x.xml deleted file mode 100644 index 08d1f526af..0000000000 --- a/gr-trellis/grc/trellis_pccc_decoder_x.xml +++ /dev/null @@ -1,119 +0,0 @@ -<?xml version="1.0"?> -<!-- -################################################### -## PCCC Decoder -################################################### - --> - - -<block> - <name>PCCC Decoder</name> - <key>trellis_pccc_decoder_x</key> - <category>[Core]/Trellis Coding</category> - <import>from gnuradio import trellis</import> - <make>trellis.pccc_decoder_$(out_type)( - trellis.fsm($o_fsm_args), $o_init_state, $o_final_state, - trellis.fsm($i_fsm_args), $i_init_state, $i_final_state, - trellis.interleaver($interleaver), - $block_size, - $iterations, - $siso_type) - </make> - <param> - <name>Output Type</name> - <key>out_type</key> - <type>enum</type> - <option> - <name>Int</name> - <key>i</key> - <opt>io:int</opt> - </option> - <option> - <name>Short</name> - <key>s</key> - <opt>io:short</opt> - </option> - <option> - <name>Byte</name> - <key>b</key> - <opt>io:byte</opt> - </option> - </param> - <param> - <name>FSM 1</name> - <key>o_fsm_args</key> - <type>raw</type> - </param> - <param> - <name>Initial State 1</name> - <key>o_init_state</key> - <value>0</value> - <type>int</type> - </param> - <param> - <name>Final State 1</name> - <key>o_final_state</key> - <value>-1</value> - <type>int</type> - </param> - <param> - <name>FSM 2</name> - <key>i_fsm_args</key> - <type>raw</type> - </param> - <param> - <name>Initial State 2</name> - <key>i_init_state</key> - <value>0</value> - <type>int</type> - </param> - <param> - <name>Final State 2</name> - <key>i_final_state</key> - <value>-1</value> - <type>int</type> - </param> - <param> - <name>Interleaver</name> - <key>interleaver</key> - <type>raw</type> - </param> - <param> - <name>Block Size</name> - <key>block_size</key> - <type>int</type> - </param> - <param> - <name>Iterations</name> - <key>iterations</key> - <value>10</value> - <type>int</type> - </param> - <param> - <name>SISO Type</name> - <key>siso_type</key> - <type>enum</type> - <option> - <name>Min Sum</name> - <key>trellis.TRELLIS_MIN_SUM</key> - </option> - <option> - <name>Sum Product</name> - <key>trellis.TRELLIS_SUM_PRODUCT</key> - </option> - </param> - <check>(isinstance(eval(""" $o_fsm_args """[1:-1], locals(),globals()), str) and open($o_fsm_args).close()) or True</check> - <check>(isinstance(eval(""" $i_fsm_args """[1:-1], locals(),globals()), str) and open($i_fsm_args).close()) or True </check> - <sink> - <name>in</name> - <type>float</type> - </sink> - <source> - <name>out</name> - <type>$out_type.io</type> - </source> - <doc> -PCCC turbo Decoder. -The fsm and interleaver arguments are passed directly to the trellis.fsm() and trellis.interleaver() constructors. - </doc> -</block> diff --git a/gr-trellis/grc/trellis_pccc_encoder_xx.block.yml b/gr-trellis/grc/trellis_pccc_encoder_xx.block.yml new file mode 100644 index 0000000000..4bc2f10b3b --- /dev/null +++ b/gr-trellis/grc/trellis_pccc_encoder_xx.block.yml @@ -0,0 +1,58 @@ +id: trellis_pccc_encoder_xx +label: PCCC Encoder +category: '[Core]/Trellis Coding' + +parameters: +- id: type + label: Type + dtype: enum + options: [bb, bs, bi, ss, si, ii] + option_labels: [Byte->Byte, Byte->Short, Byte->Int, Short->Short, Short->Int, + Int->Int] + option_attributes: + input: [byte, byte, byte, short, short, int] + output: [byte, short, int, short, int, int] + hide: part +- id: o_fsm_args + label: FSM 1 + dtype: raw +- id: o_init_state + label: Initial State 1 + dtype: int + default: '0' +- id: i_fsm_args + label: FSM 2 + dtype: raw +- id: i_init_state + label: Initial State 2 + dtype: int + default: '0' +- id: interleaver_args + label: Interleaver + dtype: raw +- id: bl + label: Blocklength + dtype: int + +inputs: +- domain: stream + dtype: ${ type.input } + +outputs: +- domain: stream + dtype: ${ type.output } + +asserts: +- ${ (isinstance(eval(""" o_fsm_args """[1:-1], locals(),globals()), str) and open(o_fsm_args).close()) or True } +- ${ (isinstance(eval(""" i_fsm_args """[1:-1], locals(),globals()), str) and open(i_fsm_args).close()) or True } + +templates: + imports: from gnuradio import trellis + make: trellis.pccc_encoder_${type}(trellis.fsm(${o_fsm_args}), ${o_init_state}, + trellis.fsm(${i_fsm_args}), ${i_init_state}, trellis.interleaver(${interleaver_args}), + ${bl}) + +documentation: |- + The fsm and interleaver arguments are passed directly to the trellis.fsm() and trellis.interleaver() constructors. + +file_format: 1 diff --git a/gr-trellis/grc/trellis_pccc_encoder_xx.xml b/gr-trellis/grc/trellis_pccc_encoder_xx.xml deleted file mode 100644 index 85348e6e9b..0000000000 --- a/gr-trellis/grc/trellis_pccc_encoder_xx.xml +++ /dev/null @@ -1,100 +0,0 @@ -<?xml version="1.0"?> -<!-- -################################################### -## PCCC Encoder -################################################### - --> - -<block> - <name>PCCC Encoder</name> - <key>trellis_pccc_encoder_xx</key> - <category>[Core]/Trellis Coding</category> - <import>from gnuradio import trellis</import> - <make>trellis.pccc_encoder_$(type)(trellis.fsm($o_fsm_args), $o_init_state, trellis.fsm($i_fsm_args), $i_init_state, trellis.interleaver($interleaver_args), $bl)</make> - <param> - <name>Type</name> - <key>type</key> - <type>enum</type> - <option> - <name>Byte->Byte</name> - <key>bb</key> - <opt>input:byte</opt> - <opt>output:byte</opt> - </option> - <option> - <name>Byte->Short</name> - <key>bs</key> - <opt>input:byte</opt> - <opt>output:short</opt> - </option> - <option> - <name>Byte->Int</name> - <key>bi</key> - <opt>input:byte</opt> - <opt>output:int</opt> - </option> - <option> - <name>Short->Short</name> - <key>ss</key> - <opt>input:short</opt> - <opt>output:short</opt> - </option> - <option> - <name>Short->Int</name> - <key>si</key> - <opt>input:short</opt> - <opt>output:int</opt> - </option> - <option> - <name>Int->Int</name> - <key>ii</key> - <opt>input:int</opt> - <opt>output:int</opt> - </option> - </param> - <param> - <name>FSM 1</name> - <key>o_fsm_args</key> - <type>raw</type> - </param> - <param> - <name>Initial State 1</name> - <key>o_init_state</key> - <value>0</value> - <type>int</type> - </param> - <param> - <name>FSM 2</name> - <key>i_fsm_args</key> - <type>raw</type> - </param> - <param> - <name>Initial State 2</name> - <key>i_init_state</key> - <value>0</value> - <type>int</type> - </param> - <param> - <name>Interleaver</name> - <key>interleaver_args</key> - <type>raw</type> - </param> - <param> - <name>Blocklength</name> - <key>bl</key> - <type>int</type> - </param> - <check>(isinstance(eval(""" $o_fsm_args """[1:-1], locals(),globals()), str) and open($o_fsm_args).close()) or True</check> - <check>(isinstance(eval(""" $i_fsm_args """[1:-1], locals(),globals()), str) and open($i_fsm_args).close()) or True </check> - <sink> - <name>in</name> - <type>$type.input</type> - </sink> - <source> - <name>out</name> - <type>$type.output</type> - </source> - <doc> -The fsm and interleaver arguments are passed directly to the trellis.fsm() and trellis.interleaver() constructors. - </doc> -</block> diff --git a/gr-trellis/grc/trellis_permutation.block.yml b/gr-trellis/grc/trellis_permutation.block.yml new file mode 100644 index 0000000000..2dba671448 --- /dev/null +++ b/gr-trellis/grc/trellis_permutation.block.yml @@ -0,0 +1,54 @@ +id: trellis_permutation +label: Trellis Permutation +category: '[Core]/Trellis Coding' + +parameters: +- id: type + label: 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: interleaver_size + label: Interleaver Size + dtype: int +- id: table + label: Table + dtype: int_vector +- id: syms_per_block + label: Symbols per Block + dtype: int +- id: vlen + label: Vec Length + dtype: int + default: '1' + hide: ${ 'part' if vlen == 1 else 'none' } + +inputs: +- domain: stream + dtype: ${ type } + vlen: ${ vlen } + +outputs: +- domain: stream + dtype: ${ type } + vlen: ${ vlen } + +asserts: +- ${ vlen > 0 } + +templates: + imports: from gnuradio import trellis + make: trellis.permutation(${interleaver_size}, ${table}, ${syms_per_block}, ${type.size}*${vlen}) + callbacks: + - set_K(${interleaver_size}) + - set_TABLE(${table}) + - set_SYMS_PER_BLOCK(${syms_per_block}) + +documentation: |- + Interleaver size is given in blocks. + One Symbol = (in/out type) * (vector length) + +file_format: 1 diff --git a/gr-trellis/grc/trellis_permutation.xml b/gr-trellis/grc/trellis_permutation.xml deleted file mode 100644 index 99eb2d291c..0000000000 --- a/gr-trellis/grc/trellis_permutation.xml +++ /dev/null @@ -1,85 +0,0 @@ -<?xml version="1.0"?> -<!-- -################################################### -##Trellis Permutation -################################################### - --> - - -<block> - <name>Trellis Permutation</name> - <key>trellis_permutation</key> - <category>[Core]/Trellis Coding</category> - <import>from gnuradio import trellis</import> - <make>trellis.permutation($interleaver_size, $table, $syms_per_block, $type.size*$vlen)</make> - <callback>set_K($interleaver_size)</callback> - <callback>set_TABLE($table)</callback> - <callback>set_SYMS_PER_BLOCK($syms_per_block)</callback> - - <param> - <name>Type</name> - <key>type</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>Interleaver Size</name> - <key>interleaver_size</key> - <type>int</type> - </param> - <param> - <name>Table</name> - <key>table</key> - <type>int_vector</type> - </param> - <param> - <name>Symbols per Block</name> - <key>syms_per_block</key> - <type>int</type> - </param> - <param> - <name>Vec Length</name> - <key>vlen</key> - <value>1</value> - <type>int</type> - </param> - <check>$vlen > 0</check> - <sink> - <name>in</name> - <type>$type</type> - <vlen>$vlen</vlen> - </sink> - <source> - <name>out</name> - <type>$type</type> - <vlen>$vlen</vlen> - </source> - <doc> -Interleaver size is given in blocks. -One Symbol = (in/out type) * (vector length) - </doc> -</block> diff --git a/gr-trellis/grc/trellis_sccc_decoder_combined_xx.block.yml b/gr-trellis/grc/trellis_sccc_decoder_combined_xx.block.yml new file mode 100644 index 0000000000..441d9593b8 --- /dev/null +++ b/gr-trellis/grc/trellis_sccc_decoder_combined_xx.block.yml @@ -0,0 +1,102 @@ +id: trellis_sccc_decoder_combined_xx +label: SCCC Decoder Combo +category: '[Core]/Trellis Coding' + +parameters: +- id: type + label: Input Type + dtype: enum + options: [c, f] + option_labels: [Complex, Float] + option_attributes: + io: [complex, float] + table: [complex_vector, real_vector] + hide: part +- id: out_type + label: Output Type + dtype: enum + options: [i, s, b] + option_labels: [Int, Short, Byte] + option_attributes: + io: [int, short, byte] + hide: part +- id: o_fsm_args + label: Outer FSM + dtype: raw +- id: o_init_state + label: Outer Initial State + dtype: int + default: '0' +- id: o_final_state + label: Outer Final State + dtype: int + default: '-1' +- id: i_fsm_args + label: Inner FSM + dtype: raw +- id: i_init_state + label: Inner Initial State + dtype: int + default: '0' +- id: i_final_state + label: Inner Final State + dtype: int + default: '-1' +- id: interleaver + label: Interleaver + dtype: raw +- id: block_size + label: Block Size + dtype: int +- id: iterations + label: Iterations + dtype: int + default: '10' +- id: dim + label: Dimensionality + dtype: int +- id: table + label: Constellation + dtype: ${ type.table } +- id: metric_type + label: Metric Type + dtype: enum + options: [digital.TRELLIS_EUCLIDEAN, digital.TRELLIS_HARD_SYMBOL, digital.TRELLIS_HARD_BIT] + option_labels: [Euclidean, Hard Symbol, Hard Bit] +- id: siso_type + label: SISO Type + dtype: enum + options: [trellis.TRELLIS_MIN_SUM, trellis.TRELLIS_SUM_PRODUCT] + option_labels: [Min Sum, Sum Product] +- id: scaling + label: Scaling + dtype: real + default: '1.0' + +inputs: +- domain: stream + dtype: ${ type.io } + +outputs: +- domain: stream + dtype: ${ out_type.io } + +asserts: +- ${ (isinstance(eval(""" o_fsm_args """[1:-1], locals(),globals()), str) and open(o_fsm_args).close()) or True } +- ${ (isinstance(eval(""" i_fsm_args """[1:-1], locals(),globals()), str) and open(i_fsm_args).close()) or True } + +templates: + imports: from gnuradio import trellis, digital + make: "trellis.sccc_decoder_combined_${type}${out_type}(\n trellis.fsm(${o_fsm_args}),\ + \ ${o_init_state}, ${o_final_state},\n trellis.fsm(${i_fsm_args}), ${i_init_state},\ + \ ${i_final_state},\n trellis.interleaver(${interleaver}),\n ${block_size},\n\ + \ ${iterations},\n ${siso_type},\n ${dim}, ${table},\ + \ ${metric_type},\n ${scaling})\n " + callbacks: + - set_scaling(${scaling}) + +documentation: |- + SCCC turbo Decoder combined with metric calculation. + The fsm arguments are passed directly to the trellis.fsm() constructor. + +file_format: 1 diff --git a/gr-trellis/grc/trellis_sccc_decoder_combined_xx.xml b/gr-trellis/grc/trellis_sccc_decoder_combined_xx.xml deleted file mode 100644 index 79be0b8b5d..0000000000 --- a/gr-trellis/grc/trellis_sccc_decoder_combined_xx.xml +++ /dev/null @@ -1,172 +0,0 @@ -<?xml version="1.0"?> -<!-- -################################################### -## SCCC Decoder Combined -################################################### - --> - - -<block> - <name>SCCC Decoder Combo</name> - <key>trellis_sccc_decoder_combined_xx</key> - <category>[Core]/Trellis Coding</category> - <import>from gnuradio import trellis, digital</import> - <make>trellis.sccc_decoder_combined_$(type)$(out_type)( - trellis.fsm($o_fsm_args), $o_init_state, $o_final_state, - trellis.fsm($i_fsm_args), $i_init_state, $i_final_state, - trellis.interleaver($interleaver), - $block_size, - $iterations, - $siso_type, - $dim, $table, $metric_type, - $scaling) - </make> - <callback>set_scaling($scaling)</callback> - <param> - <name>Input Type</name> - <key>type</key> - <type>enum</type> - <option> - <name>Complex</name> - <key>c</key> - <opt>io:complex</opt> - <opt>table:complex_vector</opt> - </option> - <option> - <name>Float</name> - <key>f</key> - <opt>io:float</opt> - <opt>table:real_vector</opt> - </option> - </param> - <param> - <name>Output Type</name> - <key>out_type</key> - <type>enum</type> - <option> - <name>Int</name> - <key>i</key> - <opt>io:int</opt> - </option> - <option> - <name>Short</name> - <key>s</key> - <opt>io:short</opt> - </option> - <option> - <name>Byte</name> - <key>b</key> - <opt>io:byte</opt> - </option> - </param> - <param> - <name>Outer FSM</name> - <key>o_fsm_args</key> - <type>raw</type> - </param> - <param> - <name>Outer Initial State</name> - <key>o_init_state</key> - <value>0</value> - <type>int</type> - </param> - <param> - <name>Outer Final State</name> - <key>o_final_state</key> - <value>-1</value> - <type>int</type> - </param> - <param> - <name>Inner FSM</name> - <key>i_fsm_args</key> - <type>raw</type> - </param> - <param> - <name>Inner Initial State</name> - <key>i_init_state</key> - <value>0</value> - <type>int</type> - </param> - <param> - <name>Inner Final State</name> - <key>i_final_state</key> - <value>-1</value> - <type>int</type> - </param> - <param> - <name>Interleaver</name> - <key>interleaver</key> - <type>raw</type> - </param> - <param> - <name>Block Size</name> - <key>block_size</key> - <type>int</type> - </param> - <param> - <name>Iterations</name> - <key>iterations</key> - <value>10</value> - <type>int</type> - </param> - <param> - <name>Dimensionality</name> - <key>dim</key> - <type>int</type> - </param> - <param> - <name>Constellation</name> - <key>table</key> - <type>$type.table</type> - </param> - <param> - <name>Metric Type</name> - <key>metric_type</key> - <type>enum</type> - <option> - <name>Euclidean</name> - <key>digital.TRELLIS_EUCLIDEAN</key> - </option> - <option> - <name>Hard Symbol</name> - <key>digital.TRELLIS_HARD_SYMBOL</key> - </option> - <option> - <name>Hard Bit</name> - <key>digital.TRELLIS_HARD_BIT</key> - </option> - </param> - <param> - <name>SISO Type</name> - <key>siso_type</key> - <type>enum</type> - <option> - <name>Min Sum</name> - <key>trellis.TRELLIS_MIN_SUM</key> - </option> - <option> - <name>Sum Product</name> - <key>trellis.TRELLIS_SUM_PRODUCT</key> - </option> - </param> - <param> - <name>Scaling</name> - <key>scaling</key> - <value>1.0</value> - <type>real</type> - </param> - <check>(isinstance(eval(""" $o_fsm_args """[1:-1], locals(),globals()), str) and open($o_fsm_args).close()) or True</check> - <check>(isinstance(eval(""" $i_fsm_args """[1:-1], locals(),globals()), str) and open($i_fsm_args).close()) or True </check> - <sink> - <name>in</name> - <type>$type.io</type> - </sink> - <source> - <name>out</name> - <type>$out_type.io</type> - </source> - <doc> -SCCC turbo Decoder combined with metric calculation. -The fsm arguments are passed directly to the trellis.fsm() constructor. - </doc> -</block> diff --git a/gr-trellis/grc/trellis_sccc_decoder_x.block.yml b/gr-trellis/grc/trellis_sccc_decoder_x.block.yml new file mode 100644 index 0000000000..794115d48a --- /dev/null +++ b/gr-trellis/grc/trellis_sccc_decoder_x.block.yml @@ -0,0 +1,75 @@ +id: trellis_sccc_decoder_x +label: SCCC Decoder +category: '[Core]/Trellis Coding' + +parameters: +- id: out_type + label: Output Type + dtype: enum + options: [i, s, b] + option_labels: [Int, Short, Byte] + option_attributes: + io: [int, short, byte] + hide: part +- id: o_fsm_args + label: Outer FSM + dtype: raw +- id: o_init_state + label: Outer Initial State + dtype: int + default: '0' +- id: o_final_state + label: Outer Final State + dtype: int + default: '-1' +- id: i_fsm_args + label: Inner FSM + dtype: raw +- id: i_init_state + label: Inner Initial State + dtype: int + default: '0' +- id: i_final_state + label: Inner Final State + dtype: int + default: '-1' +- id: interleaver + label: Interleaver + dtype: raw +- id: block_size + label: Block Size + dtype: int +- id: iterations + label: Iterations + dtype: int + default: '10' +- id: siso_type + label: SISO Type + dtype: enum + options: [trellis.TRELLIS_MIN_SUM, trellis.TRELLIS_SUM_PRODUCT] + option_labels: [Min Sum, Sum Product] + +inputs: +- domain: stream + dtype: float + +outputs: +- domain: stream + dtype: ${ out_type.io } + +asserts: +- ${ (isinstance(eval(""" o_fsm_args """[1:-1], locals(),globals()), str) and open(o_fsm_args).close()) or True } +- ${ (isinstance(eval(""" i_fsm_args """[1:-1], locals(),globals()), str) and open(i_fsm_args).close()) or True } + +templates: + imports: from gnuradio import trellis + make: "trellis.sccc_decoder_${out_type}(\n trellis.fsm(${o_fsm_args}), ${o_init_state},\ + \ ${o_final_state},\n trellis.fsm(${i_fsm_args}), ${i_init_state}, ${i_final_state},\n\ + \ trellis.interleaver(${interleaver}),\n ${block_size},\n ${iterations},\n\ + \ ${siso_type})\n " + +documentation: |- + SCCC turbo Decoder. + The fsm and interleaver arguments are passed directly to the trellis.fsm() and trellis.interleaver() constructors. + +file_format: 1 diff --git a/gr-trellis/grc/trellis_sccc_decoder_x.xml b/gr-trellis/grc/trellis_sccc_decoder_x.xml deleted file mode 100644 index 584ff0b0af..0000000000 --- a/gr-trellis/grc/trellis_sccc_decoder_x.xml +++ /dev/null @@ -1,119 +0,0 @@ -<?xml version="1.0"?> -<!-- -################################################### -## SCCC Decoder -################################################### - --> - - -<block> - <name>SCCC Decoder</name> - <key>trellis_sccc_decoder_x</key> - <category>[Core]/Trellis Coding</category> - <import>from gnuradio import trellis</import> - <make>trellis.sccc_decoder_$(out_type)( - trellis.fsm($o_fsm_args), $o_init_state, $o_final_state, - trellis.fsm($i_fsm_args), $i_init_state, $i_final_state, - trellis.interleaver($interleaver), - $block_size, - $iterations, - $siso_type) - </make> - <param> - <name>Output Type</name> - <key>out_type</key> - <type>enum</type> - <option> - <name>Int</name> - <key>i</key> - <opt>io:int</opt> - </option> - <option> - <name>Short</name> - <key>s</key> - <opt>io:short</opt> - </option> - <option> - <name>Byte</name> - <key>b</key> - <opt>io:byte</opt> - </option> - </param> - <param> - <name>Outer FSM</name> - <key>o_fsm_args</key> - <type>raw</type> - </param> - <param> - <name>Outer Initial State</name> - <key>o_init_state</key> - <value>0</value> - <type>int</type> - </param> - <param> - <name>Outer Final State</name> - <key>o_final_state</key> - <value>-1</value> - <type>int</type> - </param> - <param> - <name>Inner FSM</name> - <key>i_fsm_args</key> - <type>raw</type> - </param> - <param> - <name>Inner Initial State</name> - <key>i_init_state</key> - <value>0</value> - <type>int</type> - </param> - <param> - <name>Inner Final State</name> - <key>i_final_state</key> - <value>-1</value> - <type>int</type> - </param> - <param> - <name>Interleaver</name> - <key>interleaver</key> - <type>raw</type> - </param> - <param> - <name>Block Size</name> - <key>block_size</key> - <type>int</type> - </param> - <param> - <name>Iterations</name> - <key>iterations</key> - <value>10</value> - <type>int</type> - </param> - <param> - <name>SISO Type</name> - <key>siso_type</key> - <type>enum</type> - <option> - <name>Min Sum</name> - <key>trellis.TRELLIS_MIN_SUM</key> - </option> - <option> - <name>Sum Product</name> - <key>trellis.TRELLIS_SUM_PRODUCT</key> - </option> - </param> - <check>(isinstance(eval(""" $o_fsm_args """[1:-1], locals(),globals()), str) and open($o_fsm_args).close()) or True</check> - <check>(isinstance(eval(""" $i_fsm_args """[1:-1], locals(),globals()), str) and open($i_fsm_args).close()) or True </check> - <sink> - <name>in</name> - <type>float</type> - </sink> - <source> - <name>out</name> - <type>$out_type.io</type> - </source> - <doc> -SCCC turbo Decoder. -The fsm and interleaver arguments are passed directly to the trellis.fsm() and trellis.interleaver() constructors. - </doc> -</block> diff --git a/gr-trellis/grc/trellis_sccc_encoder_xx.block.yml b/gr-trellis/grc/trellis_sccc_encoder_xx.block.yml new file mode 100644 index 0000000000..5068af38ff --- /dev/null +++ b/gr-trellis/grc/trellis_sccc_encoder_xx.block.yml @@ -0,0 +1,58 @@ +id: trellis_sccc_encoder_xx +label: SCCC Encoder +category: '[Core]/Trellis Coding' + +parameters: +- id: type + label: Type + dtype: enum + options: [bb, bs, bi, ss, si, ii] + option_labels: [Byte->Byte, Byte->Short, Byte->Int, Short->Short, Short->Int, + Int->Int] + option_attributes: + input: [byte, byte, byte, short, short, int] + output: [byte, short, int, short, int, int] + hide: part +- id: o_fsm_args + label: Outer FSM + dtype: raw +- id: o_init_state + label: Outer Initial State + dtype: int + default: '0' +- id: i_fsm_args + label: Inner FSM + dtype: raw +- id: i_init_state + label: Inner Initial State + dtype: int + default: '0' +- id: interleaver_args + label: Interleaver + dtype: raw +- id: bl + label: Blocklength + dtype: int + +inputs: +- domain: stream + dtype: ${ type.input } + +outputs: +- domain: stream + dtype: ${ type.output } + +asserts: +- ${ (isinstance(eval(""" o_fsm_args """[1:-1], locals(),globals()), str) and open(o_fsm_args).close()) or True } +- ${ (isinstance(eval(""" i_fsm_args """[1:-1], locals(),globals()), str) and open(i_fsm_args).close()) or True } + +templates: + imports: from gnuradio import trellis + make: trellis.sccc_encoder_${type}(trellis.fsm(${o_fsm_args}), ${o_init_state}, + trellis.fsm(${i_fsm_args}), ${i_init_state}, trellis.interleaver(${interleaver_args}), + ${bl}) + +documentation: |- + The fsm and interleaver arguments are passed directly to the trellis.fsm() and trellis.interleaver() constructors. + +file_format: 1 diff --git a/gr-trellis/grc/trellis_sccc_encoder_xx.xml b/gr-trellis/grc/trellis_sccc_encoder_xx.xml deleted file mode 100644 index 7b4ab30c75..0000000000 --- a/gr-trellis/grc/trellis_sccc_encoder_xx.xml +++ /dev/null @@ -1,100 +0,0 @@ -<?xml version="1.0"?> -<!-- -################################################### -##SCCC Encoder -################################################### - --> - -<block> - <name>SCCC Encoder</name> - <key>trellis_sccc_encoder_xx</key> - <category>[Core]/Trellis Coding</category> - <import>from gnuradio import trellis</import> - <make>trellis.sccc_encoder_$(type)(trellis.fsm($o_fsm_args), $o_init_state, trellis.fsm($i_fsm_args), $i_init_state, trellis.interleaver($interleaver_args), $bl)</make> - <param> - <name>Type</name> - <key>type</key> - <type>enum</type> - <option> - <name>Byte->Byte</name> - <key>bb</key> - <opt>input:byte</opt> - <opt>output:byte</opt> - </option> - <option> - <name>Byte->Short</name> - <key>bs</key> - <opt>input:byte</opt> - <opt>output:short</opt> - </option> - <option> - <name>Byte->Int</name> - <key>bi</key> - <opt>input:byte</opt> - <opt>output:int</opt> - </option> - <option> - <name>Short->Short</name> - <key>ss</key> - <opt>input:short</opt> - <opt>output:short</opt> - </option> - <option> - <name>Short->Int</name> - <key>si</key> - <opt>input:short</opt> - <opt>output:int</opt> - </option> - <option> - <name>Int->Int</name> - <key>ii</key> - <opt>input:int</opt> - <opt>output:int</opt> - </option> - </param> - <param> - <name>Outer FSM</name> - <key>o_fsm_args</key> - <type>raw</type> - </param> - <param> - <name>Outer Initial State</name> - <key>o_init_state</key> - <value>0</value> - <type>int</type> - </param> - <param> - <name>Inner FSM</name> - <key>i_fsm_args</key> - <type>raw</type> - </param> - <param> - <name>Inner Initial State</name> - <key>i_init_state</key> - <value>0</value> - <type>int</type> - </param> - <param> - <name>Interleaver</name> - <key>interleaver_args</key> - <type>raw</type> - </param> - <param> - <name>Blocklength</name> - <key>bl</key> - <type>int</type> - </param> - <check>(isinstance(eval(""" $o_fsm_args """[1:-1], locals(),globals()), str) and open($o_fsm_args).close()) or True</check> - <check>(isinstance(eval(""" $i_fsm_args """[1:-1], locals(),globals()), str) and open($i_fsm_args).close()) or True </check> - <sink> - <name>in</name> - <type>$type.input</type> - </sink> - <source> - <name>out</name> - <type>$type.output</type> - </source> - <doc> -The fsm and interleaver arguments are passed directly to the trellis.fsm() and trellis.interleaver() constructors. - </doc> -</block> diff --git a/gr-trellis/grc/trellis_siso_combined_f.block.yml b/gr-trellis/grc/trellis_siso_combined_f.block.yml new file mode 100644 index 0000000000..0a10dc14d3 --- /dev/null +++ b/gr-trellis/grc/trellis_siso_combined_f.block.yml @@ -0,0 +1,79 @@ +id: trellis_siso_combined_f +label: SISO Combo +category: '[Core]/Trellis Coding' + +parameters: +- id: fsm_args + label: FSM Args + dtype: raw +- id: block_size + label: Block Size + dtype: int +- id: init_state + label: Initial State + dtype: int + default: '0' +- id: final_state + label: Final State + dtype: int + default: '-1' +- id: a_post_in + label: A-posteriori In + dtype: enum + options: ['True', 'False'] + option_labels: ['Yes', 'No'] +- id: a_post_out + label: A-posteriori Out + dtype: enum + options: ['True', 'False'] + option_labels: ['Yes', 'No'] +- id: siso_type + label: SISO Type + dtype: enum + options: [trellis.TRELLIS_MIN_SUM, trellis.TRELLIS_SUM_PRODUCT] + option_labels: [Min Sum, Sum Product] +- id: dim + label: Dimensionality + dtype: int +- id: table + label: Constellation + dtype: real_vector +- id: metric_type + label: Metric Type + dtype: enum + options: [trellis.TRELLIS_EUCLIDEAN, trellis.TRELLIS_HARD_SYMBOL, trellis.TRELLIS_HARD_BIT] + option_labels: [Euclidean, Hard Symbol, Hard Bit] + +inputs: +- label: in_i + domain: stream + dtype: float +- label: in_o + domain: stream + dtype: float + +outputs: +- domain: stream + dtype: float + +templates: + imports: from gnuradio import trellis + make: trellis.siso_combined_f(trellis.fsm(${fsm_args}), ${block_size}, ${init_state}, + ${final_state}, ${a_post_in}, ${a_post_out}, ${siso_type}, ${dim}, ${table}, + ${metric_type}) + callbacks: + - set_FSM(trellis.fsm(${fsm_args})) + - set_K(${block_size}) + - set_S0(${init_state}) + - set_SK(${final_state}) + - set_POSTI(${a_post_in}) + - set_POSTO(${a_post_out}) + - set_SISO_TYPE(${siso_type}) + - set_D(${dim}) + - set_TABLE(${table}) + - set_TYPE(${metric_type}) + +documentation: |- + BCJR Algorithm combined with metric calculation. The fsm arguments are passed directly to the trellis.fsm() constructor. + +file_format: 1 diff --git a/gr-trellis/grc/trellis_siso_combined_f.xml b/gr-trellis/grc/trellis_siso_combined_f.xml deleted file mode 100644 index f8ec9c2d21..0000000000 --- a/gr-trellis/grc/trellis_siso_combined_f.xml +++ /dev/null @@ -1,129 +0,0 @@ -<?xml version="1.0"?> -<!-- -################################################### -##Trellis SISO Combined -################################################### - --> - - -<block> - <name>SISO Combo</name> - <key>trellis_siso_combined_f</key> - <category>[Core]/Trellis Coding</category> - <import>from gnuradio import trellis</import> - <make>trellis.siso_combined_f(trellis.fsm($fsm_args), $block_size, $init_state, $final_state, $a_post_in, $a_post_out, $siso_type, $dim, $table, $metric_type)</make> - <callback>set_FSM(trellis.fsm($fsm_args))</callback> - <callback>set_K($block_size)</callback> - <callback>set_S0($init_state)</callback> - <callback>set_SK($final_state)</callback> - <callback>set_POSTI($a_post_in)</callback> - <callback>set_POSTO($a_post_out)</callback> - <callback>set_SISO_TYPE($siso_type)</callback> - <callback>set_D($dim)</callback> - <callback>set_TABLE($table)</callback> - <callback>set_TYPE($metric_type)</callback> - <param> - <name>FSM Args</name> - <key>fsm_args</key> - <type>raw</type> - </param> - <param> - <name>Block Size</name> - <key>block_size</key> - <type>int</type> - </param> - <param> - <name>Initial State</name> - <key>init_state</key> - <value>0</value> - <type>int</type> - </param> - <param> - <name>Final State</name> - <key>final_state</key> - <value>-1</value> - <type>int</type> - </param> - <param> - <name>A-posteriori In</name> - <key>a_post_in</key> - <type>enum</type> - <option> - <name>Yes</name> - <key>True</key> - </option> - <option> - <name>No</name> - <key>False</key> - </option> - </param> - <param> - <name>A-posteriori Out</name> - <key>a_post_out</key> - <type>enum</type> - <option> - <name>Yes</name> - <key>True</key> - </option> - <option> - <name>No</name> - <key>False</key> - </option> - </param> - <param> - <name>SISO Type</name> - <key>siso_type</key> - <type>enum</type> - <option> - <name>Min Sum</name> - <key>trellis.TRELLIS_MIN_SUM</key> - </option> - <option> - <name>Sum Product</name> - <key>trellis.TRELLIS_SUM_PRODUCT</key> - </option> - </param> - <param> - <name>Dimensionality</name> - <key>dim</key> - <type>int</type> - </param> - <param> - <name>Constellation</name> - <key>table</key> - <type>real_vector</type> - </param> - <param> - <name>Metric Type</name> - <key>metric_type</key> - <type>enum</type> - <option> - <name>Euclidean</name> - <key>trellis.TRELLIS_EUCLIDEAN</key> - </option> - <option> - <name>Hard Symbol</name> - <key>trellis.TRELLIS_HARD_SYMBOL</key> - </option> - <option> - <name>Hard Bit</name> - <key>trellis.TRELLIS_HARD_BIT</key> - </option> - </param> - <sink> - <name>in_i</name> - <type>float</type> - </sink> - <sink> - <name>in_o</name> - <type>float</type> - </sink> - <source> - <name>out</name> - <type>float</type> - </source> - <doc> -BCJR Algorithm combined with metric calculation. \ -The fsm arguments are passed directly to the trellis.fsm() constructor. - </doc> -</block> diff --git a/gr-trellis/grc/trellis_siso_f.block.yml b/gr-trellis/grc/trellis_siso_f.block.yml new file mode 100644 index 0000000000..5687dee4ea --- /dev/null +++ b/gr-trellis/grc/trellis_siso_f.block.yml @@ -0,0 +1,67 @@ +id: trellis_siso_f +label: SISO +category: '[Core]/Trellis Coding' + +parameters: +- id: fsm_args + label: FSM Args + dtype: raw +- id: block_size + label: Block Size + dtype: int +- id: init_state + label: Initial State + dtype: int + default: '0' +- id: final_state + label: Final State + dtype: int + default: '-1' +- id: a_post_in + label: A-posteriori In + dtype: enum + options: ['True', 'False'] + option_labels: ['Yes', 'No'] +- id: a_post_out + label: A-posteriori Out + dtype: enum + options: ['True', 'False'] + option_labels: ['Yes', 'No'] +- id: siso_type + label: SISO Type + dtype: enum + options: [trellis.TRELLIS_MIN_SUM, trellis.TRELLIS_SUM_PRODUCT] + option_labels: [Min Sum, Sum Product] + +inputs: +- label: priori + domain: stream + dtype: float +- label: prioro + domain: stream + dtype: float + +outputs: +- domain: stream + dtype: float + +asserts: +- ${ (isinstance(eval(""" fsm_args """[1:-1], locals(),globals()), str) and open(fsm_args).close()) or True } + +templates: + imports: from gnuradio import trellis + make: trellis.siso_f(trellis.fsm(${fsm_args}), ${block_size}, ${init_state}, ${final_state}, + ${a_post_in}, ${a_post_out}, ${siso_type}) + callbacks: + - set_FSM(trellis.fsm(${fsm_args})) + - set_K(${block_size}) + - set_S0(${init_state}) + - set_SK(${final_state}) + - set_POSTI(${a_post_in}) + - set_POSTO(${a_post_out}) + - set_SISO_TYPE(${siso_type}) + +documentation: |- + BCJR Algorithm. The fsm arguments are passed directly to the trellis.fsm() constructor. + +file_format: 1 diff --git a/gr-trellis/grc/trellis_siso_f.xml b/gr-trellis/grc/trellis_siso_f.xml deleted file mode 100644 index e121643e3f..0000000000 --- a/gr-trellis/grc/trellis_siso_f.xml +++ /dev/null @@ -1,100 +0,0 @@ -<?xml version="1.0"?> -<!-- -################################################### -##Trellis SISO -################################################### - --> - - -<block> - <name>SISO</name> - <key>trellis_siso_f</key> - <category>[Core]/Trellis Coding</category> - <import>from gnuradio import trellis</import> - <make>trellis.siso_f(trellis.fsm($fsm_args), $block_size, $init_state, $final_state, $a_post_in, $a_post_out, $siso_type)</make> - <callback>set_FSM(trellis.fsm($fsm_args))</callback> - <callback>set_K($block_size)</callback> - <callback>set_S0($init_state)</callback> - <callback>set_SK($final_state)</callback> - <callback>set_POSTI($a_post_in)</callback> - <callback>set_POSTO($a_post_out)</callback> - <callback>set_SISO_TYPE($siso_type)</callback> - <param> - <name>FSM Args</name> - <key>fsm_args</key> - <type>raw</type> - </param> - <param> - <name>Block Size</name> - <key>block_size</key> - <type>int</type> - </param> - <param> - <name>Initial State</name> - <key>init_state</key> - <value>0</value> - <type>int</type> - </param> - <param> - <name>Final State</name> - <key>final_state</key> - <value>-1</value> - <type>int</type> - </param> - <param> - <name>A-posteriori In</name> - <key>a_post_in</key> - <type>enum</type> - <option> - <name>Yes</name> - <key>True</key> - </option> - <option> - <name>No</name> - <key>False</key> - </option> - </param> - <param> - <name>A-posteriori Out</name> - <key>a_post_out</key> - <type>enum</type> - <option> - <name>Yes</name> - <key>True</key> - </option> - <option> - <name>No</name> - <key>False</key> - </option> - </param> - <param> - <name>SISO Type</name> - <key>siso_type</key> - <type>enum</type> - <option> - <name>Min Sum</name> - <key>trellis.TRELLIS_MIN_SUM</key> - </option> - <option> - <name>Sum Product</name> - <key>trellis.TRELLIS_SUM_PRODUCT</key> - </option> - </param> - <check>(isinstance(eval(""" $fsm_args """[1:-1], locals(),globals()), str) and open($fsm_args).close()) or True</check> - <sink> - <name>priori</name> - <type>float</type> - </sink> - <sink> - <name>prioro</name> - <type>float</type> - </sink> - <source> - <name>out</name> - <type>float</type> - </source> - <doc> -BCJR Algorithm. \ -The fsm arguments are passed directly to the trellis.fsm() constructor. - </doc> -</block> diff --git a/gr-trellis/grc/trellis_viterbi_combined_xx.block.yml b/gr-trellis/grc/trellis_viterbi_combined_xx.block.yml new file mode 100644 index 0000000000..8d1451e2da --- /dev/null +++ b/gr-trellis/grc/trellis_viterbi_combined_xx.block.yml @@ -0,0 +1,76 @@ +id: trellis_viterbi_combined_xx +label: Viterbi Combo +category: '[Core]/Trellis Coding' + +parameters: +- id: type + label: Input Type + dtype: enum + options: [c, f, i, s] + option_labels: [Complex, Float, Int, Short] + option_attributes: + io: [complex, float, int, short] + table: [complex_vector, real_vector, int_vector, int_vector] + hide: part +- id: out_type + label: Output Type + dtype: enum + options: [i, s, b] + option_labels: [Int, Short, Byte] + option_attributes: + io: [int, short, byte] + hide: part +- id: fsm_args + label: FSM Args + dtype: raw +- id: block_size + label: Block Size + dtype: int +- id: init_state + label: Initial State + dtype: int + default: '0' +- id: final_state + label: Final State + dtype: int + default: '-1' +- id: dim + label: Dimensionality + dtype: int +- id: table + label: Constellation + dtype: ${ type.table } +- id: metric_type + label: Metric Type + dtype: enum + options: [digital.TRELLIS_EUCLIDEAN, digital.TRELLIS_HARD_SYMBOL, digital.TRELLIS_HARD_BIT] + option_labels: [Euclidean, Hard Symbol, Hard Bit] + +inputs: +- domain: stream + dtype: ${ type.io } + +outputs: +- domain: stream + dtype: ${ out_type.io } + +asserts: +- ${ (isinstance(eval(""" fsm_args """[1:-1], locals(),globals()), str) and open(fsm_args).close()) or True } + +templates: + imports: from gnuradio import trellis, digital + make: trellis.viterbi_combined_${type}${out_type}(trellis.fsm(${fsm_args}), ${block_size}, + ${init_state}, ${final_state}, ${dim}, ${table}, ${metric_type}) + callbacks: + - set_FSM(trellis.fsm(${fsm_args})) + - set_K(${block_size}) + - set_S0(${init_state}) + - set_SK(${final_state}) + - set_D(${dim}) + - set_TABLE(${table}) + - set_TYPE(${metric_type}) + +documentation: |- + Viterbi Decoder combined with metric calculation. The fsm arguments are passed directly to the trellis.fsm() constructor. + +file_format: 1 diff --git a/gr-trellis/grc/trellis_viterbi_combined_xx.xml b/gr-trellis/grc/trellis_viterbi_combined_xx.xml deleted file mode 100644 index a52e5ed2b5..0000000000 --- a/gr-trellis/grc/trellis_viterbi_combined_xx.xml +++ /dev/null @@ -1,133 +0,0 @@ -<?xml version="1.0"?> -<!-- -################################################### -##Trellis Viterbi Combined -################################################### - --> - - -<block> - <name>Viterbi Combo</name> - <key>trellis_viterbi_combined_xx</key> - <category>[Core]/Trellis Coding</category> - <import>from gnuradio import trellis, digital</import> - <make>trellis.viterbi_combined_$(type)$(out_type)(trellis.fsm($fsm_args), $block_size, $init_state, $final_state, $dim, $table, $metric_type)</make> - <callback>set_FSM(trellis.fsm($fsm_args))</callback> - <callback>set_K($block_size)</callback> - <callback>set_S0($init_state)</callback> - <callback>set_SK($final_state)</callback> - <callback>set_D($dim)</callback> - <callback>set_TABLE($table)</callback> - <callback>set_TYPE($metric_type)</callback> - <param> - <name>Input Type</name> - <key>type</key> - <type>enum</type> - <option> - <name>Complex</name> - <key>c</key> - <opt>io:complex</opt> - <opt>table:complex_vector</opt> - </option> - <option> - <name>Float</name> - <key>f</key> - <opt>io:float</opt> - <opt>table:real_vector</opt> - </option> - <option> - <name>Int</name> - <key>i</key> - <opt>io:int</opt> - <opt>table:int_vector</opt> - </option> - <option> - <name>Short</name> - <key>s</key> - <opt>io:short</opt> - <opt>table:int_vector</opt> - </option> - </param> - <param> - <name>Output Type</name> - <key>out_type</key> - <type>enum</type> - <option> - <name>Int</name> - <key>i</key> - <opt>io:int</opt> - </option> - <option> - <name>Short</name> - <key>s</key> - <opt>io:short</opt> - </option> - <option> - <name>Byte</name> - <key>b</key> - <opt>io:byte</opt> - </option> - </param> - <param> - <name>FSM Args</name> - <key>fsm_args</key> - <type>raw</type> - </param> - <param> - <name>Block Size</name> - <key>block_size</key> - <type>int</type> - </param> - <param> - <name>Initial State</name> - <key>init_state</key> - <value>0</value> - <type>int</type> - </param> - <param> - <name>Final State</name> - <key>final_state</key> - <value>-1</value> - <type>int</type> - </param> - <param> - <name>Dimensionality</name> - <key>dim</key> - <type>int</type> - </param> - <param> - <name>Constellation</name> - <key>table</key> - <type>$type.table</type> - </param> - <param> - <name>Metric Type</name> - <key>metric_type</key> - <type>enum</type> - <option> - <name>Euclidean</name> - <key>digital.TRELLIS_EUCLIDEAN</key> - </option> - <option> - <name>Hard Symbol</name> - <key>digital.TRELLIS_HARD_SYMBOL</key> - </option> - <option> - <name>Hard Bit</name> - <key>digital.TRELLIS_HARD_BIT</key> - </option> - </param> - <check>(isinstance(eval(""" $fsm_args """[1:-1], locals(),globals()), str) and open($fsm_args).close()) or True</check> - <sink> - <name>in</name> - <type>$type.io</type> - </sink> - <source> - <name>out</name> - <type>$out_type.io</type> - </source> - <doc> -Viterbi Decoder combined with metric calculation. \ -The fsm arguments are passed directly to the trellis.fsm() constructor. - </doc> -</block> diff --git a/gr-trellis/grc/trellis_viterbi_x.block.yml b/gr-trellis/grc/trellis_viterbi_x.block.yml new file mode 100644 index 0000000000..2caa5992e7 --- /dev/null +++ b/gr-trellis/grc/trellis_viterbi_x.block.yml @@ -0,0 +1,53 @@ +id: trellis_viterbi_x +label: Viterbi +category: '[Core]/Trellis Coding' + +parameters: +- id: type + label: Type + dtype: enum + options: [i, s, b] + option_labels: [Int, Short, Byte] + option_attributes: + io: [int, short, byte] + hide: part +- id: fsm_args + label: FSM Args + dtype: raw +- id: block_size + label: Block Size + dtype: int +- id: init_state + label: Initial State + dtype: int + default: '0' +- id: final_state + label: Final State + dtype: int + default: '-1' + +inputs: +- domain: stream + dtype: float + +outputs: +- domain: stream + dtype: ${ type.io } + +asserts: +- ${ (isinstance(eval(""" fsm_args """[1:-1], locals(),globals()), str) and open(fsm_args).close()) or True } + +templates: + imports: from gnuradio import trellis + make: trellis.viterbi_${type}(trellis.fsm(${fsm_args}), ${block_size}, ${init_state}, + ${final_state}) + callbacks: + - set_FSM(trellis.fsm(${fsm_args})) + - set_K(${block_size}) + - set_S0(${init_state}) + - set_SK(${final_state}) + +documentation: |- + Viterbi Decoder. The fsm arguments are passed directly to the trellis.fsm() constructor. + +file_format: 1 diff --git a/gr-trellis/grc/trellis_viterbi_x.xml b/gr-trellis/grc/trellis_viterbi_x.xml deleted file mode 100644 index 21611ee51d..0000000000 --- a/gr-trellis/grc/trellis_viterbi_x.xml +++ /dev/null @@ -1,74 +0,0 @@ -<?xml version="1.0"?> -<!-- -################################################### -##Trellis Viterbi -################################################### - --> - - -<block> - <name>Viterbi</name> - <key>trellis_viterbi_x</key> - <category>[Core]/Trellis Coding</category> - <import>from gnuradio import trellis</import> - <make>trellis.viterbi_$(type)(trellis.fsm($fsm_args), $block_size, $init_state, $final_state)</make> - <callback>set_FSM(trellis.fsm($fsm_args))</callback> - <callback>set_K($block_size)</callback> - <callback>set_S0($init_state)</callback> - <callback>set_SK($final_state)</callback> - <param> - <name>Type</name> - <key>type</key> - <type>enum</type> - <option> - <name>Int</name> - <key>i</key> - <opt>io:int</opt> - </option> - <option> - <name>Short</name> - <key>s</key> - <opt>io:short</opt> - </option> - <option> - <name>Byte</name> - <key>b</key> - <opt>io:byte</opt> - </option> - </param> - <param> - <name>FSM Args</name> - <key>fsm_args</key> - <type>raw</type> - </param> - <param> - <name>Block Size</name> - <key>block_size</key> - <type>int</type> - </param> - <param> - <name>Initial State</name> - <key>init_state</key> - <value>0</value> - <type>int</type> - </param> - <param> - <name>Final State</name> - <key>final_state</key> - <value>-1</value> - <type>int</type> - </param> - <check>(isinstance(eval(""" $fsm_args """[1:-1], locals(),globals()), str) and open($fsm_args).close()) or True</check> - <sink> - <name>in</name> - <type>float</type> - </sink> - <source> - <name>out</name> - <type>$type.io</type> - </source> - <doc> -Viterbi Decoder. \ -The fsm arguments are passed directly to the trellis.fsm() constructor. - </doc> -</block> |