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

📄 bitmap.asv

📁 OFDM系统
💻 ASV
字号:
function MappedDATA = BitMap(in,N_BPSC)

%Input: the data and the coded bits per subcarrier.
%OUtput: the Mapped data.
%Function: 

Num = max(size(in));

switch N_BPSC
case 1
   for i = 1:1:Num/N_BPSC
      MappedDATA(i) = (in(i)-0.5)*2+sqrt(-1)*0;
   end
case 2
   for i = 1:1:Num/N_BPSC
      MappedDATA(i) = (in(i*N_BPSC-1)-0.5)*2+sqrt(-1)*((in(i*N_BPSC)-0.5)*2);
   end
   %MappedDATA = MappedDATA/sqrt(2);
case 4
   for i = 1:1:Num/N_BPSC
      Lowpart = in(i*N_BPSC-3)+in(i*N_BPSC-2)*2;
      Highpart = in(i*N_BPSC-1)+in(i*N_BPSC)*2;
      switch Lowpart
      case 0
         real = -3;
      case 1
         real = 3;
      case 2
         real = -1;
      case 3
         real = 1;
      otherwise
         error(' No This BitMap Choice!!! ');
      end
      switch Highpart
      case 0
         img = -3;
      case 1
         img = 3;
      case 2
         img = -1;
      case 3
         img = 1;
      otherwise
         error(' No This BitMap Choice!!! ');
      end
      MappedDATA(i) = real+sqrt(-1)*img;
   end
   MappedDATA = MappedDATA/sqrt(10);                   % power normalization!
case 6
   for i = 1:1:Num/N_BPSC
      Lowpart = in(i*N_BPSC-5)+in(i*N_BPSC-4)*2+in(i*N_BPSC-3)*4;
      Highpart = in(i*N_BPSC-2)+in(i*N_BPSC-1)*2+in(i*N_BPSC)*4;
      switch Lowpart
      case 0
         real = -7;
      case 1
         real = 7;
      case 2
         real = -1;
      case 3
         real = 1;
      case 4
         real = -5;
      case 5
         real = 5;
      case 6
         real = -3;
      case 7
         real = 3;
      otherwise
         error(' No This BitMap Choice!!! ');
      end
      switch Highpart
      case 0
         img = -7;
      case 1
         img = 7;
      case 2
         img = -1;
      case 3
         img = 1;
      case 4
         img = -5;
      case 5
         img = 5;
      case 6
         img = -3;
      case 7
         img = 3;
      otherwise
         error(' No This BitMap Choice!!! ');
      end
      MappedDATA(i) = real+sqrt(-1)*img;
   end
   MappedDATA = MappedDATA/sqrt(42);
otherwise
   error(' No This BitMap Choice!!! ');
end

⌨️ 快捷键说明

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