0% found this document useful (0 votes)
139 views21 pages

Lab 06 To Perform Block Coding in Simulink

The document provides instructions for simulating block coding techniques in Simulink. It describes using a Bernoulli binary generator to generate random binary data in frames, encoding the data using a Hamming encoder, optionally adding errors using a gain block, decoding the data using a Hamming decoder, and calculating the error rate. It also provides similar instructions for simulating Reed-Solomon coding using a random integer generator, Reed-Solomon encoder and decoder, and plotting the difference between the original and recovered messages.

Uploaded by

Arshad Ali
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
139 views21 pages

Lab 06 To Perform Block Coding in Simulink

The document provides instructions for simulating block coding techniques in Simulink. It describes using a Bernoulli binary generator to generate random binary data in frames, encoding the data using a Hamming encoder, optionally adding errors using a gain block, decoding the data using a Hamming decoder, and calculating the error rate. It also provides similar instructions for simulating Reed-Solomon coding using a random integer generator, Reed-Solomon encoder and decoder, and plotting the difference between the original and recovered messages.

Uploaded by

Arshad Ali
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 21

Mobile Communication Lab

Lab 06

To Perform Block Coding in Simulink

Prepared by Engr Ali M Durrani


1
(CECOS University) [email protected]
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) [email protected]
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) [email protected]
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) [email protected]
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) [email protected]
Example 6a
Hamming Code in Binary Format

Prepared by Engr Ali M Durrani


6
(CECOS University) [email protected]
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) [email protected]
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) [email protected]
Hamming Encoder
Hamming Decoder,
<with default parameter values>

Prepared by Engr Ali M Durrani


9
(CECOS University) [email protected]
• Error Rate Calculation
– Set Output data to Port

Prepared by Engr Ali M Durrani


10
(CECOS University) [email protected]
• Display

Prepared by Engr Ali M Durrani


11
(CECOS University) [email protected]
Running Simulation
• Connect the blocks as shown
• Set Stop time to inf

Prepared by Engr Ali M Durrani


12
(CECOS University) [email protected]
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) [email protected]
Example 6b
Reed-Solomon Code in Integer Format

Prepared by Engr Ali M Durrani


14
(CECOS University) [email protected]
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) [email protected]
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) [email protected]
Gain
- Set Gain to [0; 0; 0; 0; 0; ones(10,1)]

Prepared by Engr Ali M Durrani


17
(CECOS University) [email protected]
Unbuffer< Use the default parameter value>

Prepared by Engr Ali M Durrani


18
(CECOS University) [email protected]
• Scope

Prepared by Engr Ali M Durrani


19
(CECOS University) [email protected]
Running Simulation
• Connect the blocks as shown
• Set Stop time to 500

Prepared by Engr Ali M Durrani


20
(CECOS University) [email protected]
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) [email protected]

You might also like