This document introduces Simulink and the Communications Blockset. It provides an overview of Simulink and how it can be used to model dynamic and embedded systems through interactive graphical modeling and customizable block libraries. It then describes the Communications Blockset and how it contains blocks for modeling various communication system processes. Finally, it outlines the steps to build an example model that simulates encoding, modulation, transmission over a noisy channel, decoding, and error rate calculation of a random binary message signal.
1. LAB No: 01
Introduction to Simulink and communication Blockset
Introduction to Simulink:
Simulink is an environment for simulation and model-based design for dynamic and embedded
systems. It provides an interactive graphical environment and a customizable set of block libraries
that let you design, simulate, implement, and test a variety of time-varying systems, including
communications, controls, signal processing, video processing, and image processing. Simulink
offers:
• A quick way of develop your model in contrast to text based-programming language such as e.g.,
C.
• Simulink has integrated solvers. In text based-programming language such as e.g., C you need
to write your own solver.
Start using Simulink
You start Simulink from the MATLAB IDE: Open MATLAB and select the Simulink icon in the
Toolbar:
2. Or type “Simulink” in the Command window, like this:
Then the following window appears (Simulink Library Browser):
3. The Simulink Library Browser is the library where you find all the blocks you may use in Simulink.
Simulink software includes an extensive library of functions commonly used in modeling a system.
These include:
• Continuous and discrete dynamics blocks, such as Integration, transfer functions, Transport
Delay, etc.
• Math blocks, such as Sum, Product, Add, etc.
• Sources, such as Ramp, Random Generator, Step, etc.
Block Libraries
Here are some common used Continuous Blocks:
Here are some common used Math Operations Blocks:
Here are some common used signal Routing Blocks:
Here are some common used Sinks Blocks:
4. Here are some common used Sources Blocks:
In addition, there are lots of block in different Toolboxes:
5. Introduction to Communications Blockset:
• The Communications Blockset is a collection of Simulink blocks designed for research,
development, system design, analysis, and simulation in the communications area.
• You can use the blockset’s ready-to-use blocks directly, or you can easily modify them to
implement your own methods and algorithms.
Communications Blockset
Blocks in this product can model various processes within communication systems, including:
• Signal generation
• Source coding
• Error-control coding
• Interleaving
• Modulation/demodulation
• Transmission along a channel
• Synchronization
The Example Model:
• The figure below shows the example model:
6. Overview of the Simulation
• This example simulation starts by creating a random binary message signal.
• The simulation encodes the message into a convolution code, modulates the code using the
binary phase shift keying (BPSK) technique, and adds white Gaussian noise to the modulated
data in order to simulate a noisy channel.
• Then, the simulation decodes the convolution code while trying to correct as many noise-
induced errors as possible.
• The decoding also involves some intermediate steps to prepare the received data for the
decoding block.
• Finally, the simulation compares the decoded information to the original message signal in
order to compute and display an error rate.
• The table below indicates which blocks from the Communications Blockset appear in the
model, the order they appear in the model, and the purpose each one serves.
The model also uses some blocks from Simulink and the DSP Blockset:
• Unbuffer (DSP Blockset)
• Complex to Real-Image (Simulink)
• Terminator (Simulink)
• Buffer (DSP Blockset)
• Display (Simulink)
7. Building the Model
Part 1: Placing the First Block
• To start building the model, follow these steps:
• Type commlib at the MATLAB prompt. This opens the Communications Blockset main
library.
• From the library's File menu, select New and then select Model. This opens a new model
window called untitled. You will build the example model in this window.
• From the model window's File menu, select Save. Choose an appropriate location and filename
for the model you are about to build. You should save the model frequently while you are
editing it, to avoid losing any work.
• In the Communications Blockset main library, double-click on the Comm Sources icon. This
opens the Comm Sources library.
• In the Comm Sources library, find the icon for the Bernoulli Random Binary Generator block.
Drag it into the model window. 12 Building the Model
• In the model window (not the Comm Sources library window), double-click on the Bernoulli
Random Binary Generator icon. This opens the block's parameter dialog box, also called its
mask.
8. Part 2: Placing Other Blocks
• This section tells how to find and configure the other blocks required for the example model.
First open the main libraries of the products that contain those blocks:
• To open the main DSP Blockset library, type dsplib at the MATLAB prompt.
• To open the main Simulink library, type simulink3 at the MATLAB prompt.
From the Communications Blockset Library:
• Convolutional Encoder < Use default parameter values >