?? bitmap.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 + -