📄 typedef.h
字号:
#ifndef _TYPEDEF_
#define _TYPEDEF_
#include "globalMacro.h"
typedef unsigned char Uint8; //8 bit unsigned data.
typedef unsigned short Uint16; //16 bit unsigned data.
typedef unsigned long Uint32; //32 bit unsigned data.
typedef signed char Int8; //8 bit signed data.
typedef signed short Int16; //16 bit signed data.
typedef signed long Int32; //32 bit signed data.
typedef signed long SizeType; //for data length.
typedef struct
{
Uint32 baseFrameDurationSam;//frame duration in samples;
Uint8 frameDurationTimes; //the times of the base frame duration
Uint16 frameDurationSym; // frame duration in symbols;
Uint8 burstNum; //the number of bursts in a frame;
Uint8 timePaddingSam; //the time padding duration in samples in the frame.
Uint8 cpDataRatio; //the CP to Data period ratio, 1/4/8/16/32.
Uint16 fftSize; //FFT size in samples
Uint16 subcarriers; //the useful subcarrier in a symbol
}FrameParam; //the frame structure parameters
typedef struct
{
//input
Uint8 frameIndex; //4 LSB bit the frame index number
Uint8 subChannelIndex; //the sub-channel index
Uint16 burstIndex; //the burst Index in a frame.
Uint8 infoBytes; //payload info bytes
Uint8 preambleFlag; //=NO_PREAMBLE, SHORT_PREAMBLE, LONG_PREAMBLE;
//STC_PREAMBLE;
//output
Uint8 burstFlag; //=FCH_BURSTFLAG, indication that the burst is FCH
//=BURSTONE_BURSTFLAG, the burst is non-FCH but not in STC.
//=STCFCH_BURSTFLAG, indication that the burst is STC-FCH.
//=STC_BURSTFLAG, the burst is in STC region but is not STC-FCH
Uint8 rateId; //Rate_ID
Uint8 diuc; //DIUC
Uint8 bsid; //4 LSB bit of BS ID
Uint16 burstSizeSym; //the allocated burst length in OFDM symbols
//=3 for FCH; =2 for STC_FCH;
Uint8 status; //execution status
//NOFEC_DONE=no FEC coding done,
//RSENCODE_DONE=RS encoding is done,
//CONVENCODE_DONE=convolutional encoding is done
//INTERLEAVE_DONE=interleaving is done
//DATAMOD_DONE=data modulation is done
//input/output:
Uint16 burstSymIndex; //the OFDM symbol index in a burst.
Uint8 stcFlag; //0=the first call, 1=the second call, used for STC encoding
}DlTxBurstParam;
typedef struct
{
//input
Uint8 frameIndex; //4 LSB bit the frame index number
Uint8 subChannelIndex; //the sub-channel index
Uint16 burstIndex; //the burst Index in a frame.
Uint8 infoBytes; //payload info bytes
Uint8 preambleFlag; //=NO_PREAMBLE, SHORT_PREAMBLE, LONG_PREAMBLE;
//STC_PREAMBLE;
//output
Uint8 burstFlag; //=STC_BURSTFLAG, indication that the burst is in STC region.
//=FCH_BURSTFLAG, indication that the burst is FCH
//=BURSTONE_BURSTFLAG, indication that the burst is the burst #1 after FCH
//=STCFCH_BURSTFLAG, indication that the burst is STC-FCH.
Uint8 rateId; //Rate_ID
Uint8 diuc; //DIUC
Uint8 bsid; //4 LSB bit of BS ID
Uint16 burstSizeSym; //the allocated burst length in OFDM symbols
Uint8 exeStatus; //execution status
//NOFECDEC_DONE=no FEC coding done,
//RSDECODE_DONE=RS decoding is done,
//CONVDECODE_DONE=convolutional decoding is done
//DEINTERLEAVE_DONE=deinterleaving is done
//DATADEMOD_DONE=data demodulation is done
Uint8 rsDecErrStatus; //RSDEC_OK_NO_ERRORS, no RS decoding errors.
//RSDEC_OK_ERROR_1; 1 error, corrected
//RSDEC_OK _ERROR_2;
//RSDEC_OK _ERROR_3;
//RSDEC_OK _ERROR_4;
//RSDEC_OK _ERROR_5;
//RSDEC_OK _ERROR_6;
//RSDEC_OK _ERROR_7;
//RSDEC_OK _ERROR_8; 8 errors, corrected
//RSDEC_ERRORS; RS decode errors beyond correction.
//input/output:
Uint16 ofdmSymIndex; //the OFDM symbol index in a burst.
Uint8 stcFlag; //0=the first call, 1=the second call, used for STC decoding
}DlRxBurstParam;
typedef struct
{
Uint8 fecType; //0-19, see table 360
Uint8 diucExitThreshold; //in 0.25dB step
Uint8 diucEntryThreshold; //in 0.25dB step
Uint8 tcs; //0=disabled, 1=enabled.
}DlBurstProfileParam; //burst profile parameters
typedef struct
{
Uint16 uncodedBlockSize; //before FEC in bytes including "0x00"tail byte,
//without subchannelization
Uint16 codedBlockSize; //after FEC in bytes without subchannelization
Uint16 rsParityBytes; //RS parity bytes without subchannelization
Uint16 conCodedSize; //after CC in bytes without subchannelization
Uint16 btcCodedSize; //after BTC in bytes without subchannelization
Uint16 ctcCodedSize; //after CTC in bytes without subchannelization
Uint8 ccRate;
Uint8 btsRate;
Uint8 ctcRate;
Uint8 modulation;
Uint16 nucbps; //max number of uncoded bits (before rand.) per subchannel per symbol.
Uint16 nccbpss; //number of CC coded bits per (single) subchannel per symbol.
Uint8 ncpc; //number of coded bits per subcarrier.
Uint16 ncbpss; //number of coded bits per (single) sub-channel per OFDM symbol,
//=12*ncpc, Ncbps=ncbpss*number of allocated subChannels.
//For DL, Ncbps=16*ncbpss, always.
Uint16 nqam; //=nbpss/ncpc, the number of QAM symbols per symbol per (single) subchannel
}OfdmSymbolParam;
typedef struct
{
Uint16 qamSymBitwidth; //the actual bitwidth for QAM data in either I or Q, relative to the qamSymAveAmp
Int16 qamSymAveAmp; //the average amplitude of QAM data.before DAC
Uint16 dacBitwidth; //the bitwidth for DAC
Int16 dacScalingfac; //the saling factor for DAC conversion,
}TxScalingParam;
typedef struct
{
Uint16 ofdmSymIndex; //OFDM symbol index, updated for each call.
Uint16 encodePoly; //the encoding polynomial,
Uint16 registers; //the state of the register, updated for each OFDM symbols
}PilotParam;
typedef struct
{
Uint16 Sym; //starting time in symbols
Uint16 Burst; //starting time in bursts
}StcStartTimeParam;
typedef enum ModulationTag
{
QPSK = 0X0001, // QPSK modulation
QAM16 = 0X0002, // 16QAM modulation
QAM64 = 0X0003, // 64QAM modulation
QAM256 = 0X0004, // 256QAM modulation
BPSK = 0X0005, // BPSK modulation
}Modulation;
typedef enum ccRateTag
{
ONE_HALF = 0X0010, // 1/2 code rate
TWO_THIRDS = 0X0020, // 2/3 code rate
THREE_FOURTHS = 0X0030, // 3/4 code rate
FIVE_SIXTHS = 0X0040, // 5/6 code rate
SEVEN_EIGHTHS = 0X0050, // 7/8 code rate
} ccRate;
typedef struct
{
Int16 ChEstOut[2*PREAMBLE_FREQ_FULL_SIZE]; //channel estimates
Int16 chEstPwr[PREAMBLE_FREQ_FULL_SIZE];
Int16 timingEst; //timing Offset Estimates in samples
Int16 rxSignalPower; //Rx signal power in linearity.
Int16 rxNoisePower; //Rx noise power in linearity
}ChannelEstResult; //channel estimation results.
typedef struct
{
Int16 rxPower; //RX signal power in linearity
Int16 rxPowerDb; //RX signal power in dB..
Int16 rxNoise; //RX noise power in linearity.
Int16 rxNoiseDb; //RX noise power in dB.
Int16 cinrRevserse; //the reverse of Signal to noise ratio in linearity.
Int16 cinrRevserseDb; //the reverse of Signal to noise ratio in linearity.
}RxPowerParam;
typedef struct
{
Uint8 initialFlag; //0=the first call; 1=else.
Int16 smoothFactor; //smoothing factor for updating.
Int16 agcGain; //the Gain for the current frame(in dB)
Int16 fixedGain; //in dB, RX fixed gain in receive train.
Int16 mean; //mean in linearity
Int16 deviation; //estimates deviation in linearity
Int16 meanDb; // mean in dB;
Int16 stdDeviationDb; //dev. In dB.
}RssiParam;
typedef struct
{
Uint8 initialFlag; //0=the first call; 1=else.
Int16 smoothFactor; //smoothing factor for updating.
Int16 agcGain; //the Gain for the current frame(in dB)
Int16 fixedGain; //in dB, RX fixed gain in receive train.
Int16 mean; //mean in linearity
Int16 devation; //estimates deviation in linearity
Int16 meanDb; // mean in dB;
Int16 stdDeviationDb; //dev. In dB.
}CinrParam;
typedef struct
{
Int16 desiredRxPowerDb; //Desired RX signal in dB.
Int16 smoothFactor; //smoothing factor for AGC gain updating.
}AgcCalParam;
typedef struct
{
Int16 preambleFreqTable64[2*PREAMBLE_FREQ_FULL_SIZE];
Int16 preambleFreqTable128Even[2*PREAMBLE_FREQ_FULL_SIZE];
Int16 preambleFreqTable128Odd[2*PREAMBLE_FREQ_FULL_SIZE];
}PreambleIFreqTable;
typedef struct
{
Int16 fixedPhase[2]; // the fixed phase shift in radian.
//fixedPhase[0]=cosvalue;
//fixedPhase[1]=sinvalue;
Int16 freqIq; // the phase change angular frequency.
}PhaseParam;
typedef struct
{
Int16 Qam16Threshold[5];
Int16 Qam64Threshold[9];
}QamThreshold;
#endif
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -