0% found this document useful (0 votes)
85 views20 pages

Lab 07 To Perform Interleaving in Simulink

This document provides instructions for performing block interleaving in Simulink. It discusses block coding, interleaving features, block interleavers, and provides an example of how to build a Simulink model to implement interleaving and improve error rate performance when the communication channel introduces burst errors. It also describes lab tasks to implement convolutional interleaving and verify that the original data is restored after interleaving and deinterleaving.

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)
85 views20 pages

Lab 07 To Perform Interleaving in Simulink

This document provides instructions for performing block interleaving in Simulink. It discusses block coding, interleaving features, block interleavers, and provides an example of how to build a Simulink model to implement interleaving and improve error rate performance when the communication channel introduces burst errors. It also describes lab tasks to implement convolutional interleaving and verify that the original data is restored after interleaving and deinterleaving.

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/ 20

Mobile Communication Lab

Lab 07

To Perform Block Interleaving in Simulink

Prepared by Engr Ali M Durrani


1
(CECOS University) [email protected]
Block Coding
• An interleaver permutes symbols according to a
mapping.

• A corresponding deinterleaver uses the inverse


mapping to restore the original sequence of
symbols.

• Interleaving and deinterleaving can be useful for


reducing errors caused by burst errors in a
communication system.

Prepared by Engr Ali M Durrani


2
(CECOS University) [email protected]
Interleaving Features of the Blockset
• This blockset provides interleavers in two broad
categories:

• Block interleavers.
This category includes matrix, random, algebraic,
and helical scan interleavers as special cases.

• Convolutional interleavers.
This category includes a helical interleaver as a
special case, as well as a general multiplexed
interleaver.
Prepared by Engr Ali M Durrani
3
(CECOS University) [email protected]
Block Interleavers
• A block interleaver accepts a set of symbols and
rearranges them, without repeating or omitting
any of the symbols in the set.

• The number of symbols in each set is fixed for a


given interleaver.

• The interleaver’s operation on a set of symbols is


independent of its operation on all other sets of
symbols.
Prepared by Engr Ali M Durrani
4
(CECOS University) [email protected]
Example 7a
The following example shows how to use an interleaver to
improve the error rate when the channel produces bursts of
errors

Prepared by Engr Ali M Durrani


5
(CECOS University) [email protected]
Creating the Vector of Errors
• Before running the model, use the following
code to create a binary vector in the MATLAB
workspace.

Prepared by Engr Ali M Durrani


6
(CECOS University) [email protected]
• To determine the ratio of the number of 1s to
the total number of symbols in the vector
errors, type

Prepared by Engr Ali M Durrani


7
(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
8
(CECOS University) [email protected]
Bernoulli Binary Generator
• Check the frame based data box
• Set Samples per frame to 4.
• Set output data type to Boolean

Prepared by Engr Ali M Durrani


9
(CECOS University) [email protected]
• Signal From Workspace
- Set Signal to errors.
- Set Sample time to 4/7.
- Set Samples per frame to 84

Prepared by Engr Ali M Durrani


10
(CECOS University) [email protected]
Hamming Encoder
Hamming Decoder,
<with default parameter values>

Prepared by Engr Ali M Durrani


11
(CECOS University) [email protected]
Buffer (2 copies)
(1) Set Output buffer size (per channel)to 84
(2) Set Output buffer size (per channel)to 7

Prepared by Engr Ali M Durrani


12
(CECOS University) [email protected]
Random Interleaver
Random Deinterleaver
- Set Number of elements to 84.

Prepared by Engr Ali M Durrani


13
(CECOS University) [email protected]
Logical Operator
- Set Operator to XOR

Prepared by Engr Ali M Durrani


14
(CECOS University) [email protected]
• Error Rate Calculation
Set Receive delay to (4/7)*84.
- Set Computation delay to 100.
- Set Output data to Port.

Prepared by Engr Ali M Durrani


15
(CECOS University) [email protected]
• Display

Prepared by Engr Ali M Durrani


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

Prepared by Engr Ali M Durrani


17
(CECOS University) [email protected]
Lab Task 7a
Implement the convolutional interleaving and
deinterleaving using a sequence of consecutive integers

• Ramp, in the Simulink Sources library

• Zero-Order Hold, in the Simulink Discrete library

• Convolutional Interleaver –
Set Rows of shift registers to 3 ,- Set Initial conditions to [-1 -2 -3].

• Convolutional Deinterleaver
• - Set Rows of shift registers to 3 , Set Initial conditions to [-1 -2 -3].
Prepared by Engr Ali M Durrani
18
(CECOS University) [email protected]
Lab task 7a continue
• Save the two copies of To Workspace with Variable name to
interleaved and restored, respectively.

• Set Save format to Array in each of the two copies of this block.

• Now set Stop time to 20. Run the simulation, then execute the
following command.

comparison = [[0:20]', interleaved, restored]

• In this output, the first column contains the original symbol


sequence. The second column contains the interleaved sequence,
while the third column contains the restored sequence.

Prepared by Engr Ali M Durrani


19
(CECOS University) [email protected]
Lab Task 7b
• What is the difference between the first and
last column of the comparison matrix in
Lab task 6a do you see the original data ?

Prepared by Engr Ali M Durrani


20
(CECOS University) [email protected]

You might also like