1 Star 0 Fork 0

zhoub86/ECE257B_OFDM_NL

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
mapping.m 1.13 KB
一键复制 编辑 原始数据 按行查看 历史
paulyoon95 提交于 2018-06-15 21:39 . Add files via upload
function [map_out]=mapping(data,mode,scale)
% mode : Modulation order (2/4/16/64 = BSPK/QPSK/16-QAM/64-QAM)
% scale : scaling up or down the modulation, default value = 1
input_seq = data;
switch mode
case 1
b=scale*[1 -1];
case 2
b=scale*[1+1i -1+1i 1-1i -1-1i];
case 4
b=scale*[1+1i 1+3i 1-1i 1-3i 3+1i 3+3i 3-1i 3-3i -1+1i -1+3i -1-1i -1-3i -3+1i -3+3i -3-1i -3-3i];
case 6
b=scale*[3+3i 3+1i 3+5i 3+7i 3-3i 3-1i 3-5i 3-7i 1+3i 1+1i 1+5i 1+7i 1-3i 1-1i 1-5i 1-7i 5+3i 5+1i 5+5i 5+7i 5-3i 5-1i 5-5i 5-7i 7+3i 7+1i 7+5i 7+7i 7-3i 7-1i 7-5i 7-7i -3+3i -3+1i -3+5i -3+7i -3-3i -3-1i -3-5i -3-7i -1+3i -1+1i -1+5i -1+7i -1-3i -1-1i -1-5i -1-7i -5+3i -5+1i -5+5i -5+7i -5-3i -5-1i -5-5i -5-7i -7+3i -7+1i -7+5i -7+7i -7-3i -7-1i -7-5i -7-7i];
otherwise
error('wrong choice');
end
count=1;
map_out = zeros(1,ceil(length(input_seq)/mode));
for i=1:(ceil(length(input_seq)/mode))
temp=0;
for j=1:mode
temp=bitor(temp,bitshift(input_seq(count),(j-1)));
count=count+1;
if(count>length(input_seq))
break;
end
end
map_out(i)=b(temp+1);
end
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/zhoub86/ECE257B_OFDM_NL.git
git@gitee.com:zhoub86/ECE257B_OFDM_NL.git
zhoub86
ECE257B_OFDM_NL
ECE257B_OFDM_NL
master

搜索帮助

0d507c66 1850385 C8b1a773 1850385