Practical File
Communication System & Networks
Simulation Lab (EC-644)
M. Tech (CSN) 2nd Semester: Academic Year
2024-25
Submitted by
G DEVENDHAR
(Roll No.:)
To
Dr. RAKESH SHARMA
Assistant Professor
E&CE Department
Electronics & Communication Engineering
Department
NATIONAL INSTITUTE OF TECHNOLOGY
HAMIRPUR
Hamirpur, Himachal Pradesh – 177005 (India)
January-June 2025
Index
S. Pag Remar
Experiment Date
No. e ks
1. Introduction to MATLAB
Generation of Basic continuous and
2.
discrete signals
Write a MATLAB program to find the linear
3.
convolution of two discrete signals
INTRODUCTION TO MATLAB
MATLAB (MATRIX LABORATORY):
MATLAB is a software package for high-performance language
for technical computing. It integrates computation, visualization, and
programming in an easy-to-use environment where problems and
solutions are expressed in familiar mathematical notation. Typical uses
include the following.
Math and computation
Algorithm development
Data acquisition
Modeling, simulation, and prototyping
Data analysis, exploration, and visualization
Scientific and engineering graphics
Application development, including graphical user interface
building
The name MATLAB stands for matrix laboratory. MATLAB was
originally written to provide easy access to matrix software developed
by the LINPACK and EISPACK projects. Today, MATLAB engines
incorporate the LAPACK and BLAS libraries, embedding the state of
the art in software for matrix computation.
MATLAB has evolved over a period of years with input from many
users. In university environments, it is the standard instructional tool
for introductory and advanced courses in mathematics, engineering,
and science. In industry, MATLAB is the tool of choice for high-
productivity research, development, and analysis.
MATLAB features a family of add-on application-specific solutions
called toolboxes. Very important to most users of MATLAB, toolboxes
allow learning and applying specialized technology. Toolboxes are
comprehensive collections of MATLAB functions (M-files) that extend
the MATLAB environment to solve classes of problems. Areas in which
toolboxes are available include Image processing, signal processing,
control systems, neural networks, fuzzy logic, wavelets, simulation, and
many others.
The main features of MATLAB
1. Advance algorithm for high-performance numerical computation,
especially in the
Field matrix algebra
2. A large collection of predefined mathematical functions and the
ability to define one’s own functions.
3. Two-and three-dimensional graphics for plotting and displaying
data
4. A complete online help system
5. Powerful, matrix, or vector-oriented high-level programming
language for individual applications.
6. Toolboxes available for solving advanced problems in several
application areas
Common Procedure to all Programs in MATLAB
1. Click on the MATLAB Icon on the desktop.
2. MATLAB window open.
3. Click on the ‘FILE’ Menu on the menu bar.
4. Click on NEW M-File from the File Menu.
5. An editor window opens and starts typing commands.
6. Now SAVE the file in the directory.
7. Then Click on DEBUG from the Menu bar and Click Run.
Experiment: 1
LINEAR CONVOLUTION
Aim: To find the output with linear convolution operation using
MATLAB Software.
EQUIPMENT:
PC with Windows/MacOS
MATLAB Software
Theory:
Convolution is a mathematical operation used to express the relation
between input and output of an LTI system. It relates to the input,
output, and impulse response of an LTI system as
y(t)=x(t)*h(t)
Where y (t) = output of LTI system
x (t) = input of LTI system
h (t) = impulse response of LTI system
There are two types of convolutions:
Continuous convolution
Discrete convolution
Continuous Convolution
y(t)=x(t)∗h(t)
=∫x(τ)h(t−τ)dτ = ∫x(t−τ)h(τ)dτ
Discrete Convolution
y(n)=x(n)∗h(n)
=Σx(k)h(n−k) = Σx(n−k)h(k)
By using convolution, we can find the zero-state response of the
system.
Algorithm/Pseudocode:
Program:
%% Convolution of two sequences
clc;
close all;
clear all;
x1=input('enter the 1st sequence');
x2=input('enter the 2nd sequence');
l1=length(x1);
l2=length(x2);
if(l1<l2)
X1=[x1,zeros(1,l2-l1)];
X2=x2;
else
X2=[x2,zeros(1,l1-l2)];
X1=x1;
end
c=conv(X1,X2);
stem(c);
title('convolution of two sequences');
xlabel('n');
ylabel('y(n)');
Result:
Enter the 1st sequence x(n) = [1 2 1 2]
Enter the 2nd sequence h(n) = [1 0 -1 3]
The output sequence y(n) = 1 2 0 3 5 1 6
Conclusion:
In this experiment linear convolution of two sequences has been
performed using MATLAB software.
Applications:
Convolution is used to obtain the output response of an LTI system to
an arbitrary input signal. It is used to find the filter response and finds
applications in speech processing and radar signal processing etc.