Initial import
This commit is contained in:
37
arphy_fec.h
Normal file
37
arphy_fec.h
Normal file
@@ -0,0 +1,37 @@
|
||||
#ifndef HADAMARD_H
|
||||
#define HADAMARD_H
|
||||
|
||||
// FEC
|
||||
#define MAX_FEC_INPUT_SIZE 8U
|
||||
#define MAX_FEC_OUTPUT_SIZE 128U // (2^(MAX_FEC_INPUT_SIZE-1)) non fa
|
||||
#define MAX_FEC_PER_BLOCK 4U
|
||||
|
||||
#define ARPHY_FEC_TYPE_NONE 0
|
||||
#define ARPHY_FEC_TYPE_HADAMARD 1
|
||||
#define ARPHY_FEC_TYPE_MAX 1
|
||||
|
||||
#define ARPHY_FEC_INPUT_SIZE_NIBBLE 0
|
||||
#define ARPHY_FEC_INPUT_SIZE_BYTE 1
|
||||
|
||||
|
||||
typedef struct {
|
||||
uint8_t type; ///< algoritmo di FEC
|
||||
uint8_t in_bit_size; ///< net data size in bits
|
||||
uint8_t out_bit_size; ///< code size in bits
|
||||
uint8_t out_symbols_size; ///< code size in symbols
|
||||
uint8_t hamming_distance; ///<
|
||||
uint8_t sqrsum; // fattore qualita
|
||||
} block_code;
|
||||
|
||||
extern block_code fec;
|
||||
|
||||
// buffer per FEC
|
||||
extern int16_t tx_FHT_Buffer[MAX_FEC_OUTPUT_SIZE], rx_FHT_Buffer[MAX_FEC_OUTPUT_SIZE];
|
||||
|
||||
void arphy_set_up_FEC(block_code* fec_params);
|
||||
void arphy_FEC_encode(uint8_t Chunk, uint8_t ChunkSize, int16_t *DataBuffer);
|
||||
uint8_t arphy_FEC_decode(int16_t *DataMatrix);
|
||||
void FastHadamardTransform(int16_t *Data, uint8_t fec_size);
|
||||
void InverseFastHadamardTransform(int16_t *Data, uint8_t fec_size);
|
||||
|
||||
#endif /* HADAMARD_H */
|
||||
Reference in New Issue
Block a user