From: javi on

Hi all,

I need to implement a BCH encoder in c++. I already have the code
generator polinomial, and know k (the information block length) and n( the
codeword length). Does anybody know where I can find some info about how to
implement it? Or maybe some freely available code which performs this
encoding in c++?

If I got it right, the redundant bits are the reminder of dividing
(modulo-2)the information bits by the generator polinomial. But, should I
add zeros to the information bits before performing the division? I say
this because somewhere I read that I should add as many zeros as the
degree of the code generator polinomial.

And the other issue is, how to implement this modulo-2 division in c++? Is
there any available source that performs this operation?

This message was sent using the Comp.DSP web interface on
www.DSPRelated.com
From: jaco.versfeld on
Hi Javi,

> If I got it right, the redundant bits are the reminder of dividing
> (modulo-2)the information bits by the generator polinomial. But, should I
> add zeros to the information bits before performing the division? I say
> this because somewhere I read that I should add as many zeros as the
> degree of the code generator polinomial.

Yes, c(x) = x^{n-k}*p(x) + [x^{n-k}*p(x)] mod g(x). Thus, you shift
your data bits (represented by the polynomial p(x)) left and add the
remainder of the shifted polynomial divided by g(x). This gives you a
systematic encoding.

Another way is to construct the Generator matrix G, and to multiply
your data by G.

If you do not need a systematic encoding, you can simply multiply your
data polynomial p(x) by g(x).

> And the other issue is, how to implement this modulo-2 division in c++? Is
> there any available source that performs this operation?

I used Matlab for my coding simulations (very fast implementation, not
too fast when running the simulations). Otherwise, if you want to fast
track yourself without re-inventing the wheel using C++, try the NTL
library: http://www.shoup.net/ntl/ .

I also did some simulations (Reed-Solomon codes, a subclass of BCH
codes) using Java. I adapted the code from
http://jeans.studentenweb.org/study/tai/galois/galois.html to do my
Java simulations.

Hope this helps,
Jaco Versfeld

From: javi on
>Hi Javi,
>
>> If I got it right, the redundant bits are the reminder of dividing
>> (modulo-2)the information bits by the generator polinomial. But, should
I
>> add zeros to the information bits before performing the division? I
say
>> this because somewhere I read that I should add as many zeros as the
>> degree of the code generator polinomial.
>
>Yes, c(x) = x^{n-k}*p(x) + [x^{n-k}*p(x)] mod g(x). Thus, you shift
>your data bits (represented by the polynomial p(x)) left and add the
>remainder of the shifted polynomial divided by g(x). This gives you a
>systematic encoding.
>
>Another way is to construct the Generator matrix G, and to multiply
>your data by G.
>
>If you do not need a systematic encoding, you can simply multiply your
>data polynomial p(x) by g(x).
>
>> And the other issue is, how to implement this modulo-2 division in c++?
Is
>> there any available source that performs this operation?
>
>I used Matlab for my coding simulations (very fast implementation, not
>too fast when running the simulations). Otherwise, if you want to fast
>track yourself without re-inventing the wheel using C++, try the NTL
>library: http://www.shoup.net/ntl/ .
>
>I also did some simulations (Reed-Solomon codes, a subclass of BCH
>codes) using Java. I adapted the code from
>http://jeans.studentenweb.org/study/tai/galois/galois.html to do my
>Java simulations.
>
>Hope this helps,
>Jaco Versfeld
>
>

Thank you very much for your information,Jaco, I found it very helpful for
my work.

Best regards,

Javi

This message was sent using the Comp.DSP web interface on
www.DSPRelated.com