1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43
| #include "conv_code_delay.hpp"
#include <itpp/itcomm.h>
#include <math.h>
namespace itpp
{
...
bvec Convolutional_Code_derived::sdvd(cvec deinterleaved_symbol,int g[2][K], float es_ovr_n0, long channel_length)
{
int *decoder_output_matrix;
int i, j, l, ll; /* loop variables */
long t; /* time */
int memory_contents[K]; /* input + conv. encoder sr */
int input[TWOTOTHEM][TWOTOTHEM]; /* maps current/nxt sts to input */
int output[TWOTOTHEM][2]; /* gives conv. encoder output */
int nextstate[TWOTOTHEM][2]; /* for current st, gives nxt given input */
int accum_err_metric[TWOTOTHEM][2]; /* accumulated error metrics */
int state_history[TWOTOTHEM][K * 5 + 1]; /* state history table */
int state_sequence[K * 5 + 1]; /* state sequence list */
int *channel_output_matrix; /* ptr to input matrix */
int binary_output[2]; /* vector to store binary enc output */
int branch_output[2]; /* vector to store trial enc output */
int m, n, number_of_states, depth_of_trellis, step, branch_metric,
sh_ptr, sh_col, x, xx, h, hh, next_state, last_stop; /* misc variables */
.....
branch_metric += branch_metric + abs( *( channel_output_matrix +
( 0 * channel_length + t ) ) - 7 * binary_output[0] ) +
abs( *( channel_output_matrix +
( 1 * channel_length + t ) ) - 7 * binary_output[1] );
...
} |
Partager