📄 randomization.cpp
字号:
#include "typedef.h"
#include "randomization.h"
#include "global_var.h"
//initializtion RandVector
void dlRandInit(Uint16 burstIndex, //0=FCH, indication that the burst is FCH.
//1= indication that this is theburst #1after FCH.
Uint8 bsid,
Uint8 diuc,
Uint8 frameIndex,
Uint16 *pRandVector)
{
if(burstIndex < 2)
{
*pRandVector = 0x4a80;
}
else
{
*pRandVector = (Uint16)(frameIndex & 0x0f);
*pRandVector |= ((diuc & 0x0f) << 5);
*pRandVector |= 0x0610;
*pRandVector |= ((bsid & 0x0f)<< 11);
}
}
//randomization
void randomization (Uint8 mode,
DlTxBurstParam *pDlTxBurstParam,
Uint16 burstIndex,
Uint8 *pRandomizationIn,
Uint16 randomizationInLength,
Uint16 *pRandVector,
Uint8 *pRandomizationOut)
{
Int16 i, j;
Int8 feedBack;
if((*pDlTxBurstParam).burstSymIndex == 0)
{
dlRandInit(burstIndex,(*pDlTxBurstParam).bsid,
(*pDlTxBurstParam).diuc,(*pDlTxBurstParam).frameIndex,pRandVector);
}
for (i = 0; i < randomizationInLength; i++)
{
pRandomizationOut[i] = pRandomizationIn[i];
for (j = 0; j < 8; j++)
{
feedBack = (*pRandVector & 1);
*pRandVector >>= 1;
feedBack ^= (*pRandVector & 1);
pRandomizationOut[i] ^= feedBack << (7 - j);//"<<" before "^" ;
*pRandVector ^= (feedBack << 14);
}
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -