-
Notifications
You must be signed in to change notification settings - Fork 0
/
decoder.h
72 lines (71 loc) · 1.7 KB
/
decoder.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
61
62
63
64
65
66
67
68
69
70
71
72
#pragma once
#include "node.h"
/* Binary Convolutional Codes Decoder */
class decoder {
public:
/*
Description: Binary Convolutional Codes Decoder Constructor.
Parameters:
- void
Returns:
- void
*/
decoder();
/*
Description: encode one bit of message and return encoded .
Parameters:
- unsigned __int8 received bit
Returns:
- unsigned __int8 decoded message
*/
unsigned __int8 decode(unsigned __int8 recv);
~decoder(); // class destructor
private:
/*
Description: print decoded message
- node *n | node pointer
Returns:
- void
*/
void decodeZero(node* n);
/*
Description: graph Tracer.
Trace routes of graph
Parameters:
- unsigned __int8 state
- unsigned __int8 data
- unsigned __int8 level
Returns:
- node * | node pointer
*/
node * graphTracer(unsigned __int8 state, unsigned __int8 data, unsigned __int8 level);
/*
Description: find min graph distances.
used this function to refine and remove large distances
Parameters:
- unsigned __int8 state
- unsigned __int8 data
- unsigned __int8 level
Returns:
- node * | node pointer
*/
node* getMinDistancePaths(unsigned __int8 state, unsigned __int8 data, unsigned __int8 level);
/*
Description: find min graph distances
and print state and value for error-correction
Parameters:
- node *n | node pointer
Returns:
- __int8 distance value
*/
__int8 printStatesMinPath(node* n);
/*
calculate the Hamming distance between two integers
Parameters:
- unsigned __int8 x
- unsigned __int8 y
Returns:
- unsigned __int8 distance
*/
unsigned __int8 hammingDistance(unsigned __int8 x, unsigned __int8 y);
};