diff options
Diffstat (limited to 'gr-trellis/src/lib/trellis_viterbi_combined_b.cc')
-rw-r--r-- | gr-trellis/src/lib/trellis_viterbi_combined_b.cc | 29 |
1 files changed, 15 insertions, 14 deletions
diff --git a/gr-trellis/src/lib/trellis_viterbi_combined_b.cc b/gr-trellis/src/lib/trellis_viterbi_combined_b.cc index 2d245f58b..86501ac76 100644 --- a/gr-trellis/src/lib/trellis_viterbi_combined_b.cc +++ b/gr-trellis/src/lib/trellis_viterbi_combined_b.cc @@ -34,35 +34,35 @@ static const float INF = 1.0e9; trellis_viterbi_combined_b_sptr trellis_make_viterbi_combined_b ( const fsm &FSM, - int D, - const std::vector<float> &TABLE, int K, int S0, int SK, + int D, + const std::vector<float> &TABLE, trellis_metric_type_t TYPE) { - return trellis_viterbi_combined_b_sptr (new trellis_viterbi_combined_b (FSM,D,TABLE,K,S0,SK,TYPE)); + return trellis_viterbi_combined_b_sptr (new trellis_viterbi_combined_b (FSM,K,S0,SK,D,TABLE,TYPE)); } trellis_viterbi_combined_b::trellis_viterbi_combined_b ( const fsm &FSM, - int D, - const std::vector<float> &TABLE, int K, int S0, int SK, + int D, + const std::vector<float> &TABLE, trellis_metric_type_t TYPE) : gr_block ("viterbi_combined_b", gr_make_io_signature (1, -1, sizeof (float)), gr_make_io_signature (1, -1, sizeof (unsigned char))), d_FSM (FSM), - d_D (D), - d_TABLE (TABLE), d_K (K), d_S0 (S0), d_SK (SK), - d_TYPE (TYPE), - d_trace(FSM.S()*K) + d_D (D), + d_TABLE (TABLE), + d_TYPE (TYPE)//, + //d_trace(FSM.S()*K) { set_relative_rate (1.0 / ((double) d_D)); set_output_multiple (d_K); @@ -88,14 +88,15 @@ void viterbi_algorithm_combined(int I, int S, int O, const std::vector<int> &OS, const std::vector<int> &PS, const std::vector<int> &PI, - int D, - const std::vector<float> &TABLE, int K, int S0,int SK, + int D, + const std::vector<float> &TABLE, trellis_metric_type_t TYPE, - const float *in, unsigned char *out, - std::vector<int> &trace) + const float *in, unsigned char *out)//, + //std::vector<int> &trace) { + std::vector<int> trace(S*K); std::vector<float> alpha(S*2); float *metric = new float[O]; int alphai; @@ -173,7 +174,7 @@ trellis_viterbi_combined_b::general_work (int noutput_items, const float *in = (const float *) input_items[m]; unsigned char *out = (unsigned char *) output_items[m]; for (int n=0;n<nblocks;n++) { - viterbi_algorithm_combined(d_FSM.I(),d_FSM.S(),d_FSM.O(),d_FSM.NS(),d_FSM.OS(),d_FSM.PS(),d_FSM.PI(),d_D,d_TABLE,d_K,d_S0,d_SK,d_TYPE,&(in[n*d_K*d_D]),&(out[n*d_K]),d_trace); + viterbi_algorithm_combined(d_FSM.I(),d_FSM.S(),d_FSM.O(),d_FSM.NS(),d_FSM.OS(),d_FSM.PS(),d_FSM.PI(),d_K,d_S0,d_SK,d_D,d_TABLE,d_TYPE,&(in[n*d_K*d_D]),&(out[n*d_K]));//,d_trace); } } |