⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 ms_fqi_initialization.m

📁 CDMA2000 反向信道仿真 matlab
💻 M
字号:
%===========================================================
% MS_FQI_Initialization.m
%===========================================================
%大多数情况下不需要对数据帧进行填充,因此填充长度等于输入数据帧的长度
xPaddedFrameLength=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 frane 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 12-bit frame quality indicator
                xGenPoly=[12 11 10 9 8 4 1 0];
            %长度为24 360 744 1512 3048 6120的数据帧采用6位CRC编码
            case {24,360,744,1512,3048,6120}
                %g(x)=x16+x15+x14+x11+x6+x5+x2+x+1 for the 16-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 cdma2000 Mobile Sation block<Frame Quality Indicator>');
        end
    case 4
        %根据输入数据帧的长度设置CRC生成多项式和填充长度
        switch xFrameLength
            %长度为21的数据帧采用6位CRC编码并且产生一个填充比特
            case 21
                xPaddedFrameLength=22;
                %g(x)=x6+x5x+x2+x+1 for the 6-bit frame quality indicator(3=<RC=<6)
                xGenPoly=[6 2 1 0];
            %长度为55的数据帧采用8位CRC编码,并且产生一个填充比特
            case 55
                xPaddedFrameLength=56;
                %g(x)=x8+x7+x4x+x3+x+1 for the 8-bit frame quality
                %indicator
                xGenPoly=[8 7 4 3 1 0];
            %长度为125的数据帧采用10位CRC编码,并且产生一个填充比特
            case 125
                xPaddedFrameLength=126;
                %g(x)=x10+x9+x8+x7+x6+x4+x3+1 for the 10-bit frame quality
                %indicator
                xGenPoly=[10 9 8 7 6 4 3 0];
            %长度为267的数据帧采用12位CRC编码,并且产生一个填充比特
            case 267
                xPaddedFrameLength=268;
                %g(x)=x12+x11+x10+x9+x8+x4+x+1for the 12-bit frame quality
                %indicator
                xGenPoly=[12 11 10 9 8 4 1 0];
            %长度为24,552,1128,2280,4584 的数据帧采用16为CRC编码
            case {24,552,1128,2280,4584}
                %g(x)=x16+x15+x14+x11+x6+x5+x2+x+1 for the 16-bit frame
                %quality idicator 
                xGenPoly=[16 15 14 11 6 5 2 1 0];
            %如果输入数据帧的长度非法则报错
            otherwise
                 error('Error: Invalid Frame Length for Radio Configuration 4 in cdma2000 Mobile Sation block<Frame Quality Indicator>');
        end
    %如果输入数据帧的无线配置非法则报错
    otherwise
         error('Error: Invalid or Unhandled Radio Configuration in cdma2000 Mobile Sation block<Frame Quality Indicator>');
end
%end program

                
                
                
                
                
                
                
                
                
                
        

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -