commBCHEncoder/commBCHDecoder

  • Follow


Hi to all, 
This question is considered with the use of Communications
Toolbox/Blockset.

I am trying to write a m-file that uses the comm.BCHEncoder/comm.Decoder in MATLAB R2010b for the DVB-T2 (DVB-S2 are the same) standard?.

In  the DVB-S.2 model in Simulink the compiler doesn't complaint for any LDPC rate  and everything seems OK.
In my code,if I try to use comm.BCHEncoder with any code rate other than 1/2 again everything is OK.
When I try Kbch=32208 and Nbch=32400, 
I get an error:The values for N and K do not produce a valid narrow-sense BCH code.

%-----------------BCH encoding....  --------------------------------------
%  
% Constrution of BCH_Encoder and BCH_Decoder
N_BCH=32400;
K_BCH=32208;
BBFrame=round(rand(32208,1));
BCH_Encoder=comm.BCHEncoder('CodewordLength',N_BCH,'MessageLength',K_BCH,'GeneratorPolynomial',g);
BCH_Decoder=comm.BCHDecoder('CodewordLength',N_BCH,'MessageLength',K_BCH,'GeneratorPolynomial',g);

BCHFrame=step(BCH_Encoder
Where BBframe  is a random 32400 binary vector, and g the generator polynomial exactly the same as in the Simulink model DVB.S2 (can be found under "dvb stuct".
P.S.   I also tried to use the PrimitivePolynomial with no success.   

Hope for help  
kindly regards Spiros
0
Reply Spiros 12/18/2010 3:37:04 PM

Hi Spiros,
You also need to set the appropriate primitive polynomial.  Please have a look at the function called "getParamsDVBS2Demo" that comes with the DVBS2 demo.  The demo uses the G^16 minimum weight primitive polynomial (e.g. primpoly(16,'min')).
Hth,
Ethem

"Spiros " <spzettas@gmail.com> wrote in message <ieikf0$s16$1@fred.mathworks.com>...
> Hi to all, 
> This question is considered with the use of Communications
> Toolbox/Blockset.
> 
> I am trying to write a m-file that uses the comm.BCHEncoder/comm.Decoder in MATLAB R2010b for the DVB-T2 (DVB-S2 are the same) standard?.
> 
> In  the DVB-S.2 model in Simulink the compiler doesn't complaint for any LDPC rate  and everything seems OK.
> In my code,if I try to use comm.BCHEncoder with any code rate other than 1/2 again everything is OK.
> When I try Kbch=32208 and Nbch=32400, 
> I get an error:The values for N and K do not produce a valid narrow-sense BCH code.
> 
> %-----------------BCH encoding....  --------------------------------------
> %  
> % Constrution of BCH_Encoder and BCH_Decoder
> N_BCH=32400;
> K_BCH=32208;
> BBFrame=round(rand(32208,1));
> BCH_Encoder=comm.BCHEncoder('CodewordLength',N_BCH,'MessageLength',K_BCH,'GeneratorPolynomial',g);
> BCH_Decoder=comm.BCHDecoder('CodewordLength',N_BCH,'MessageLength',K_BCH,'GeneratorPolynomial',g);
> 
> BCHFrame=step(BCH_Encoder
> Where BBframe  is a random 32400 binary vector, and g the generator polynomial exactly the same as in the Simulink model DVB.S2 (can be found under "dvb stuct".
> P.S.   I also tried to use the PrimitivePolynomial with no success.   
> 
> Hope for help  
> kindly regards Spiros
0
Reply Ethem 12/20/2010 4:07:20 PM


Hi Ethem
A found a solution, but the one you propose is more elegant.
Thanks a lot.
Regards Spiros
0
Reply Spiros 12/20/2010 7:03:07 PM

"Spiros" wrote in message <ieo99b$lep$1@fred.mathworks.com>...
> Hi Ethem
> A found a solution, but the one you propose is more elegant.
> Thanks a lot.
> Regards Spiros


Hello, Im working on DVB-T2 system and I got stuck on the same problem with BCH code as you did. Could you please tell me how you solved it ? Thanks a lot!
0
Reply Adam 3/2/2011 12:27:07 PM

I've mailed you my BCH code.
HTH
regards Spiros
0
Reply spzettas (2) 3/4/2011 10:56:24 AM

"Adam " <a.strouhal@centrum.cz> wrote in message <ikld2r$cg2$1@fred.mathworks.com>...
> "Spiros" wrote in message <ieo99b$lep$1@fred.mathworks.com>...
> > Hi Ethem
> > A found a solution, but the one you propose is more elegant.
> > Thanks a lot.
> > Regards Spiros
> 
> 
> Hello, Im working on DVB-T2 system and I got stuck on the same problem with BCH code as you did. Could you please tell me how you solved it ? Thanks a lot!
Hi Spiros
I am working on DVB-S2 in matlab
i faced same problem with BCH en/decoder
would you plz tell me how i can use bch decoder for dvb-s2 normal fecframes(64800)
with different rates e.g. 1/2
regards
0
Reply bahmanazarbad (9) 4/12/2011 7:15:08 AM

"Spiros" wrote in message <ikqggo$cnm$1@fred.mathworks.com>...
> I've mailed you my BCH code.
> HTH
> regards Spiros
Dear Spiros
I faced same problem using bch enc/dec in dvb-s2 model in matlab
i wonder if you can help me ,i need to know how you solved your problem for n,k in bch enc/dec
Thanks in advance
0
Reply bahmanazarbad (9) 4/12/2011 7:33:08 AM

"Bahman " <bahmanazarbad@yahoo.com> wrote in message <io0v7j$l0n$1@fred.mathworks.com>...
> "Spiros" wrote in message <ikqggo$cnm$1@fred.mathworks.com>...
> > I've mailed you my BCH code.
> > HTH
> > regards Spiros
> Dear Spiros
> I faced same problem using bch enc/dec in dvb-s2 model in matlab
> i wonder if you can help me ,i need to know how you solved your problem for n,k in bch enc/dec
> Thanks in advance
See your mail.
HTH
Spiros
0
Reply spzettas (2) 4/15/2011 7:35:20 PM

hello Spiros
could u please help me to find the solution for bch coding...
thank u
"Spiros" wrote in message <ieikf0$s16$1@fred.mathworks.com>...
> Hi to all, 
> This question is considered with the use of Communications
> Toolbox/Blockset.
> 
> I am trying to write a m-file that uses the comm.BCHEncoder/comm.Decoder in MATLAB R2010b for the DVB-T2 (DVB-S2 are the same) standard?.
> 
> In  the DVB-S.2 model in Simulink the compiler doesn't complaint for any LDPC rate  and everything seems OK.
> In my code,if I try to use comm.BCHEncoder with any code rate other than 1/2 again everything is OK.
> When I try Kbch=32208 and Nbch=32400, 
> I get an error:The values for N and K do not produce a valid narrow-sense BCH code.
> 
> %-----------------BCH encoding....  --------------------------------------
> %  
> % Constrution of BCH_Encoder and BCH_Decoder
> N_BCH=32400;
> K_BCH=32208;
> BBFrame=round(rand(32208,1));
> BCH_Encoder=comm.BCHEncoder('CodewordLength',N_BCH,'MessageLength',K_BCH,'GeneratorPolynomial',g);
> BCH_Decoder=comm.BCHDecoder('CodewordLength',N_BCH,'MessageLength',K_BCH,'GeneratorPolynomial',g);
> 
> BCHFrame=step(BCH_Encoder
> Where BBframe  is a random 32400 binary vector, and g the generator polynomial exactly the same as in the Simulink model DVB.S2 (can be found under "dvb stuct".
> P.S.   I also tried to use the PrimitivePolynomial with no success.   
> 
> Hope for help  
> kindly regards Spiros
0
Reply rtakilan (1) 5/14/2011 6:29:04 AM

"Spiros" wrote in message <ikqggo$cnm$1@fred.mathworks.com>...
> I've mailed you my BCH code.
> HTH
> regards Spiros

Good time of day!

Can you provide to me also this information?

Thanks a lot

V.B.
0
Reply ratty_vb (1) 5/22/2011 7:31:04 PM

 Dear Spiros
i also work on dvbs2 bch encoding and decoding. i am confused about constrution of  bch enc and dec in matlab in normal length ie , N_BCH=32400  and  K_BCH=32208. could you please mail you code to me?
thank you and with my best regards
Allice
0
Reply allicew (1) 6/2/2011 8:29:06 AM

"Spiros" wrote in message <ieikf0$s16$1@fred.mathworks.com>...
> Hi to all, 
> This question is considered with the use of Communications
> Toolbox/Blockset.
> 
> I am trying to write a m-file that uses the comm.BCHEncoder/comm.Decoder in MATLAB R2010b for the DVB-T2 (DVB-S2 are the same) standard?.
> 
> In  the DVB-S.2 model in Simulink the compiler doesn't complaint for any LDPC rate  and everything seems OK.
> In my code,if I try to use comm.BCHEncoder with any code rate other than 1/2 again everything is OK.
> When I try Kbch=32208 and Nbch=32400, 
> I get an error:The values for N and K do not produce a valid narrow-sense BCH code.
> 
> %-----------------BCH encoding....  --------------------------------------
> %  
> % Constrution of BCH_Encoder and BCH_Decoder
> N_BCH=32400;
> K_BCH=32208;
> BBFrame=round(rand(32208,1));
> BCH_Encoder=comm.BCHEncoder('CodewordLength',N_BCH,'MessageLength',K_BCH,'GeneratorPolynomial',g);
> BCH_Decoder=comm.BCHDecoder('CodewordLength',N_BCH,'MessageLength',K_BCH,'GeneratorPolynomial',g);
> 
> BCHFrame=step(BCH_Encoder
> Where BBframe  is a random 32400 binary vector, and g the generator polynomial exactly the same as in the Simulink model DVB.S2 (can be found under "dvb stuct".
> P.S.   I also tried to use the PrimitivePolynomial with no success.   
> 
> Hope for help  
> kindly regards Spiros

Hello Spiros,

I am faced with the same problem could you please help me out.
Your help will be appreciated.
Thanks a lot
0
Reply obina.iheme (2) 6/28/2011 1:21:04 PM

"Leonardo O. Iheme" <obina.iheme@yahoo.com> wrote in message <iuckg0$7o3$1@newscl01ah.mathworks.com>...
> "Spiros" wrote in message <ieikf0$s16$1@fred.mathworks.com>...
> > Hi to all, 
> > This question is considered with the use of Communications
> > Toolbox/Blockset.
> > 
> > I am trying to write a m-file that uses the comm.BCHEncoder/comm.Decoder in MATLAB R2010b for the DVB-T2 (DVB-S2 are the same) standard?.
> > 
> > In  the DVB-S.2 model in Simulink the compiler doesn't complaint for any LDPC rate  and everything seems OK.
> > In my code,if I try to use comm.BCHEncoder with any code rate other than 1/2 again everything is OK.
> > When I try Kbch=32208 and Nbch=32400, 
> > I get an error:The values for N and K do not produce a valid narrow-sense BCH code.
> > 
> > %-----------------BCH encoding....  --------------------------------------
> > %  
> > % Constrution of BCH_Encoder and BCH_Decoder
> > N_BCH=32400;
> > K_BCH=32208;
> > BBFrame=round(rand(32208,1));
> > BCH_Encoder=comm.BCHEncoder('CodewordLength',N_BCH,'MessageLength',K_BCH,'GeneratorPolynomial',g);
> > BCH_Decoder=comm.BCHDecoder('CodewordLength',N_BCH,'MessageLength',K_BCH,'GeneratorPolynomial',g);
> > 
> > BCHFrame=step(BCH_Encoder
> > Where BBframe  is a random 32400 binary vector, and g the generator polynomial exactly the same as in the Simulink model DVB.S2 (can be found under "dvb stuct".
> > P.S.   I also tried to use the PrimitivePolynomial with no success.   
> > 
> > Hope for help  
> > kindly regards Spiros
> 
> Hello Spiros,
> 
> I am faced with the same problem could you please help me out.
> Your help will be appreciated.
> Thanks a lot

Figured it out myself and solved it. Thanks
0
Reply obina.iheme (2) 7/4/2011 5:50:12 AM

I hope  you are still using this Forum.  Is there anyway you can send me the code as well.  I am having the same problem

Thanks!
Brian
0
Reply skibumlewy (5) 12/7/2011 9:05:09 PM

I am getting an error:

Error in ==> testing at 1
hEnc = comm.BCHEncoder;
 
??? Undefined function or variable 'comm'.

any idea how to fix this?

Thanks!
0
Reply skibumlewy (5) 12/7/2011 9:39:08 PM

"Spiros" wrote in message <ieo99b$lep$1@fred.mathworks.com>...
> Hi Ethem
> A found a solution, but the one you propose is more elegant.
> Thanks a lot.
> Regards Spiros

hello please i'm facing same problems here. could u help me out. fuluskaze@yahoo.com
0
Reply case28 (11) 6/23/2012 9:49:09 PM

hi,

plus i keep getting this error telling me my codeword length cant exceed 255...

??? Error using ==> fec.bchbase.setN at 20
N must equal 2^m-1 for some integer m between 3 and 8.

How can I achieve larger block lengths up to dvbs2 standards

"Fulus " <case28@gmail.com> wrote in message <js5dkl$kim$1@newscl01ah.mathworks.com>...
> "Spiros" wrote in message <ieo99b$lep$1@fred.mathworks.com>...
> > Hi Ethem
> > A found a solution, but the one you propose is more elegant.
> > Thanks a lot.
> > Regards Spiros
> 
> hello please i'm facing same problems here. could u help me out. fuluskaze@yahoo.com
0
Reply case28 (11) 6/23/2012 11:42:07 PM

"Fulus " <case28@gmail.com> wrote in message <js5k8f$gem$1@newscl01ah.mathworks.com>...
> hi,
> 
> plus i keep getting this error telling me my codeword length cant exceed 255...
> 
> ??? Error using ==> fec.bchbase.setN at 20
> N must equal 2^m-1 for some integer m between 3 and 8.
> 
> How can I achieve larger block lengths up to dvbs2 standards
> 
> "Fulus " <case28@gmail.com> wrote in message <js5dkl$kim$1@newscl01ah.mathworks.com>...
> > "Spiros" wrote in message <ieo99b$lep$1@fred.mathworks.com>...
> > > Hi Ethem
> > > A found a solution, but the one you propose is more elegant.
> > > Thanks a lot.
> > > Regards Spiros
> > 
> > hello please i'm facing same problems here. could u help me out. fuluskaze@yahoo.com

Dear Fulus

You need to make such intialization

You need to define parameters for each modcod according to etsi standard

%-----DVB-S2---INITIALIZATION.......an example

    EncoderBCH = comm.BCHEncoder;
    EncoderBCH.CodewordLength=N_BCH;
    EncoderBCH.MessageLength=K_BCH;
    EncoderBCH.PrimitivePolynomialSource='Property';
    EncoderBCH.PrimitivePolynomial=de2bi(65581,'left-msb');                                                                                                                                                                                                                                                                                                                                           
    EncoderBCH.GeneratorPolynomialSource='Property';
    EncoderBCH.GeneratorPolynomial=genBCH;
    EncoderBCH.CheckGeneratorPolynomial= false;
    henc = fec.ldpcenc(H);
    hdec = fec.ldpcdec(H);
    hdec.DecisionType = 'Hard decision';
    hdec.OutputFormat = 'Information part';
    hdec.NumIterations = 50;

    hdec.DoParityChecks = 'Yes';   

    DecoderBCH = comm.BCHDecoder;
    DecoderBCH.CodewordLength=N_BCH;
    DecoderBCH.MessageLength=K_BCH;
    DecoderBCH.PrimitivePolynomialSource='Property';
    DecoderBCH.PrimitivePolynomial=de2bi(65581,'left-msb');
    DecoderBCH.GeneratorPolynomialSource='Property';
    DecoderBCH.GeneratorPolynomial=genBCH;
    DecoderBCH.CheckGeneratorPolynomial= false;
Bahman
0
Reply bahmanazarbad (9) 6/24/2012 9:27:07 AM

Hello,

Thank you so much Bahman for your kind assistance. I am still getting an error message telling me my codeword length cant exceed 255. I think I am still doing something wrongly. Any help please. Thanks
0
Reply case28 (11) 6/26/2012 12:09:07 AM

"Spiros" wrote in message <ieo99b$lep$1@fred.mathworks.com>...
> Hi Ethem
> A found a solution, but the one you propose is more elegant.
> Thanks a lot.
> Regards Spiros

Hello, 

I really need immediate assistance on BCH encoding and decoding for dvbs2. I have encountered similar problems as you did. could you kindly assist me here. thanks

Fulus
0
Reply case28 (11) 7/3/2012 12:41:07 AM

"Fulus " <case28@gmail.com> wrote in message <jstf33$fjh$1@newscl01ah.mathworks.com>...
> "Spiros" wrote in message <ieo99b$lep$1@fred.mathworks.com>...
> > Hi Ethem
> > A found a solution, but the one you propose is more elegant.
> > Thanks a lot.
> > Regards Spiros
> 
> Hello, 
> 
> I really need immediate assistance on BCH encoding and decoding for dvbs2. I have encountered similar problems as you did. could you kindly assist me here. thanks
> 
> Fulus
%Dear fulus this is an example for QPSK 8/9 try it

genBCH_t8 =[1  0  0	 0	1  1  1	 0	0  0  0	 0	0  0  1  1	1  0  0	 1	0  0  1  ...
            0  1  0  1	0  1  1  1	1  1  0  1	1  1  0  0	0  1  0  0	1  0  0	 ...
            1  1  1  1	0  0  1  0	1  1  1	 1	0  1  1  1	1  0  1  0	0  0  1	 ...
            1  0  0  1	1  1  1  1	1  1  0  0	0  1  1	 0	1  1  0  1	0  1  1  ...
            1  0  1  0	1  0  0	 0	0  0  1  0	0  1  1  1	1  1  0  0	1  0  1  ...
            1  0  0  1	1  0  0  0	1  0  1  0	1  1];
    
        
    
    H = dvbs2ldpc(8/9);
    K_BCH=57472;
    N_BCH=57600;
    
    genBCH=genBCH_t8;
    EncoderBCH = comm.BCHEncoder;
    EncoderBCH.CodewordLength=N_BCH;
    EncoderBCH.MessageLength=K_BCH;
    EncoderBCH.PrimitivePolynomialSource='Property';
    EncoderBCH.PrimitivePolynomial=de2bi(65581,'left-msb');																																																																																			
    EncoderBCH.GeneratorPolynomialSource='Property';
    EncoderBCH.GeneratorPolynomial=genBCH;
    EncoderBCH.CheckGeneratorPolynomial= false;
    henc = fec.ldpcenc(H);
    hdec = fec.ldpcdec(H);
    hdec.DecisionType = 'Hard decision';
    hdec.OutputFormat = 'Information part';
    hdec.NumIterations = 50;

    hdec.DoParityChecks = 'Yes';    

    DecoderBCH = comm.BCHDecoder;
    DecoderBCH.CodewordLength=N_BCH;
    DecoderBCH.MessageLength=K_BCH;
    DecoderBCH.PrimitivePolynomialSource='Property';
    DecoderBCH.PrimitivePolynomial=de2bi(65581,'left-msb');
    DecoderBCH.GeneratorPolynomialSource='Property';
    DecoderBCH.GeneratorPolynomial=genBCH;
    DecoderBCH.CheckGeneratorPolynomial= false;
bahman
0
Reply bahmanazarbad (9) 7/3/2012 6:24:07 AM

Hello,

Thank you so much for the initialization you sent me, I have a better understanding now, the BCH is encoding well now. However, the LDPC is a bit of a problem. after the bchecoding the ldpc encoder returns that; ''Input must be a column vector of length K''.  I then reshapes the output bchfec  -  xsym=reshape( bchfec,length( bchfec)/k,k);

making it frame based column vectors of lenght N_BCH as input to the ldpc encoder. this now returns a diff error which I do not understand

Error using LDPCEncoder/step
Multichannel operation is not supported.

Error in DVBS2_a (line 54)
FECFrame=step(hEnc,xsym);

I am looking into any method to "Split Multichannel Frame-Based Signals into Individual Signals". I have had little or no success on it. I kindly would love ur input on how to go about this.

Thank you
0
Reply case28 (11) 7/16/2012 1:26:27 AM

"Fulus " <case28@gmail.com> wrote in message <jtvqk3$pdo$1@newscl01ah.mathworks.com>...
> Hello,
> 
> Thank you so much for the initialization you sent me, I have a better understanding now, the BCH is encoding well now. However, the LDPC is a bit of a problem. after the bchecoding the ldpc encoder returns that; ''Input must be a column vector of length K''.  I then reshapes the output bchfec  -  xsym=reshape( bchfec,length( bchfec)/k,k);
> 
> making it frame based column vectors of lenght N_BCH as input to the ldpc encoder. this now returns a diff error which I do not understand
> 
> Error using LDPCEncoder/step
> Multichannel operation is not supported.
> 
> Error in DVBS2_a (line 54)
> FECFrame=step(hEnc,xsym);
> 
> I am looking into any method to "Split Multichannel Frame-Based Signals into Individual Signals". I have had little or no success on it. I kindly would love ur input on how to go about this.
> 
> Thank you

Hi dear Fulus

There is no need to reshape only invert the out put of bch encoder
Suppose that the output of bch is this:
encodedData = step(EncoderBCH, data);
then you invert it 
encodedData=encodedData';
then
codeword = encode(henc, encodedData);
codeword will be your LDPC FECFRAME

Bahman
0
Reply bahmanazarbad (9) 7/16/2012 6:04:07 AM

Hello 

I have inverted the bch output just as you suggested but still the same "multichannel operation is not supported" error. here is a bit of my code so you might take a look
thank you.

hStr=RandStream('mt19937ar','seed',654321);
BBFrame=randi(hStr,[0,1],32208*k,1);
BCHFEC=step(EncoderBCH,BBFrame); 
BCHFEC=BCHFEC';
FECFrame=step(hEnc,BCHFEC);
hInt = comm.BlockInterleaver(permVec);
IntData = step(hInt, FECFrame);
hMod = comm.PSKModulator(M, 'PhaseOffset',pi/16); 
Msg_tx = step(hMod, IntData); 
Msg_tx = rectpulse(Msg_tx,NSAMP);
EbNo=5;
snr=EbNo+10*log10(H)-10*log10(Nsamp);
hAWGN = comm.AWGNChannel('NoiseMethod', ...
          'Signal to noise ratio (SNR)','SNR',snr);
noisy_msg = step(hAWGN, Msg_tx);
noisy_msg = intdump(noisy_msg, Nsamp);
hDemod = comm.PSKDemodulator(M, 'PhaseOffset',pi/16);
Msg_rx = step(hDemod, noisy_msg);
hDeInt = comm.BlockDeinterleaver(permVec);
FECFrame_rx = step(hDeInt, Msg_rx);
BCH_rx = step(hdec, FECFrame_rx);
BCH_rx =BCH_rx ';
BBFrame_rx = step(DecoderBCH, BCH_rx); 
0
Reply case28 (11) 7/16/2012 8:54:08 PM

"Fulus " <case28@gmail.com> wrote in message <ju1v1g$e24$1@newscl01ah.mathworks.com>...
> Hello 
> 
> I have inverted the bch output just as you suggested but still the same "multichannel operation is not supported" error. here is a bit of my code so you might take a look
> thank you.
> 
> hStr=RandStream('mt19937ar','seed',654321);
> BBFrame=randi(hStr,[0,1],32208*k,1);
> BCHFEC=step(EncoderBCH,BBFrame); 
> BCHFEC=BCHFEC';
> FECFrame=step(hEnc,BCHFEC);
> hInt = comm.BlockInterleaver(permVec);
> IntData = step(hInt, FECFrame);
> hMod = comm.PSKModulator(M, 'PhaseOffset',pi/16); 
> Msg_tx = step(hMod, IntData); 
> Msg_tx = rectpulse(Msg_tx,NSAMP);
> EbNo=5;
> snr=EbNo+10*log10(H)-10*log10(Nsamp);
> hAWGN = comm.AWGNChannel('NoiseMethod', ...
>           'Signal to noise ratio (SNR)','SNR',snr);
> noisy_msg = step(hAWGN, Msg_tx);
> noisy_msg = intdump(noisy_msg, Nsamp);
> hDemod = comm.PSKDemodulator(M, 'PhaseOffset',pi/16);
> Msg_rx = step(hDemod, noisy_msg);
> hDeInt = comm.BlockDeinterleaver(permVec);
> FECFrame_rx = step(hDeInt, Msg_rx);
> BCH_rx = step(hdec, FECFrame_rx);
> BCH_rx =BCH_rx ';
> BBFrame_rx = step(DecoderBCH, BCH_rx); 

Hi dear

First of all you need to send BBFrame of 64800 bits at once like this

data = randi([0 1], K_BCH, 1);
BCHFEC=step(EncoderBCH,data); 

second: there is no interleaving for QPSK at all
third:I prefer to do interleaving by making the element vector myself like this:

%----ELEMENTS FOR 8PSK (excluding rate 3/5 which is different)
    l=1;
    for i=1:21600
    
   
      Interleave_8psk_b(l,1)=i;
    
      Interleave_8psk_b(l+1,1)=i+21600;
    
      Interleave_8psk_b(l+2,1)=i+43200;
      l=l+3;
forth:I prefer to use AWGN instead of comm.awgn
fifth: as long as you may send single BBFrames I'm afraid there is no need for sampeling.(intdump and rectpulse)

Bahman
0
Reply bahmanazarbad (9) 7/17/2012 10:12:14 AM

Hello Bahman

I observed that its when i use "hEnc = comm.LDPCEncoder(H); and
hDec = comm.LDPCDecoder(H);"   that the decoder introduces errors. I used this because I got an error message which I could not understand while using the following you recommended:

henc = fec.ldpcenc(H);
hdec = fec.ldpcdec(H);
hdec.DecisionType = 'Hard decision';
hdec.OutputFormat = 'Information part';
hdec.NumIterations = 50;

here is the error message I got, which I have since been unable to resolve: 

Error using tf (line 293)
The values of the "num" and "den" properties must be row vectors or cell arrays of row
vectors, where each vector is nonempty and containing numeric data. Type "help tf.num" or
"help tf.den" for more information.

Error in step (line 97)
   sys = tf(a,b);

Error in wild (line 42)
        BCHFEC=step(henc,BBframe);
0
Reply case28 (11) 8/14/2012 5:39:07 PM

"Fulus " <case28@gmail.com> wrote in message <k0e2fr$p69$1@newscl01ah.mathworks.com>...
> Hello Bahman
> 
> I observed that its when i use "hEnc = comm.LDPCEncoder(H); and
> hDec = comm.LDPCDecoder(H);"   that the decoder introduces errors. I used this because I got an error message which I could not understand while using the following you recommended:
> 
> henc = fec.ldpcenc(H);
> hdec = fec.ldpcdec(H);
> hdec.DecisionType = 'Hard decision';
> hdec.OutputFormat = 'Information part';
> hdec.NumIterations = 50;
> 
> here is the error message I got, which I have since been unable to resolve: 
> 
> Error using tf (line 293)
> The values of the "num" and "den" properties must be row vectors or cell arrays of row
> vectors, where each vector is nonempty and containing numeric data. Type "help tf.num" or
> "help tf.den" for more information.
> 
> Error in step (line 97)
>    sys = tf(a,b);
> 
> Error in wild (line 42)
>         BCHFEC=step(henc,BBframe);

Hi dear

is your bbframe a row vector?
because error indicates that it is a column vector,try it inverted (BBframe')
0
Reply bahmanazarbad (9) 8/15/2012 2:49:08 AM

> Hi dear
> 
> is your bbframe a row vector?
> because error indicates that it is a column vector,try it inverted (BBframe')

Hello, 

yeah you right, I nverted it and it runs without errors now however, it still isnt function as it suppose to because as I go higher in Eb/No my BER isnt going lower but is actually increasing by a tiny amount. That is the Decoder is still introducing errors.
0
Reply case28 (11) 8/15/2012 11:53:08 AM

"Fulus " <case28@gmail.com> wrote in message <k0g2j4$ar5$1@newscl01ah.mathworks.com>...
> > Hi dear
> > 
> > is your bbframe a row vector?
> > because error indicates that it is a column vector,try it inverted (BBframe')
> 
> Hello, 
> 
> yeah you right, I nverted it and it runs without errors now however, it still isnt function as it suppose to because as I go higher in Eb/No my BER isnt going lower but is actually increasing by a tiny amount. That is the Decoder is still introducing errors.

Hi dear
you need to be careful about the noise you are introducing to awgn as well as noise variance you need to set in demodulator
0
Reply bahmanazarbad (9) 8/16/2012 4:19:10 AM

"Bahman " <bahmanazarbad@yahoo.com> wrote in message <k0hsbu$1kd$1@newscl01ah.mathworks.com>...
> "Fulus " <case28@gmail.com> wrote in message <k0g2j4$ar5$1@newscl01ah.mathworks.com>...
> > > Hi dear
> > > 
> > > is your bbframe a row vector?
> > > because error indicates that it is a column vector,try it inverted (BBframe')
> > 
> > Hello, 
> > 
> > yeah you right, I nverted it and it runs without errors now however, it still isnt function as it suppose to because as I go higher in Eb/No my BER isnt going lower but is actually increasing by a tiny amount. That is the Decoder is still introducing errors.
> 
> Hi dear
> you need to be careful about the noise you are introducing to awgn as well as noise variance you need to set in demodulator

Hi Everyone!

I hope that someone could help me, even.

I had the sames problems with BCH and LDPC Enc/Dec to make it run......but at the end I can solved.

Now, my problem is that when I use (without add a AWGN channel and modulation) encoder and decoder of BCH (in raw)......its returns 0 errors between the original msg and received/decoded msg. But its not so when I use LDPC (in raw) because I get to many errors (original msg - decoded msg).

Do you know why? I attach the code that I use:
H=dvbs2ldpc(1/4);
enc = fec.ldpcenc(H);  

dec = fec.ldpcdec(H);
dec.DecisionType = 'Hard decision';
dec.OutputFormat = 'Information part';
dec.NumIterations = 50;

msg = randi([0 1],1,enc.NumInfoBits);
codeword = encode(enc,msg);

decodedmsg = decode(dec, codeword);

% Compare with original message
disp(['Number of bits incorrectly decoded = ' ...
     num2str(nnz(decodedmsg-msg))]);

THANXXXX
0
Reply wishkeep (3) 8/22/2012 10:24:08 AM

"Ed MrTz" wrote in message <k12c08$sbt$1@newscl01ah.mathworks.com>...
> "Bahman " <bahmanazarbad@yahoo.com> wrote in message <k0hsbu$1kd$1@newscl01ah.mathworks.com>...
> > "Fulus " <case28@gmail.com> wrote in message <k0g2j4$ar5$1@newscl01ah.mathworks.com>...
> > > > Hi dear
> > > > 
> > > > is your bbframe a row vector?
> > > > because error indicates that it is a column vector,try it inverted (BBframe')
> > > 
> > > Hello, 
> > > 
> > > yeah you right, I nverted it and it runs without errors now however, it still isnt function as it suppose to because as I go higher in Eb/No my BER isnt going lower but is actually increasing by a tiny amount. That is the Decoder is still introducing errors.
> > 
> > Hi dear
> > you need to be careful about the noise you are introducing to awgn as well as noise variance you need to set in demodulator
> 
> Hi Everyone!
> 
> I hope that someone could help me, even.
> 
> I had the sames problems with BCH and LDPC Enc/Dec to make it run......but at the end I can solved.
> 
> Now, my problem is that when I use (without add a AWGN channel and modulation) encoder and decoder of BCH (in raw)......its returns 0 errors between the original msg and received/decoded msg. But its not so when I use LDPC (in raw) because I get to many errors (original msg - decoded msg).
> 
> Do you know why? I attach the code that I use:
> H=dvbs2ldpc(1/4);
> enc = fec.ldpcenc(H);  
> 
> dec = fec.ldpcdec(H);
> dec.DecisionType = 'Hard decision';
> dec.OutputFormat = 'Information part';
> dec.NumIterations = 50;
> 
> msg = randi([0 1],1,enc.NumInfoBits);
> codeword = encode(enc,msg);
> 
> decodedmsg = decode(dec, codeword);


> 
> % Compare with original message
> disp(['Number of bits incorrectly decoded = ' ...
>      num2str(nnz(decodedmsg-msg))]);
> 
> THANXXXX
DEAR WHERE IS YOUR TRANSMISSION CHANNEL??????
BAHMAN
0
Reply bahmanazarbad (9) 8/22/2012 12:06:09 PM

The input of decode method should be a bipolar soft signal where a 0 is 
represented by a real number greater than zero, and a 1 is represented by a 
real number less than 0.  If you try:

>> decodedmsg = decode(dec, 1-2*codeword);

You should see zero errors.  A more realistic simulation would be

rcvd = awgn(1-2*codeword, SNR);  % chose an SNR value
decodedmsg = decode(dec, rcvd);

Hth,
Ethem


"Bahman " <bahmanazarbad@yahoo.com> wrote in message 
news:k12hvh$ihk$1@newscl01ah.mathworks.com...
> "Ed MrTz" wrote in message <k12c08$sbt$1@newscl01ah.mathworks.com>...
>> "Bahman " <bahmanazarbad@yahoo.com> wrote in message 
>> <k0hsbu$1kd$1@newscl01ah.mathworks.com>...
>> > "Fulus " <case28@gmail.com> wrote in message 
>> > <k0g2j4$ar5$1@newscl01ah.mathworks.com>...
>> > > > Hi dear
>> > > >
>> > > > is your bbframe a row vector?
>> > > > because error indicates that it is a column vector,try it inverted 
>> > > > (BBframe')
>> > >
>> > > Hello, yeah you right, I nverted it and it runs without errors now 
>> > > however, it still isnt function as it suppose to because as I go 
>> > > higher in Eb/No my BER isnt going lower but is actually increasing by 
>> > > a tiny amount. That is the Decoder is still introducing errors.
>> >
>> > Hi dear
>> > you need to be careful about the noise you are introducing to awgn as 
>> > well as noise variance you need to set in demodulator
>>
>> Hi Everyone!
>>
>> I hope that someone could help me, even.
>>
>> I had the sames problems with BCH and LDPC Enc/Dec to make it 
>> run......but at the end I can solved.
>>
>> Now, my problem is that when I use (without add a AWGN channel and 
>> modulation) encoder and decoder of BCH (in raw)......its returns 0 errors 
>> between the original msg and received/decoded msg. But its not so when I 
>> use LDPC (in raw) because I get to many errors (original msg - decoded 
>> msg).
>>
>> Do you know why? I attach the code that I use:
>> H=dvbs2ldpc(1/4);
>> enc = fec.ldpcenc(H);  dec = fec.ldpcdec(H);
>> dec.DecisionType = 'Hard decision';
>> dec.OutputFormat = 'Information part';
>> dec.NumIterations = 50;
>>
>> msg = randi([0 1],1,enc.NumInfoBits);
>> codeword = encode(enc,msg);
>>
>> decodedmsg = decode(dec, codeword);
>
>
>>
>> % Compare with original message
>> disp(['Number of bits incorrectly decoded = ' ...
>>      num2str(nnz(decodedmsg-msg))]);
>>
>> THANXXXX
> DEAR WHERE IS YOUR TRANSMISSION CHANNEL??????
> BAHMAN 

0
Reply esozer (17) 8/22/2012 1:27:45 PM

Thanks so much, Ethem Sozer!!!!

It has been really useful!!!! Now, I can continue with the other blocks!

Thanks also to Bahman for the interest. I told that I was trying without channel block (awgn) and modulation.

Regards


Ethem Sozer" <esozer@mathworks.com> wrote in message <k12mok$784$1@newscl01ah.mathworks.com>...
> The input of decode method should be a bipolar soft signal where a 0 is 
> represented by a real number greater than zero, and a 1 is represented by a 
> real number less than 0.  If you try:
> 
> >> decodedmsg = decode(dec, 1-2*codeword);
> 
> You should see zero errors.  A more realistic simulation would be
> 
> rcvd = awgn(1-2*codeword, SNR);  % chose an SNR value
> decodedmsg = decode(dec, rcvd);
> 
> Hth,
> Ethem
> 
> 
> "Bahman " <bahmanazarbad@yahoo.com> wrote in message 
> news:k12hvh$ihk$1@newscl01ah.mathworks.com...
> > "Ed MrTz" wrote in message <k12c08$sbt$1@newscl01ah.mathworks.com>...
> >> "Bahman " <bahmanazarbad@yahoo.com> wrote in message 
> >> <k0hsbu$1kd$1@newscl01ah.mathworks.com>...
> >> > "Fulus " <case28@gmail.com> wrote in message 
> >> > <k0g2j4$ar5$1@newscl01ah.mathworks.com>...
> >> > > > Hi dear
> >> > > >
> >> > > > is your bbframe a row vector?
> >> > > > because error indicates that it is a column vector,try it inverted 
> >> > > > (BBframe')
> >> > >
> >> > > Hello, yeah you right, I nverted it and it runs without errors now 
> >> > > however, it still isnt function as it suppose to because as I go 
> >> > > higher in Eb/No my BER isnt going lower but is actually increasing by 
> >> > > a tiny amount. That is the Decoder is still introducing errors.
> >> >
> >> > Hi dear
> >> > you need to be careful about the noise you are introducing to awgn as 
> >> > well as noise variance you need to set in demodulator
> >>
> >> Hi Everyone!
> >>
> >> I hope that someone could help me, even.
> >>
> >> I had the sames problems with BCH and LDPC Enc/Dec to make it 
> >> run......but at the end I can solved.
> >>
> >> Now, my problem is that when I use (without add a AWGN channel and 
> >> modulation) encoder and decoder of BCH (in raw)......its returns 0 errors 
> >> between the original msg and received/decoded msg. But its not so when I 
> >> use LDPC (in raw) because I get to many errors (original msg - decoded 
> >> msg).
> >>
> >> Do you know why? I attach the code that I use:
> >> H=dvbs2ldpc(1/4);
> >> enc = fec.ldpcenc(H);  dec = fec.ldpcdec(H);
> >> dec.DecisionType = 'Hard decision';
> >> dec.OutputFormat = 'Information part';
> >> dec.NumIterations = 50;
> >>
> >> msg = randi([0 1],1,enc.NumInfoBits);
> >> codeword = encode(enc,msg);
> >>
> >> decodedmsg = decode(dec, codeword);
> >
> >
> >>
> >> % Compare with original message
> >> disp(['Number of bits incorrectly decoded = ' ...
> >>      num2str(nnz(decodedmsg-msg))]);
> >>
> >> THANXXXX
> > DEAR WHERE IS YOUR TRANSMISSION CHANNEL??????
> > BAHMAN 
0
Reply wishkeep (3) 8/25/2012 9:18:07 AM

Hi again!

After a while, I came back programming this code and with the "patch" told me before "decodedmsg = decode(dec, 1-2*codeword);" ran OKS but when I try to get BER curve of LDPC on AWGN channel and QPSK mod,  comparing with QPSK no coded reference curve...... the LDPC curve appears over the theorical QPSK curve, instead of plot below.

Anybody knows why?

Extra: I use dvds2ldpc to generate the H matrix and fec.ldpcenc/dec to code.

Thanks for all,

Edgar

"Ethem Sozer" <esozer@mathworks.com> wrote in message <k12mok$784$1@newscl01ah.mathworks.com>...
> The input of decode method should be a bipolar soft signal where a 0 is 
> represented by a real number greater than zero, and a 1 is represented by a 
> real number less than 0.  If you try:
> 
> >> decodedmsg = decode(dec, 1-2*codeword);
> 
> You should see zero errors.  A more realistic simulation would be
> 
> rcvd = awgn(1-2*codeword, SNR);  % chose an SNR value
> decodedmsg = decode(dec, rcvd);
> 
> Hth,
> Ethem
> 
> 
> "Bahman " <bahmanazarbad@yahoo.com> wrote in message 
> news:k12hvh$ihk$1@newscl01ah.mathworks.com...
> > "Ed MrTz" wrote in message <k12c08$sbt$1@newscl01ah.mathworks.com>...
> >> "Bahman " <bahmanazarbad@yahoo.com> wrote in message 
> >> <k0hsbu$1kd$1@newscl01ah.mathworks.com>...
> >> > "Fulus " <case28@gmail.com> wrote in message 
> >> > <k0g2j4$ar5$1@newscl01ah.mathworks.com>...
> >> > > > Hi dear
> >> > > >
> >> > > > is your bbframe a row vector?
> >> > > > because error indicates that it is a column vector,try it inverted 
> >> > > > (BBframe')
> >> > >
> >> > > Hello, yeah you right, I nverted it and it runs without errors now 
> >> > > however, it still isnt function as it suppose to because as I go 
> >> > > higher in Eb/No my BER isnt going lower but is actually increasing by 
> >> > > a tiny amount. That is the Decoder is still introducing errors.
> >> >
> >> > Hi dear
> >> > you need to be careful about the noise you are introducing to awgn as 
> >> > well as noise variance you need to set in demodulator
> >>
> >> Hi Everyone!
> >>
> >> I hope that someone could help me, even.
> >>
> >> I had the sames problems with BCH and LDPC Enc/Dec to make it 
> >> run......but at the end I can solved.
> >>
> >> Now, my problem is that when I use (without add a AWGN channel and 
> >> modulation) encoder and decoder of BCH (in raw)......its returns 0 errors 
> >> between the original msg and received/decoded msg. But its not so when I 
> >> use LDPC (in raw) because I get to many errors (original msg - decoded 
> >> msg).
> >>
> >> Do you know why? I attach the code that I use:
> >> H=dvbs2ldpc(1/4);
> >> enc = fec.ldpcenc(H);  dec = fec.ldpcdec(H);
> >> dec.DecisionType = 'Hard decision';
> >> dec.OutputFormat = 'Information part';
> >> dec.NumIterations = 50;
> >>
> >> msg = randi([0 1],1,enc.NumInfoBits);
> >> codeword = encode(enc,msg);
> >>
> >> decodedmsg = decode(dec, codeword);
> >
> >
> >>
> >> % Compare with original message
> >> disp(['Number of bits incorrectly decoded = ' ...
> >>      num2str(nnz(decodedmsg-msg))]);
> >>
> >> THANXXXX
> > DEAR WHERE IS YOUR TRANSMISSION CHANNEL??????
> > BAHMAN 
0
Reply wishkeep (3) 12/29/2012 4:18:11 PM

33 Replies
380 Views

(page loaded in 1.165 seconds)


Reply: