-
Notifications
You must be signed in to change notification settings - Fork 5
/
CONVOLUTION.h
60 lines (41 loc) · 1.33 KB
/
CONVOLUTION.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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
/********************************************************************************************
* CONVOLUTION Arduino library
* Created 15/05/2015
* Anthony LE CREN [email protected]
* Modified 24/07/2015
* fix bug data ptr upper than 32
* BSD license, all text above must be included in any redistribution
*
* Instance :
*
* Functions :
*
*******************************************************************************************/
#ifndef CONVOLUTION_H
#define CONVOLUTION_H
#include <Arduino.h>
class CONVOLUTION
{
public:
CONVOLUTION();
void convolution(byte *input, byte *output);
void pseudo_random(byte *array);
void interleave(byte *array);
void add_crc(byte *array);
boolean check_crc(byte *array);
void noise(byte *output,byte nb_noising,byte mode);
void viterbi(byte* output,byte* history,byte* decoded);
void print_data(byte * array);
void print_data_bis(byte * array);
int size_buffer;
unsigned int crc;
byte acc_error[2][4];
private:
void fcsbit(byte tbyte);
void compute_crc(byte *array);
void compute_error_branch(int ptr,byte current_state, byte encoded_input,byte* history);
byte hamming_distance(byte encoder_channel,byte encoded_input);
byte set_position(byte value, byte next_state, byte current_state);
};
extern CONVOLUTION Convolve;
#endif