Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

BCH Encoder Different result from MATLAB #8

Open
h-sh-h opened this issue Jan 11, 2022 · 1 comment
Open

BCH Encoder Different result from MATLAB #8

h-sh-h opened this issue Jan 11, 2022 · 1 comment

Comments

@h-sh-h
Copy link

h-sh-h commented Jan 11, 2022

Hi,
First of all thank you for making this great project.

One thing that I have problem with is the difference between the output of bch encoder for BCH(127,71) from MATLAB comm.BCHEncoder even if generator polynomials are the same.
I checked the ENC parameter and it's the same as "genpoly(127,71)" function from MATLAB.

But when I input the same data to both "bch_encode" and MATLAB function i get different encoded data. Actually the difference is only in the second part of data not the original part of data.

Can you please tell me why ?
Thanks

@h-sh-h
Copy link
Author

h-sh-h commented Jan 11, 2022

I came up with another problem
I know that "any polynomial that is a multiple of the generator polynomial is a valid BCH codeword" . But when I divide the encoded data by the generator polynomial it has non-zero remainder. when I do it with the MATLAB encoded data it has zero remainder which is correct

Why ?

example BCH(127_71)
"bch_verilog" encoded data =>
1 0 0 0 0 0 1 1 1 0 0 0 0 0 0 0 1 0 0 0 1 0 0 1 0 0 0 0 0 0 0 0 1 1 1 1 0 0 0 0 0 0 1 0 1 0 0 0 0 1 1 1 1 0 1 0 1 0 0 1 1 1 0 1 0 0 0 0 1 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 1 1 0 1 1 0 1 0 1 0 0 1 0 1 1 1 1 0 0 0 1 1 0 1 0 1 0 0 1 1

"MATLAB" encoded data =>
1 0 0 0 0 0 1 1 1 0 0 0 0 0 0 0 1 0 0 0 1 0 0 1 0 0 0 0 0 0 0 0 1 1 1 1 0 0 0 0 0 0 1 0 1 0 0 0 0 1 1 1 1 0 1 0 1 0 0 1 1 1 0 1 0 0 0 0 1 1 1 1 1 1 0 0 0 0 1 0 0 0 1 0 1 1 1 1 1 1 1 0 0 1 0 0 1 0 1 0 1 0 0 1 1 0 0 1 1 0 0 0 1 1 0 0 0 1 0 1 1 1 1 0 0 0 0

Thanks

PS : I changed the primitive polynomial for m=7 in bch_defs to make both MATLAB and bch_verilog the same and therfore the generator polynomials for both are the same

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant