LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Generating BCH Codes for Forward Error Correction

Has anybody created VIs for generating BCH (Bose-Chaudhuri-Hochquenghem) error correction codes?

I need to generate the codes for a 16 bit data packet.

I've found samples in C on the web (http://www.eccpage.com/) but nothing in LV.

Thanks,
-dave
0 Kudos
Message 1 of 7
(6,695 Views)
I am not familiar with BCH, however you can call C DLLs in LabVIEW as well as Matlab.

So you could compile thier C code into a DLL and call it using the Call Library Function Node. For more information on that refer to Using External Code in LabVIEW

Or you can call the Matlab code using the Matlab Script structure. For more information refer to the LabVIEW User Manual.
0 Kudos
Message 2 of 7
(6,695 Views)
I should have mentioned in my post that I don't have easy access to a C compliler..... That's really where my problem lies.

thanks,
-dave
0 Kudos
Message 3 of 7
(6,695 Views)
Oh I see, that makes more sense now. I am not sure but you may be able to find an open source compiler that you can use on the Web.
0 Kudos
Message 4 of 7
(6,695 Views)
I found an open source compiler which helped me debug my VIs....

I don't have time to pretty up the VI and make it compatible for all cases, but I've attached the VI if anybody needs a way to create BCH codes for forward error correction.

It's fixed for a code length of 15<32 and max error of 2 bits, but that can be changed by setting "G" to the appropriate value.
-dave
Message 5 of 7
(6,695 Views)
Dave,

Thanks for closing the loop by posting the code here. I took a look at it and tried to clean it up a bit. I think the execution should be the same, but you may want to check it out. For example, what does the �d� variable do?

In addition if you would like to post the example to a more permanent location follow this link Example Code Library

From that link select "Submit new example code" at the bottom of the page. The code submitted there will just be another way for customers to find your code. In addition it lets you take credit for the work you have done.

Again thanks for the example.

Evan
National Instruments
0 Kudos
Message 6 of 7
(6,695 Views)

I hate to bump a topic that is over 6 years old, but I am in need of a simple BCH encoding algorithm and do not have the toolbox which provides this.  I only need the encoding algorithm so I am hoping to implement this .VI posted here. 

 

I have slightly altered the cleaned up version that was posted to have the inputs/outputs in a format that I expect, but I am worried that it is not correctly calculating the BCH code.  This is my first time working with BCH codes, but I need to implement the CCSDS version using n = 63, k = 56 7-bit BCH code with generator polynomial G(x) = x^7 + x^6 + x^2 + 1.

 

I think when using 0xC5C5C5C5C5C5C5 as my input message the 7 bit BCH is supposed to be 0x43, but I am getting 0x00.  Could someone with more experience than me see if I did something obviously wrong?  Or know of a way to validate a BCH encoding algorithm, so I know if what I did was correct.  I attached my modeified .vi.  Thanks!

0 Kudos
Message 7 of 7
(6,263 Views)