BCH decoding with erasures results in nonbinary vector

4 views (last 30 days)
I'm testing the performance of BCH codes with erasures and errors and occasionally the decoder will give me strange values. Take the following code, where I am sending the all zeros message with some errors and erasures.
bch_dec = fec.bchdec(31,16);
errors = [0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 1 1 0]';
erasures=[0 0 0 0 0 1 1 1 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0]';
decoded = decode(bch_dec, errors, erasures)'
ans = [0 0 0 0 0 28 29 20 0 0 0 14 0 0 0 0]
I was expecting to always receive a binary vector so I'm not sure how to interpret these results.

Answers (2)

Suneesh
Suneesh on 7 Dec 2011
How did you generate the 'error' vector? For a BCH Decoder with N=31 and K = 16, decoding your 'error' vector without any erasures would result in DECODE reporting 3 errors corrected. So any erasures, even a single one, would result in a failed decoding and hence the garbage value. Try: [decoded,cnumerr] = decode(bch_dec, errors);
A 'cnumerr' value of -1 indicates a failed decoding.
  1 Comment
Jacques
Jacques on 7 Dec 2011
I'm just doing a monte carlo simulation with an error and erasure model. I'm usually not checking cnumerr but in this case it is 1. I'm trying to gather information on such things as BER so I would like the decoding algorithm to output a binary vector even when it isn't possible to correctly decode the input.

Sign in to comment.


Suneesh
Suneesh on 7 Dec 2011
For BER calculations I would suggest using an example message, encoding it, then introducing errors and erasures within the capabilities of the BCH decoder that you are using, then decoding and comparing with the original data for bit errors.
Also cnumerr = 1 indicates that 1 error has been corrected. cnumerr = -1 indicates failed decoding
HTH Suneesh

Community Treasure Hunt

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

Start Hunting!