-
Notifications
You must be signed in to change notification settings - Fork 10
/
libconvcodes.h
36 lines (28 loc) · 1.07 KB
/
libconvcodes.h
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
//
// Created by gianluca on 20/02/17.
//
#ifndef DEEPSPACE_TURBO_LIBCONVCODES_H
#define DEEPSPACE_TURBO_LIBCONVCODES_H
typedef struct str_convcode{
int components;
int memory;
int **forward_connections;
int *backward_connections;
int **next_state;
int **neighbors;
int ***output;
} t_convcode;
int get_bit(int num, int position);
char* state2str(int state, int memory);
int convcode_stateupdate(int state, int input, t_convcode *code);
int *convcode_output(int state, int input, t_convcode *code);
t_convcode *convcode_initialize(char *forward[], char *backward, int N_components);
void convcode_clear(t_convcode *code);
int* convcode_encode(int *packet, int packet_length, t_convcode *code);
int* convcode_decode(double *received, int length, t_convcode *code);
void print_neighbors(t_convcode *code);
// BCJR decoding
int * convcode_extrinsic(double *received, double length, double ***a_priori, t_convcode *code, double noise_variance,
int decision);
static double exp_sum(double a, double b);
#endif //DEEPSPACE_TURBO_LIBCONVCODES_H