Getting Started |
 |
Building the Hamming Code Model
You can build the Hamming code model by adding blocks to the model shown in the figure Channel Noise Model. To do so, follow these steps:
- Type
channeldoc
at the MATLAB prompt to open the channel noise model. Then save the model as my_hamming
in the directory where you keep your work files. See Saving a Model.
- Drag the following two Communications Blockset blocks from the Simulink Library Browser into the model window:
- Hamming Encoder block, from the Block sublibrary of the Error Detection and Correction library
- Hamming Decoder block, from the Block sublibrary of the Error Detection and Correction library
- Click the right border of the model and drag it to the right to widen the model window.
- Move the Binary Symmetric Channel block, the Error Rate Calculation block, and the Display block to the right by clicking and dragging. This creates more space between the Binary Symmetric Channel block and the blocks next to it. The model should now look like the following figure.

- Click the Hamming Encoder block and drag it on top of the line between the Bernoulli Binary Generator block and the Binary Symmetric Channel block, to the right of the branch point, as shown in the following figure. Then release the mouse button. The Hamming Encoder block should automatically connect to the line from the Bernoulli Binary Generator block to the Binary Symmetric Channel block.

- Click the Hamming Decoder block and drag it on top of the line between the Binary Symmetric Channel block and the Error Rate Calculation block.
| Reducing the Error Rate Using a Hamming Code | | Hamming Encoder and Decoder |  |