Dear sir ,
I am trying to create a matlab model of HARQ ( all types) using LDPC (llr based) as fec .
I wrote a code using matlab library (fec.ldpcenc-fec.ldpcdec) , but the BER curve is somehow different than the other literature works (the drop is around 3-5 dB SNR ,not between 0-1dB or 1-1.5dB ,also for high ldpc iteration(50) numbers bottom line of the curve is only 10^(-0.9)) .
Could you explain me what is wrong with my approach ,did i miss something (maybe sigma calculations?) ?
R=1/2;
t_er=zeros(1,21);
er=zeros(1,21);
SNRdB=-1:0.20:3;
trial=70;
enc = fec.ldpcenc; % Construct a default LDPC encoder object
dec = fec.ldpcdec; % Construct a companion LDPC decoder object
dec.DecisionType = 'Hard decision'; % Set decision type
dec.OutputFormat = 'Information part'; % Set output format
dec.NumIterations = 50; % Set number of iterations
dec.DoParityChecks = 'Yes'; % Stop if all parity-checks are satisfied
for z=1:21%z=1:length(SNRdB)
for run=1:trial
msg = randi([0 1],1,enc.NumInfoBits); % Generate a random binary message
codeword = encode(enc,msg); % Encode the message
% Construct a BPSK modulator object
modObj = modem.pskmod('M',2,'InputType','Bit');
% Modulate the signal (map bit 0 to 1 + 0i, bit 1 to -1 + 0i)
modulatedsig = modulate(modObj, codeword);
%dB to actual SNR
SNR(z)=10^(SNRdB(z)/10);
ebno_c(z)=SNR(z)*R; %Eb/No for coded signal!!!!!!!!!!!!!!<----!
% Noise parameters
var(z) = 1 / (2 * ebno_c(z));%No/2 !!!!!!!!!!!!!!!
%or-->sigma = sqrt((10^(-SNRdB(z)/10))/(2*R));
% Transmit signal through AWGN channel
receivedsig = modulatedsig+sqrt(var(z)).*randn(1,enc.blocklength);
%or-->receivedsig = modulatedsig+sigma.*randn(1,enc.blocklength);
% Construct a BPSK demodulator object to compute log-likelihood ratios
demodObj = modem.pskdemod(modObj,'DecisionType','LLR','NoiseVariance',var(z));
%or-->demodObj = modem.pskdemod(modObj,'DecisionType','LLR','NoiseVariance',sigma^2);
% Compute log-likelihood ratios (AWGN channel)
llr = demodulate(demodObj, receivedsig);
% Decode received signal
decodedmsg = decode(dec, llr);
% Actual number of iterations executed
iter = ...
num2str(dec.ActualNumIterations);
% Number of parity-checks violated
parity_checks_violated = num2str(sum(dec.FinalParityChecks));
% Compare with original message
er(z) = (nnz(decodedmsg-msg));
t_er(z)=t_er(z)+er(z);
end
av_er(z)=t_er(z)/trial;
ber(z)=av_er(z)/32400; %for R=1/3-->ber(z)=av_er(z)/21600;
end
semilogy(SNRdB,ber,'--rs','LineWidth',2,'MarkerEdgeColor','r')
Could you help me to get LDPC(DVB-S2) Eb/No-BER by using matlab library functions??
THANK YOU IN ADVANCE
|
|
0
|
|
|
|
Reply
|
on
|
11/19/2010 6:30:24 PM |
|
for R=1/3 BER graphs i used :
R=1/3;
H = dvbs2ldpc(R);
enc = fec.ldpcenc(H);
dec = fec.ldpcdec(H);
(enc=fec.ldpcenc; %creates 1/2 Rate DVB-S2 LDPC encoder object.)
"on on" <matidoisaduende@yahoo.com> wrote in message <ic6fo0$pqp$1@fred.mathworks.com>...
> Dear sir ,
> I am trying to create a matlab model of HARQ ( all types) using LDPC (llr based) as fec .
> I wrote a code using matlab library (fec.ldpcenc-fec.ldpcdec) , but the BER curve is somehow different than the other literature works (the drop is around 3-5 dB SNR ,not between 0-1dB or 1-1.5dB ,also for high ldpc iteration(50) numbers bottom line of the curve is only 10^(-0.9)) .
> Could you explain me what is wrong with my approach ,did i miss something (maybe sigma calculations?) ?
>
> R=1/2;
> t_er=zeros(1,21);
> er=zeros(1,21);
> SNRdB=-1:0.20:3;
> trial=70;
>
> enc = fec.ldpcenc; % Construct a default LDPC encoder object
> dec = fec.ldpcdec; % Construct a companion LDPC decoder object
> dec.DecisionType = 'Hard decision'; % Set decision type
> dec.OutputFormat = 'Information part'; % Set output format
> dec.NumIterations = 50; % Set number of iterations
> dec.DoParityChecks = 'Yes'; % Stop if all parity-checks are satisfied
>
> for z=1:21%z=1:length(SNRdB)
>
> for run=1:trial
> msg = randi([0 1],1,enc.NumInfoBits); % Generate a random binary message
> codeword = encode(enc,msg); % Encode the message
>
> % Construct a BPSK modulator object
> modObj = modem.pskmod('M',2,'InputType','Bit');
>
> % Modulate the signal (map bit 0 to 1 + 0i, bit 1 to -1 + 0i)
> modulatedsig = modulate(modObj, codeword);
>
> %dB to actual SNR
> SNR(z)=10^(SNRdB(z)/10);
> ebno_c(z)=SNR(z)*R; %Eb/No for coded signal!!!!!!!!!!!!!!<----!
>
> % Noise parameters
> var(z) = 1 / (2 * ebno_c(z));%No/2 !!!!!!!!!!!!!!!
>
> %or-->sigma = sqrt((10^(-SNRdB(z)/10))/(2*R));
>
> % Transmit signal through AWGN channel
> receivedsig = modulatedsig+sqrt(var(z)).*randn(1,enc.blocklength);
>
> %or-->receivedsig = modulatedsig+sigma.*randn(1,enc.blocklength);
>
>
> % Construct a BPSK demodulator object to compute log-likelihood ratios
> demodObj = modem.pskdemod(modObj,'DecisionType','LLR','NoiseVariance',var(z));
>
> %or-->demodObj = modem.pskdemod(modObj,'DecisionType','LLR','NoiseVariance',sigma^2);
>
>
> % Compute log-likelihood ratios (AWGN channel)
> llr = demodulate(demodObj, receivedsig);
>
> % Decode received signal
> decodedmsg = decode(dec, llr);
>
> % Actual number of iterations executed
> iter = ...
> num2str(dec.ActualNumIterations);
>
> % Number of parity-checks violated
> parity_checks_violated = num2str(sum(dec.FinalParityChecks));
>
> % Compare with original message
> er(z) = (nnz(decodedmsg-msg));
> t_er(z)=t_er(z)+er(z);
>
> end
> av_er(z)=t_er(z)/trial;
> ber(z)=av_er(z)/32400; %for R=1/3-->ber(z)=av_er(z)/21600;
> end
> semilogy(SNRdB,ber,'--rs','LineWidth',2,'MarkerEdgeColor','r')
>
>
> Could you help me to get LDPC(DVB-S2) Eb/No-BER by using matlab library functions??
> THANK YOU IN ADVANCE
>
>
|
|
0
|
|
|
|
Reply
|
on
|
11/19/2010 9:07:04 PM
|
|
Any luck getting an answer on this problem?
"on on" <matidoisaduende@yahoo.com> wrote in message <ic6fo0$pqp$1@fred.mathworks.com>...
> Dear sir ,
> I am trying to create a matlab model of HARQ ( all types) using LDPC (llr based) as fec .
> I wrote a code using matlab library (fec.ldpcenc-fec.ldpcdec) , but the BER curve is somehow different than the other literature works (the drop is around 3-5 dB SNR ,not between 0-1dB or 1-1.5dB ,also for high ldpc iteration(50) numbers bottom line of the curve is only 10^(-0.9)) .
> Could you explain me what is wrong with my approach ,did i miss something (maybe sigma calculations?) ?
>
> R=1/2;
> t_er=zeros(1,21);
> er=zeros(1,21);
> SNRdB=-1:0.20:3;
> trial=70;
>
> enc = fec.ldpcenc; % Construct a default LDPC encoder object
> dec = fec.ldpcdec; % Construct a companion LDPC decoder object
> dec.DecisionType = 'Hard decision'; % Set decision type
> dec.OutputFormat = 'Information part'; % Set output format
> dec.NumIterations = 50; % Set number of iterations
> dec.DoParityChecks = 'Yes'; % Stop if all parity-checks are satisfied
>
> for z=1:21%z=1:length(SNRdB)
>
> for run=1:trial
> msg = randi([0 1],1,enc.NumInfoBits); % Generate a random binary message
> codeword = encode(enc,msg); % Encode the message
>
> % Construct a BPSK modulator object
> modObj = modem.pskmod('M',2,'InputType','Bit');
>
> % Modulate the signal (map bit 0 to 1 + 0i, bit 1 to -1 + 0i)
> modulatedsig = modulate(modObj, codeword);
>
> %dB to actual SNR
> SNR(z)=10^(SNRdB(z)/10);
> ebno_c(z)=SNR(z)*R; %Eb/No for coded signal!!!!!!!!!!!!!!<----!
>
> % Noise parameters
> var(z) = 1 / (2 * ebno_c(z));%No/2 !!!!!!!!!!!!!!!
>
> %or-->sigma = sqrt((10^(-SNRdB(z)/10))/(2*R));
>
> % Transmit signal through AWGN channel
> receivedsig = modulatedsig+sqrt(var(z)).*randn(1,enc.blocklength);
>
> %or-->receivedsig = modulatedsig+sigma.*randn(1,enc.blocklength);
>
>
> % Construct a BPSK demodulator object to compute log-likelihood ratios
> demodObj = modem.pskdemod(modObj,'DecisionType','LLR','NoiseVariance',var(z));
>
> %or-->demodObj = modem.pskdemod(modObj,'DecisionType','LLR','NoiseVariance',sigma^2);
>
>
> % Compute log-likelihood ratios (AWGN channel)
> llr = demodulate(demodObj, receivedsig);
>
> % Decode received signal
> decodedmsg = decode(dec, llr);
>
> % Actual number of iterations executed
> iter = ...
> num2str(dec.ActualNumIterations);
>
> % Number of parity-checks violated
> parity_checks_violated = num2str(sum(dec.FinalParityChecks));
>
> % Compare with original message
> er(z) = (nnz(decodedmsg-msg));
> t_er(z)=t_er(z)+er(z);
>
> end
> av_er(z)=t_er(z)/trial;
> ber(z)=av_er(z)/32400; %for R=1/3-->ber(z)=av_er(z)/21600;
> end
> semilogy(SNRdB,ber,'--rs','LineWidth',2,'MarkerEdgeColor','r')
>
>
> Could you help me to get LDPC(DVB-S2) Eb/No-BER by using matlab library functions??
> THANK YOU IN ADVANCE
>
>
|
|
0
|
|
|
|
Reply
|
skibumlewy (5)
|
11/19/2011 6:33:29 PM
|
|
|
2 Replies
730 Views
(page loaded in 0.119 seconds)
|