summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xgr-trellis/src/examples/test_sccc_turbo1.py2
-rw-r--r--gr-trellis/src/lib/core_algorithms.cc11
-rw-r--r--gr-trellis/src/lib/core_algorithms.h1
-rw-r--r--gr-trellis/src/lib/trellis_sccc_decoder_combined_XX.cc.t18
-rw-r--r--gr-trellis/src/lib/trellis_sccc_decoder_combined_XX.h.t12
-rw-r--r--gr-trellis/src/lib/trellis_sccc_decoder_combined_XX.i.t8
6 files changed, 41 insertions, 11 deletions
diff --git a/gr-trellis/src/examples/test_sccc_turbo1.py b/gr-trellis/src/examples/test_sccc_turbo1.py
index 59b2c2bfe..8a630c0d4 100755
--- a/gr-trellis/src/examples/test_sccc_turbo1.py
+++ b/gr-trellis/src/examples/test_sccc_turbo1.py
@@ -24,7 +24,7 @@ def run_test (fo,fi,interleaver,Kb,bitspersymbol,K,dimensionality,constellation,
noise = gr.noise_source_f(gr.GR_GAUSSIAN,math.sqrt(N0/2),seed)
# RX
- dec = trellis.sccc_decoder_combined_fs(fo,0,-1,fi,0,-1,interleaver,K,IT,trellis.TRELLIS_MIN_SUM,dimensionality,constellation,trellis.TRELLIS_EUCLIDEAN)
+ dec = trellis.sccc_decoder_combined_fs(fo,0,-1,fi,0,-1,interleaver,K,IT,trellis.TRELLIS_MIN_SUM,dimensionality,constellation,trellis.TRELLIS_EUCLIDEAN,1.0)
fsmi2s = gr.unpacked_to_packed_ss(bitspersymbol,gr.GR_MSB_FIRST) # pack FSM input symbols to shorts
dst = gr.check_lfsr_32k_s()
diff --git a/gr-trellis/src/lib/core_algorithms.cc b/gr-trellis/src/lib/core_algorithms.cc
index b81e14965..c1bafa379 100644
--- a/gr-trellis/src/lib/core_algorithms.cc
+++ b/gr-trellis/src/lib/core_algorithms.cc
@@ -786,6 +786,7 @@ void sccc_decoder_combined(
float (*p2mymin)(float,float),
int D, const std::vector<Ti> &TABLE,
trellis_metric_type_t METRIC_TYPE,
+ float scaling,
const Ti *observations, To *data
)
{
@@ -802,8 +803,10 @@ std::vector<float> oposti(blocklength*FSMo.I());
std::vector<float> oposto(blocklength*FSMo.O());
// turn observations to neg-log-priors
-for(int k=0;k<blocklength;k++)
+for(int k=0;k<blocklength;k++) {
calc_metric(FSMi.O(), D, TABLE, &(observations[k*D]), &(iprioro[k*FSMi.O()]),METRIC_TYPE);
+ iprioro[k*FSMi.O()] *= scaling;
+}
for(int rep=0;rep<repetitions;rep++) {
// run inner SISO
@@ -896,6 +899,7 @@ void sccc_decoder_combined<float,unsigned char>(
float (*p2mymin)(float,float),
int D, const std::vector<float> &TABLE,
trellis_metric_type_t METRIC_TYPE,
+ float scaling,
const float *observations, unsigned char *data
);
@@ -907,6 +911,7 @@ void sccc_decoder_combined<float,short>(
float (*p2mymin)(float,float),
int D, const std::vector<float> &TABLE,
trellis_metric_type_t METRIC_TYPE,
+ float scaling,
const float *observations, short *data
);
@@ -918,6 +923,7 @@ void sccc_decoder_combined<float,int>(
float (*p2mymin)(float,float),
int D, const std::vector<float> &TABLE,
trellis_metric_type_t METRIC_TYPE,
+ float scaling,
const float *observations, int *data
);
@@ -929,6 +935,7 @@ void sccc_decoder_combined<gr_complex,unsigned char>(
float (*p2mymin)(float,float),
int D, const std::vector<gr_complex> &TABLE,
trellis_metric_type_t METRIC_TYPE,
+ float scaling,
const gr_complex *observations, unsigned char *data
);
@@ -940,6 +947,7 @@ void sccc_decoder_combined<gr_complex,short>(
float (*p2mymin)(float,float),
int D, const std::vector<gr_complex> &TABLE,
trellis_metric_type_t METRIC_TYPE,
+ float scaling,
const gr_complex *observations, short *data
);
@@ -951,6 +959,7 @@ void sccc_decoder_combined<gr_complex,int>(
float (*p2mymin)(float,float),
int D, const std::vector<gr_complex> &TABLE,
trellis_metric_type_t METRIC_TYPE,
+ float scaling,
const gr_complex *observations, int *data
);
diff --git a/gr-trellis/src/lib/core_algorithms.h b/gr-trellis/src/lib/core_algorithms.h
index ad1b48057..8e4ffe522 100644
--- a/gr-trellis/src/lib/core_algorithms.h
+++ b/gr-trellis/src/lib/core_algorithms.h
@@ -99,6 +99,7 @@ void sccc_decoder_combined(
float (*p2mymin)(float,float),
int D, const std::vector<Ti> &TABLE,
trellis_metric_type_t METRIC_TYPE,
+ float scaling,
const Ti *observations, To *data
);
diff --git a/gr-trellis/src/lib/trellis_sccc_decoder_combined_XX.cc.t b/gr-trellis/src/lib/trellis_sccc_decoder_combined_XX.cc.t
index ce8df037a..62532bd4e 100644
--- a/gr-trellis/src/lib/trellis_sccc_decoder_combined_XX.cc.t
+++ b/gr-trellis/src/lib/trellis_sccc_decoder_combined_XX.cc.t
@@ -45,7 +45,8 @@ trellis_make_@BASE_NAME@ (
trellis_siso_type_t SISO_TYPE,
int D,
const std::vector<@I_TYPE@> &TABLE,
- trellis_metric_type_t METRIC_TYPE
+ trellis_metric_type_t METRIC_TYPE,
+ float scaling
)
{
return gnuradio::get_initial_sptr (new @NAME@ (
@@ -56,7 +57,8 @@ trellis_make_@BASE_NAME@ (
repetitions,
SISO_TYPE,
D,
- TABLE,METRIC_TYPE
+ TABLE,METRIC_TYPE,
+ scaling
));
}
@@ -69,7 +71,8 @@ trellis_make_@BASE_NAME@ (
trellis_siso_type_t SISO_TYPE,
int D,
const std::vector<@I_TYPE@> &TABLE,
- trellis_metric_type_t METRIC_TYPE
+ trellis_metric_type_t METRIC_TYPE,
+ float scaling
)
: gr_block ("@BASE_NAME@",
gr_make_io_signature (1, 1, sizeof (@I_TYPE@)),
@@ -82,12 +85,18 @@ trellis_make_@BASE_NAME@ (
d_SISO_TYPE (SISO_TYPE),
d_D (D),
d_TABLE (TABLE),
- d_METRIC_TYPE (METRIC_TYPE)
+ d_METRIC_TYPE (METRIC_TYPE),
+ d_scaling (scaling)
{
set_relative_rate (1.0 / ((double) d_D));
set_output_multiple (d_blocklength);
}
+void @NAME@::set_scaling(float scaling)
+{
+ d_scaling = scaling;
+}
+
void
@NAME@::forecast (int noutput_items, gr_vector_int &ninput_items_required)
@@ -127,6 +136,7 @@ int
p2min,
d_D,d_TABLE,
d_METRIC_TYPE,
+ d_scaling,
&(in[n*d_blocklength*d_D]),&(out[n*d_blocklength])
);
}
diff --git a/gr-trellis/src/lib/trellis_sccc_decoder_combined_XX.h.t b/gr-trellis/src/lib/trellis_sccc_decoder_combined_XX.h.t
index e878c4d6e..146c26516 100644
--- a/gr-trellis/src/lib/trellis_sccc_decoder_combined_XX.h.t
+++ b/gr-trellis/src/lib/trellis_sccc_decoder_combined_XX.h.t
@@ -44,7 +44,8 @@ typedef boost::shared_ptr<@NAME@> @SPTR_NAME@;
trellis_siso_type_t SISO_TYPE, // perform "min-sum" or "sum-product" combining
int D,
const std::vector<@I_TYPE@> &TABLE,
- trellis_metric_type_t METRIC_TYPE
+ trellis_metric_type_t METRIC_TYPE,
+ float scaling
);
@@ -66,6 +67,7 @@ class @NAME@ : public gr_block
int d_D;
std::vector<@I_TYPE@> d_TABLE;
trellis_metric_type_t d_METRIC_TYPE;
+ float d_scaling;
std::vector<float> d_buffer;
friend @SPTR_NAME@ trellis_make_@BASE_NAME@ (
@@ -77,7 +79,8 @@ class @NAME@ : public gr_block
trellis_siso_type_t SISO_TYPE,
int D,
const std::vector<@I_TYPE@> &TABLE,
- trellis_metric_type_t METRIC_TYPE
+ trellis_metric_type_t METRIC_TYPE,
+ float scaling
);
@NAME@ (
@@ -89,7 +92,8 @@ class @NAME@ : public gr_block
trellis_siso_type_t SISO_TYPE,
int D,
const std::vector<@I_TYPE@> &TABLE,
- trellis_metric_type_t METRIC_TYPE
+ trellis_metric_type_t METRIC_TYPE,
+ float scaling
);
public:
@@ -106,6 +110,8 @@ public:
std::vector<@I_TYPE@> TABLE () const { return d_TABLE; }
trellis_metric_type_t METRIC_TYPE () const { return d_METRIC_TYPE; }
trellis_siso_type_t SISO_TYPE () const { return d_SISO_TYPE; }
+ float scaling () const { return d_scaling; }
+ void set_scaling (float scaling);
void forecast (int noutput_items,
gr_vector_int &ninput_items_required);
diff --git a/gr-trellis/src/lib/trellis_sccc_decoder_combined_XX.i.t b/gr-trellis/src/lib/trellis_sccc_decoder_combined_XX.i.t
index 80c906401..84f2eb07d 100644
--- a/gr-trellis/src/lib/trellis_sccc_decoder_combined_XX.i.t
+++ b/gr-trellis/src/lib/trellis_sccc_decoder_combined_XX.i.t
@@ -33,7 +33,8 @@ GR_SWIG_BLOCK_MAGIC(trellis,@BASE_NAME@);
trellis_siso_type_t SISO_TYPE,
int D,
const std::vector<@I_TYPE@> &TABLE,
- trellis_metric_type_t METRIC_TYPE
+ trellis_metric_type_t METRIC_TYPE,
+ float scaling
);
@@ -49,7 +50,8 @@ private:
trellis_siso_type_t SISO_TYPE,
int D,
const std::vector<@I_TYPE@> &TABLE,
- trellis_metric_type_t METRIC_TYPE
+ trellis_metric_type_t METRIC_TYPE,
+ float scaling
);
public:
@@ -66,4 +68,6 @@ public:
std::vector<@I_TYPE@> TABLE () const { return d_TABLE; }
trellis_metric_type_t METRIC_TYPE () const { return d_METRIC_TYPE; }
trellis_siso_type_t SISO_TYPE () const { return d_SISO_TYPE; }
+ float scaling() const { return d_scaling; }
+ void set_scaling (float scaling);
};