summaryrefslogtreecommitdiff
path: root/gr-trellis/src/lib/trellis_viterbi_combined_s.cc
diff options
context:
space:
mode:
authoranastas2006-08-23 05:18:04 +0000
committeranastas2006-08-23 05:18:04 +0000
commit979ae071d508762513981a063961551b59199081 (patch)
tree672f7711baf0404b3304c86f93f76fd263afe80c /gr-trellis/src/lib/trellis_viterbi_combined_s.cc
parent180347e40854f865a1592af729a00236f061d039 (diff)
downloadgnuradio-979ae071d508762513981a063961551b59199081.tar.gz
gnuradio-979ae071d508762513981a063961551b59199081.tar.bz2
gnuradio-979ae071d508762513981a063961551b59199081.zip
clean-up of Viterbi blocks: d_trace is not a private variable anymore but a local variable
git-svn-id: http://gnuradio.org/svn/gnuradio/trunk@3382 221aa14e-8319-0410-a670-987f0aec2ac5
Diffstat (limited to 'gr-trellis/src/lib/trellis_viterbi_combined_s.cc')
-rw-r--r--gr-trellis/src/lib/trellis_viterbi_combined_s.cc29
1 files changed, 15 insertions, 14 deletions
diff --git a/gr-trellis/src/lib/trellis_viterbi_combined_s.cc b/gr-trellis/src/lib/trellis_viterbi_combined_s.cc
index f103db229..b664f6e95 100644
--- a/gr-trellis/src/lib/trellis_viterbi_combined_s.cc
+++ b/gr-trellis/src/lib/trellis_viterbi_combined_s.cc
@@ -34,35 +34,35 @@ static const float INF = 1.0e9;
trellis_viterbi_combined_s_sptr
trellis_make_viterbi_combined_s (
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_s_sptr (new trellis_viterbi_combined_s (FSM,D,TABLE,K,S0,SK,TYPE));
+ return trellis_viterbi_combined_s_sptr (new trellis_viterbi_combined_s (FSM,K,S0,SK,D,TABLE,TYPE));
}
trellis_viterbi_combined_s::trellis_viterbi_combined_s (
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_s",
gr_make_io_signature (1, -1, sizeof (float)),
gr_make_io_signature (1, -1, sizeof (short))),
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, short *out,
- std::vector<int> &trace)
+ const float *in, short *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_s::general_work (int noutput_items,
const float *in = (const float *) input_items[m];
short *out = (short *) 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);
}
}