| Products & Services | Solutions | Academia | Support | User Community | Company |
| Download Product Updates | | | Get Pricing | | | Trial Software |
| Documentation → Communications Toolbox |
| Contents | Index |
| Learn more about Communications Toolbox |
genpoly = bchgenpoly(n,k)
genpoly = bchgenpoly(n,k,prim_poly)
[genpoly,t] = bchgenpoly(...)
genpoly = bchgenpoly(n,k) returns the narrow-sense generator polynomial of a BCH code with codeword length n and message length k. The codeword length n must have the form 2m-1 for some integer m. The output genpoly is a Galois row vector in GF(2) that represents the coefficients of the generator polynomial in order of descending powers. The narrow-sense generator polynomial is LCM[m_1(x), m_2(x), ..., m_2t(x)], where LCM is the least common multiple, m_i(x) is the minimum polynomial corresponding to αi, α is a root of the default primitive polynomial for the field GF(n+1), and t is the error-correcting capability of the code.
Note Although the bchgenpoly function performs intermediate computations in GF(n+1), the final polynomial has binary coefficients. The output from bchgenpoly is a Galois vector in GF(2) rather than in GF(n+1). |
genpoly = bchgenpoly(n,k,prim_poly) is the same as the syntax above, except that prim_poly specifies the primitive polynomial for GF(n+1) that has A as a root. prim_poly is an integer whose binary representation indicates the coefficients of the primitive polynomial. To use the default primitive polynomial for GF(n+1), set prim_poly to [].
[genpoly,t] = bchgenpoly(...) returns t, the error-correction capability of the code.
The results below show that a [15,11] BCH code can correct one error and has a generator polynomial X4 + X + 1.
m = 4; n = 2^m-1; % Codeword length k = 11; % Message length % Get generator polynomial and error-correction capability. [genpoly,t] = bchgenpoly(n,k)
The output is
genpoly = GF(2) array.
Array elements =
1 0 0 1 1
t =
1
The maximum allowable value of n is 511.
bchenc, bchdec, bchnumerr, Block Coding
[1] Peterson, W. Wesley, and E. J. Weldon, Jr., Error-Correcting Codes, 2nd ed., Cambridge, MA, MIT Press, 1972.
![]() | bchenc | bchnumerr | ![]() |

Learn how to apply early verification to your development process through these technical resources.
How much time do you spend on testing to ensure implementation meets system-level requirements?
| © 1984-2009- The MathWorks, Inc. - Site Help - Patents - Trademarks - Privacy Policy - Preventing Piracy - RSS |