commit-gnuradio
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Commit-gnuradio] [gnuradio] 01/07: Added set_ methods for most paramete


From: git
Subject: [Commit-gnuradio] [gnuradio] 01/07: Added set_ methods for most parameters in (almost) all gr-trellis blocks Added FSM functionality + minor fixes
Date: Thu, 16 Oct 2014 16:14:04 +0000 (UTC)

This is an automated email from the git hooks/post-receive script.

jcorgan pushed a commit to branch master
in repository gnuradio.

commit 46e9dfed237990da20b5fb054b7fd33b1c152b4a
Author: Achilleas Anastasopoulos <address@hidden>
Date:   Wed Oct 1 17:51:12 2014 -0400

    Added set_ methods for most parameters in (almost) all gr-trellis blocks
    Added FSM functionality + minor fixes
---
 gr-trellis/examples/grc/equalization.grc           | 1612 ++++++++++++++++++++
 gr-trellis/grc/trellis_encoder_xx.xml              |    2 +
 gr-trellis/grc/trellis_metrics_x.xml               |    3 +
 .../grc/trellis_pccc_decoder_combined_xx.xml       |    2 +-
 gr-trellis/grc/trellis_permutation.xml             |    4 +
 .../grc/trellis_sccc_decoder_combined_xx.xml       |    2 +-
 gr-trellis/grc/trellis_siso_combined_f.xml         |   16 +-
 gr-trellis/grc/trellis_siso_f.xml                  |   13 +-
 gr-trellis/grc/trellis_viterbi_combined_xx.xml     |    8 +-
 gr-trellis/grc/trellis_viterbi_x.xml               |    4 +
 gr-trellis/include/gnuradio/trellis/encoder_XX.h.t |    7 +-
 gr-trellis/include/gnuradio/trellis/fsm.h          |   10 +
 gr-trellis/include/gnuradio/trellis/metrics_X.h.t  |    5 +
 gr-trellis/include/gnuradio/trellis/permutation.h  |    7 +-
 .../gnuradio/trellis/sccc_decoder_combined_XX.h.t  |    1 +
 .../include/gnuradio/trellis/siso_combined_f.h     |   11 +
 gr-trellis/include/gnuradio/trellis/siso_f.h       |    8 +
 gr-trellis/include/gnuradio/trellis/viterbi_X.h.t  |   13 +-
 .../gnuradio/trellis/viterbi_combined_XX.h.t       |    9 +-
 gr-trellis/lib/calc_metric.cc                      |   17 +-
 gr-trellis/lib/core_algorithms.cc                  |   39 +
 gr-trellis/lib/encoder_XX_impl.h.t                 |    7 +-
 gr-trellis/lib/fsm.cc                              |   48 +
 gr-trellis/lib/metrics_X_impl.cc.t                 |   22 +-
 gr-trellis/lib/metrics_X_impl.h.t                  |    4 +
 gr-trellis/lib/permutation_impl.cc                 |   14 +-
 gr-trellis/lib/permutation_impl.h                  |    6 +-
 gr-trellis/lib/siso_combined_f_impl.cc             |   75 +-
 gr-trellis/lib/siso_combined_f_impl.h              |   12 +
 gr-trellis/lib/siso_f_impl.cc                      |   57 +-
 gr-trellis/lib/siso_f_impl.h                       |    9 +
 gr-trellis/lib/viterbi_X_impl.cc.t                 |   12 +
 gr-trellis/lib/viterbi_X_impl.h.t                  |   12 +-
 gr-trellis/lib/viterbi_combined_XX_impl.cc.t       |   14 +-
 gr-trellis/lib/viterbi_combined_XX_impl.h.t        |   19 +-
 gr-trellis/python/trellis/CMakeLists.txt           |    1 +
 gr-trellis/python/trellis/__init__.py              |    3 +
 gr-trellis/python/trellis/fsm_utils.py             |  218 +++
 38 files changed, 2252 insertions(+), 74 deletions(-)

diff --git a/gr-trellis/examples/grc/equalization.grc 
b/gr-trellis/examples/grc/equalization.grc
new file mode 100644
index 0000000..0e9c1bd
--- /dev/null
+++ b/gr-trellis/examples/grc/equalization.grc
@@ -0,0 +1,1612 @@
+<?xml version='1.0' encoding='ASCII'?>
+<?grc format='1' created='3.7.6'?>
+<flow_graph>
+  <timestamp>Wed Oct  1 11:04:18 2014</timestamp>
+  <block>
+    <key>options</key>
+    <param>
+      <key>id</key>
+      <value>viterbi_equalization</value>
+    </param>
+    <param>
+      <key>_enabled</key>
+      <value>True</value>
+    </param>
+    <param>
+      <key>title</key>
+      <value>Viterbi Equalization</value>
+    </param>
+    <param>
+      <key>author</key>
+      <value>AA</value>
+    </param>
+    <param>
+      <key>description</key>
+      <value>gnuradio flow graph</value>
+    </param>
+    <param>
+      <key>window_size</key>
+      <value>2048, 2048</value>
+    </param>
+    <param>
+      <key>generate_options</key>
+      <value>wx_gui</value>
+    </param>
+    <param>
+      <key>category</key>
+      <value>Custom</value>
+    </param>
+    <param>
+      <key>run_options</key>
+      <value>prompt</value>
+    </param>
+    <param>
+      <key>run</key>
+      <value>True</value>
+    </param>
+    <param>
+      <key>max_nouts</key>
+      <value>0</value>
+    </param>
+    <param>
+      <key>realtime_scheduling</key>
+      <value></value>
+    </param>
+    <param>
+      <key>alias</key>
+      <value></value>
+    </param>
+    <param>
+      <key>_coordinate</key>
+      <value>(10, 10)</value>
+    </param>
+    <param>
+      <key>_rotation</key>
+      <value>0</value>
+    </param>
+  </block>
+  <block>
+    <key>variable</key>
+    <param>
+      <key>id</key>
+      <value>block</value>
+    </param>
+    <param>
+      <key>_enabled</key>
+      <value>True</value>
+    </param>
+    <param>
+      <key>value</key>
+      <value>bpsym*1000</value>
+    </param>
+    <param>
+      <key>alias</key>
+      <value></value>
+    </param>
+    <param>
+      <key>_coordinate</key>
+      <value>(216, 21)</value>
+    </param>
+    <param>
+      <key>_rotation</key>
+      <value>0</value>
+    </param>
+  </block>
+  <block>
+    <key>variable</key>
+    <param>
+      <key>id</key>
+      <value>R</value>
+    </param>
+    <param>
+      <key>_enabled</key>
+      <value>True</value>
+    </param>
+    <param>
+      <key>value</key>
+      <value>100e3</value>
+    </param>
+    <param>
+      <key>alias</key>
+      <value></value>
+    </param>
+    <param>
+      <key>_coordinate</key>
+      <value>(216, 109)</value>
+    </param>
+    <param>
+      <key>_rotation</key>
+      <value>0</value>
+    </param>
+  </block>
+  <block>
+    <key>variable</key>
+    <param>
+      <key>id</key>
+      <value>channel</value>
+    </param>
+    <param>
+      <key>_enabled</key>
+      <value>True</value>
+    </param>
+    <param>
+      <key>value</key>
+      <value>fu.c_channel</value>
+    </param>
+    <param>
+      <key>alias</key>
+      <value></value>
+    </param>
+    <param>
+      <key>_coordinate</key>
+      <value>(320, 85)</value>
+    </param>
+    <param>
+      <key>_rotation</key>
+      <value>0</value>
+    </param>
+  </block>
+  <block>
+    <key>variable</key>
+    <param>
+      <key>id</key>
+      <value>modulation</value>
+    </param>
+    <param>
+      <key>_enabled</key>
+      <value>True</value>
+    </param>
+    <param>
+      <key>value</key>
+      <value>fu.pam4</value>
+    </param>
+    <param>
+      <key>alias</key>
+      <value></value>
+    </param>
+    <param>
+      <key>_coordinate</key>
+      <value>(320, 21)</value>
+    </param>
+    <param>
+      <key>_rotation</key>
+      <value>0</value>
+    </param>
+  </block>
+  <block>
+    <key>variable</key>
+    <param>
+      <key>id</key>
+      <value>fsm</value>
+    </param>
+    <param>
+      <key>_enabled</key>
+      <value>True</value>
+    </param>
+    <param>
+      <key>value</key>
+      <value>trellis.fsm(len(modulation[1]),len(channel))</value>
+    </param>
+    <param>
+      <key>alias</key>
+      <value></value>
+    </param>
+    <param>
+      <key>_coordinate</key>
+      <value>(320, 157)</value>
+    </param>
+    <param>
+      <key>_rotation</key>
+      <value>0</value>
+    </param>
+  </block>
+  <block>
+    <key>variable</key>
+    <param>
+      <key>id</key>
+      <value>tot_channel</value>
+    </param>
+    <param>
+      <key>_enabled</key>
+      <value>True</value>
+    </param>
+    <param>
+      <key>value</key>
+      <value>fu.make_isi_lookup(modulation,channel,True)</value>
+    </param>
+    <param>
+      <key>alias</key>
+      <value></value>
+    </param>
+    <param>
+      <key>_coordinate</key>
+      <value>(320, 229)</value>
+    </param>
+    <param>
+      <key>_rotation</key>
+      <value>0</value>
+    </param>
+  </block>
+  <block>
+    <key>variable</key>
+    <param>
+      <key>id</key>
+      <value>bpsym</value>
+    </param>
+    <param>
+      <key>_enabled</key>
+      <value>True</value>
+    </param>
+    <param>
+      <key>value</key>
+      <value>int(round(math.log(fsm.I())/math.log(2)))</value>
+    </param>
+    <param>
+      <key>alias</key>
+      <value></value>
+    </param>
+    <param>
+      <key>_coordinate</key>
+      <value>(528, 13)</value>
+    </param>
+    <param>
+      <key>_rotation</key>
+      <value>0</value>
+    </param>
+  </block>
+  <block>
+    <key>variable</key>
+    <param>
+      <key>id</key>
+      <value>Es</value>
+    </param>
+    <param>
+      <key>_enabled</key>
+      <value>True</value>
+    </param>
+    <param>
+      <key>value</key>
+      <value>1</value>
+    </param>
+    <param>
+      <key>alias</key>
+      <value></value>
+    </param>
+    <param>
+      <key>_coordinate</key>
+      <value>(608, 157)</value>
+    </param>
+    <param>
+      <key>_rotation</key>
+      <value>0</value>
+    </param>
+  </block>
+  <block>
+    <key>variable</key>
+    <param>
+      <key>id</key>
+      <value>noisevar</value>
+    </param>
+    <param>
+      <key>_enabled</key>
+      <value>True</value>
+    </param>
+    <param>
+      <key>value</key>
+      <value>10**(-EsN0_dB/10.0)  * Es   /2.0</value>
+    </param>
+    <param>
+      <key>alias</key>
+      <value></value>
+    </param>
+    <param>
+      <key>_coordinate</key>
+      <value>(872, 157)</value>
+    </param>
+    <param>
+      <key>_rotation</key>
+      <value>0</value>
+    </param>
+  </block>
+  <block>
+    <key>import</key>
+    <param>
+      <key>id</key>
+      <value>import_0_0</value>
+    </param>
+    <param>
+      <key>_enabled</key>
+      <value>True</value>
+    </param>
+    <param>
+      <key>import</key>
+      <value>import gnuradio.trellis.fsm_utils as fu</value>
+    </param>
+    <param>
+      <key>alias</key>
+      <value></value>
+    </param>
+    <param>
+      <key>_coordinate</key>
+      <value>(24, 252)</value>
+    </param>
+    <param>
+      <key>_rotation</key>
+      <value>0</value>
+    </param>
+  </block>
+  <block>
+    <key>import</key>
+    <param>
+      <key>id</key>
+      <value>import_0</value>
+    </param>
+    <param>
+      <key>_enabled</key>
+      <value>True</value>
+    </param>
+    <param>
+      <key>import</key>
+      <value>import numpy</value>
+    </param>
+    <param>
+      <key>alias</key>
+      <value></value>
+    </param>
+    <param>
+      <key>_coordinate</key>
+      <value>(16, 140)</value>
+    </param>
+    <param>
+      <key>_rotation</key>
+      <value>0</value>
+    </param>
+  </block>
+  <block>
+    <key>import</key>
+    <param>
+      <key>id</key>
+      <value>import_0_1</value>
+    </param>
+    <param>
+      <key>_enabled</key>
+      <value>True</value>
+    </param>
+    <param>
+      <key>import</key>
+      <value>import math</value>
+    </param>
+    <param>
+      <key>alias</key>
+      <value></value>
+    </param>
+    <param>
+      <key>_coordinate</key>
+      <value>(24, 188)</value>
+    </param>
+    <param>
+      <key>_rotation</key>
+      <value>0</value>
+    </param>
+  </block>
+  <block>
+    <key>blocks_throttle</key>
+    <param>
+      <key>id</key>
+      <value>blocks_throttle_0</value>
+    </param>
+    <param>
+      <key>_enabled</key>
+      <value>True</value>
+    </param>
+    <param>
+      <key>type</key>
+      <value>byte</value>
+    </param>
+    <param>
+      <key>samples_per_second</key>
+      <value>R</value>
+    </param>
+    <param>
+      <key>vlen</key>
+      <value>1</value>
+    </param>
+    <param>
+      <key>ignoretag</key>
+      <value>True</value>
+    </param>
+    <param>
+      <key>alias</key>
+      <value></value>
+    </param>
+    <param>
+      <key>affinity</key>
+      <value></value>
+    </param>
+    <param>
+      <key>minoutbuf</key>
+      <value>0</value>
+    </param>
+    <param>
+      <key>maxoutbuf</key>
+      <value>0</value>
+    </param>
+    <param>
+      <key>_coordinate</key>
+      <value>(216, 380)</value>
+    </param>
+    <param>
+      <key>_rotation</key>
+      <value>0</value>
+    </param>
+  </block>
+  <block>
+    <key>digital_chunks_to_symbols_xx</key>
+    <param>
+      <key>id</key>
+      <value>digital_chunks_to_symbols_xx_0</value>
+    </param>
+    <param>
+      <key>_enabled</key>
+      <value>True</value>
+    </param>
+    <param>
+      <key>in_type</key>
+      <value>short</value>
+    </param>
+    <param>
+      <key>out_type</key>
+      <value>float</value>
+    </param>
+    <param>
+      <key>symbol_table</key>
+      <value>tot_channel[1]</value>
+    </param>
+    <param>
+      <key>dimension</key>
+      <value>tot_channel[0]</value>
+    </param>
+    <param>
+      <key>num_ports</key>
+      <value>1</value>
+    </param>
+    <param>
+      <key>alias</key>
+      <value></value>
+    </param>
+    <param>
+      <key>affinity</key>
+      <value></value>
+    </param>
+    <param>
+      <key>minoutbuf</key>
+      <value>0</value>
+    </param>
+    <param>
+      <key>maxoutbuf</key>
+      <value>0</value>
+    </param>
+    <param>
+      <key>_coordinate</key>
+      <value>(920, 373)</value>
+    </param>
+    <param>
+      <key>_rotation</key>
+      <value>0</value>
+    </param>
+  </block>
+  <block>
+    <key>blocks_add_xx</key>
+    <param>
+      <key>id</key>
+      <value>blocks_add_xx_1</value>
+    </param>
+    <param>
+      <key>_enabled</key>
+      <value>True</value>
+    </param>
+    <param>
+      <key>type</key>
+      <value>float</value>
+    </param>
+    <param>
+      <key>num_inputs</key>
+      <value>2</value>
+    </param>
+    <param>
+      <key>vlen</key>
+      <value>1</value>
+    </param>
+    <param>
+      <key>alias</key>
+      <value></value>
+    </param>
+    <param>
+      <key>affinity</key>
+      <value></value>
+    </param>
+    <param>
+      <key>minoutbuf</key>
+      <value>0</value>
+    </param>
+    <param>
+      <key>maxoutbuf</key>
+      <value>0</value>
+    </param>
+    <param>
+      <key>_coordinate</key>
+      <value>(912, 488)</value>
+    </param>
+    <param>
+      <key>_rotation</key>
+      <value>0</value>
+    </param>
+  </block>
+  <block>
+    <key>blocks_null_sink</key>
+    <param>
+      <key>id</key>
+      <value>blocks_null_sink_1</value>
+    </param>
+    <param>
+      <key>_enabled</key>
+      <value>True</value>
+    </param>
+    <param>
+      <key>type</key>
+      <value>float</value>
+    </param>
+    <param>
+      <key>vlen</key>
+      <value>1</value>
+    </param>
+    <param>
+      <key>num_inputs</key>
+      <value>1</value>
+    </param>
+    <param>
+      <key>bus_conns</key>
+      <value>[[0,],]</value>
+    </param>
+    <param>
+      <key>alias</key>
+      <value></value>
+    </param>
+    <param>
+      <key>affinity</key>
+      <value></value>
+    </param>
+    <param>
+      <key>_coordinate</key>
+      <value>(1024, 552)</value>
+    </param>
+    <param>
+      <key>_rotation</key>
+      <value>0</value>
+    </param>
+  </block>
+  <block>
+    <key>analog_noise_source_x</key>
+    <param>
+      <key>id</key>
+      <value>analog_noise_source_x_0</value>
+    </param>
+    <param>
+      <key>_enabled</key>
+      <value>True</value>
+    </param>
+    <param>
+      <key>type</key>
+      <value>float</value>
+    </param>
+    <param>
+      <key>noise_type</key>
+      <value>analog.GR_GAUSSIAN</value>
+    </param>
+    <param>
+      <key>amp</key>
+      <value>noisevar**0.5</value>
+    </param>
+    <param>
+      <key>seed</key>
+      <value>-42</value>
+    </param>
+    <param>
+      <key>alias</key>
+      <value></value>
+    </param>
+    <param>
+      <key>affinity</key>
+      <value></value>
+    </param>
+    <param>
+      <key>minoutbuf</key>
+      <value>0</value>
+    </param>
+    <param>
+      <key>maxoutbuf</key>
+      <value>0</value>
+    </param>
+    <param>
+      <key>_coordinate</key>
+      <value>(520, 494)</value>
+    </param>
+    <param>
+      <key>_rotation</key>
+      <value>0</value>
+    </param>
+  </block>
+  <block>
+    <key>trellis_encoder_xx</key>
+    <param>
+      <key>id</key>
+      <value>trellis_encoder_xx_0</value>
+    </param>
+    <param>
+      <key>_enabled</key>
+      <value>True</value>
+    </param>
+    <param>
+      <key>type</key>
+      <value>bs</value>
+    </param>
+    <param>
+      <key>fsm_args</key>
+      <value>fsm</value>
+    </param>
+    <param>
+      <key>init_state</key>
+      <value>0</value>
+    </param>
+    <param>
+      <key>alias</key>
+      <value></value>
+    </param>
+    <param>
+      <key>affinity</key>
+      <value></value>
+    </param>
+    <param>
+      <key>minoutbuf</key>
+      <value>0</value>
+    </param>
+    <param>
+      <key>maxoutbuf</key>
+      <value>0</value>
+    </param>
+    <param>
+      <key>_coordinate</key>
+      <value>(648, 373)</value>
+    </param>
+    <param>
+      <key>_rotation</key>
+      <value>0</value>
+    </param>
+  </block>
+  <block>
+    <key>virtual_source</key>
+    <param>
+      <key>id</key>
+      <value>virtual_source_0</value>
+    </param>
+    <param>
+      <key>_enabled</key>
+      <value>True</value>
+    </param>
+    <param>
+      <key>stream_id</key>
+      <value>observation</value>
+    </param>
+    <param>
+      <key>_coordinate</key>
+      <value>(16, 732)</value>
+    </param>
+    <param>
+      <key>_rotation</key>
+      <value>0</value>
+    </param>
+  </block>
+  <block>
+    <key>virtual_sink</key>
+    <param>
+      <key>id</key>
+      <value>virtual_sink_0</value>
+    </param>
+    <param>
+      <key>_enabled</key>
+      <value>True</value>
+    </param>
+    <param>
+      <key>stream_id</key>
+      <value>observation</value>
+    </param>
+    <param>
+      <key>_coordinate</key>
+      <value>(832, 620)</value>
+    </param>
+    <param>
+      <key>_rotation</key>
+      <value>0</value>
+    </param>
+  </block>
+  <block>
+    <key>virtual_source</key>
+    <param>
+      <key>id</key>
+      <value>virtual_source_0_0_0</value>
+    </param>
+    <param>
+      <key>_enabled</key>
+      <value>True</value>
+    </param>
+    <param>
+      <key>stream_id</key>
+      <value>estimate</value>
+    </param>
+    <param>
+      <key>_coordinate</key>
+      <value>(72, 1244)</value>
+    </param>
+    <param>
+      <key>_rotation</key>
+      <value>0</value>
+    </param>
+  </block>
+  <block>
+    <key>virtual_source</key>
+    <param>
+      <key>id</key>
+      <value>virtual_source_0_0</value>
+    </param>
+    <param>
+      <key>_enabled</key>
+      <value>True</value>
+    </param>
+    <param>
+      <key>stream_id</key>
+      <value>info</value>
+    </param>
+    <param>
+      <key>_coordinate</key>
+      <value>(80, 1148)</value>
+    </param>
+    <param>
+      <key>_rotation</key>
+      <value>0</value>
+    </param>
+  </block>
+  <block>
+    <key>wxgui_numbersink2</key>
+    <param>
+      <key>id</key>
+      <value>wxgui_numbersink2_3_0_0</value>
+    </param>
+    <param>
+      <key>_enabled</key>
+      <value>True</value>
+    </param>
+    <param>
+      <key>type</key>
+      <value>float</value>
+    </param>
+    <param>
+      <key>title</key>
+      <value>BER</value>
+    </param>
+    <param>
+      <key>units</key>
+      <value>BER</value>
+    </param>
+    <param>
+      <key>samp_rate</key>
+      <value>R</value>
+    </param>
+    <param>
+      <key>min_value</key>
+      <value>0</value>
+    </param>
+    <param>
+      <key>max_value</key>
+      <value>1.0</value>
+    </param>
+    <param>
+      <key>factor</key>
+      <value>1.0</value>
+    </param>
+    <param>
+      <key>decimal_places</key>
+      <value>6</value>
+    </param>
+    <param>
+      <key>ref_level</key>
+      <value>0</value>
+    </param>
+    <param>
+      <key>number_rate</key>
+      <value>15</value>
+    </param>
+    <param>
+      <key>peak_hold</key>
+      <value>False</value>
+    </param>
+    <param>
+      <key>average</key>
+      <value>False</value>
+    </param>
+    <param>
+      <key>avg_alpha</key>
+      <value>0.001</value>
+    </param>
+    <param>
+      <key>show_gauge</key>
+      <value>False</value>
+    </param>
+    <param>
+      <key>win_size</key>
+      <value></value>
+    </param>
+    <param>
+      <key>grid_pos</key>
+      <value></value>
+    </param>
+    <param>
+      <key>notebook</key>
+      <value></value>
+    </param>
+    <param>
+      <key>alias</key>
+      <value></value>
+    </param>
+    <param>
+      <key>affinity</key>
+      <value></value>
+    </param>
+    <param>
+      <key>_coordinate</key>
+      <value>(728, 1133)</value>
+    </param>
+    <param>
+      <key>_rotation</key>
+      <value>0</value>
+    </param>
+  </block>
+  <block>
+    <key>analog_random_source_x</key>
+    <param>
+      <key>id</key>
+      <value>analog_random_source_x_0</value>
+    </param>
+    <param>
+      <key>_enabled</key>
+      <value>True</value>
+    </param>
+    <param>
+      <key>type</key>
+      <value>byte</value>
+    </param>
+    <param>
+      <key>min</key>
+      <value>0</value>
+    </param>
+    <param>
+      <key>max</key>
+      <value>2</value>
+    </param>
+    <param>
+      <key>num_samps</key>
+      <value>1007</value>
+    </param>
+    <param>
+      <key>repeat</key>
+      <value>True</value>
+    </param>
+    <param>
+      <key>alias</key>
+      <value></value>
+    </param>
+    <param>
+      <key>affinity</key>
+      <value></value>
+    </param>
+    <param>
+      <key>minoutbuf</key>
+      <value>0</value>
+    </param>
+    <param>
+      <key>maxoutbuf</key>
+      <value>0</value>
+    </param>
+    <param>
+      <key>_coordinate</key>
+      <value>(8, 359)</value>
+    </param>
+    <param>
+      <key>_rotation</key>
+      <value>0</value>
+    </param>
+  </block>
+  <block>
+    <key>virtual_sink</key>
+    <param>
+      <key>id</key>
+      <value>virtual_sink_0_0</value>
+    </param>
+    <param>
+      <key>_enabled</key>
+      <value>True</value>
+    </param>
+    <param>
+      <key>stream_id</key>
+      <value>info</value>
+    </param>
+    <param>
+      <key>_coordinate</key>
+      <value>(208, 324)</value>
+    </param>
+    <param>
+      <key>_rotation</key>
+      <value>0</value>
+    </param>
+  </block>
+  <block>
+    <key>blocks_packed_to_unpacked_xx</key>
+    <param>
+      <key>id</key>
+      <value>blocks_packed_to_unpacked_xx_0</value>
+    </param>
+    <param>
+      <key>_enabled</key>
+      <value>True</value>
+    </param>
+    <param>
+      <key>type</key>
+      <value>byte</value>
+    </param>
+    <param>
+      <key>bits_per_chunk</key>
+      <value>bpsym</value>
+    </param>
+    <param>
+      <key>endianness</key>
+      <value>gr.GR_MSB_FIRST</value>
+    </param>
+    <param>
+      <key>num_ports</key>
+      <value>1</value>
+    </param>
+    <param>
+      <key>alias</key>
+      <value></value>
+    </param>
+    <param>
+      <key>affinity</key>
+      <value></value>
+    </param>
+    <param>
+      <key>minoutbuf</key>
+      <value>0</value>
+    </param>
+    <param>
+      <key>maxoutbuf</key>
+      <value>0</value>
+    </param>
+    <param>
+      <key>_coordinate</key>
+      <value>(408, 397)</value>
+    </param>
+    <param>
+      <key>_rotation</key>
+      <value>0</value>
+    </param>
+  </block>
+  <block>
+    <key>blocks_unpacked_to_packed_xx</key>
+    <param>
+      <key>id</key>
+      <value>blocks_unpacked_to_packed_xx_0</value>
+    </param>
+    <param>
+      <key>_enabled</key>
+      <value>True</value>
+    </param>
+    <param>
+      <key>type</key>
+      <value>byte</value>
+    </param>
+    <param>
+      <key>bits_per_chunk</key>
+      <value>1</value>
+    </param>
+    <param>
+      <key>endianness</key>
+      <value>gr.GR_MSB_FIRST</value>
+    </param>
+    <param>
+      <key>num_ports</key>
+      <value>1</value>
+    </param>
+    <param>
+      <key>alias</key>
+      <value></value>
+    </param>
+    <param>
+      <key>affinity</key>
+      <value></value>
+    </param>
+    <param>
+      <key>minoutbuf</key>
+      <value>0</value>
+    </param>
+    <param>
+      <key>maxoutbuf</key>
+      <value>0</value>
+    </param>
+    <param>
+      <key>_coordinate</key>
+      <value>(400, 309)</value>
+    </param>
+    <param>
+      <key>_rotation</key>
+      <value>0</value>
+    </param>
+  </block>
+  <block>
+    <key>note</key>
+    <param>
+      <key>id</key>
+      <value>note_0</value>
+    </param>
+    <param>
+      <key>_enabled</key>
+      <value>True</value>
+    </param>
+    <param>
+      <key>note</key>
+      <value>Substititue the metrics/Viterbi block with Viterbi_combo</value>
+    </param>
+    <param>
+      <key>alias</key>
+      <value></value>
+    </param>
+    <param>
+      <key>_coordinate</key>
+      <value>(720, 908)</value>
+    </param>
+    <param>
+      <key>_rotation</key>
+      <value>0</value>
+    </param>
+  </block>
+  <block>
+    <key>virtual_sink</key>
+    <param>
+      <key>id</key>
+      <value>virtual_sink_0_1</value>
+    </param>
+    <param>
+      <key>_enabled</key>
+      <value>True</value>
+    </param>
+    <param>
+      <key>stream_id</key>
+      <value>estimate</value>
+    </param>
+    <param>
+      <key>_coordinate</key>
+      <value>(984, 812)</value>
+    </param>
+    <param>
+      <key>_rotation</key>
+      <value>0</value>
+    </param>
+  </block>
+  <block>
+    <key>blocks_packed_to_unpacked_xx</key>
+    <param>
+      <key>id</key>
+      <value>blocks_packed_to_unpacked_xx_0_0</value>
+    </param>
+    <param>
+      <key>_enabled</key>
+      <value>True</value>
+    </param>
+    <param>
+      <key>type</key>
+      <value>byte</value>
+    </param>
+    <param>
+      <key>bits_per_chunk</key>
+      <value>1</value>
+    </param>
+    <param>
+      <key>endianness</key>
+      <value>gr.GR_MSB_FIRST</value>
+    </param>
+    <param>
+      <key>num_ports</key>
+      <value>1</value>
+    </param>
+    <param>
+      <key>alias</key>
+      <value></value>
+    </param>
+    <param>
+      <key>affinity</key>
+      <value></value>
+    </param>
+    <param>
+      <key>minoutbuf</key>
+      <value>0</value>
+    </param>
+    <param>
+      <key>maxoutbuf</key>
+      <value>0</value>
+    </param>
+    <param>
+      <key>_coordinate</key>
+      <value>(768, 813)</value>
+    </param>
+    <param>
+      <key>_rotation</key>
+      <value>0</value>
+    </param>
+  </block>
+  <block>
+    <key>blocks_unpacked_to_packed_xx</key>
+    <param>
+      <key>id</key>
+      <value>blocks_unpacked_to_packed_xx_0_0</value>
+    </param>
+    <param>
+      <key>_enabled</key>
+      <value>True</value>
+    </param>
+    <param>
+      <key>type</key>
+      <value>byte</value>
+    </param>
+    <param>
+      <key>bits_per_chunk</key>
+      <value>bpsym</value>
+    </param>
+    <param>
+      <key>endianness</key>
+      <value>gr.GR_MSB_FIRST</value>
+    </param>
+    <param>
+      <key>num_ports</key>
+      <value>1</value>
+    </param>
+    <param>
+      <key>alias</key>
+      <value></value>
+    </param>
+    <param>
+      <key>affinity</key>
+      <value></value>
+    </param>
+    <param>
+      <key>minoutbuf</key>
+      <value>0</value>
+    </param>
+    <param>
+      <key>maxoutbuf</key>
+      <value>0</value>
+    </param>
+    <param>
+      <key>_coordinate</key>
+      <value>(760, 749)</value>
+    </param>
+    <param>
+      <key>_rotation</key>
+      <value>0</value>
+    </param>
+  </block>
+  <block>
+    <key>blks2_error_rate</key>
+    <param>
+      <key>id</key>
+      <value>blks2_error_rate_0</value>
+    </param>
+    <param>
+      <key>_enabled</key>
+      <value>True</value>
+    </param>
+    <param>
+      <key>type</key>
+      <value>'BER'</value>
+    </param>
+    <param>
+      <key>win_size</key>
+      <value>block*100</value>
+    </param>
+    <param>
+      <key>bits_per_symbol</key>
+      <value>1</value>
+    </param>
+    <param>
+      <key>alias</key>
+      <value></value>
+    </param>
+    <param>
+      <key>affinity</key>
+      <value></value>
+    </param>
+    <param>
+      <key>minoutbuf</key>
+      <value>0</value>
+    </param>
+    <param>
+      <key>maxoutbuf</key>
+      <value>0</value>
+    </param>
+    <param>
+      <key>_coordinate</key>
+      <value>(312, 1184)</value>
+    </param>
+    <param>
+      <key>_rotation</key>
+      <value>0</value>
+    </param>
+  </block>
+  <block>
+    <key>variable_slider</key>
+    <param>
+      <key>id</key>
+      <value>EsN0_dB</value>
+    </param>
+    <param>
+      <key>_enabled</key>
+      <value>True</value>
+    </param>
+    <param>
+      <key>label</key>
+      <value>Es/N0 (dB)</value>
+    </param>
+    <param>
+      <key>value</key>
+      <value>14.0</value>
+    </param>
+    <param>
+      <key>min</key>
+      <value>-10</value>
+    </param>
+    <param>
+      <key>max</key>
+      <value>30</value>
+    </param>
+    <param>
+      <key>num_steps</key>
+      <value>1000</value>
+    </param>
+    <param>
+      <key>style</key>
+      <value>wx.SL_HORIZONTAL</value>
+    </param>
+    <param>
+      <key>converver</key>
+      <value>float_converter</value>
+    </param>
+    <param>
+      <key>grid_pos</key>
+      <value></value>
+    </param>
+    <param>
+      <key>notebook</key>
+      <value></value>
+    </param>
+    <param>
+      <key>alias</key>
+      <value></value>
+    </param>
+    <param>
+      <key>_coordinate</key>
+      <value>(728, 105)</value>
+    </param>
+    <param>
+      <key>_rotation</key>
+      <value>0</value>
+    </param>
+  </block>
+  <block>
+    <key>trellis_viterbi_x</key>
+    <param>
+      <key>id</key>
+      <value>trellis_viterbi_x_0</value>
+    </param>
+    <param>
+      <key>_enabled</key>
+      <value>False</value>
+    </param>
+    <param>
+      <key>type</key>
+      <value>b</value>
+    </param>
+    <param>
+      <key>fsm_args</key>
+      <value>fsm</value>
+    </param>
+    <param>
+      <key>block_size</key>
+      <value>block/bpsym</value>
+    </param>
+    <param>
+      <key>init_state</key>
+      <value>-1</value>
+    </param>
+    <param>
+      <key>final_state</key>
+      <value>-1</value>
+    </param>
+    <param>
+      <key>alias</key>
+      <value></value>
+    </param>
+    <param>
+      <key>affinity</key>
+      <value></value>
+    </param>
+    <param>
+      <key>minoutbuf</key>
+      <value>0</value>
+    </param>
+    <param>
+      <key>maxoutbuf</key>
+      <value>0</value>
+    </param>
+    <param>
+      <key>_coordinate</key>
+      <value>(496, 711)</value>
+    </param>
+    <param>
+      <key>_rotation</key>
+      <value>0</value>
+    </param>
+  </block>
+  <block>
+    <key>trellis_metrics_x</key>
+    <param>
+      <key>id</key>
+      <value>trellis_metrics_x_0</value>
+    </param>
+    <param>
+      <key>_enabled</key>
+      <value>False</value>
+    </param>
+    <param>
+      <key>type</key>
+      <value>f</value>
+    </param>
+    <param>
+      <key>card</key>
+      <value>fsm.O()</value>
+    </param>
+    <param>
+      <key>dim</key>
+      <value>tot_channel[0]</value>
+    </param>
+    <param>
+      <key>table</key>
+      <value>tot_channel[1]</value>
+    </param>
+    <param>
+      <key>metric_type</key>
+      <value>digital.TRELLIS_EUCLIDEAN</value>
+    </param>
+    <param>
+      <key>alias</key>
+      <value></value>
+    </param>
+    <param>
+      <key>affinity</key>
+      <value></value>
+    </param>
+    <param>
+      <key>minoutbuf</key>
+      <value>0</value>
+    </param>
+    <param>
+      <key>maxoutbuf</key>
+      <value>0</value>
+    </param>
+    <param>
+      <key>_coordinate</key>
+      <value>(288, 711)</value>
+    </param>
+    <param>
+      <key>_rotation</key>
+      <value>0</value>
+    </param>
+  </block>
+  <block>
+    <key>trellis_viterbi_combined_xx</key>
+    <param>
+      <key>id</key>
+      <value>trellis_viterbi_combined_xx_0</value>
+    </param>
+    <param>
+      <key>_enabled</key>
+      <value>True</value>
+    </param>
+    <param>
+      <key>type</key>
+      <value>f</value>
+    </param>
+    <param>
+      <key>out_type</key>
+      <value>b</value>
+    </param>
+    <param>
+      <key>fsm_args</key>
+      <value>fsm</value>
+    </param>
+    <param>
+      <key>block_size</key>
+      <value>block/bpsym</value>
+    </param>
+    <param>
+      <key>init_state</key>
+      <value>-1</value>
+    </param>
+    <param>
+      <key>final_state</key>
+      <value>-1</value>
+    </param>
+    <param>
+      <key>dim</key>
+      <value>tot_channel[0]</value>
+    </param>
+    <param>
+      <key>table</key>
+      <value>tot_channel[1]</value>
+    </param>
+    <param>
+      <key>metric_type</key>
+      <value>digital.TRELLIS_EUCLIDEAN</value>
+    </param>
+    <param>
+      <key>alias</key>
+      <value></value>
+    </param>
+    <param>
+      <key>affinity</key>
+      <value></value>
+    </param>
+    <param>
+      <key>minoutbuf</key>
+      <value>0</value>
+    </param>
+    <param>
+      <key>maxoutbuf</key>
+      <value>0</value>
+    </param>
+    <param>
+      <key>_coordinate</key>
+      <value>(368, 850)</value>
+    </param>
+    <param>
+      <key>_rotation</key>
+      <value>0</value>
+    </param>
+  </block>
+  <connection>
+    <source_block_id>analog_noise_source_x_0</source_block_id>
+    <sink_block_id>blocks_add_xx_1</sink_block_id>
+    <source_key>0</source_key>
+    <sink_key>1</sink_key>
+  </connection>
+  <connection>
+    <source_block_id>digital_chunks_to_symbols_xx_0</source_block_id>
+    <sink_block_id>blocks_add_xx_1</sink_block_id>
+    <source_key>0</source_key>
+    <sink_key>0</sink_key>
+  </connection>
+  <connection>
+    <source_block_id>analog_random_source_x_0</source_block_id>
+    <sink_block_id>blocks_throttle_0</sink_block_id>
+    <source_key>0</source_key>
+    <sink_key>0</sink_key>
+  </connection>
+  <connection>
+    <source_block_id>trellis_encoder_xx_0</source_block_id>
+    <sink_block_id>digital_chunks_to_symbols_xx_0</sink_block_id>
+    <source_key>0</source_key>
+    <sink_key>0</sink_key>
+  </connection>
+  <connection>
+    <source_block_id>blocks_throttle_0</source_block_id>
+    <sink_block_id>blocks_unpacked_to_packed_xx_0</sink_block_id>
+    <source_key>0</source_key>
+    <sink_key>0</sink_key>
+  </connection>
+  <connection>
+    <source_block_id>blocks_add_xx_1</source_block_id>
+    <sink_block_id>blocks_null_sink_1</sink_block_id>
+    <source_key>0</source_key>
+    <sink_key>0</sink_key>
+  </connection>
+  <connection>
+    <source_block_id>blocks_unpacked_to_packed_xx_0</source_block_id>
+    <sink_block_id>blocks_packed_to_unpacked_xx_0</sink_block_id>
+    <source_key>0</source_key>
+    <sink_key>0</sink_key>
+  </connection>
+  <connection>
+    <source_block_id>blocks_packed_to_unpacked_xx_0</source_block_id>
+    <sink_block_id>trellis_encoder_xx_0</sink_block_id>
+    <source_key>0</source_key>
+    <sink_key>0</sink_key>
+  </connection>
+  <connection>
+    <source_block_id>virtual_source_0</source_block_id>
+    <sink_block_id>trellis_viterbi_combined_xx_0</sink_block_id>
+    <source_key>0</source_key>
+    <sink_key>0</sink_key>
+  </connection>
+  <connection>
+    <source_block_id>trellis_metrics_x_0</source_block_id>
+    <sink_block_id>trellis_viterbi_x_0</sink_block_id>
+    <source_key>0</source_key>
+    <sink_key>0</sink_key>
+  </connection>
+  <connection>
+    <source_block_id>virtual_source_0</source_block_id>
+    <sink_block_id>trellis_metrics_x_0</sink_block_id>
+    <source_key>0</source_key>
+    <sink_key>0</sink_key>
+  </connection>
+  <connection>
+    <source_block_id>blocks_add_xx_1</source_block_id>
+    <sink_block_id>virtual_sink_0</sink_block_id>
+    <source_key>0</source_key>
+    <sink_key>0</sink_key>
+  </connection>
+  <connection>
+    <source_block_id>virtual_source_0_0_0</source_block_id>
+    <sink_block_id>blks2_error_rate_0</sink_block_id>
+    <source_key>0</source_key>
+    <sink_key>1</sink_key>
+  </connection>
+  <connection>
+    <source_block_id>virtual_source_0_0</source_block_id>
+    <sink_block_id>blks2_error_rate_0</sink_block_id>
+    <source_key>0</source_key>
+    <sink_key>0</sink_key>
+  </connection>
+  <connection>
+    <source_block_id>blks2_error_rate_0</source_block_id>
+    <sink_block_id>wxgui_numbersink2_3_0_0</sink_block_id>
+    <source_key>0</source_key>
+    <sink_key>0</sink_key>
+  </connection>
+  <connection>
+    <source_block_id>analog_random_source_x_0</source_block_id>
+    <sink_block_id>virtual_sink_0_0</sink_block_id>
+    <source_key>0</source_key>
+    <sink_key>0</sink_key>
+  </connection>
+  <connection>
+    <source_block_id>blocks_packed_to_unpacked_xx_0_0</source_block_id>
+    <sink_block_id>virtual_sink_0_1</sink_block_id>
+    <source_key>0</source_key>
+    <sink_key>0</sink_key>
+  </connection>
+  <connection>
+    <source_block_id>trellis_viterbi_combined_xx_0</source_block_id>
+    <sink_block_id>blocks_unpacked_to_packed_xx_0_0</sink_block_id>
+    <source_key>0</source_key>
+    <sink_key>0</sink_key>
+  </connection>
+  <connection>
+    <source_block_id>blocks_unpacked_to_packed_xx_0_0</source_block_id>
+    <sink_block_id>blocks_packed_to_unpacked_xx_0_0</sink_block_id>
+    <source_key>0</source_key>
+    <sink_key>0</sink_key>
+  </connection>
+  <connection>
+    <source_block_id>trellis_viterbi_x_0</source_block_id>
+    <sink_block_id>blocks_unpacked_to_packed_xx_0_0</sink_block_id>
+    <source_key>0</source_key>
+    <sink_key>0</sink_key>
+  </connection>
+</flow_graph>
diff --git a/gr-trellis/grc/trellis_encoder_xx.xml 
b/gr-trellis/grc/trellis_encoder_xx.xml
index d877d53..c4259ff 100644
--- a/gr-trellis/grc/trellis_encoder_xx.xml
+++ b/gr-trellis/grc/trellis_encoder_xx.xml
@@ -11,6 +11,8 @@
   <category>Trellis Coding</category>
   <import>from gnuradio import trellis</import>
   <make>trellis.encoder_$(type)(trellis.fsm($fsm_args), $init_state)</make>
+  <callback>set_FSM(trellis.fsm($fsm_args))</callback>
+  <callback>set_ST($init_state)</callback>
   <param>
     <name>Type</name>
     <key>type</key>
diff --git a/gr-trellis/grc/trellis_metrics_x.xml 
b/gr-trellis/grc/trellis_metrics_x.xml
index f551bc1..8bb978f 100644
--- a/gr-trellis/grc/trellis_metrics_x.xml
+++ b/gr-trellis/grc/trellis_metrics_x.xml
@@ -12,6 +12,9 @@
        <category>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>
diff --git a/gr-trellis/grc/trellis_pccc_decoder_combined_xx.xml 
b/gr-trellis/grc/trellis_pccc_decoder_combined_xx.xml
index 9bb4b03..ff727fb 100644
--- a/gr-trellis/grc/trellis_pccc_decoder_combined_xx.xml
+++ b/gr-trellis/grc/trellis_pccc_decoder_combined_xx.xml
@@ -21,7 +21,7 @@
     $dim, $table, $metric_type,
     $scaling)
   </make>
-        <callback>set_TABLE($table)</callback>
+        <callback>set_scaling($scaling)</callback>
   <param>
     <name>Input Type</name>
     <key>type</key>
diff --git a/gr-trellis/grc/trellis_permutation.xml 
b/gr-trellis/grc/trellis_permutation.xml
index bf6fc3f..0f118e8 100644
--- a/gr-trellis/grc/trellis_permutation.xml
+++ b/gr-trellis/grc/trellis_permutation.xml
@@ -12,6 +12,10 @@
        <category>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>
diff --git a/gr-trellis/grc/trellis_sccc_decoder_combined_xx.xml 
b/gr-trellis/grc/trellis_sccc_decoder_combined_xx.xml
index bacc16c..4947376 100644
--- a/gr-trellis/grc/trellis_sccc_decoder_combined_xx.xml
+++ b/gr-trellis/grc/trellis_sccc_decoder_combined_xx.xml
@@ -21,7 +21,7 @@
     $dim, $table, $metric_type,
     $scaling)
   </make>
-        <callback>set_TABLE($table)</callback>
+        <callback>set_scaling($scaling)</callback>
   <param>
     <name>Input Type</name>
     <key>type</key>
diff --git a/gr-trellis/grc/trellis_siso_combined_f.xml 
b/gr-trellis/grc/trellis_siso_combined_f.xml
index 95eceee..542bba6 100644
--- a/gr-trellis/grc/trellis_siso_combined_f.xml
+++ b/gr-trellis/grc/trellis_siso_combined_f.xml
@@ -12,6 +12,16 @@
        <category>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>
@@ -101,7 +111,11 @@
                </option>
        </param>
        <sink>
-               <name>in</name>
+               <name>in_i</name>
+               <type>float</type>
+       </sink>
+       <sink>
+               <name>in_o</name>
                <type>float</type>
        </sink>
        <source>
diff --git a/gr-trellis/grc/trellis_siso_f.xml 
b/gr-trellis/grc/trellis_siso_f.xml
index 67eeb27..30849d2 100644
--- a/gr-trellis/grc/trellis_siso_f.xml
+++ b/gr-trellis/grc/trellis_siso_f.xml
@@ -12,6 +12,13 @@
   <category>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>
@@ -75,7 +82,11 @@
   </param>
   <check>(isinstance(eval(""" $fsm_args """[1:-1], locals(),globals()), str) 
and open($fsm_args).close()) or True</check>
   <sink>
-    <name>in</name>
+    <name>priori</name>
+    <type>float</type>
+  </sink>
+  <sink>
+    <name>prioro</name>
     <type>float</type>
   </sink>
   <source>
diff --git a/gr-trellis/grc/trellis_viterbi_combined_xx.xml 
b/gr-trellis/grc/trellis_viterbi_combined_xx.xml
index 81b4986..9c755dc 100644
--- a/gr-trellis/grc/trellis_viterbi_combined_xx.xml
+++ b/gr-trellis/grc/trellis_viterbi_combined_xx.xml
@@ -12,7 +12,13 @@
   <category>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_TABLE($table)</callback>
+  <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>
diff --git a/gr-trellis/grc/trellis_viterbi_x.xml 
b/gr-trellis/grc/trellis_viterbi_x.xml
index 734bb53..9083061 100644
--- a/gr-trellis/grc/trellis_viterbi_x.xml
+++ b/gr-trellis/grc/trellis_viterbi_x.xml
@@ -12,6 +12,10 @@
   <category>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>
diff --git a/gr-trellis/include/gnuradio/trellis/encoder_XX.h.t 
b/gr-trellis/include/gnuradio/trellis/encoder_XX.h.t
index 7ece5d3..67d17f3 100644
--- a/gr-trellis/include/gnuradio/trellis/encoder_XX.h.t
+++ b/gr-trellis/include/gnuradio/trellis/encoder_XX.h.t
@@ -44,8 +44,11 @@ namespace gr {
 
       static sptr make(const fsm &FSM, int ST);
 
-      virtual fsm FSM() const = 0;
-      virtual int ST() const = 0;
+      virtual fsm FSM() = 0;
+      virtual int ST() = 0;
+
+      virtual void set_FSM(fsm &FSM) =0;
+      virtual void set_ST(int ST) =0;
     };
 
   } /* namespace trellis */
diff --git a/gr-trellis/include/gnuradio/trellis/fsm.h 
b/gr-trellis/include/gnuradio/trellis/fsm.h
index cc8893f..5ba4483 100644
--- a/gr-trellis/include/gnuradio/trellis/fsm.h
+++ b/gr-trellis/include/gnuradio/trellis/fsm.h
@@ -153,6 +153,16 @@ namespace gr {
        * \param FSM2  second FSMS
        */
       fsm(const fsm &FSM1, const fsm &FSM2);
+     
+       
+      /*!
+       * \brief Creates an FSMS describing the trellis of two serially 
concatenated FSMs.
+       *
+       * \param FSMo  outer FSMS
+       * \param FSMi  inner FSMS
+       * \param serial set it to true to distinguish from the previous 
constructor
+       */
+      fsm(const fsm &FSMo, const fsm &FSMi, bool serial);
 
       /*!
        * \brief Creates an FSMS representing n stages through the originial 
FSM (AKA radix-n FSM).
diff --git a/gr-trellis/include/gnuradio/trellis/metrics_X.h.t 
b/gr-trellis/include/gnuradio/trellis/metrics_X.h.t
index 3f650fa..f463c86 100644
--- a/gr-trellis/include/gnuradio/trellis/metrics_X.h.t
+++ b/gr-trellis/include/gnuradio/trellis/metrics_X.h.t
@@ -49,9 +49,14 @@ namespace gr {
       virtual int D() const = 0;
       virtual digital::trellis_metric_type_t TYPE() const = 0;
       virtual std::vector<@I_TYPE@> TABLE() const = 0;
+
+      virtual void set_O(int O) = 0;
+      virtual void set_D(int D) = 0;
+      virtual void set_TYPE(digital::trellis_metric_type_t type) = 0;
       virtual void set_TABLE(const std::vector<@I_TYPE@> &table) = 0;
     };
 
+
   } /* namespace trellis */
 } /* namespace gr */
 
diff --git a/gr-trellis/include/gnuradio/trellis/permutation.h 
b/gr-trellis/include/gnuradio/trellis/permutation.h
index 80b9fef..5c86f3c 100644
--- a/gr-trellis/include/gnuradio/trellis/permutation.h
+++ b/gr-trellis/include/gnuradio/trellis/permutation.h
@@ -44,9 +44,14 @@ namespace gr {
                       int SYMS_PER_BLOCK, size_t NBYTES);
 
       virtual int K() const = 0;
-      virtual const std::vector<int> & TABLE() const = 0;
+      virtual std::vector<int> TABLE() const = 0;
       virtual int SYMS_PER_BLOCK() const = 0;
       virtual size_t BYTES_PER_SYMBOL() const = 0;
+
+      virtual void set_K(int K) =0;
+      virtual void set_TABLE (const std::vector<int> &table) = 0;
+      virtual void set_SYMS_PER_BLOCK(int spb) =0;
+      
     };
 
   } /* namespace trellis */
diff --git a/gr-trellis/include/gnuradio/trellis/sccc_decoder_combined_XX.h.t 
b/gr-trellis/include/gnuradio/trellis/sccc_decoder_combined_XX.h.t
index 699de12..e1f95df 100644
--- a/gr-trellis/include/gnuradio/trellis/sccc_decoder_combined_XX.h.t
+++ b/gr-trellis/include/gnuradio/trellis/sccc_decoder_combined_XX.h.t
@@ -70,6 +70,7 @@ namespace gr {
       virtual digital::trellis_metric_type_t METRIC_TYPE() const = 0;
       virtual siso_type_t SISO_TYPE() const = 0;
       virtual float scaling() const  = 0;
+
       virtual void set_scaling(float scaling) = 0;
     };
 
diff --git a/gr-trellis/include/gnuradio/trellis/siso_combined_f.h 
b/gr-trellis/include/gnuradio/trellis/siso_combined_f.h
index 47c34ea..4c37b2c 100644
--- a/gr-trellis/include/gnuradio/trellis/siso_combined_f.h
+++ b/gr-trellis/include/gnuradio/trellis/siso_combined_f.h
@@ -60,6 +60,17 @@ namespace gr {
       virtual int D() const = 0;
       virtual std::vector<float> TABLE() const = 0;
       virtual digital::trellis_metric_type_t TYPE() const = 0;
+
+      virtual void set_FSM(const fsm &FSM) =0;
+      virtual void set_K(int K) =0;
+      virtual void set_S0(int S0) =0;
+      virtual void set_SK(int SK) =0;
+      virtual void set_POSTI(bool POSTI) =0;
+      virtual void set_POSTO(bool POSTO) =0;
+      virtual void set_SISO_TYPE(trellis::siso_type_t type) =0;
+      virtual void set_D(int D) =0;
+      virtual void set_TABLE(const std::vector<float> &table) =0;
+      virtual void set_TYPE(digital::trellis_metric_type_t type) =0;
     };
 
   } /* namespace trellis */
diff --git a/gr-trellis/include/gnuradio/trellis/siso_f.h 
b/gr-trellis/include/gnuradio/trellis/siso_f.h
index ae212cb..89bcba0 100644
--- a/gr-trellis/include/gnuradio/trellis/siso_f.h
+++ b/gr-trellis/include/gnuradio/trellis/siso_f.h
@@ -53,6 +53,14 @@ namespace gr {
       virtual bool POSTI() const = 0;
       virtual bool POSTO() const = 0;
       virtual siso_type_t SISO_TYPE() const = 0;
+
+      virtual void set_FSM(const fsm &FSM) =0;
+      virtual void set_K(int K) =0;
+      virtual void set_S0(int S0) =0;
+      virtual void set_SK(int SK) =0;
+      virtual void set_POSTI(bool posti) =0;
+      virtual void set_POSTO(bool posto) =0;
+      virtual void set_SISO_TYPE(trellis::siso_type_t type) = 0;
     };
 
   } /* namespace trellis */
diff --git a/gr-trellis/include/gnuradio/trellis/viterbi_X.h.t 
b/gr-trellis/include/gnuradio/trellis/viterbi_X.h.t
index 2d72cb5..6101227 100644
--- a/gr-trellis/include/gnuradio/trellis/viterbi_X.h.t
+++ b/gr-trellis/include/gnuradio/trellis/viterbi_X.h.t
@@ -45,10 +45,15 @@ namespace gr {
       static sptr make(const fsm &FSM, int K,
                       int S0, int SK);
 
-      virtual fsm FSM() const = 0;
-      virtual int K() const = 0;
-      virtual int S0() const = 0;
-      virtual int SK() const = 0;
+      virtual fsm FSM() const  = 0;
+      virtual int K()  const = 0;
+      virtual int S0()  const = 0;
+      virtual int SK()  const = 0;
+
+      virtual void set_FSM(fsm &FSM) =0;
+      virtual void set_K(int K) =0;
+      virtual void set_S0(int S0) =0;
+      virtual void set_SK(int SK) =0;
     };
 
   } /* namespace trellis */
diff --git a/gr-trellis/include/gnuradio/trellis/viterbi_combined_XX.h.t 
b/gr-trellis/include/gnuradio/trellis/viterbi_combined_XX.h.t
index 2becf8b..4546e95 100644
--- a/gr-trellis/include/gnuradio/trellis/viterbi_combined_XX.h.t
+++ b/gr-trellis/include/gnuradio/trellis/viterbi_combined_XX.h.t
@@ -50,12 +50,19 @@ namespace gr {
 
       virtual fsm FSM() const = 0;
       virtual int K() const = 0;
-      virtual int S0() const = 0;
+      virtual int S0() const  = 0;
       virtual int SK() const = 0;
       virtual int D() const = 0;
       virtual std::vector<@I_TYPE@> TABLE() const = 0;
       virtual digital::trellis_metric_type_t TYPE() const = 0;
+
+      virtual void set_FSM(const fsm &FSM) =0;
+      virtual void set_K(int K) =0;
+      virtual void set_S0(int S0) =0;
+      virtual void set_SK(int SK) =0;
+      virtual void set_D(int D) =0;
       virtual void set_TABLE (const std::vector<@I_TYPE@> &table) = 0;
+      virtual void set_TYPE(digital::trellis_metric_type_t type) = 0;
     };
 
   } /* namespace trellis */
diff --git a/gr-trellis/lib/calc_metric.cc b/gr-trellis/lib/calc_metric.cc
index b958999..bdbb13e 100644
--- a/gr-trellis/lib/calc_metric.cc
+++ b/gr-trellis/lib/calc_metric.cc
@@ -73,19 +73,17 @@ namespace gr {
     }
 
     template
-    void calc_metric<short>(int O, int D, const std::vector<short> &TABLE, 
const short *input,
-                           float *metric, digital::trellis_metric_type_t type);
+    void calc_metric<char>(int O, int D, const std::vector<char> &TABLE, const 
char *input, float *metric, digital::trellis_metric_type_t type);
 
     template
-    void calc_metric<int>(int O, int D, const std::vector<int> &TABLE, const 
int *input,
-                         float *metric, digital::trellis_metric_type_t type);
+    void calc_metric<short>(int O, int D, const std::vector<short> &TABLE, 
const short *input, float *metric, digital::trellis_metric_type_t type);
 
-    template
-    void calc_metric<float>(int O, int D, const std::vector<float> &TABLE, 
const float *input,
-                           float *metric, digital::trellis_metric_type_t type);
+    template void calc_metric<int>(int O, int D, const std::vector<int> 
&TABLE, const int *input, float *metric, digital::trellis_metric_type_t type);
 
-    void calc_metric(int O, int D, const std::vector<short> &TABLE, const 
short *input,
-                    float *metric, digital::trellis_metric_type_t type)
+    template void calc_metric<float>(int O, int D, const std::vector<float> 
&TABLE, const float *input, float *metric, digital::trellis_metric_type_t type);
+
+    /*
+    void calc_metric(int O, int D, const std::vector<short> &TABLE, const 
short *input, float *metric, digital::trellis_metric_type_t type)
     {
       float minm = FLT_MAX;
       int minmi = 0;
@@ -124,7 +122,6 @@ namespace gr {
       }
     }
 
-    /*
     void calc_metric(int O, int D, const std::vector<int> &TABLE, const int 
*input,
                     float *metric, digital::trellis_metric_type_t type)
     {
diff --git a/gr-trellis/lib/core_algorithms.cc 
b/gr-trellis/lib/core_algorithms.cc
index a8a0174..eb32b65 100644
--- a/gr-trellis/lib/core_algorithms.cc
+++ b/gr-trellis/lib/core_algorithms.cc
@@ -215,6 +215,19 @@ namespace gr {
     //---------------
 
     template void
+    viterbi_algorithm_combined<char,unsigned char>(int I, int S, int O,
+                                                   const std::vector<int> &NS,
+                                                   const std::vector<int> &OS,
+                                                   const std::vector< 
std::vector<int> > &PS,
+                                                   const std::vector< 
std::vector<int> > &PI,
+                                                   int K,
+                                                   int S0,int SK,
+                                                   int D,
+                                                   const std::vector<char> 
&TABLE,
+                                                   
digital::trellis_metric_type_t TYPE,
+                                                   const char *in, unsigned 
char *out);
+
+    template void
     viterbi_algorithm_combined<short,unsigned char>(int I, int S, int O,
                                                    const std::vector<int> &NS,
                                                    const std::vector<int> &OS,
@@ -269,6 +282,19 @@ namespace gr {
     //---------------
 
     template void
+    viterbi_algorithm_combined<char,short>(int I, int S, int O,
+                                           const std::vector<int> &NS,
+                                           const std::vector<int> &OS,
+                                           const std::vector< std::vector<int> 
> &PS,
+                                           const std::vector< std::vector<int> 
> &PI,
+                                           int K,
+                                           int S0,int SK,
+                                           int D,
+                                           const std::vector<char> &TABLE,
+                                           digital::trellis_metric_type_t TYPE,
+                                           const char *in, short *out);
+
+    template void
     viterbi_algorithm_combined<short,short>(int I, int S, int O,
                                            const std::vector<int> &NS,
                                            const std::vector<int> &OS,
@@ -323,6 +349,19 @@ namespace gr {
     //--------------
 
     template void
+    viterbi_algorithm_combined<char,int>(int I, int S, int O,
+                                         const std::vector<int> &NS,
+                                         const std::vector<int> &OS,
+                                         const std::vector< std::vector<int> > 
&PS,
+                                         const std::vector< std::vector<int> > 
&PI,
+                                         int K,
+                                         int S0,int SK,
+                                         int D,
+                                         const std::vector<char> &TABLE,
+                                         digital::trellis_metric_type_t TYPE,
+                                         const char *in, int *out);
+
+    template void
     viterbi_algorithm_combined<short,int>(int I, int S, int O,
                                          const std::vector<int> &NS,
                                          const std::vector<int> &OS,
diff --git a/gr-trellis/lib/encoder_XX_impl.h.t 
b/gr-trellis/lib/encoder_XX_impl.h.t
index ec2f826..d58f9b0 100644
--- a/gr-trellis/lib/encoder_XX_impl.h.t
+++ b/gr-trellis/lib/encoder_XX_impl.h.t
@@ -40,8 +40,11 @@ namespace gr {
       @IMPL_NAME@(const fsm &FSM, int ST);
       address@hidden@();
 
-      fsm FSM() const { return d_FSM; }
-      int ST() const { return d_ST; }
+      fsm FSM() { return d_FSM;; }
+      int ST() {  return d_ST; }
+
+      void set_FSM(fsm &FSM) { d_FSM = FSM; }
+      void set_ST(int ST) { d_ST = ST; }
 
       int work(int noutput_items,
               gr_vector_const_void_star &input_items,
diff --git a/gr-trellis/lib/fsm.cc b/gr-trellis/lib/fsm.cc
index 20eeed5..4e57949 100644
--- a/gr-trellis/lib/fsm.cc
+++ b/gr-trellis/lib/fsm.cc
@@ -313,6 +313,54 @@ namespace gr {
       generate_TM();
     }
 
+
+    //######################################################################
+    //# Automatically generate an FSM specification describing the
+    //# the joint trellis of two serially concatenated fsms.
+    //######################################################################
+    fsm::fsm(const fsm &FSMo, const fsm &FSMi, bool serial)
+    {
+      if(serial==false || FSMo.O()!=FSMi.I()) {
+        d_I=0;
+        d_S=0;
+        d_O=0;
+        d_NS.resize(0);
+        d_OS.resize(0);
+        d_PS.resize(0);
+        d_PI.resize(0);
+        d_TMi.resize(0);
+        d_TMl.resize(0);
+        return;
+      }
+ 
+      d_I=FSMo.I();
+      d_S=FSMo.S()*FSMi.S();
+      d_O=FSMi.O();
+
+      d_NS.resize(d_I*d_S);
+      d_OS.resize(d_I*d_S);
+
+      for(int s=0;s<d_S;s++) {
+        for(int i=0;i<d_I;i++) {
+          int so=s/FSMi.S();
+          int si=s%FSMi.S();
+          int oo=FSMo.OS()[so * FSMo.I() + i];
+          int oi=FSMi.OS()[si * FSMi.I() + oo];
+          d_NS[s*d_I+i] = FSMo.NS()[so * FSMo.I() + i] * FSMo.S() + 
FSMi.NS()[si * FSMi.I() + oo];
+          d_OS[s*d_I+i] = oi;
+        }
+      }
+
+      generate_PS_PI();
+      generate_TM();
+    }
+
+
+
+
+
+
+
     //######################################################################
     //# Generate a new FSM representing n stages through the original FSM
     //# AKA radix-n FSM
diff --git a/gr-trellis/lib/metrics_X_impl.cc.t 
b/gr-trellis/lib/metrics_X_impl.cc.t
index 499bd8b..2b811de 100644
--- a/gr-trellis/lib/metrics_X_impl.cc.t
+++ b/gr-trellis/lib/metrics_X_impl.cc.t
@@ -54,8 +54,23 @@ namespace gr {
       set_output_multiple ((int)d_O);
     }
 
-    @IMPL_NAME@::address@hidden@()
+    void @IMPL_NAME@::set_O(int O)
+    { 
+      d_O = O; 
+      set_relative_rate (1.0 * d_O / ((double) d_D));
+      set_output_multiple ((int)d_O);
+    }
+
+    void @IMPL_NAME@::set_D(int D)
+    { 
+      d_D = D; 
+      set_relative_rate (1.0 * d_O / ((double) d_D));
+    }
+
+    void
+    @IMPL_NAME@::set_TYPE(digital::trellis_metric_type_t type)
     {
+      d_TYPE = type;
     }
 
     void
@@ -64,6 +79,11 @@ namespace gr {
       d_TABLE = table;
     }
 
+    @IMPL_NAME@::address@hidden@()
+    {
+    }
+
+
     void
     @IMPL_NAME@::forecast(int noutput_items, gr_vector_int 
&ninput_items_required)
     {
diff --git a/gr-trellis/lib/metrics_X_impl.h.t 
b/gr-trellis/lib/metrics_X_impl.h.t
index 2b4481f..9323ae4 100644
--- a/gr-trellis/lib/metrics_X_impl.h.t
+++ b/gr-trellis/lib/metrics_X_impl.h.t
@@ -47,6 +47,10 @@ namespace gr {
       int D() const { return d_D; }
       digital::trellis_metric_type_t TYPE() const { return d_TYPE; }
       std::vector<@I_TYPE@> TABLE() const { return d_TABLE; }
+
+      void set_O(int O);
+      void set_D(int D);
+      void set_TYPE(digital::trellis_metric_type_t type);
       void set_TABLE(const std::vector<@I_TYPE@> &table);
 
       void forecast(int noutput_items,
diff --git a/gr-trellis/lib/permutation_impl.cc 
b/gr-trellis/lib/permutation_impl.cc
index 06bba1e..0d9d359 100644
--- a/gr-trellis/lib/permutation_impl.cc
+++ b/gr-trellis/lib/permutation_impl.cc
@@ -49,10 +49,22 @@ namespace gr {
        d_SYMS_PER_BLOCK(SYMS_PER_BLOCK),
        d_BYTES_PER_SYMBOL(BYTES_PER_SYMBOL)
     {
-      set_output_multiple(d_K*SYMS_PER_BLOCK);
+      set_output_multiple(d_K*d_SYMS_PER_BLOCK);
       //std::cout << d_K << "\n";
     }
 
+    void permutation_impl::set_K(int K)
+    {
+      d_K=K;
+      set_output_multiple(d_K*d_SYMS_PER_BLOCK);
+    }
+
+    void permutation_impl::set_SYMS_PER_BLOCK(int spb)
+    {
+      d_SYMS_PER_BLOCK=spb;
+      set_output_multiple(d_K*d_SYMS_PER_BLOCK);
+    }
+
     permutation_impl::~permutation_impl()
     {
     }
diff --git a/gr-trellis/lib/permutation_impl.h 
b/gr-trellis/lib/permutation_impl.h
index 2c7b28d..5c74fba 100644
--- a/gr-trellis/lib/permutation_impl.h
+++ b/gr-trellis/lib/permutation_impl.h
@@ -43,10 +43,14 @@ namespace gr {
       ~permutation_impl();
 
       int K() const { return d_K; }
-      const std::vector<int> & TABLE() const { return d_TABLE; }
+      std::vector<int> TABLE() const { return d_TABLE; }
       int SYMS_PER_BLOCK() const { return d_SYMS_PER_BLOCK; }
       size_t BYTES_PER_SYMBOL() const { return d_BYTES_PER_SYMBOL; }
 
+      void set_K(int K) ;
+      void set_TABLE (const std::vector<int> &table) {d_TABLE = table; }
+      void set_SYMS_PER_BLOCK(int spb) ;
+
       int work(int noutput_items,
               gr_vector_const_void_star &input_items,
               gr_vector_void_star &output_items);
diff --git a/gr-trellis/lib/siso_combined_f_impl.cc 
b/gr-trellis/lib/siso_combined_f_impl.cc
index d30f5cc..f9e8e28 100644
--- a/gr-trellis/lib/siso_combined_f_impl.cc
+++ b/gr-trellis/lib/siso_combined_f_impl.cc
@@ -48,23 +48,9 @@ namespace gr {
                                  SISO_TYPE, D, TABLE, TYPE));
     }
 
-    siso_combined_f_impl::siso_combined_f_impl(const fsm &FSM, int K,
-                                              int S0, int SK,
-                                              bool POSTI, bool POSTO,
-                                              siso_type_t SISO_TYPE,
-                                              int D, const std::vector<float> 
&TABLE,
-                                              digital::trellis_metric_type_t 
TYPE)
-      : block("siso_combined_f",
-                io_signature::make(1, -1, sizeof(float)),
-                io_signature::make(1, -1, sizeof(float))),
-       d_FSM(FSM), d_K(K), d_S0(S0), d_SK(SK),
-       d_POSTI(POSTI), d_POSTO(POSTO),
-       d_SISO_TYPE(SISO_TYPE),
-       d_D(D), d_TABLE(TABLE), d_TYPE(TYPE)//,
-       //d_alpha(FSM.S()*(K+1)),
-       //d_beta(FSM.S()*(K+1))
+    void siso_combined_f_impl::recalculate()
     {
-      int multiple;
+      int multiple; 
       if(d_POSTI && d_POSTO)
         multiple = d_FSM.I()+d_FSM.O();
       else if(d_POSTI)
@@ -74,7 +60,6 @@ namespace gr {
       else
         throw std::runtime_error ("Not both POSTI and POSTO can be false.");
 
-      //printf("constructor: Multiple = %d\n",multiple);
       set_output_multiple(d_K*multiple);
 
       //what is the meaning of relative rate for a block with 2 inputs?
@@ -84,11 +69,63 @@ namespace gr {
       //set_relative_rate ( multiple / ((double) d_FSM.O()) );
       // I am tempted to automate like this
       if(d_FSM.I() <= d_D)
-       set_relative_rate(multiple / ((double)d_D));
+        set_relative_rate(multiple / ((double)d_D));
       else
-       set_relative_rate(multiple / ((double)d_FSM.I()));
+        set_relative_rate(multiple / ((double)d_FSM.I()));
+    }
+    
+
+    siso_combined_f_impl::siso_combined_f_impl(const fsm &FSM, int K,
+                                              int S0, int SK,
+                                              bool POSTI, bool POSTO,
+                                              siso_type_t SISO_TYPE,
+                                              int D, const std::vector<float> 
&TABLE,
+                                              digital::trellis_metric_type_t 
TYPE)
+      : block("siso_combined_f",
+                io_signature::make(1, -1, sizeof(float)),
+                io_signature::make(1, -1, sizeof(float))),
+       d_FSM(FSM), d_K(K), d_S0(S0), d_SK(SK),
+       d_POSTI(POSTI), d_POSTO(POSTO),
+       d_SISO_TYPE(SISO_TYPE),
+       d_D(D), d_TABLE(TABLE), d_TYPE(TYPE)//,
+       //d_alpha(FSM.S()*(K+1)),
+       //d_beta(FSM.S()*(K+1))
+    {
+      recalculate();
+    }
+
+    void siso_combined_f_impl::set_FSM(const fsm &FSM)
+    {
+      d_FSM=FSM;
+      recalculate();
     }
 
+    void siso_combined_f_impl::set_K(int K)
+    {
+      d_K=K;
+      recalculate();
+    }
+
+    void siso_combined_f_impl::set_POSTI(bool POSTI)
+    {
+      d_POSTI = POSTI;
+      recalculate();
+    }
+
+    void siso_combined_f_impl::set_POSTO(bool POSTO)
+    {
+      d_POSTO = POSTO;
+      recalculate();
+    }
+
+    void siso_combined_f_impl::set_D(int D)
+    {
+      d_D=D;
+      recalculate();
+    }
+
+    
+
     siso_combined_f_impl::~siso_combined_f_impl()
     {
     }
diff --git a/gr-trellis/lib/siso_combined_f_impl.h 
b/gr-trellis/lib/siso_combined_f_impl.h
index 5035a0a..9457637 100644
--- a/gr-trellis/lib/siso_combined_f_impl.h
+++ b/gr-trellis/lib/siso_combined_f_impl.h
@@ -41,6 +41,7 @@ namespace gr {
       int d_D;
       std::vector<float> d_TABLE;
       digital::trellis_metric_type_t d_TYPE;
+      void recalculate();
       //std::vector<float> d_alpha;
       //std::vector<float> d_beta;
 
@@ -64,6 +65,17 @@ namespace gr {
       std::vector<float> TABLE() const { return d_TABLE; }
       digital::trellis_metric_type_t TYPE() const { return d_TYPE; }
 
+      void set_FSM(const fsm &FSM);
+      void set_K(int K);
+      void set_S0(int S0){ d_S0 = S0; }
+      void set_SK(int SK){ d_SK = SK; }
+      void set_POSTI(bool POSTI);
+      void set_POSTO(bool POSTO);
+      void set_SISO_TYPE(trellis::siso_type_t type) { d_SISO_TYPE = type; }
+      void set_D(int D);
+      void set_TABLE(const std::vector<float> &table){ d_TABLE = table; }
+      void set_TYPE(digital::trellis_metric_type_t type){ d_TYPE = type; }
+
       void forecast(int noutput_items,
                    gr_vector_int &ninput_items_required);
 
diff --git a/gr-trellis/lib/siso_f_impl.cc b/gr-trellis/lib/siso_f_impl.cc
index d699cec..a1c7ab3 100644
--- a/gr-trellis/lib/siso_f_impl.cc
+++ b/gr-trellis/lib/siso_f_impl.cc
@@ -45,19 +45,8 @@ namespace gr {
        (new siso_f_impl(FSM, K, S0, SK, POSTI, POSTO, SISO_TYPE));
     }
 
-    siso_f_impl::siso_f_impl(const fsm &FSM, int K,
-                            int S0, int SK,
-                            bool POSTI, bool POSTO,
-                            siso_type_t SISO_TYPE)
-      : block("siso_f",
-                io_signature::make(1, -1, sizeof(float)),
-                io_signature::make(1, -1, sizeof(float))),
-       d_FSM(FSM), d_K(K),
-       d_S0(S0),d_SK(SK),
-       d_POSTI(POSTI), d_POSTO(POSTO),
-       d_SISO_TYPE(SISO_TYPE)//,
-       //d_alpha(FSM.S()*(K+1)),
-       //d_beta(FSM.S()*(K+1))
+
+    void siso_f_impl::recalculate()
     {
       int multiple;
       if(d_POSTI && d_POSTO)
@@ -69,7 +58,6 @@ namespace gr {
       else
         throw std::runtime_error ("Not both POSTI and POSTO can be false.");
 
-      //printf("constructor: Multiple = %d\n",multiple);
       set_output_multiple (d_K*multiple);
 
       //what is the meaning of relative rate for a block with 2 inputs?
@@ -84,6 +72,47 @@ namespace gr {
        set_relative_rate(multiple / ((double) d_FSM.I()));
     }
 
+    siso_f_impl::siso_f_impl(const fsm &FSM, int K,
+                            int S0, int SK,
+                            bool POSTI, bool POSTO,
+                            siso_type_t SISO_TYPE)
+      : block("siso_f",
+                io_signature::make(1, -1, sizeof(float)),
+                io_signature::make(1, -1, sizeof(float))),
+       d_FSM(FSM), d_K(K),
+       d_S0(S0),d_SK(SK),
+       d_POSTI(POSTI), d_POSTO(POSTO),
+       d_SISO_TYPE(SISO_TYPE)//,
+       //d_alpha(FSM.S()*(K+1)),
+       //d_beta(FSM.S()*(K+1))
+    {
+      recalculate();
+    }
+
+    void siso_f_impl::set_FSM(const fsm &FSM)
+    {
+      d_FSM=FSM;
+      recalculate();
+    }
+
+    void siso_f_impl::set_K(int K)
+    {
+      d_K=K;
+      recalculate();
+    }
+
+    void siso_f_impl::set_POSTI(bool POSTI)
+    { 
+      d_POSTI = POSTI; 
+      recalculate();
+    }
+
+    void siso_f_impl::set_POSTO(bool POSTO)
+    { 
+      d_POSTO = POSTO; 
+      recalculate();
+    }
+
     siso_f_impl::~siso_f_impl()
     {
     }
diff --git a/gr-trellis/lib/siso_f_impl.h b/gr-trellis/lib/siso_f_impl.h
index ca8f623..c8c9e1a 100644
--- a/gr-trellis/lib/siso_f_impl.h
+++ b/gr-trellis/lib/siso_f_impl.h
@@ -42,6 +42,7 @@ namespace gr {
       bool d_POSTI;
       bool d_POSTO;
       siso_type_t d_SISO_TYPE;
+      void recalculate();
       //std::vector<float> d_alpha;
       //std::vector<float> d_beta;
 
@@ -60,6 +61,14 @@ namespace gr {
       bool POSTO() const { return d_POSTO; }
       siso_type_t SISO_TYPE() const { return d_SISO_TYPE; }
 
+      void set_FSM(const fsm &FSM);
+      void set_K(int K);
+      void set_S0(int S0){ d_S0 = S0; }
+      void set_SK(int SK){ d_SK = SK; }
+      void set_POSTI(bool POSTI);
+      void set_POSTO(bool POSTO);
+      void set_SISO_TYPE(trellis::siso_type_t type) { d_SISO_TYPE = type; }
+
       void forecast(int noutput_items,
                    gr_vector_int &ninput_items_required);
 
diff --git a/gr-trellis/lib/viterbi_X_impl.cc.t 
b/gr-trellis/lib/viterbi_X_impl.cc.t
index 247424b..bd5bdd8 100644
--- a/gr-trellis/lib/viterbi_X_impl.cc.t
+++ b/gr-trellis/lib/viterbi_X_impl.cc.t
@@ -55,6 +55,18 @@ namespace gr {
       set_output_multiple(d_K);
     }
 
+    void @IMPL_NAME@::set_FSM(fsm &FSM) 
+    { 
+      d_FSM = FSM; 
+      set_relative_rate(1.0 / ((double)d_FSM.O()));
+    }
+
+    void @IMPL_NAME@::set_K(int K) 
+    { 
+      d_K = K; 
+      set_output_multiple(d_K);
+    }
+
     @IMPL_NAME@::address@hidden@()
     {
     }
diff --git a/gr-trellis/lib/viterbi_X_impl.h.t 
b/gr-trellis/lib/viterbi_X_impl.h.t
index b9554e8..44934a5 100644
--- a/gr-trellis/lib/viterbi_X_impl.h.t
+++ b/gr-trellis/lib/viterbi_X_impl.h.t
@@ -44,11 +44,15 @@ namespace gr {
                  int S0, int SK);
       address@hidden@();
 
-      fsm FSM() const { return d_FSM; }
-      int K() const { return d_K; }
-      int S0() const { return d_S0; }
-      int SK() const { return d_SK; }
+      fsm FSM() const  { return d_FSM; }
+      int K()  const { return d_K; }
+      int S0()  const { return d_S0; }
+      int SK()  const { return d_SK; }
 
+      void set_FSM(fsm &FSM);
+      void set_K(int K);
+      void set_S0(int S0) { d_S0 = S0; }
+      void set_SK(int SK) { d_SK = SK; }
       //std::vector<int> trace () const { return d_trace; }
 
       void forecast(int noutput_items,
diff --git a/gr-trellis/lib/viterbi_combined_XX_impl.cc.t 
b/gr-trellis/lib/viterbi_combined_XX_impl.cc.t
index c7cf10e..91bb4e6 100644
--- a/gr-trellis/lib/viterbi_combined_XX_impl.cc.t
+++ b/gr-trellis/lib/viterbi_combined_XX_impl.cc.t
@@ -60,14 +60,22 @@ namespace gr {
       set_output_multiple(d_K);
     }
 
-    @IMPL_NAME@::address@hidden@()
+    void
+    @IMPL_NAME@::set_K(int K)
     {
+      d_K = K;
+      set_output_multiple(d_K);
     }
 
     void
-    @IMPL_NAME@::set_TABLE(const std::vector<@I_TYPE@> &table)
+    @IMPL_NAME@::set_D(int D)
+    {
+      d_D = D;
+      set_relative_rate(1.0 / ((double)d_D));
+    }
+
+    @IMPL_NAME@::address@hidden@()
     {
-      d_TABLE = table;
     }
 
     void
diff --git a/gr-trellis/lib/viterbi_combined_XX_impl.h.t 
b/gr-trellis/lib/viterbi_combined_XX_impl.h.t
index 199e8c8..7098d8b 100644
--- a/gr-trellis/lib/viterbi_combined_XX_impl.h.t
+++ b/gr-trellis/lib/viterbi_combined_XX_impl.h.t
@@ -49,15 +49,22 @@ namespace gr {
                  digital::trellis_metric_type_t TYPE);
       address@hidden@();
 
-      fsm FSM() const { return d_FSM; }
-      int K() const { return d_K; }
-      int S0() const { return d_S0; }
-      int SK() const { return d_SK; }
-      int D() const { return d_D; }
+      fsm FSM() const  { return d_FSM; }
+      int K()  const { return d_K; }
+      int S0()  const { return d_S0; }
+      int SK()  const { return d_SK; }
+      int D()  const { return d_D; }
       std::vector<@I_TYPE@> TABLE() const { return d_TABLE; }
       digital::trellis_metric_type_t TYPE() const { return d_TYPE; }
       //std::vector<int> trace() const { return d_trace; }
-      void set_TABLE(const std::vector<@I_TYPE@> &table);
+
+      void set_FSM(const fsm &FSM){ d_FSM = FSM; }
+      void set_K(int K);
+      void set_S0(int S0){ d_S0 = S0; }
+      void set_SK(int SK){ d_SK = SK; }
+      void set_D(int D);
+      void set_TABLE(const std::vector<@I_TYPE@> &table) { d_TABLE = table; }
+      void set_TYPE(digital::trellis_metric_type_t type) { d_TYPE = type; }
 
       void forecast(int noutput_items,
                    gr_vector_int &ninput_items_required);
diff --git a/gr-trellis/python/trellis/CMakeLists.txt 
b/gr-trellis/python/trellis/CMakeLists.txt
index b4223af..5cfe927 100644
--- a/gr-trellis/python/trellis/CMakeLists.txt
+++ b/gr-trellis/python/trellis/CMakeLists.txt
@@ -25,6 +25,7 @@ include(GrPython)
 GR_PYTHON_INSTALL(
     FILES
     __init__.py
+    fsm_utils.py
     DESTINATION ${GR_PYTHON_DIR}/gnuradio/trellis
     COMPONENT "trellis_python"
 )
diff --git a/gr-trellis/python/trellis/__init__.py 
b/gr-trellis/python/trellis/__init__.py
index 6c6d80e..662aa58 100644
--- a/gr-trellis/python/trellis/__init__.py
+++ b/gr-trellis/python/trellis/__init__.py
@@ -31,3 +31,6 @@ except ImportError:
     dirname, filename = os.path.split(os.path.abspath(__file__))
     __path__.append(os.path.join(dirname, "..", "..", "swig"))
     from trellis_swig import *
+
+# import any pure python here
+import fsm_utils
diff --git a/gr-trellis/python/trellis/fsm_utils.py 
b/gr-trellis/python/trellis/fsm_utils.py
new file mode 100755
index 0000000..c579f09
--- /dev/null
+++ b/gr-trellis/python/trellis/fsm_utils.py
@@ -0,0 +1,218 @@
+#!/usr/bin/env python
+#
+# Copyright 2004 Free Software Foundation, Inc.
+#
+# This file is part of GNU Radio
+#
+# GNU Radio is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 3, or (at your option)
+# any later version.
+#
+# GNU Radio is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with GNU Radio; see the file COPYING.  If not, write to
+# the Free Software Foundation, Inc., 51 Franklin Street,
+# Boston, MA 02110-1301, USA.
+#
+
+
+import re
+import math
+import sys
+import operator
+import numpy
+
+#from gnuradio import trellis
+#
+#try:
+    #import scipy.linalg
+#except ImportError:
+    #print "Error: Program requires scipy (see: www.scipy.org)."
+    #sys.exit(1)
+
+
+
+######################################################################
+# Decimal to any base conversion.
+# Convert 'num' to a list of 'l' numbers representing 'num'
+# to base 'base' (most significant symbol first).
+######################################################################
+def dec2base(num,base,l):
+    s=range(l)
+    n=num
+    for i in range(l):
+        s[l-i-1]=n%base
+        n=int(n/base)
+    if n!=0:
+        print 'Number ', num, ' requires more than ', l, 'digits.'
+    return s
+
+
+######################################################################
+# Conversion from any base to decimal.
+# Convert a list 's' of symbols to a decimal number
+# (most significant symbol first)
+######################################################################
+def base2dec(s,base):
+    num=0
+    for i in range(len(s)):
+        num=num*base+s[i]
+    return num
+
+
+
+
+######################################################################
+# Automatically generate the lookup table that maps the FSM outputs
+# to channel inputs corresponding to a channel 'channel' and a modulation
+# 'mod'. Optional normalization of channel to unit energy.
+# This table is used by the 'metrics' block to translate
+# channel outputs to metrics for use with the Viterbi algorithm.
+# Limitations: currently supports only one-dimensional modulations.
+######################################################################
+def make_isi_lookup(mod,channel,normalize):
+    dim=mod[0]
+    constellation = mod[1]
+
+    if normalize:
+        p = 0
+        for i in range(len(channel)):
+            p = p + channel[i]**2
+        for i in range(len(channel)):
+            channel[i] = channel[i]/math.sqrt(p)
+
+    lookup=range(len(constellation)**len(channel))
+    for o in range(len(constellation)**len(channel)):
+        ss=dec2base(o,len(constellation),len(channel))
+        ll=0
+        for i in range(len(channel)):
+            ll=ll+constellation[ss[i]]*channel[i]
+        lookup[o]=ll
+    return (1,lookup)
+
+
+
+
+
+
+######################################################################
+# Automatically generate the signals appropriate for CPM
+# decomposition.
+# This decomposition is based on the paper by B. Rimoldi
+# "A decomposition approach to CPM", IEEE Trans. Info Theory, March 1988
+# See also my own notes at http://www.eecs.umich.edu/~anastas/docs/cpm.pdf
+######################################################################
+def make_cpm_signals(K,P,M,L,q,frac):
+
+    Q=numpy.size(q)/L
+    h=(1.0*K)/P
+    f0=-h*(M-1)/2
+    dt=0.0; # maybe start at t=0.5
+    t=(dt+numpy.arange(0,Q))/Q
+    qq=numpy.zeros(Q)
+    for m in range(L):
+       qq=qq + q[m*Q:m*Q+Q]
+    w=math.pi*h*(M-1)*t-2*math.pi*h*(M-1)*qq+math.pi*h*(L-1)*(M-1)
+
+    X=(M**L)*P
+    PSI=numpy.empty((X,Q))
+    for x in range(X):
+       xv=dec2base(x/P,M,L)
+       xv=numpy.append(xv, x%P)
+       qq1=numpy.zeros(Q)
+       for m in range(L):
+          qq1=qq1+xv[m]*q[m*Q:m*Q+Q]
+       psi=2*math.pi*h*xv[-1]+4*math.pi*h*qq1+w
+       #print psi
+       PSI[x]=psi
+    PSI = numpy.transpose(PSI)
+    SS=numpy.exp(1j*PSI) # contains all signals as columns
+    #print SS
+
+
+    # Now we need to orthogonalize the signals
+    F = scipy.linalg.orth(SS) # find an orthonormal basis for SS
+    #print numpy.dot(numpy.transpose(F.conjugate()),F) # check for 
orthonormality
+    S = numpy.dot(numpy.transpose(F.conjugate()),SS)
+    #print F
+    #print S
+
+    # We only want to keep those dimensions that contain most
+    # of the energy of the overall constellation (eg, frac=0.9 ==> 90%)
+    # evaluate mean energy in each dimension
+    E=numpy.sum(numpy.absolute(S)**2,axis=1)/Q
+    E=E/numpy.sum(E)
+    #print E
+    Es = -numpy.sort(-E)
+    Esi = numpy.argsort(-E)
+    #print Es
+    #print Esi
+    Ecum=numpy.cumsum(Es)
+    #print Ecum
+    v0=numpy.searchsorted(Ecum,frac)
+    N = v0+1
+    #print v0
+    #print Esi[0:v0+1]
+    Ff=numpy.transpose(numpy.transpose(F)[Esi[0:v0+1]])
+    #print Ff
+    Sf = S[Esi[0:v0+1]]
+    #print Sf
+
+
+    return (f0,SS,S,F,Sf,Ff,N)
+    #return f0
+
+
+
+
+######################################################################
+# A list of common modulations.
+# Format: (dimensionality,constellation)
+######################################################################
+pam2 = (1,[-1, 1])
+pam4 = (1,[-3, -1, 3, 1])              # includes Gray mapping
+pam8 = (1,[-7, -5, -3, -1, 1, 3, 5, 7])
+
+psk4=(2,[1, 0, \
+         0, 1, \
+         0, -1,\
+        -1, 0])                                # includes Gray mapping
+
+psk8=(2,[math.cos(2*math.pi*0/8), math.sin(2*math.pi*0/8),  \
+         math.cos(2*math.pi*1/8), math.sin(2*math.pi*1/8),  \
+         math.cos(2*math.pi*2/8), math.sin(2*math.pi*2/8),  \
+         math.cos(2*math.pi*3/8), math.sin(2*math.pi*3/8),  \
+         math.cos(2*math.pi*4/8), math.sin(2*math.pi*4/8),  \
+         math.cos(2*math.pi*5/8), math.sin(2*math.pi*5/8),  \
+         math.cos(2*math.pi*6/8), math.sin(2*math.pi*6/8),  \
+         math.cos(2*math.pi*7/8), math.sin(2*math.pi*7/8)])
+
+psk2x3 = (3,[-1,-1,-1, \
+             -1,-1,1, \
+             -1,1,-1, \
+             -1,1,1, \
+             1,-1,-1, \
+             1,-1,1, \
+             1,1,-1, \
+             1,1,1])
+
+
+orth2 = (2,[1, 0, \
+            0, 1])
+orth4=(4,[1, 0, 0, 0, \
+          0, 1, 0, 0, \
+          0, 0, 1, 0, \
+          0, 0, 0, 1])
+
+######################################################################
+# A list of channels to be tested
+######################################################################
+
+# C test channel (J. Proakis, Digital Communications, McGraw-Hill Inc., 2001)
+c_channel = [0.227, 0.460, 0.688, 0.460, 0.227]
+



reply via email to

[Prev in Thread] Current Thread [Next in Thread]