都说华为的5G polar码很牛,对华为5G polar仿真了一下,结果大吃一惊。信号都淹没在噪声以下了,还能实现正确传输。
1 小小的科普一下
LDPC码和Turbo码相比,华为设计的极化码具有更好的性能,因此取代了LTE系统中用于控制信道的尾比特卷积码。它被应用于增强型移动宽带(eMBB)场景的下行和上行控制信息(DCI/UCI),以及广播信道(BCH)。
2 5G polar码处理
5G polar码的处理步骤:
1,生成 K-crcLen 个随机比特。
2,计算一个循环冗余校验(CRC)值,并将其附加到这些比特后面。
3,将附加了 CRC 的比特进行极化编码,使其达到母码块长度。
4,执行速率匹配操作,以传输 E 个比特。
5,对这 E 个比特进行调制。
6,添加指定功率的高斯白噪声。
7,对含噪信号进行软解调,输出对数似然比(LLR)值。
8,执行解速率匹配操作,包括打孔、缩短或重复等处理。
9,使用连续消除列表(CA-SCL)算法对恢复的 LLR 值进行极化解码,包括解交织操作。
3 结果
下图中上面一个是发送端的信号,BPSK调制的两个点清晰可见。下面一个是接收端的信号已经被噪声彻底淹没了。
看下图,在信号被淹没的情况下(此时信噪比为-1.1dB),竟然能过够实现无差错解调!
感兴趣的朋友代码拿去验证。
clear;
%%
% Specify the code parameters used for a simulation.
% Code parameters
K = 54; % Message length in bits, including CRC, K > 30
E = 124; % Rate matched output length, E <= 8192
% EbNo = 0.8;%0.8; % EbNo in dB
L = 8; % List length, a power of two, [1 2 4 8]
numFrames = 1000; % Number of frames to simulate
linkDir = 'DL'; % Link direction: downlink ('DL') OR uplink ('UL')
if strcmpi(linkDir,'DL')
% Downlink scenario (K >= 36, including CRC bits)
crcLen = 24;
poly = '24C';
nPC = 0;
nMax = 9;
iIL = true;
iBIL = false;
else
% Uplink scenario (K > 30, including CRC bits)
crcLen = 11;
poly = '11';
nPC = 0;
nMax = 10;
iIL = false;
iBIL = true;
end
n=1;
for EbNo = -2:0.5:2.5
R = K/E; % Effective code rate
bps = 1; %2 % bits per symbol, 1 for BPSK, 2 for QPSK
EsNo = EbNo + 10*log10(bps);
snrdB = EsNo + 10*log10(R); % in dB
noiseVar = 1./(10.^(snrdB/10));
% Channel
chan = comm.AWGNChannel('NoiseMethod','Variance','Variance',noiseVar);
%% Polar Decoding
% Error meter
ber = comm.ErrorRate;
numferr = 0;
for i = 1:numFrames
% Generate a random message
msg = randi([0 1],K-crcLen,1);
% Attach CRC
msgcrc = nrCRCEncode(msg,poly);
% Polar encode
% encOut = nrPolarEncode(msgcrc,E,nMax,iIL);
encOut = nrPolarEncode(msgcrc,E);
N = length(encOut);
% Rate match
modIn = nrRateMatchPolar(encOut,K,E,iBIL);
% Modulate
modOut = nrSymbolModulate(modIn,'BPSK');
% modOut = nrSymbolModulate(encOut,'BPSK');
% Add White Gaussian noise
rSig = chan(modOut);
% Soft demodulate
rxLLR = nrSymbolDemodulate(rSig,'BPSK',noiseVar);%QPSK
% Rate recover
decIn = nrRateRecoverPolar(rxLLR,K,N,iBIL);
% Polar decode
decBits = nrPolarDecode(decIn,K,E,L,nMax,iIL,crcLen);
% decBits = nrPolarDecode(rxLLR,K,E,L,nMax,iIL,crcLen);
% Compare msg and decoded bits
errStats = ber(double(decBits(1:K-crcLen)), msg);
numferr = numferr + any(decBits(1:K-crcLen)~=msg);
end
BitErrorRate(n)=errStats(1);
SNR(n)=snrdB;
n=n+1;
disp(['Block Error Rate: ' num2str(numferr/numFrames) ...
', Bit Error Rate: ' num2str(errStats(1)) ...
', at SNR = ' num2str(snrdB) ' dB'])
end
%%%%%%%%%%绘制polar码性能图%%%%%%%
plot(SNR,BitErrorRate,'-*');
title('polar码性能');
xlabel('SNR(dB)');
ylabel('BER');