You are on page 1of 9

______________________________________________________________________

TITLE : INTRODUCTION TO SIMULINK-II

DATE OF
: 17 th Oct , 2022
EXPERIMENT

Lab Number : 2

NAME : ___Asad Iqbal___

ROLL NO : ___200401033____

Instructor : _Ma’am Saniya Zafar_

Communication Systems Lab Page 1


______________________________________________________________________

 Objective:
In this lab, we will learn to develop advanced models in Simulink. We have already
got basic knowledge of MATLAB in the previous semester.
 Introduction to Simulink:
Simulink is a dynamic system simulation environment. This allows us to
represent our system as a block diagram where we can connect blocks using the
mouse and edit block parameters using the keyboard. Simulink supports linear and
nonlinear systems modeled in continuous time, sampled time, or
a mixture of both. We can easily create models from scratch or take
existing models and add to them. The simulation is interactive, so we can change
parameters on the fly and see what happens immediately.
 Lab Performance:
 Task 1:
 Generate 10 uniformly distributed random numbers in the range −𝑋𝑋 to 𝑋𝑋,
where 𝑋𝑋 refer to the last two digits of your registration number. Store these
numbers in a file named Data_File.mat by using the To file block. You will be
required to mention a Variable name and select Save format: Array. After
retrieving these random numbers, develop a stem plot in MATLAB.

 Procedure:
clc
close all
clear all
y=[-18.5486937023460,1.96021276012073,1.77729932068721,-
11.3365410754162,-28.2027317253885,-22.0105247725782,-
0.397538791130081,-
2.34657555322469,8.54986558088561,22.8347829672670];
stem(y)
title('Random No.')
xlabel('Frequency');
ylabel('Magnitude');

Communication Systems Lab Page 2


______________________________________________________________________

 Task 2:
 Implement the following equation in Simulink:

2 6
𝑦= (4 sin(3𝑡) − 3 cos(4𝑡)) + 𝑒−2𝑡. (2)
25 25

Communication Systems Lab Page 3


______________________________________________________________________

 Task 2:
Visit the following website and choose an audio sample
of your
choice.https://file-examples.com/index.php/sample-audio-
files/sample-mp3-download/
i. Display the time and frequency information of the chosen signal.
ii. At which frequency, you get the highest peak?
iii. Find two peaks on the time display of the signal. What is the time
difference between them?
1.
 Time Display:

 Frequency Display:

Communication Systems Lab Page 4


______________________________________________________________________

2. The highest peak is at 0.042 kHz.

3. T1=7.524, T2=2.508
▲T=5.0167

Communication Systems Lab Page 5


______________________________________________________________________

 Experiments: [CLO-2; PLO-4; P4]


 Declare a time vector (𝑡) in MATLAB and access it in Simulink. Implement
the following equation in Simulink:
𝜋 3
𝑠 = exp(−0.5𝑡) sin (𝑡 + )+
6 2
Plot s versus t in Simulink.
 Download any online available .mp3 file from the link mentioned in Task #3.
Using this file as “input signal” perform the following operations.
 In a new designing model, read the “input signal” and display its time series and
frequency spectrum.
 Add band limited white noise (from Sources) to the “input signal” in the
same model generating a “noisy signal”.
 Send the “input signal” and the “noisy signal” to two different variables in
MATLAB.
 Plot the signals in MATLAB (in two rows of the same Figure) and state the
difference that you notice between them.

a)

Communication Systems Lab Page 6


______________________________________________________________________

b)

c)

Communication Systems Lab Page 7


______________________________________________________________________

 There is almost no difference between the two signals. It means


the noise signal is not affecting our input signal.

 Conclusions:
From this lab report we conclude that with the help of SIMULINK software we can
compute any given equation. Also, we can display the time and frequency signal of
any given audio. We learn to plot/stem a signal using to workspace and from
Workspace.

Communication Systems Lab Page 8


______________________________________________________________________

////////////////////////////////////// The End///////////////////////////////////////

Communication Systems Lab Page 9

You might also like