demapping_ofdm_qpsk2p.m
来自「通信系统中常用的多进制数字相位调制的源代码 并结合ofdm系统 加入了相应的保护」· M 代码 · 共 44 行
M
44 行
function data_re=demapping_ofdm_qpsk(R)
A=R;
pilot_index=[29 41 53 65 77 89 101 113 125 137 149 161 173 185 197 209];
%pilot_index1=[29 53 77 101 125 149 173 197];
%Pilot_index2=[41 65 89 113 137 161 185 209];
DC_index=129;
pilot_num=16;
pilot_flag=1;
DC_flag=1;
data_index=1;
k=29;
while k<=229
if pilot_flag<=pilot_num
if k==pilot_index(pilot_flag)
k=k+1;
pilot_flag=pilot_flag+1;%两边的数据不用管?
end
end
if DC_flag==1
if k==DC_index
k=k+1;
DC_flag=0; %求出导频指数和直流指数?
end
end
temp=data_index*2;
real_A=real(A(k));
imag_A=imag(A(k));
if (real_A>0)&(imag_A>0)
data_re(temp-1)=0;
data_re(temp)=0;
elseif (real_A<0)&(imag_A>0)
data_re(temp-1)=0;
data_re(temp)=1;
elseif (real_A<0)&(imag_A<0)
data_re(temp-1)=1;
data_re(temp)=1;
else
data_re(temp-1)=1; %一个符号解出两个比特流
data_re(temp)=0;
end
k=k+1;
data_index=data_index+1;
end
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?