Do we need to reset the state of nrLDPCDecode for correct output?
3 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
Hello,
I am simulating a communication system with the 5G NR toolbox. I am generating one data frame and encoding it with LDPC using nrLDPCEncode. Then, this encoded data frame is passed through a fading channel, and awgn noise is added. At the receiver, I will take the same received frame, and pass it through 2 algorithms (channel estimation and data detection) to get 2 results. Now, these 2 algorithms all use nrLDPCDecode on the same frame of data. The performance is compared after running the simulation for maybe some 1000 channel realizations and for different SNRs.
Now the question is, I am using the same transmitted data frame, and running it through nrLDPCDecode after processing it with different algorithms at the receiver. Will this cause some issue while decoding? Earlier, we used to be able to do reset(LDPCDecoder) and release(LDPCDecoder) if we had an comm.LDPC decoding object, and that ensured that the objects did not have any residual memory and its states were cleared. Does this happen automatically in nrLDPCDecode? Or are we expected to encode and decode a single stream each time?
A pseudocode of what happens with my algorithm. This is just for representation, I am not doing the full OFDM modulation or other steps here. This code won't run as it is not complete, just meant to give you an idea. My question is, is the structure/flow of the code wrong? Do I need to do algorithm1 and algorithm2 seperately? Do I need to generate new data each time?
data = randi([0 1],transport_block_length,1);
CRCencoded = nrCRCEncode(datain,cbsInfo.CRC);
cbsIn = nrCodeBlockSegmentLDPC(CRCencoded,cbsInfo.BGN);
enc_bits = nrLDPCEncode(cbsIn,cbsInfo.BGN);
outlen = ceil(transport_block_length/rate);
ratematched_bits = nrRateMatchLDPC(enc_bits,outlen,rv,modulation,nlayers);
Mod_data = qammod(ratematched_bits,Mvec(1),'UnitAveragePower',true,'InputType','bit');
channel_object = =comm.RayleighChannel('SampleRate',Fs,'PathDelays',delays, ...
'AveragePathGains',powers_dB, 'NormalizePathGains',false,...
'MaximumDopplerShift',fd_max,'PathGainsOutputPort',true);
for snr_ii=1:length(snr)
for mc_ii = 1:No_of_Channel_Realizations
release(channel_object); reset(channel_object);
[Faded_Data,CIR] = chan(Mod_data);
Received_data = Faded_Data+AWGN_Noise;
Processed_LLR_Values1 = algorithm1(Received_data);
Processed_LLR_Values2 = algorithm2(Received_data);
%% Post Processing 1
raterec_bits1 = nrRateRecoverLDPC(Processed_LLR_Values1(:),transport_block_length,rate,rv,modulation,nlayers);
[dec_bits1]= nrLDPCDecode(raterec_bits1,cbsInfo.BGN,20); %Max number of iterations fixed roughly according to the graph in "New stopping criteria for iterative decoding of LDPC codes in H-ARQsystems"
cbsOut1 = nrCodeBlockDesegmentLDPC(dec_bits1,cbsInfo.BGN,desegmentlength);
CRCdecoded1 = nrCRCDecode(cbsOut1,cbsInfo.CRC);
bit_error1(mc_ii) = sum(CRCdecoded1~=data)/length(CRCdecoded1);
%% Post Processing 2
raterec_bits2 = nrRateRecoverLDPC(Processed_LLR_Values2(:),transport_block_length,rate,rv,modulation,nlayers);
[dec_bits2]= nrLDPCDecode(raterec_bits2,cbsInfo.BGN,20); %Max number of iterations fixed roughly according to the graph in "New stopping criteria for iterative decoding of LDPC codes in H-ARQsystems"
cbsOut2 = nrCodeBlockDesegmentLDPC(dec_bits2,cbsInfo.BGN,desegmentlength);
CRCdecoded2 = nrCRCDecode(cbsOut2,cbsInfo.CRC);
bit_error2(mc_ii) = sum(CRCdecoded2~=data)/length(CRCdecoded2);
end
end
0 commentaires
Réponses (1)
Nadia Shaik
le 10 Mar 2023
Hi Abhay,
I understand that you wish to know if the "nrLDPCDecode" have any residual memory and if you can use the same transmitted data frame and run it through "nrLDPCDecode" after processing it with different algorithms at the receiver.
The "comm.LDPCDecoder" is a System Obejct and therefore has "reset" and "release" functions. On the other hand, the "nrLDPCDecode" function works on a set of LLRs (Log-Likelihood Ratios) and does not retain any memory of previous decoding runs or the algorithms used to process the received data. If the input to "nrLDPCDecode" is a valid set of LLRs and the decoding process is configured with the same parameters for both runs, the decoding results should be consistent.
I hope this helps!
0 commentaires
Voir également
Catégories
En savoir plus sur Wireless Communications dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!