I wrote a LDPC decoding code based on DVB-S2, but it also decodes well even under EbNo < -1.6dB

3 visualizaciones (últimos 30 días)
Below is the communication system model code written based on DVB-S2 standard.
The code runs well, but even when EbNo < -1.6dB, BER converges to 10^(-5) for low code rates.
I realized that the data should not be decoded well for low EbNo.
So can somebody help me with this?
The code might look little bit complicated, but I guess that the problem occurs at % RIcian channel fading part.
Thank you in advance.
CN = []; % For data collecting
list_G = [0 0; 1 0; 1 1; 0 1];
list_IQ = [cos(pi/4)+1i*sin(pi/4); cos(3*pi/4)+1i*sin(3*pi/4); cos(5*pi/4)+1i*sin(5*pi/4); cos(7*pi/4)+1i*sin(7*pi/4)];
for R = 3
if R == 1
r = 1/3; msglen = 5400; TIMES = 20; EbNo = [2,3,4];
elseif R == 2
r = 1/2; msglen = 7200; TIMES = 3; EbNo = [2];
elseif R == 3
r = 3/5; msglen = 9720; TIMES = 3; EbNo = [-0.5];%EbNo = 0.5:0.25:2.5;
elseif R == 4
r = 2/3; msglen = 10800; TIMES = 3; EbNo = [0 0.5];%EbNo = [1, 1.25, 1.5, 1.75, 2, 2.5, 3];
elseif R == 5
r = 3/4; msglen = 11880; TIMES = 2; EbNo = [2 3];%EbNo = 1.5:0.25:3.5;
elseif R == 6
r = 4/5; msglen = 12600; TIMES = 2; EbNo = [2.5 3.5];%EbNo = 2:0.25:4;
elseif R == 7
r = 5/6; msglen = 13320; TIMES = 2; EbNo = [2.5 3.5];%EbNo = [2, 2.25, 2.5, 2.75, 3, 3.5, 4];
elseif R == 8
r = 8/9; msglen = 14400; TIMES = 2; EbNo = [3.5 4.5];%EbNo = [3, 3.25, 3.5, 3.75, 4, 4.5, 5];
end
Hchk = DVBS2LDPC_H_short(r); [Hrow, Hcol] = find(Hchk ~= 0); % Sparse parity check matrix for DVB-S2
for TOT = 1:TIMES
%% Inner encoding: LDPC
msg = randi([0,1], 1, msglen);
Tx = DVBS2LDPC_short(msg, r); % Refer to DVBS2_QPSK_LDPC.m file
%% QPSK modulation
Tx4 = zeros(1,16200/2);
for i = 1:length(Tx)/2
if Tx(2*(i-1)+1:2*(i-1)+2) == [0 0]
Tx4(i) = list_IQ(1);
elseif Tx(2*(i-1)+1:2*(i-1)+2) == [1 0]
Tx4(i) = list_IQ(2);
elseif Tx(2*(i-1)+1:2*(i-1)+2) == [1 1]
Tx4(i) = list_IQ(3);
else
Tx4(i) = list_IQ(4);
end
end
%% Rician channel fading (I think the problem is around here!)
K = 10;
Es = mean(abs(Tx4).^2);
No = Es./((10.^(EbNo/10))*log2(4));
for jj = 1:length(EbNo)
tic
h = sqrt(K/(K+1)) + sqrt(1/(K+1))*(1/sqrt(2))*(randn(size(Tx4)) + 1j*randn(size(Tx4)));
ric_Tx = Tx4.*h;
AWGN = sqrt(No(jj)/2) * (randn(size(Tx4)) + 1j*randn(size(Tx4)));
ric_Rx_noise = ric_Tx + AWGN;
ric_Rx = ric_Rx_noise ./ h;
%% QPSK demodulation
Rx4 = [];
for i = 1:length(ric_Rx)
temp = abs(list_IQ - ric_Rx(i));
[m, idx] = min(temp);
Rx4 = [Rx4, list_G(idx,:)];
end
%% LDPC decode
% 0) Parity check: if checked good, no need to decode. Start from 1) if not
% 1) Initialize u_n
U = zeros(1,16200); count = 0;
for i = 1:length(ric_Rx)
U(2*(i-1)+1) = -(1/No(jj))*(real(ric_Rx(i))-(1/sqrt(2)))^2 + (1/No(jj))*(real(ric_Rx(i))-(-1/sqrt(2)))^2; % a priori log-likelihood ratio for the transmitted bit
U(2*(i-1)+2) = -(1/No(jj))*(imag(ric_Rx(i))-(1/sqrt(2)))^2 + (1/No(jj))*(imag(ric_Rx(i))-(-1/sqrt(2)))^2; % Remind: No = 2v^2 for Gaussian distribution
end
% 2) Initialization of outgoing messages from bit nodes
V_msg = [transpose(Hcol); transpose(Hrow)]; % 1st row: v-node, 2nd row: c-node, 3rd row: update from v-node to c-node
for i = 1:size(Hrow,1)
V_msg(3,i) = U(V_msg(1,i));
end
chk = mod(Hchk*Rx4',2); % Initialize chk to start LDPC iteration
while any(chk) && count < 50 && sum(chk==1)>=15
% 3) Check node update
C_re = []; % 1st row: c-node, 2nd row: v-node, 3rd row: respond from c-node to v-node
for i = 1:length(U)-msglen
tempC = []; % k번째 c-node가 연결되어 있는 v-node 및 받은 데이터 저장
for j = 1:size(V_msg,2)
if V_msg(2,j) == i
tempC = [tempC, V_msg(:,j)];
else
end
end
for j = 1:size(tempC,2)
temp = tempC(3,:); temp(:,j) = [];
temp = g(temp);
C_re = [C_re, [tempC(2,j);tempC(1,j);temp]]; % k번째 c-node가 연결되어 있는 v-node 및 보내는 데이터 저장
end
end
% 4) Bit node update
for i = 1:length(U)
tempC = []; % n번째 v-node가 연결되어 있는 c-node 및 받은 데이터 저장
for j = 1:size(C_re,2)
if C_re(2,j) == i
tempC = [tempC, C_re(:,j)];
else
end
end
for j = 1:size(tempC,2)
temp = tempC(3,:); temp(:,j) = [];
temp = sum(temp);
for n = 1:size(V_msg,2)
if V_msg(1,n) == tempC(2,j) && V_msg(2,n) == tempC(1,j)
V_msg(3,n) = U(V_msg(1,n)) + temp;
break
else
end
end
end
end
% 5) Hard decision making
for i = 1:length(U)/2
for j = 1:size(V_msg,2) % 1st bit of symbol
if C_re(2,j) == 2*i-1
temp = C_re(:,j);
break
end
end
list = [];
for j = 1:size(V_msg,2)
if V_msg(1,j) == temp(2)
list = [list, V_msg(:,j)];
end
end
for j = 1:size(list,2)
if list(2,j) == temp(1)
list = list(:,j);
break
end
end
TEMP = temp(3) + list(3); % temp(3) = w, list(3) = v
if TEMP >= 0
Rx4(2*i-1) = 0;
else
Rx4(2*i-1) = 1;
end
for j = 1:size(V_msg,2) % 2nd bit of symbol
if C_re(2,j) == 2*i
temp = C_re(:,j);
break
end
end
list = [];
for j = 1:size(V_msg,2)
if V_msg(1,j) == temp(2)
list = [list, V_msg(:,j)];
end
end
for j = 1:size(list,2)
if list(2,j) == temp(1)
list = list(:,j);
break
end
end
TEMP = temp(3) + list(3); % temp(3) = w, list(3) = v
if TEMP >= 0
Rx4(2*i) = 0;
else
Rx4(2*i) = 1;
end
end
count = count +1;
chk = mod(Hchk*Rx4',2);
[number,BER] = biterr(Tx(1:msglen),Rx4(1:msglen));
CN = [CN; r, TOT, EbNo(jj), count, number, sum(chk==1)];
end
if number <= 8
CN = [CN; r, TOT, EbNo(jj), count, 0, 0]; % Assume that BCH decoding is done well
end
toc
end
end
end

Respuestas (1)

Riya
Riya el 15 de Dic. de 2023
Hello Geewon,
As per my understanding, you wrote a LDPC decoding code based on DVB-S2, but it should decode well even under EbNo < -1.6dB
Please note that based on the provided code, here's a breakdown of the potential areas to focus on for addressing the convergence issue, along with some suggestions for improvement:
  • Rician Channel Fading
The Rician channel model seems to be implemented correctly. However, ensure that the parameters such as K factor, channel estimation, and noise variance are appropriate for the given scenario. You might consider testing different K factor values to see if the convergence behavior changes.
% Rician Channel Fading
K = 10;
Es = mean(abs(Tx4).^2);
No = Es./((10.^(EbNo/10))*log2(4));
for jj = 1:length(EbNo)
h = sqrt(K/(K+1)) + sqrt(1/(K+1))*(1/sqrt(2))*(randn(size(Tx4)) + 1j*randn(size(Tx4)));
ric_Tx = Tx4.*h;
AWGN = sqrt(No(jj)/2) * (randn(size(Tx4)) + 1j*randn(size(Tx4)));
ric_Rx_noise = ric_Tx + AWGN;
ric_Rx = ric_Rx_noise ./ h;
% ...
end
  • LDPC Decoding
Ensure that the LDPC decoder is functioning correctly, especially for low EbNo values. You may want to verify the LDPC decoder's performance at low SNR values.
For more information regarding fading channels you can refer the following document:
I hope it helps!

Categorías

Más información sobre AI for Wireless en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by