Refactored some common functions for metric calculations. Updated the documentation.
authoranastas <anastas@221aa14e-8319-0410-a670-987f0aec2ac5>
Sun, 3 Sep 2006 20:27:42 +0000 (20:27 +0000)
committeranastas <anastas@221aa14e-8319-0410-a670-987f0aec2ac5>
Sun, 3 Sep 2006 20:27:42 +0000 (20:27 +0000)
git-svn-id: http://gnuradio.org/svn/gnuradio/trunk@3469 221aa14e-8319-0410-a670-987f0aec2ac5

16 files changed:
gr-trellis/doc/gr-trellis.xml
gr-trellis/doc/test_tcm.py
gr-trellis/doc/test_tcm.py.xml
gr-trellis/src/lib/interleaver.cc
gr-trellis/src/lib/trellis_calc_metric.cc
gr-trellis/src/lib/trellis_calc_metric.h
gr-trellis/src/lib/trellis_metrics_X.cc.t
gr-trellis/src/lib/trellis_metrics_c.cc
gr-trellis/src/lib/trellis_metrics_f.cc
gr-trellis/src/lib/trellis_metrics_i.cc
gr-trellis/src/lib/trellis_metrics_s.cc
gr-trellis/src/lib/trellis_siso_combined_f.cc
gr-trellis/src/lib/trellis_viterbi_combined_X.cc.t
gr-trellis/src/lib/trellis_viterbi_combined_b.cc
gr-trellis/src/lib/trellis_viterbi_combined_i.cc
gr-trellis/src/lib/trellis_viterbi_combined_s.cc

index f65b953565322df1715957a725b230b02141cf27..e33a94a2d7d70934114aca5f2bf66a3e60c4acf4 100644 (file)
@@ -341,26 +341,113 @@ In this section we give a brief description of the basic blocks implemented that
 
 <!-- %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -->
 <sect2 id="encoder"><title>Trellis Encoder</title>
-
 <para>
 The trellis.encoder_XX(FSM, ST) block instantiates an FSM encoder corresponding to the fsm FSM and having initial state ST. The input and output is a sequence of bytes, shorts or integers. 
 </para>
-
 </sect2>
 
 <!-- %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -->
 <sect2 id="decoder"><title>Viterbi Decoder</title>
+<para>
+The trellis.viterbi_X(FSM, K, S0, SK) block instantiates a Viterbi decoder 
+for a sequence of K trellis steps generated by the given FSM and with initial and final states set to S0 and SK, respectively (S0 and/or SK are set to -1
+if the corresponding states are not fixed/known at the receiver side).
+The output of this block is a sequence of K bytes, shorts or integers representing the estimated input (i.e., uncoded) sequence.
+The input is a sequence of K x FSM.O( ) floats, where the k x K + i 
+float represents the cost associated with the k-th
+step in the trellis and the i-th FSM output.
+Observe that these inputs are generated externally and thus the Viterbi block is not informed of their meaning (they can be genarated as soft or hard inputs, etc); the only requirement is that they represent additive costs.
+</para>
+</sect2>
+
+<!-- %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -->
+<sect2 id="metrics"><title>Metrics Calculator</title>
+<para>
+The trellis.metrics_X(O,D,TABLE,TYPE) block is responsible for 
+transforming the channel output to the stream of metrics appropriate as 
+inputs to the Viterbi block described above. For each D input bytes/shorts/integers/floats/complexes it produces O output floats 
+
+</para>
 
 <para>
-The trellis.viterbi_X(FSM, K, S0, SK) block instantiates a Viterbi decoder
-for an underlying ...
+
+The parameter TYPE dictates how these metrics are generated:
+
+<itemizedlist>
+<listitem><para>
+TRELLIS_EUCLIDEAN: for each D-dimensional vector 
+r<subscript>k</subscript>=
+(r<subscript>k,1</subscript>,r<subscript>k,2</subscript>,...,r<subscript>k,D</subscript>) 
+evaluates
+</para>
+<para>
+||r<subscript>k</subscript>-c<subscript>i</subscript>||<superscript>2</superscript> = sum<subscript>j=1</subscript><superscript>D</superscript> |r<subscript>k,j</subscript>-c<subscript>i,j</subscript>|<superscript>2</superscript>
 </para>
+<para>
+for each of the O hypothesized ouput
+symbols c<subscript>i</subscript> = (c<subscript>i,1</subscript>,c<subscript>i,2</subscript>,...,c<subscript>i,D</subscript>) defined in the vector TABLE,
+where TABLE[i * D + j] = c<subscript>i,j</subscript>.
+</para></listitem>
+
 
+<listitem><para>
+TRELLIS_HARD_SYMBOL: for each D-dimensional vector 
+r<subscript>k</subscript>=
+(r<subscript>k,1</subscript>,r<subscript>k,2</subscript>,...,r<subscript>k,D</subscript>) 
+evaluates
+</para>
+<para>
+i<subscript>0</subscript>= argmax<subscript>i</subscript> ||r<subscript>k</subscript>-c<subscript>i</subscript>||<superscript>2</superscript> = 
+argmax<subscript>i</subscript> sum<subscript>j=1</subscript><superscript>D</superscript> |r<subscript>k,j</subscript>-c<subscript>i,j</subscript>|<superscript>2</superscript>
+</para>
+<para>
+and outputs a sequence of O floats of the form (0,...,0,1,0,...,0), where the 
+i<subscript>0</subscript> position is set to 1. This corresponds to generating hard inputs (based on the symbol-wise Hamming distance) to the Viterbi algorithm.
+</para></listitem>
+
+
+<listitem><para>
+TRELLIS_HARD_BIT (not yet implemented): for each D-dimensional vector 
+r<subscript>k</subscript>=
+(r<subscript>k,1</subscript>,r<subscript>k,2</subscript>,...,r<subscript>k,D</subscript>) 
+evaluates
+</para>
+<para>
+i<subscript>0</subscript>= argmax<subscript>i</subscript> ||r<subscript>k</subscript>-c<subscript>i</subscript>||<superscript>2</superscript> = 
+argmax<subscript>i</subscript> sum<subscript>j=1</subscript><superscript>D</superscript> (r<subscript>k,j</subscript>-c<subscript>i,j</subscript>)<superscript>2</superscript>
+</para>
+<para>
+and outputs a sequence of O floats of the form (d<subscript>1</subscript>,d<subscript>2</subscript>,...,d<subscript>O</subscript>), where the 
+d<subscript>i</subscript> is the bitwise Hamming distance between i and  i<subscript>0</subscript>. This corresponds to generating hard inputs (based on the bit-wise Hamming distance) to the Viterbi algorithm.
+</para></listitem>
+
+
+</itemizedlist>
+
+
+</para>
 </sect2>
 
 
 
 
+<!-- %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -->
+<sect2 id="viterbi_combined"><title>Combined Metrics Calculator and Viterbi Decoder</title>
+<para>
+Although the separation of metric calculation and Viterbi algorithm blocks
+is consistent with our goal of providing general blocks that can be easily 
+reused, this separation might result in large input/output buffer sizes
+betwen blocks. Indeed for an FSM with a large output alphabet, the 
+output of the metric block/input of the Viterbi block is FSM.O( ) floats for
+each trellis step. Sometimes this results in buffer overflow even for
+moderate sequence lengths.
+To overcome this problem we provide a block that incorporates the metric calculation and Viterbi algorithm into a single GNU Radio block, namely
+trellis.viterbi_combined_X( FSM, K, S0, SK, D, TABLE, TYPE) where the arguments are exactly those used in the aforementioned two blocks.
+</para>
+</sect2>
+
+
+
 
 
 </sect1>
@@ -400,7 +487,7 @@ error rate.
 The FSM is first intantiated in "main" by 
 </para>
 <programlisting>
- 62      f=trellis.fsm(fname) # get the FSM specification from a file (will hopefully be automated in the future...)
+ 62      f=trellis.fsm(fname) # get the FSM specification from a file
 </programlisting>
 
 
@@ -426,11 +513,11 @@ symbols that will drive the FSM encoder.
 
 
 <para>
-The FSM will produce K output symbols (remeber the FSM produces always one output symbol for each input symbol). Each of these symbols needs to be modulated. Since we are simulating the communication system, we need not simulate the actual waveforms. An M-ary, N-dimensional
-modulation is completely specified by a set of M, N-dimensional real vectors. In "fsm_utils.py" file we give a number of useful modulations with the following format: modulation = (N,constellation), where
-constellation=[c11,c12,...,c1N,c21,c22,...,c2N,...,cM1,cM2,...cMN].
+The FSM will produce K output symbols (remeber the FSM produces always one output symbol for each input symbol). Each of these symbols needs to be modulated. Since we are simulating the communication system, we need not simulate the actual waveforms. An M-ary, D-dimensional
+modulation is completely specified by a set of M, D-dimensional real vectors. In "fsm_utils.py" file we give a number of useful modulations with the following format: modulation = (D,constellation), where
+constellation=[c11,c12,...,c1D,c21,c22,...,c2D,...,cM1,cM2,...cMD].
 The meaning of the above is that every constellation point c_i
-is an N-dimnsional vector c_i=(ci1,ci2,...,ciN)
+is an D-dimnsional vector c_i=(ci1,ci2,...,ciD)
 For instance, 4-ary PAM is represented as
 (1,[-3, -1, 1, 3]), while QPSK is represented as
 (2,[1, 0, 0, 1, 0, -1, -1, 0]). In our example we choose QPSK modulation.
@@ -487,7 +574,7 @@ and an initial state (which is set to 0 in this example).
 We now need to modulate the FSM output symbols.
 The "chunks_to_symbols_sf" is essentially a memoryless mapper which 
 for each input symbol y_k 
-outputs a sequence of N numbers ci1,ci2,...,ciN  representing the 
+outputs a sequence of D numbers ci1,ci2,...,ciD  representing the 
 coordianates of the constellation symbol c_i with i=y_k.
 </para>
 <programlisting>
@@ -496,8 +583,8 @@ coordianates of the constellation symbol c_i with i=y_k.
 
 <para>
 The channel is AWGN with appropriate noise variance.
-For each transmitted symbol c_k=(ck1,ck2,...,ckN) we receive a noisy version
-r_k=(rk1,rk2,...,rkN).
+For each transmitted symbol c_k=(ck1,ck2,...,ckD) we receive a noisy version
+r_k=(rk1,rk2,...,rkD).
 </para>
 <programlisting>
  22      # CHANNEL
@@ -522,10 +609,10 @@ This means that for each time period we need to evaluate
 O such numbers (one for each possible output symbol y_k). 
 This is done 
 in "metrics_f". In particular, metrics_f is a memoryless device
-taking N inputs at a time and producing O outputs. The N inputs are
-rk1,rk2,...,rkN.
+taking D inputs at a time and producing O outputs. The D inputs are
+rk1,rk2,...,rkD.
 The O outputs
-are the costs associated with observations rk1,rk2,...,rkN and
+are the costs associated with observations rk1,rk2,...,rkD and
 hypothesized output symbols c_1,c_2,...,c_M. For instance,
 if we choose to perform soft-input VA, we need to evaluate
 the Euclidean distance between r_k and each of c_1,c_2,...,c_M,
@@ -592,7 +679,7 @@ automate fsm generation from rational functions
 
 <listitem>
 <para>
-Optimize the VA code.
+Optimize the VA code if possible.
 </para>
 </listitem>
 
index bf93a421f87e74843f09a83e79d25f95e2bc17e6..e2429b80c0057033c721d9c411303d0ce5cd94a2 100644 (file)
@@ -59,7 +59,7 @@ def main(args):
         sys.exit (1)
 
     # system parameters
-    f=trellis.fsm(fname) # get the FSM specification from a file (will hopefully be automated in the future...)
+    f=trellis.fsm(fname) # get the FSM specification from a file
     Kb=1024*16  # packet size in bits (make it multiple of 16 so it can be packed in a short)
     bitspersymbol = int(round(math.log(f.I())/math.log(2))) # bits per FSM input symbol
     K=Kb/bitspersymbol # packet size in trellis steps
index ff15f4476cc7133cea5861318a92a0983d08146a..c8d11d303f626749767ded29c1916ff09e5b817b 100644 (file)
@@ -61,7 +61,7 @@
  59          sys.exit (1)
  60  
  61      # system parameters
- 62      f=trellis.fsm(fname) # get the FSM specification from a file (will hopefully be automated in the future...)
+ 62      f=trellis.fsm(fname) # get the FSM specification from a file
  63      Kb=1024*16  # packet size in bits (make it multiple of 16 so it can be packed in a short)
  64      bitspersymbol = int(round(math.log(f.I())/math.log(2))) # bits per FSM input symbol
  65      K=Kb/bitspersymbol # packet size in trellis steps
index b17fae54c66f40bfa7bc1637f23b593f9f9e94ac..5e8a912d94d5fe74aef86cfa4d81227484aceaaa 100644 (file)
@@ -97,7 +97,7 @@ interleaver::interleaver(int K, unsigned int seed)
     d_INTER[i]=i;
     tmp[i] = rand(); 
   }
-  //quicksort_index <int> (tmp,d_INTER,0,d_K-1); got to resolve this...
+  //quicksort_index <int> (tmp,d_INTER,0,d_K-1); //got to resolve this...
   quicksort_index1 (tmp,d_INTER,0,d_K-1);
 
   // generate DEINTER table
index 5faa4b7c70bd4c3d2a1ab02da6f9d9383fd068e0..4c502b81bacbfc5f96710afc569171874a015388 100644 (file)
@@ -24,7 +24,9 @@
 #include <stdexcept>
 #include "trellis_calc_metric.h"
 
-void calc_metric_s(int O, int D, const std::vector<short> &TABLE, const short *in, float *metric, trellis_metric_type_t type)
+
+
+void calc_metric(int O, int D, const std::vector<short> &TABLE, const short *in, float *metric, trellis_metric_type_t type)
 {
   float minm = FLT_MAX;
   int minmi = 0;
@@ -64,8 +66,7 @@ void calc_metric_s(int O, int D, const std::vector<short> &TABLE, const short *i
 }
 
 
-
-void calc_metric_i(int O, int D, const std::vector<int> &TABLE, const int *in, float *metric, trellis_metric_type_t type)
+void calc_metric(int O, int D, const std::vector<int> &TABLE, const int *in, float *metric, trellis_metric_type_t type)
 {
   float minm = FLT_MAX;
   int minmi = 0;
@@ -106,7 +107,7 @@ void calc_metric_i(int O, int D, const std::vector<int> &TABLE, const int *in, f
 
 
 
-void calc_metric_f(int O, int D, const std::vector<float> &TABLE, const float *in, float *metric, trellis_metric_type_t type)
+void calc_metric(int O, int D, const std::vector<float> &TABLE, const float *in, float *metric, trellis_metric_type_t type)
 {
   float minm = FLT_MAX;
   int minmi = 0;
@@ -146,7 +147,7 @@ void calc_metric_f(int O, int D, const std::vector<float> &TABLE, const float *i
 }
 
 
-void calc_metric_c(int O, int D, const std::vector<gr_complex> &TABLE, const gr_complex *in, float *metric, trellis_metric_type_t type)
+void calc_metric(int O, int D, const std::vector<gr_complex> &TABLE, const gr_complex *in, float *metric, trellis_metric_type_t type)
 {
   float minm = FLT_MAX;
   int minmi = 0;
@@ -183,3 +184,47 @@ void calc_metric_c(int O, int D, const std::vector<gr_complex> &TABLE, const gr_
     throw std::runtime_error ("Invalid metric type.");
   }
 }
+
+
+/*
+template <class T> void calc_metric(int O, int D, const std::vector<T> &TABLE, const T *in, float *metric, trellis_metric_type_t type)
+{
+  float minm = FLT_MAX;
+  int minmi = 0;
+
+  switch (type){
+  case TRELLIS_EUCLIDEAN:
+    for(int o=0;o<O;o++) {
+      metric[o]=0.0;
+      for (int m=0;m<D;m++) {
+        T s=in[m]-TABLE[o*D+m];
+        gr_complex sc(1.0*s,0);
+        metric[o]+=(s*conj(s)).real();
+      }
+    }
+    break;
+  case TRELLIS_HARD_SYMBOL:
+    for(int o=0;o<O;o++) {
+      metric[o]=0.0;
+      for (int m=0;m<D;m++) {
+        T s=in[m]-TABLE[o*D+m];
+        gr_complex sc(1.0*s,0);
+        metric[o]+=(s*conj(s)).real();
+      }
+      if(metric[o]<minm) {
+        minm=metric[o];
+        minmi=o;
+      }
+    }
+    for(int o=0;o<O;o++) {
+      metric[o] = (o==minmi?0.0:1.0);
+    }
+    break;
+  case TRELLIS_HARD_BIT:
+    throw std::runtime_error ("Invalid metric type (not yet implemented).");
+    break;
+  default:
+    throw std::runtime_error ("Invalid metric type.");
+  }
+}
+*/
index 0f66d82d87a4c786597f7d2a68a0d91d67de2c31..4c090584b141314d878353c11c4d36109f1cc6a0 100644 (file)
 #include <gr_complex.h>
 #include <trellis_metric_type.h>
 
-void calc_metric_s(int O, int D, const std::vector<short> &TABLE, const short *in, float *metric, trellis_metric_type_t type);
 
-void calc_metric_i(int O, int D, const std::vector<int> &TABLE, const int *in, float *metric, trellis_metric_type_t type);
+void calc_metric(int O, int D, const std::vector<short> &TABLE, const short *in, float *metric, trellis_metric_type_t type);
 
-void calc_metric_f(int O, int D, const std::vector<float> &TABLE, const float *in, float *metric, trellis_metric_type_t type);
+void calc_metric(int O, int D, const std::vector<int> &TABLE, const int *in, float *metric, trellis_metric_type_t type);
 
-void calc_metric_c(int O, int D, const std::vector<gr_complex> &TABLE, const gr_complex *in, float *metric, trellis_metric_type_t type);
+void calc_metric(int O, int D, const std::vector<float> &TABLE, const float *in, float *metric, trellis_metric_type_t type);
+
+void calc_metric(int O, int D, const std::vector<gr_complex> &TABLE, const gr_complex *in, float *metric, trellis_metric_type_t type);
+
+
+//template <class T> void calc_metric(int O, int D, const std::vector<T> &TABLE, const T *in, float *metric, trellis_metric_type_t type);
 
 #endif
index 7ace0298a575bd3a02e3957199ab51b706ef17d5..cd11dc9c7f730726d03878614082b27a814e682d 100644 (file)
@@ -83,6 +83,7 @@ for (int m=0;m<nstreams;m++) {
   float *out = (float *) output_items[m];
 
   for (int i = 0; i < noutput_items / d_O ; i++){
+/*
 #if @IS_SHORT@
     calc_metric_s(d_O, d_D, d_TABLE,&(in[i*d_D]),&(out[i*d_O]), d_TYPE);
 #elif @IS_INT@
@@ -92,6 +93,8 @@ for (int m=0;m<nstreams;m++) {
 #elif @IS_COMPLEX@
     calc_metric_c(d_O, d_D, d_TABLE,&(in[i*d_D]),&(out[i*d_O]), d_TYPE);
 #endif
+*/
+    calc_metric(d_O, d_D, d_TABLE,&(in[i*d_D]),&(out[i*d_O]), d_TYPE);
   } 
 }
 
index d80f2e7d7b7386e9ec7213cbc0415864e2f6f8be..59d35bd6d816c594a6f6b2576d0bda9efa7afbff 100644 (file)
@@ -83,6 +83,7 @@ for (int m=0;m<nstreams;m++) {
   float *out = (float *) output_items[m];
 
   for (int i = 0; i < noutput_items / d_O ; i++){
+/*
 #if 0
     calc_metric_s(d_O, d_D, d_TABLE,&(in[i*d_D]),&(out[i*d_O]), d_TYPE);
 #elif 0
@@ -92,6 +93,8 @@ for (int m=0;m<nstreams;m++) {
 #elif 1
     calc_metric_c(d_O, d_D, d_TABLE,&(in[i*d_D]),&(out[i*d_O]), d_TYPE);
 #endif
+*/
+    calc_metric(d_O, d_D, d_TABLE,&(in[i*d_D]),&(out[i*d_O]), d_TYPE);
   } 
 }
 
index 69e4a99df692a7ed63e9277cc7b4fb46c5734e86..58d4d41c2296563aa07788b6af592d890ee41881 100644 (file)
@@ -83,6 +83,7 @@ for (int m=0;m<nstreams;m++) {
   float *out = (float *) output_items[m];
 
   for (int i = 0; i < noutput_items / d_O ; i++){
+/*
 #if 0
     calc_metric_s(d_O, d_D, d_TABLE,&(in[i*d_D]),&(out[i*d_O]), d_TYPE);
 #elif 0
@@ -92,6 +93,8 @@ for (int m=0;m<nstreams;m++) {
 #elif 0
     calc_metric_c(d_O, d_D, d_TABLE,&(in[i*d_D]),&(out[i*d_O]), d_TYPE);
 #endif
+*/
+    calc_metric(d_O, d_D, d_TABLE,&(in[i*d_D]),&(out[i*d_O]), d_TYPE);
   } 
 }
 
index b0fa85fa0b857e142cb2dc2ea6e96740cd910da8..edd628c0f97b04c59d53c64c1a6194fc354f744d 100644 (file)
@@ -83,6 +83,7 @@ for (int m=0;m<nstreams;m++) {
   float *out = (float *) output_items[m];
 
   for (int i = 0; i < noutput_items / d_O ; i++){
+/*
 #if 0
     calc_metric_s(d_O, d_D, d_TABLE,&(in[i*d_D]),&(out[i*d_O]), d_TYPE);
 #elif 1
@@ -92,6 +93,8 @@ for (int m=0;m<nstreams;m++) {
 #elif 0
     calc_metric_c(d_O, d_D, d_TABLE,&(in[i*d_D]),&(out[i*d_O]), d_TYPE);
 #endif
+*/
+    calc_metric(d_O, d_D, d_TABLE,&(in[i*d_D]),&(out[i*d_O]), d_TYPE);
   } 
 }
 
index 07b4097262ba1c0d35e0dc18e6c303dfebbfde48..4c04169a5985f10d8fd12178d430bf29254c588f 100644 (file)
@@ -83,6 +83,7 @@ for (int m=0;m<nstreams;m++) {
   float *out = (float *) output_items[m];
 
   for (int i = 0; i < noutput_items / d_O ; i++){
+/*
 #if 1
     calc_metric_s(d_O, d_D, d_TABLE,&(in[i*d_D]),&(out[i*d_O]), d_TYPE);
 #elif 0
@@ -92,6 +93,8 @@ for (int m=0;m<nstreams;m++) {
 #elif 0
     calc_metric_c(d_O, d_D, d_TABLE,&(in[i*d_D]),&(out[i*d_O]), d_TYPE);
 #endif
+*/
+    calc_metric(d_O, d_D, d_TABLE,&(in[i*d_D]),&(out[i*d_O]), d_TYPE);
   } 
 }
 
index 61cf6f8bf4d6f352ab9ea155a508a41193dc4447..6d9c013a8556c8fb2912594c6e148f4d00047dc5 100644 (file)
@@ -167,7 +167,7 @@ void siso_algorithm_combined(int I, int S, int O,
   }
 
   for(int k=0;k<K;k++) { // forward recursion
-      calc_metric_f(O, D, TABLE, &(observations[k*D]), &(prioro[k*O]),TYPE); // calc metrics
+      calc_metric(O, D, TABLE, &(observations[k*D]), &(prioro[k*O]),TYPE); // calc metrics
       norm=INF;
       for(int j=0;j<S;j++) {
           minm=INF;
index 76b7fb38af35fbd1a3d6d16fbfcff4ebc473301b..14ea0d17ce789d536f0223ce2e0cc422282f18b7 100644 (file)
@@ -114,7 +114,7 @@ void viterbi_algorithm_combined(int I, int S, int O,
 
   alphai=0;
   for(int k=0;k<K;k++) {
-      calc_metric_f(O, D, TABLE, &(in[k*D]), metric,TYPE); // calc metrics
+      calc_metric(O, D, TABLE, &(in[k*D]), metric,TYPE); // calc metrics
       norm=INF;
       for(int j=0;j<S;j++) { // for each next state do ACS
           minm=INF;
index 86501ac76545072950a50c4347d2a92a2630566e..e91d48ff9cfabae74e7edf27b12b16f2e5dc4f59 100644 (file)
@@ -114,7 +114,7 @@ void viterbi_algorithm_combined(int I, int S, int O,
 
   alphai=0;
   for(int k=0;k<K;k++) {
-      calc_metric_f(O, D, TABLE, &(in[k*D]), metric,TYPE); // calc metrics
+      calc_metric(O, D, TABLE, &(in[k*D]), metric,TYPE); // calc metrics
       norm=INF;
       for(int j=0;j<S;j++) { // for each next state do ACS
           minm=INF;
index a92e7b35db9edbf16798b5316282511430e2b701..150f80a14e9ead43fa0a2df30b8b50ecba9ad8a4 100644 (file)
@@ -114,7 +114,7 @@ void viterbi_algorithm_combined(int I, int S, int O,
 
   alphai=0;
   for(int k=0;k<K;k++) {
-      calc_metric_f(O, D, TABLE, &(in[k*D]), metric,TYPE); // calc metrics
+      calc_metric(O, D, TABLE, &(in[k*D]), metric,TYPE); // calc metrics
       norm=INF;
       for(int j=0;j<S;j++) { // for each next state do ACS
           minm=INF;
index b664f6e95581f034d80d25610e3ae43a6e01738b..320189296e0fe27f8e234975108078f37cd707aa 100644 (file)
@@ -114,7 +114,7 @@ void viterbi_algorithm_combined(int I, int S, int O,
 
   alphai=0;
   for(int k=0;k<K;k++) {
-      calc_metric_f(O, D, TABLE, &(in[k*D]), metric,TYPE); // calc metrics
+      calc_metric(O, D, TABLE, &(in[k*D]), metric,TYPE); // calc metrics
       norm=INF;
       for(int j=0;j<S;j++) { // for each next state do ACS
           minm=INF;