<?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>
