Communications Blockset | ![]() ![]() |
Data Formats for Block Coding
Each message or codeword is an ordered grouping of symbols. Each block in the Block Coding sublibrary processes one word in each time step, as described in Binary Format (All Coding Methods) below. Reed-Solomon coding blocks also let you choose between binary and integer data, as described in Integer Format (Reed-Solomon only).
Binary Format (All Coding Methods)
You can structure messages and codewords as binary vector signals, where each vector represents a message word or a codeword. At a given time, the encoder receives an entire message word, encodes it, and outputs the entire codeword. The message and code signals share the same sample time.
The figure below illustrates this situation. In this example, the encoder receives a four-bit message and produces a five-bit codeword at time 0. It repeats this process with a new message at time 1.
For all coding techniques except Reed-Solomon, the message vector must have length K and the corresponding code vector has length N. For Reed-Solomon codes, the message vector must have length M*K and the corresponding code vector has length M*N. Here M is an integer greater than or equal to 3 that satisfies N = 2M-1.
If the input to a block coding block is a frame-based vector, then it must be a column vector instead of a row vector.
To produce sample-based messages in the binary format, you can configure the Bernoulli Random Binary Generator block so that its Probability of a zero parameter is a vector whose length is that of the signal you want to create. To produce frame-based messages in the binary format, you can configure the same block so that its Probability of a zero parameter is a scalar and its Samples per frame parameter is the length of the signal you want to create.
Using Serial Signals. If you prefer to structure messages and codewords as scalar signals, where several samples jointly form a message word or codeword, then you can use the Buffer and Unbuffer blocks in the DSP Blockset. Be aware that buffering involves latency and multirate processing. See the reference page for the Buffer block for more details. If your model computes error rates, then the initial delay in the coding-buffering combination influences the Receive delay parameter in the Error Rate Calculation block. If you are unsure about the sample times of signals in your model, then selecting Sample time colors from the model's Format menu, or attaching Probe blocks (from the Simulink Signals & Systems library) to connector lines might help.
Integer Format (Reed-Solomon only)
A message word for an [N,K] Reed-Solomon code consists of M*K bits, which you can interpret as K symbols between 0 and 2M. Here N = 2M-1 and M is an integer greater than or equal to 3. The integer format for Reed-Solomon codes lets you structure messages and codewords as integer signals instead of binary signals. (If the input is a frame-based vector, then it must be a column vector instead of a row vector.)
Note In this context, Simulink expects the first bit to be the least significant bit in the symbol. "First" means the smallest index in a vector or the smallest time for a series of scalars. |
The figure below illustrates the equivalence between binary and integer signals for a Reed-Solomon encoder. The case for the decoder would be similar.
To produce sample-based messages in the integer format, you can configure the Random-Integer Generator block so that M-ary number and Initial seed parameters are vectors of the desired length and all entries of the M-ary number vector are 2M. To produce frame-based messages in the integer format, you can configure the same block so that its M-ary number and Initial seed parameters are scalars and its Samples per frame parameter is the length of the signal you want to create.
![]() | Channel Coding Terminology | Using Block Encoders and Decoders Within a Model | ![]() |