| Communications Blockset™ | ![]() |
Block sublibrary of Channel Coding
The Hamming Encoder block creates a Hamming code with message length K and codeword length N. The number N must have the form 2M-1, where M is an integer greater than or equal to 3. Then K equals N-M.
The input must contain exactly K elements. If it is frame-based, then it must be a column vector. The output is a vector of length N.
The coding scheme uses elements of the finite field GF(2M). You can either specify the primitive polynomial that the algorithm should use, or you can rely on the default setting:
To use the default primitive polynomial, simply enter N and K as the first and second dialog parameters, respectively. The algorithm uses gfprimdf(M) as the primitive polynomial for GF(2M).
To specify the primitive polynomial, enter N as the first parameter and a binary vector as the second parameter. The vector represents the primitive polynomial by listing its coefficients in order of ascending exponents. You can create primitive polynomials using the Communications Toolbox™ gfprimfd function.
This block supports double and boolean data types.

The codeword length, which is also the output vector length.
Either the message length, which is also the input vector length; or a binary vector that represents a primitive polynomial for GF(2M).
hammgen (Communications Toolbox)
![]() | Hamming Decoder | Helical Deinterleaver | ![]() |
| © 1984-2008- The MathWorks, Inc. - Site Help - Patents - Trademarks - Privacy Policy - Preventing Piracy - RSS |