📄 ms_fqi_initialization.m
字号:
%MS_FQI_Initialization.m
%大多数情况下不需要对数据帧进行填充,因此填充长度等于输入数据帧的长度
xPaddedFrameLen=xFrameLength;
%根据无线配置设置CRC生成多项式合填充长度,只支持RC3和RC4
switch xRC
case 3
%根据输入数据帧的长度设置CRC生成多项式和填充长度
switch xFrameLength
%长度为16和40的数据帧采用6位CRC编码
case{16,40}
%g(x)=x6+x2+x+1 for the 6-bit frame quality indicator(RC=2)
%g(x)=x6+x5+x2+x+1 for the 6-bit frame quality indicator(3<=RC<=6)
xGenPoly=[6 2 1 0];
%长度为80的数据帧采用6位CRC编码
case 80
%g(x)=x8+x7+x4+x3+x+1 for the 8-bit frame quality indicator
xGenPoly=[8 7 4 3 1 0];
%长度为172的数据帧采用6位CRC编码
case 172
%g(x)=x12+x11+x10+x9+x8+x4+x+1 for the 12bit frame quality indicator
xGenPoly=[12 11 10 9 8 4 1 0];
%长度为24,360,744,3048,6120的数据帧采用6位CRC编码
case{24,360,744,1512,3048,6120}
%g(x)=x16+x15+x14+x11+x6+x5+x2+x+1 for the 6-bit frame
%quality indicator
xGenPoly=[16 15 14 11 6 5 2 1 0];
%如果输入数据帧的长度非法则报错
otherwise
error('Error:Invalid Frame Length for Radio Configuration 3 in cdma 2000 Mobile Station block<Frame Quality Indicator>');
end
case 4
%根据输入数据帧的长度设置CRC生成多项式和填充长度,产生一个填充比特
switch xFrameLength
case 21
xPaddedFrameLength=22;
%g(x)=x6+x5+x2+x+1for the 6-bit frame quality
%indicator(3<=RC<=6)
xGenPoly=[6 2 1 0];
case 55
xPaddedFrameLength=56;
xGenPoly=[8 7 4 3 1 0];
case 125
xPaddedFrameLength=126;
xGenPoly=[10 9 8 7 6 4 3 0];
case 267
xPaddedFrameLength=268;
xGenPoly=[12 11 10 9 8 4 1 0];
case {24,552,1128,2280,4584}
%xPaddedFrameLength=56;
xGenPoly=[16 15 14 11 6 5 2 1 0];
otherwise
error('Error:Invalid Frame Length for Radio Configuration 4 in cdma 2000 Mobile Station block<Frame Quality Indicator>');
end
otherwise
error('Error:Invalid or Unhandled Radio Configuration in cdma 2000 Mobile Station block<Frame Quality Indicator>');
end
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -