git-svn-id: http://moon:8086/svn/software/trunk/libsrc/radio@935 b431acfa-c32f-4a4a-93f1-934dc6c82436
531 lines
16 KiB
C
Executable File
531 lines
16 KiB
C
Executable File
// --------------------------------------------------------------
|
|
#ifndef _RADIO_RADIO_H_
|
|
#define _RADIO_RADIO_H_
|
|
|
|
#include "radio_types.h"
|
|
|
|
// --------------------------------------------------------------
|
|
// RF Types
|
|
// --------------------------------------------------------------
|
|
#define FRAME_CRC16_IV 0x0000
|
|
#define FRAME_CRC16_POLY 0x1021
|
|
#define FRAME_PREAMBLE_IV 0x55
|
|
#define FRAME_SCRAMBLER_SEED 0x12345678
|
|
#define FRAME_SCRAMBLER_POLY 0x80C18601
|
|
#define FRAME_NUM_BYTES_PER_FRAME 32
|
|
#define FRAME_TYPE_IDLE 0x01
|
|
#define FRAME_TYPE_DATA 0x02
|
|
|
|
typedef struct _cpx_t
|
|
{
|
|
radio_float_t imag, real;
|
|
|
|
} cpx_t;
|
|
|
|
typedef struct _cpx_arr_t
|
|
{
|
|
radio_float_t *pImag, *pReal;
|
|
|
|
} cpx_arr_t;
|
|
|
|
typedef struct _nco_t
|
|
{
|
|
radio_float_t phi, omega, dPhi, dOmega;
|
|
cpx_t state;
|
|
uint32_t tbl_index, tbl_size;
|
|
cpx_t *pTbl;
|
|
} nco_t;
|
|
|
|
#if 0
|
|
typedef struct _clkgen_t
|
|
{
|
|
nco_t *pNCO;
|
|
radio_float_t lastPhi;
|
|
|
|
} clkgen_t;
|
|
|
|
typedef struct _sampler_t
|
|
{
|
|
int count, reload;
|
|
|
|
} sampler_t;
|
|
|
|
typedef struct _lead_lag_filter_t
|
|
{
|
|
radio_float_t gain_lead, gain_lag;
|
|
radio_float_t term_lead, term_lag;
|
|
|
|
} lead_lag_filter_t;
|
|
|
|
typedef struct _str_t
|
|
{
|
|
cpx_t d[2];
|
|
|
|
} str_t;
|
|
|
|
#endif
|
|
|
|
typedef struct _rbuf_t
|
|
{
|
|
int size, iw, ir, dist;
|
|
radio_float_t *pData;
|
|
|
|
} rbuf_t;
|
|
|
|
typedef struct _fifo_t
|
|
{
|
|
uint32_t size_max;
|
|
uint32_t size;
|
|
uint32_t ir;
|
|
uint32_t iw;
|
|
uint32_t *pData;
|
|
|
|
} fifo_t;
|
|
|
|
|
|
typedef struct _sl_mean_t
|
|
{
|
|
rbuf_t buf;
|
|
uint32_t normalize_count;
|
|
radio_float_t Nr;
|
|
radio_float_t sum;
|
|
radio_float_t element_max;
|
|
radio_float_t mean;
|
|
|
|
} sl_mean_t;
|
|
|
|
typedef struct _sl_var_t
|
|
{
|
|
sl_mean_t sl_mean;
|
|
rbuf_t buf;
|
|
uint32_t normalize_count;
|
|
radio_float_t Nr;
|
|
radio_float_t sum;
|
|
radio_float_t var;
|
|
|
|
} sl_var_t;
|
|
|
|
typedef struct _sl_minmax_t
|
|
{
|
|
uint32_t L;
|
|
uint32_t N;
|
|
radio_float_t P;
|
|
radio_float_t *pU;
|
|
radio_float_t *pU_last;
|
|
uint32_t *pP;
|
|
uint32_t *pP_last;
|
|
radio_float_t max;
|
|
radio_float_t mode;
|
|
|
|
} sl_minmax_t;
|
|
|
|
typedef struct _map_t
|
|
{
|
|
radio_float_t mag, phi;
|
|
cpx_t rect;
|
|
uint32_t sym;
|
|
|
|
} map_t;
|
|
|
|
typedef struct _sym_map_t
|
|
{
|
|
uint32_t nBitsPerSym, num_const, type;
|
|
uint32_t mask, sym_last;
|
|
radio_float_t Es, Eb, R2, R4, Pref;
|
|
map_t **ppMapTbl, *pMapTbl;
|
|
radio_float_t iq_step, iq_max;
|
|
uint32_t iq_side_len;
|
|
|
|
} sym_map_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;
|
|
|
|
typedef struct _sym_err_t
|
|
{
|
|
radio_float_t err_mag, err_phi;
|
|
radio_float_t mag, phi, hard_mag;
|
|
cpx_t err, hard_sym, soft_sym;
|
|
|
|
} sym_err_t;
|
|
|
|
|
|
// --------------------------------------------------------------
|
|
// Interpolation
|
|
// --------------------------------------------------------------
|
|
typedef struct _fir_cpx_t
|
|
{
|
|
uint32_t N, r, w;
|
|
cpx_t *pX;
|
|
|
|
} fir_cpx_t;
|
|
|
|
typedef struct _fdly_t
|
|
{
|
|
int Nf;
|
|
radio_float_t *hf, *statef;
|
|
} fdly_t;
|
|
|
|
typedef struct _lgip_t
|
|
{
|
|
int N, bufsize;
|
|
rbuf_t rbuf;
|
|
} lgip_t;
|
|
|
|
typedef struct _lgip_cpx_t
|
|
{
|
|
cpx_t *pFifo;
|
|
uint32_t N, L, w, r;
|
|
|
|
} lgip_cpx_t;
|
|
|
|
typedef struct _fir_pp_t
|
|
{
|
|
uint32_t N, M;
|
|
radio_float_t **ppCoeff, *pState;
|
|
|
|
} fir_pp_t;
|
|
|
|
typedef struct _ppip_t
|
|
{
|
|
radio_float_t **ppCoeff, *pState;
|
|
uint32_t N, M;
|
|
rbuf_t rbuf;
|
|
|
|
} ppip_t;
|
|
|
|
typedef struct _ppip_cpx_t
|
|
{
|
|
cpx_t *pFifo;
|
|
radio_float_t **ppCoeff;
|
|
uint32_t N, L, M, w, r;
|
|
|
|
} ppip_cpx_t;
|
|
|
|
typedef struct _ppip_farrow_cpx_t
|
|
{
|
|
cpx_t *pFifo, *pH, *pB;
|
|
radio_float_t **ppCoeff;
|
|
uint32_t N, L, M, w, r;
|
|
|
|
} ppip_farrow_cpx_t;
|
|
|
|
// --------------------------------------------------------------
|
|
// Equalizer
|
|
// --------------------------------------------------------------
|
|
#if 0
|
|
#define CEF_MODE_NOP 0
|
|
#define CEF_MODE_CMA 1
|
|
#define CEF_MODE_DD 2
|
|
#define CEF_MODE_EQ_UPD 3
|
|
|
|
typedef struct _vcma_t
|
|
{
|
|
uint32_t L, M, N, m, init_latency_cnt;
|
|
cpx_t *pZ, **ppY, *pC, *pX, *pU;
|
|
radio_float_t b;
|
|
|
|
} vcma_t;
|
|
|
|
typedef struct _eq_cpx_t
|
|
{
|
|
uint32_t N;
|
|
cpx_t *pX, *pW;
|
|
|
|
} eq_cpx_t;
|
|
|
|
typedef struct _cma_t
|
|
{
|
|
uint32_t N, M;
|
|
eq_cpx_t eq;
|
|
radio_float_t Px, Px_last;
|
|
|
|
} cma_t;
|
|
|
|
typedef struct _dfe_cpx_t
|
|
{
|
|
uint32_t N, N_ff, N_fb;
|
|
eq_cpx_t eq;
|
|
|
|
} dfe_cpx_t;
|
|
|
|
typedef struct _cef_t
|
|
{
|
|
uint32_t N, M, mode;
|
|
vcma_t vcma;
|
|
eq_cpx_t eq;
|
|
cpx_t *pW, *pW_offline, *pW_eq, *pX;
|
|
radio_float_t R2;
|
|
|
|
} cef_t;
|
|
|
|
typedef struct _rls_t
|
|
{
|
|
uint32_t N, M;
|
|
cpx_t *pX, *pW, *pZ, *pR, *pT;
|
|
radio_float_t *R, *T, *T2, *z, *w, *x;
|
|
|
|
} rls_t;
|
|
#endif
|
|
|
|
// --------------------------------------------------------------
|
|
// Frame Types
|
|
// --------------------------------------------------------------
|
|
typedef struct _frame_hdr_t
|
|
{
|
|
uint8_t preamble[2];
|
|
uint32_t prn_state;
|
|
uint16_t crc16;
|
|
uint16_t type;
|
|
uint16_t length;
|
|
|
|
} frame_hdr_t;
|
|
|
|
typedef struct _frame_t
|
|
{
|
|
frame_hdr_t hdr;
|
|
uint8_t data[FRAME_NUM_BYTES_PER_FRAME];
|
|
|
|
} frame_t;
|
|
|
|
#ifdef __cplusplus
|
|
extern "C" {
|
|
#endif
|
|
// --------------------------------------------------------------
|
|
// Real Functions
|
|
// --------------------------------------------------------------
|
|
radio_float_t dabs(radio_float_t x);
|
|
radio_float_t dsign(radio_float_t x);
|
|
radio_float_t dmod(radio_float_t x, radio_float_t y);
|
|
radio_float_t dmax(radio_float_t x, radio_float_t y);
|
|
radio_float_t dmin(radio_float_t x, radio_float_t y);
|
|
radio_float_t dclamp(radio_float_t x, radio_float_t limit_low, radio_float_t limit_high);
|
|
radio_float_t powerDB(radio_float_t v1, radio_float_t preScale);
|
|
float fsum(float *pSrc, int len);
|
|
float fmean(float *pSrc, int len);
|
|
radio_float_t dsum(radio_float_t *pSrc, int len);
|
|
radio_float_t dmean(radio_float_t *pSrc, int len);
|
|
|
|
// --------------------------------------------------------------
|
|
// Complex Functions
|
|
// --------------------------------------------------------------
|
|
cpx_t CpxConjS(cpx_t v1);
|
|
cpx_t CpxAddS(cpx_t v1, cpx_t v2);
|
|
cpx_t CpxSubS(cpx_t v1, cpx_t v2);
|
|
cpx_t CpxMulS(cpx_t v1, cpx_t v2);
|
|
cpx_t CpxScaleRealS(cpx_t v1, radio_float_t v2);
|
|
cpx_t CpxScaleComplexS(cpx_t x, cpx_t gain);
|
|
cpx_t CpxFromReal(radio_float_t v1);
|
|
cpx_t Cpx(radio_float_t real, radio_float_t imag);
|
|
cpx_t CpxMinS(cpx_t x1, cpx_t x2);
|
|
cpx_t CpxMaxS(cpx_t x1, cpx_t x2);
|
|
radio_float_t CpxMagS(cpx_t v1);
|
|
radio_float_t CpxPhiS(cpx_t v1);
|
|
radio_float_t cpxPowerDB(cpx_t v1, radio_float_t preScale);
|
|
void CpxCopy(cpx_t *pSrc, cpx_t *pDst, uint32_t len);
|
|
void CpxConj(cpx_t *pSrcDst, uint32_t len);
|
|
void CpxAdd(cpx_t *pSrc, cpx_t *pSrcDst, uint32_t len);
|
|
void CpxSub(cpx_t *pSrc, cpx_t *pSrcDst, uint32_t len);
|
|
void CpxMul(cpx_t *pSrc, cpx_t *pSrcDst, uint32_t len);
|
|
radio_float_t CpxMag(cpx_t *pSrc);
|
|
radio_float_t CpxPhi(cpx_t *pSrc);
|
|
cpx_t csum(cpx_t *pSrc, int len);
|
|
cpx_t cmean(cpx_t *pSrc, int len);
|
|
|
|
// --------------------------------------------------------------
|
|
// NCO
|
|
// --------------------------------------------------------------
|
|
void NCO_Init(nco_t *pObj, radio_float_t omega, radio_float_t phi, uint32_t tbl_size);
|
|
void NCO_Free(nco_t *pObj);
|
|
void NCO_ModPhi(nco_t *pObj, radio_float_t dPhi);
|
|
void NCO_ModOmega(nco_t *pObj, radio_float_t dOmega);
|
|
radio_float_t NCO_GetOmega(nco_t *pObj);
|
|
void NCO_Process(nco_t *pObj);
|
|
|
|
// --------------------------------------------------------------
|
|
// Mixer
|
|
// --------------------------------------------------------------
|
|
cpx_t NCO_MixComplexS(nco_t *pObj, cpx_t *pSrc, cpx_t gain);
|
|
cpx_t NCO_MixRealS(nco_t *pObj, radio_float_t src, radio_float_t gain);
|
|
radio_float_t NCO_MixComplexRealS(nco_t *pObj, cpx_t *pSrc, cpx_t gain);
|
|
void NCO_MixComplex(nco_t *pObj, cpx_t *pSrc, cpx_t *pDst, cpx_t gain);
|
|
void NCO_MixReal(nco_t *pObj, radio_float_t src, cpx_t *pDst, radio_float_t gain);
|
|
radio_float_t NCO_MixComplexReal(nco_t *pObj, cpx_t *pSrc, cpx_t gain);
|
|
void NCO_MixComplexV(nco_t *pObj, cpx_t *pSrc, cpx_t *pDst, cpx_t gain, uint32_t len);
|
|
void NCO_MixRealV(nco_t *pObj, radio_float_t *pSrc, cpx_t *pDst, radio_float_t gain, uint32_t len);
|
|
void NCO_MixComplexRealV(nco_t *pObj, cpx_t *pSrc, radio_float_t *pDst, cpx_t gain, uint32_t len);
|
|
|
|
// --------------------------------------------------------------
|
|
// Synchronization
|
|
// --------------------------------------------------------------
|
|
#if 0
|
|
void Clkgen_Init(clkgen_t *pObj);
|
|
int Clkgen_GetPulse(clkgen_t *pObj, nco_t *pNCO);
|
|
int Clkgen_GetClock(clkgen_t *pObj);
|
|
|
|
void SamplerInit(sampler_t *pObj, int divide);
|
|
int SamplerIsSample(sampler_t *pObj);
|
|
void SamplerUpdate(sampler_t *pObj);
|
|
|
|
void STRGardnerInit(str_t *pObj);
|
|
radio_float_t STRGardnerProcess(str_t *pObj, cpx_t x);
|
|
|
|
void LeadLagInit(lead_lag_filter_t *pObj, radio_float_t lead_gain, radio_float_t lag_gain, radio_float_t ic_lag);
|
|
void LeadLagSetGainLead(lead_lag_filter_t *pObj, radio_float_t gain);
|
|
void LeadLagSetGainLag(lead_lag_filter_t *pObj, radio_float_t gain);
|
|
radio_float_t LeadLagProcess(lead_lag_filter_t *pObj, radio_float_t x);
|
|
|
|
radio_float_t PhaseErrQPSK(cpx_t x);
|
|
radio_float_t PhaseErr(cpx_t x, radio_float_t pstep, radio_float_t poffset);
|
|
#endif
|
|
// --------------------------------------------------------------
|
|
// Sliding Statistics
|
|
// --------------------------------------------------------------
|
|
void SlidingMeanInit(sl_mean_t *pObj, int N);
|
|
void SlidingMeanFree(sl_mean_t *pObj);
|
|
radio_float_t SlidingMeanProcess(sl_mean_t *pObj, radio_float_t x);
|
|
void SlidingMeanProcessV(sl_mean_t *pObj, radio_float_t *pX, uint32_t len);
|
|
radio_float_t SlidingMeanGet(sl_mean_t *pObj);
|
|
|
|
void SlidingVarInit(sl_var_t *pObj, int Npwr, int Nmean);
|
|
void SlidingVarFree(sl_var_t *pObj);
|
|
radio_float_t SlidingVarProcess(sl_var_t *pObj, radio_float_t x);
|
|
void SlidingVarProcessV(sl_var_t *pObj, radio_float_t *pX, uint32_t len);
|
|
radio_float_t SlidingVarGet(sl_var_t *pObj);
|
|
radio_float_t SlidingVarGetPowerDB(sl_var_t *pObj, radio_float_t preScale);
|
|
|
|
void SlidingMinMaxInit(sl_minmax_t *pObj, uint32_t L, radio_float_t P, radio_float_t mode);
|
|
void SlidingMinMaxFree(sl_minmax_t *pObj);
|
|
radio_float_t SlidingMinMaxProcess(sl_minmax_t *pObj, radio_float_t x);
|
|
void SlidingMinMaxProcessV(sl_minmax_t *pObj, radio_float_t *pX, uint32_t len);
|
|
radio_float_t SlidingMinMaxGet(sl_minmax_t *pObj);
|
|
|
|
// --------------------------------------------------------------
|
|
// RingBuffer
|
|
// --------------------------------------------------------------
|
|
void RBufInit(rbuf_t *pObj, int delay);
|
|
void RBufFree(rbuf_t *pObj);
|
|
void RBufPut(rbuf_t *pObj, radio_float_t x);
|
|
radio_float_t RBufGet(rbuf_t *pObj);
|
|
radio_float_t RBufGetAfter(rbuf_t *pObj, int delay);
|
|
radio_float_t RBufGetAt(rbuf_t *pObj, int index);
|
|
void FifoInit(fifo_t *pObj, uint32_t max_size);
|
|
void FifoFree(fifo_t *pObj);
|
|
uint32_t FifoSize(fifo_t *pObj);
|
|
uint32_t FifoSizeMax(fifo_t *pObj);
|
|
uint32_t FifoFront(fifo_t *pObj);
|
|
uint32_t FifoBack(fifo_t *pObj);
|
|
void FifoPushBack(fifo_t *pObj, uint32_t item);
|
|
void FifoPushFront(fifo_t *pObj, uint32_t item);
|
|
void FifoPopBack(fifo_t *pObj);
|
|
void FifoPopFront(fifo_t *pObj);
|
|
|
|
// --------------------------------------------------------------
|
|
// Interpolation
|
|
// --------------------------------------------------------------
|
|
void FDly_Init(fdly_t *pObj, int order);
|
|
void FDly_Free(fdly_t *pObj);
|
|
void FDly_CalcCoeff(fdly_t *pObj, radio_float_t delay);
|
|
radio_float_t FDly_Process(fdly_t *pObj, radio_float_t x);
|
|
|
|
void LGIpInit(lgip_t *pObj, int order, int bufsize);
|
|
void LGIpFree(lgip_t *pObj);
|
|
radio_float_t LGIpProcess(lgip_t *pObj, radio_float_t x, int m, radio_float_t mu);
|
|
|
|
void LGCpxIpInit(lgip_cpx_t *pObj, int order);
|
|
void LGCpxIpFree(lgip_cpx_t *pObj);
|
|
cpx_t LGCpxIpProcess(lgip_cpx_t *pObj, cpx_t x, int m, radio_float_t mu);
|
|
|
|
radio_float_t PolyPhaseSRRCInit(fir_pp_t *pObj, radio_float_t fa, radio_float_t tsym, radio_float_t alpha, uint32_t N, uint32_t M);
|
|
void PolyPhaseSRRCFree(fir_pp_t *pObj);
|
|
uint32_t PolyPhaseSRRCProcess(fir_pp_t *pObj, radio_float_t mu, radio_float_t *pX, radio_float_t *pY, uint32_t len);
|
|
|
|
radio_float_t PolyPhaseIpInit(ppip_t *pObj, radio_float_t fa, radio_float_t tsym, radio_float_t alpha, uint32_t N, uint32_t M);
|
|
void PolyPhaseIpFree(ppip_t *pObj);
|
|
radio_float_t PolyPhaseIpProcess(ppip_t *pObj, radio_float_t x, int m, radio_float_t mu);
|
|
|
|
radio_float_t PolyPhaseCpxIpInit(ppip_cpx_t *pObj, radio_float_t fa, radio_float_t tsym, radio_float_t alpha, uint32_t N, uint32_t M);
|
|
void PolyPhaseCpxIpFree(ppip_cpx_t *pObj);
|
|
cpx_t PolyPhaseCpxIpProcess(ppip_cpx_t *pObj, cpx_t x, int32_t m, radio_float_t mu);
|
|
|
|
void FarrowPPIPCpxInit(ppip_farrow_cpx_t *pObj, uint32_t M, uint32_t N);
|
|
void FarrowPPIPCpxFree(ppip_farrow_cpx_t *pObj);
|
|
cpx_t FarrowPPIPCpxProcess(ppip_farrow_cpx_t *pObj, cpx_t x, int32_t m, radio_float_t mu);
|
|
|
|
void FirCpxInit(fir_cpx_t *pObj, uint32_t N);
|
|
void FirCpxFree(fir_cpx_t *pObj);
|
|
void FirCpxProcessReal(fir_cpx_t *pObj, radio_float_t *pW, cpx_t *pSrc, cpx_t *pDst, uint32_t downSampleFactor, uint32_t len);
|
|
void FirCpxProcessComplex(fir_cpx_t *pObj, cpx_t *pW, cpx_t *pSrc, cpx_t *pDst, uint32_t len);
|
|
|
|
void SymErrInit(sym_err_t *pObj);
|
|
void SymStatInit(sym_stat_t *pObj, uint32_t nBitsPerSym);
|
|
void SymStatFree(sym_stat_t *pObj);
|
|
void SymStatUpDate(sym_stat_t *pObj, uint8_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);
|
|
radio_float_t SymMapGetModulus(sym_map_t *pObj, cpx_t x);
|
|
map_t SymMapGetSymbol(sym_map_t *pObj, cpx_t x);
|
|
uint8_t SymMapDecode(sym_map_t *pObj, cpx_t x, sym_err_t *pErr);
|
|
cpx_t SymMapEncode(sym_map_t *pObj, uint8_t bit);
|
|
|
|
#if 0
|
|
void CMAInit(cma_t *pObj, uint32_t ntaps, uint32_t nSamplesPerSym);
|
|
void CMAFree(cma_t *pObj);
|
|
cpx_t CMAProcess(cma_t *pObj, cpx_t x);
|
|
cpx_t CMAGodard(cpx_t sym_s_eq, radio_float_t mag_h, radio_float_t R2);
|
|
radio_float_t CMATrain(cma_t *pObj, cpx_t y, cpx_t d, radio_float_t mu);
|
|
|
|
void EQComplexInit(eq_cpx_t *pObj, uint32_t N);
|
|
void EQComplexFree(eq_cpx_t *pObj);
|
|
cpx_t EQComplexProcess(eq_cpx_t *pObj, cpx_t x);
|
|
|
|
void DFEComplexInit(dfe_cpx_t *pObj, uint32_t K);
|
|
void DFEComplexFree(dfe_cpx_t *pObj);
|
|
cpx_t DFEComplexProcess(dfe_cpx_t *pObj, cpx_t xs, cpx_t xh);
|
|
void DFEAdaptLMS(dfe_cpx_t *pObj, cpx_t e, radio_float_t mu);
|
|
|
|
void CoeffComplexUnitAt(cpx_t *pW, uint32_t N, uint32_t dly);
|
|
void CoeffComplexConv(cpx_t *pSrc, cpx_t *pDst, uint32_t N, uint32_t dly);
|
|
|
|
void LMSUpdateWeigths(eq_cpx_t *pObj, cpx_t e, radio_float_t mu);
|
|
|
|
void RLSInit(rls_t *pObj, uint32_t N, uint32_t M);
|
|
void RLSFree(rls_t *pObj);
|
|
cpx_t RLSProcess(rls_t *pObj, radio_float_t i, radio_float_t q);
|
|
radio_float_t RLSUpdate(rls_t *pObj, radio_float_t rho, radio_float_t mu, radio_float_t y, radio_float_t d);
|
|
#endif
|
|
|
|
// --------------------------------------------------------------
|
|
// Data Functions
|
|
// --------------------------------------------------------------
|
|
uint32_t Scramble(uint8_t *pSrcDst, uint32_t state, uint32_t poly, uint32_t len);
|
|
uint32_t FrameCalcNumStreamBytes(uint32_t len_raw);
|
|
uint32_t FrameFormat(uint8_t *pRaw, uint8_t *pFormatted, uint32_t len_raw, uint32_t *pPrn_state, uint16_t frame_type);
|
|
uint32_t FrameDeformat(uint8_t *pFormatted, uint8_t *pRaw, uint32_t len_formatted, uint16_t frame_type);
|
|
uint32_t FrameSerialize(uint8_t *pSrc, uint8_t *pDst, uint32_t nBitsPerSym, uint32_t srclen);
|
|
uint32_t FrameDeSerialize(uint8_t *pSrc, uint8_t *pDst, uint32_t nBitsPerSym, uint32_t srclen, uint16_t frame_type);
|
|
uint32_t FrameSymbolsMap(uint8_t *pBits, cpx_t *pSym, uint32_t nBitsPerSym, uint32_t num_syms, uint32_t type);
|
|
uint32_t FrameSymbolsDemap(cpx_t *pSym, uint8_t *pBits, uint32_t nBitsPerSym, uint32_t num_syms, uint32_t type);
|
|
|
|
#ifdef __cplusplus
|
|
}
|
|
#endif
|
|
|
|
// --------------------------------------------------------------
|
|
#endif // _RADIO_RADIO_H_
|