Вы находитесь на странице: 1из 21

Mobile Communication Lab

Lab 06

To Perform Block Coding in Simulink

Prepared by Engr Ali M Durrani


1
(CECOS University) ali@cecos.edu.pk
Block Coding
• Error-control coding techniques detect and
possibly correct errors that occur when
messages are transmitted in a digital
communication system.

• To accomplish this, the encoder transmits not


only the information symbols but also extra
redundant symbols.

Prepared by Engr Ali M Durrani


2
(CECOS University) ali@cecos.edu.pk
Block Coding
• The decoder interprets what it receives, using the
redundant symbols to detect and possibly correct
whatever errors occurred during transmission.

• You might use error-control coding if your


transmission channel is very noisy or if your data
is very sensitive to noise.

• Depending on the nature of the data or noise,


you might choose a specific type of error-control
coding.
Prepared by Engr Ali M Durrani
3
(CECOS University) ali@cecos.edu.pk
Block Coding
• Block coding is a special case of error-control
coding.

• Block coding techniques maps a fixed number


of message symbols to a fixed number of code
symbols.

• A block coder treats each block of data


independently and is a memory-less device.
Prepared by Engr Ali M Durrani
4
(CECOS University) ali@cecos.edu.pk
Block Coding Features of the Blockset
• The class of block coding techniques includes
categories shown in the diagram below

Prepared by Engr Ali M Durrani


5
(CECOS University) ali@cecos.edu.pk
Example 6a
Hamming Code in Binary Format

Prepared by Engr Ali M Durrani


6
(CECOS University) ali@cecos.edu.pk
Building the Model
• To start building the model, follow these steps:

• Type commlib at the MATLAB prompt.


This opens the Communications Blockset main library.

• Type dsplib at the MATLAB prompt.


This opens the DSP Blockset main library.

• Type simulink3 at the MATLAB prompt.


This opens the Main Simulink Library.

• From the library's File menu, select New and then select Model.
Prepared by Engr Ali M Durrani
7
(CECOS University) ali@cecos.edu.pk
Bernoulli Binary Generator
• Probability of zeros 0.5
• Set Initial seed to any positive integer scalar
• Check the frame based data box
• Set Samples per frame to 4.

Prepared by Engr Ali M Durrani


8
(CECOS University) ali@cecos.edu.pk
Hamming Encoder
Hamming Decoder,
<with default parameter values>

Prepared by Engr Ali M Durrani


9
(CECOS University) ali@cecos.edu.pk
• Error Rate Calculation
– Set Output data to Port

Prepared by Engr Ali M Durrani


10
(CECOS University) ali@cecos.edu.pk
• Display

Prepared by Engr Ali M Durrani


11
(CECOS University) ali@cecos.edu.pk
Running Simulation
• Connect the blocks as shown
• Set Stop time to inf

Prepared by Engr Ali M Durrani


12
(CECOS University) ali@cecos.edu.pk
Lab Task 6a
• The following is Hamming Code in Binary
Format of block coding how will you analyze
original ,encoded and decoded data?

Prepared by Engr Ali M Durrani


13
(CECOS University) ali@cecos.edu.pk
Example 6b
Reed-Solomon Code in Integer Format

Prepared by Engr Ali M Durrani


14
(CECOS University) ali@cecos.edu.pk
Random Integer Generator
• Set M-ary number to 15.
• Set Initial seed to any prime number greater than 30
• Check the Frame-based outputs check box.
• Set Samples per frame to 5

Prepared by Engr Ali M Durrani


15
(CECOS University) ali@cecos.edu.pk
Integer-Input RS Encoder & Integer-Input RS Encoder
- Set Codeword length N to 15.
- Set Message length K to 5

Prepared by Engr Ali M Durrani


16
(CECOS University) ali@cecos.edu.pk
Gain
- Set Gain to [0; 0; 0; 0; 0; ones(10,1)]

Prepared by Engr Ali M Durrani


17
(CECOS University) ali@cecos.edu.pk
Unbuffer< Use the default parameter value>

Prepared by Engr Ali M Durrani


18
(CECOS University) ali@cecos.edu.pk
• Scope

Prepared by Engr Ali M Durrani


19
(CECOS University) ali@cecos.edu.pk
Running Simulation
• Connect the blocks as shown
• Set Stop time to 500

Prepared by Engr Ali M Durrani


20
(CECOS University) ali@cecos.edu.pk
Lab Task 6b
• The following is Reed-Solomon Code in Integer
Format of block coding how will you plot the
difference between the original message and
recovered message? (hint: use sum)

Prepared by Engr Ali M Durrani


21
(CECOS University) ali@cecos.edu.pk

Вам также может понравиться