basemapping.m

来自「本代码是基于OFDM系统的一种转换域估计算法」· M 代码 · 共 24 行

M
24
字号
function [dSource,pilot,bit] = baseMapping(bitSource,baseType)
   simulNUM = length(bitSource);
   %%%%注意:串并转换输出和ifft输入不一定相等
   switch baseType
       case  1
           dSource = 2*(bitSource-0.5); % 0->-1 1->1
           pilot=[1];
           bit=1;
       case 2
           temp = 2*(reshape(bitSource,2,simulNUM/2)-0.5)';   % qpsk:00->-1-1 01->-11 10->1-1 11->11  
           dSource = complex(temp(:,1) ,temp(:,2))/sqrt(2);   % ensure the average symbol power is 1
           pilot=[1;1];
           bit=2;
       case 3
           temp = reshape(bitSource,4,simulNUM/4)';
           x = 2*((0.5-temp(:,1)) .* (3-2*temp(:,3)));
           y = 2*((0.5-temp(:,2)) .* (3-2*temp(:,4)));
           avAmp = (sqrt(2) + sqrt(18) + 2*sqrt(10)) / 4;       % the average signal amplitude
           dSource = complex(x,y)/avAmp;
           pilot=[0;0;0;0];
           bit=4;
       otherwise
           error('There is a unsuported Mapping Type'); 
   end

⌨️ 快捷键说明

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