I apologise in advance that his is a rather bare question in terms of code but here goes anyway.

I have some data generated by C code, which is essentially a block of bytes of variable length. This data block has to be presented as a block of 30 (24,12) Golay words, which gives me 360 bits/45 bytes of useable data.

The question is two-fold; 1) is there a Golay 24,12 C code that I can use and 2) how can I split the data into 30 blocks and present it as one?

I Googled around but unfortunately, I am not understanding the Golay encoding very well (or at all!), other than it provides error protection.

Hope someone can help.

Edit: I sort of worked it out but there seems to be several ways of doing this [1][2][3].

Different sources give me different results. Let's say my word is 0x222.

Source [1] gives me Golayed word as 0x91104D

Source [2] gives me Golayed word as 0xC85222

Source [3] gives me Golayed word as 0xC26222

Source [4] gives me Golayed word as 0xAC8222

  1. http://www.eccpage.com/golay23.c (with added parity making it 24,12)
  2. https://github.com/daniestevez/gr-ax100/blob/master/lib/golay24.c
  3. http://www.the-art-of-ecc.com/2_Short/golay24.c
  4. http://aqdi.com/articles/using-the-golay-error-detection-and-correction-code-3/

Which is correct?

0 Answers