%M进制转换为二进制码元
M=log2(M);
[m,n]=size(received_data);
y=zeros(1,M*n);
for k1=1: n
for k2=1: M
if(received_data(k1)>=2^(M-k2))
y(M*(k1-1)+k2)=1;
received_data(k1)=received_data(k1)-2^(M-k2);
else
y(M*(k1-1)+k2)=0;
end
end
end
串并转换:
function y=StoP(input_bit_stream ,M)
% 串并转换
M=log2(M);
n=length(input_bit_stream);
y=zeros(1,n/M);
for k1=1: n/M
y(k1)=0;
for k2=1: M
y(k1)=y(k1)+input_bit_stream((k1-1)*M+k2)*2^(M-k2);
end
end
legend('未加频偏','无频偏估计','加频偏估计','SL','MSL');
grid on
xlabel( 'SNR(dB)')
ylabel('BER')
作者: nadi 时间: 2018-5-9 04:34
HI,
I am looking for a matlab code to split OFDM sub-carriers into odd and even sub-carriers, can anyone help me please?作者: nadi 时间: 2018-5-11 03:58