getpilot.m

来自「关于MATLAB中实现802.16e的物理层仿真,希望对大家有帮助!」· M 代码 · 共 35 行

M
35
字号
function output=getpilot(input)
%协议对一帧中导频位置的规定
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
evenpilot=[923 927 769 773 839 843 615 619 895 899 685 689 96   100 460 464 755 759 741 745 292 296 531 535];  
oddpilot=[919 931 765 777 835 847 611 623 891 903 681 693 92   104 456 468 751 763 737 749 288 300 527 539];
  
p_even_pilot=sort(evenpilot)+1;
p_odd_pilot=sort(oddpilot)+1;
%p_even_pilot=[ 97  101  293  297  461  465  532  536  616  620  686  690  742  746  756  760  770  774  840  844  896  900  924  928];
%p_odd_pilot =[ 93  105  289  301  457  469  528  540  612  624  682  694  738  750  752  764  766  778  836  848  892  904  920  932];
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

output=[];
temp=[];
k=0;
flag=0;

for i=1:26624
    if( ((i/1024)>1)&&((i/1024)<=25))
        k=k+1;
        temp(k)=input(i);
        if (k==1024)
            k=0;
            if(flag==0)
                output=[output,temp(p_even_pilot)];
                flag=mod(flag+1,2);
            else
                output=[output,temp(p_odd_pilot)];
                flag=mod(flag+1,2);
            end
        end 
    end
end

⌨️ 快捷键说明

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