Getting Started    

Setting Sample Times and Samples per Frame

It is important to set the Sample time and Samples per frame parameters correctly in the Signal From Workspace block, so that the block has the same frame size and frame period as the Hamming Encoder block. This ensures that errors coming from the Signal From Workspace block are synchronized with channel symbols coming from the Hamming Encoder block. To determine the correct sample time, use the following relationship.

The frame size of the signal coming from the Hamming Encoder block is 7. You set the frame size by the Codeword length parameter in the block's mask. So you should set the Samples per frame parameter in the Signal From Workspace block to 7.

The frame period of the Hamming Encoder block is 4, because the Bernoulli Binary Generator block has a Sample time of 1, and a Samples per frame of 4. So you should set the Sample time parameter in the Signal From Workspace block to 4/7 so that the frame period of the block is 4.

If you are not sure what the frame sizes and frame periods of signals in the model are, you can display them using a Probe block, as described in Building a Frequency-Shift Keying Model. To do this, attach two Probe blocks, one to the line leading out of the Hamming Encoder block and one to the line leading out of the Signal From Workspace block. In the masks for both Probe blocks, clear the boxes next to Probe complex signal and Probe signal dimensions. Next, attach Terminator blocks to the output ports of the Probe blocks. Then select Update diagram from the Edit menu. The model should appear as in the following figure.

Hamming Code Model with Probe Blocks

Both Probe blocks should display a frame size of 7 and a frame period of 4.

A quick way to check whether the frame periods of two signals are the same is to select Sample time colors from the Format menu. See Using Sample Time Colors to Check Sample Times.


  Simulating Noise with Specified Error Patterns Learning More