git-svn-id: http://moon:8086/svn/software/trunk/libsrc/radio@1 b431acfa-c32f-4a4a-93f1-934dc6c82436
84 lines
2.1 KiB
C
Executable File
84 lines
2.1 KiB
C
Executable File
// --------------------------------------------------------------
|
|
#ifndef SYMBOL_H
|
|
#define SYMBOL_H
|
|
|
|
#include "radio_types.h"
|
|
#include "statistics.h"
|
|
#include "cpx.h"
|
|
|
|
// --------------------------------------------------------------
|
|
// Types
|
|
// --------------------------------------------------------------
|
|
typedef struct _map_t
|
|
{
|
|
radio_float_t mag, phi;
|
|
cpx_t rect;
|
|
symbol_t sym;
|
|
|
|
} map_t;
|
|
|
|
typedef struct _sym_map_t
|
|
{
|
|
uint32_t nBitsPerSym, num_const, type;
|
|
radio_float_t Es, Eb, Pref;
|
|
map_t **ppMapTbl, *pMapTbl;
|
|
radio_float_t iq_step, iq_max;
|
|
uint32_t iq_side_len;
|
|
radio_float_t R2_cma; // For CMA
|
|
cpx_t R_mma; // for MMA
|
|
cpx_t R_smma; // for S-MMA
|
|
|
|
} sym_map_t;
|
|
|
|
typedef struct _sym_err_t
|
|
{
|
|
radio_float_t err_mag, err_phi;
|
|
radio_float_t err_mag_norm, err_phi_norm;
|
|
radio_float_t mag, phi, hard_mag, hard_phi;
|
|
cpx_t err, hard_sym, soft_sym;
|
|
|
|
} sym_err_t;
|
|
|
|
typedef struct _per_sym_stat_t
|
|
{
|
|
uint32_t count;
|
|
radio_float_t p, var_err_mag, var_err_phi;
|
|
sl_var_t sl_err_mag, sl_err_phi;
|
|
|
|
} per_sym_stat_t;
|
|
|
|
typedef struct _sym_stat_t
|
|
{
|
|
uint32_t sym_cnt, num_const;
|
|
per_sym_stat_t *pPerSymStat;
|
|
|
|
|
|
} sym_stat_t;
|
|
|
|
// --------------------------------------------------------------
|
|
// Functions
|
|
// --------------------------------------------------------------
|
|
#ifdef __cplusplus
|
|
extern "C" {
|
|
#endif
|
|
|
|
void SymStatInit(sym_stat_t *pObj, uint32_t nBitsPerSym);
|
|
void SymStatFree(sym_stat_t *pObj);
|
|
void SymStatReset(sym_stat_t *pObj);
|
|
void SymStatUpDate(sym_stat_t *pObj, symbol_t sym, sym_err_t *pSym_err);
|
|
void SymStatPrint(sym_stat_t *pObj);
|
|
|
|
void SymMapInit(sym_map_t *pObj, uint32_t nBitsPerSym, uint32_t type);
|
|
void SymMapFree(sym_map_t *pObj);
|
|
void SymMapReinit(sym_map_t *pObj, uint32_t nBitsPerSym, uint32_t type);
|
|
cpx_t SymMapMap(sym_map_t *pObj, symbol_t symbol);
|
|
symbol_t SymMapDemap(sym_map_t *pObj, cpx_t x);
|
|
map_t SymMapGetSymbolInfo(sym_map_t *pObj, symbol_t symbol);
|
|
sym_err_t SymMapGetError(sym_map_t *pObj, cpx_t x, symbol_t symbol);
|
|
#ifdef __cplusplus
|
|
}
|
|
#endif // __cplusplus
|
|
|
|
// --------------------------------------------------------------
|
|
#endif // SYMBOL_H
|