You are on page 1of 4

EC 355 :Digital Signal Processing Laboratory

A Laboratory Report on Experiment: 01

GENERATING SIGNALS USING MATLAB SIMULATOR

Submitted by :

SHOAIB WARJRI
B19EC004
Faculty in-charge
Dr. Ch V Rama Rao.
in partial fulfilment of the degree of

Bachelor of Technology in
Electronics and Communication Engineering

Department of Electronics and Communication Engineering


National Institute of Technology Meghalaya
Bijni Complex, Laitumkhrah
Shillong, Meghalaya, India-793003
August-December, 2021
Experiment 1:
Title of the Experiment: Generation of the Given Signals.
1. X[n] = 2𝜕(𝑛 + 2) − 𝜕(𝑛 − 4), −5 ≤ 𝑛 ≤ 5.
2. X[n] = cos(0.04𝜋𝑛) , 0 ≤ 𝑛 ≤ 50.
3. X[n] = {…, 5, 4, 3, 2, 1, 5, 4, 3, 2, 1, 5, 4, 3, 2, 1, 5, 4, 3, 2, 1, …};
−1 ≤ 𝑛 ≤ 9.
4. X[n] = 𝑛[𝑢(𝑛) − 𝑢(𝑛 − 10)] + 10𝑒 −0.3(𝑛−10) [𝑢(𝑛 − 10) −
𝑢(𝑛 − 20)], 0 ≤ 𝑛 ≤ 20.
Theory: MATLAB is an interactive, matrix-based system for scientific and
engineering numeric computation and visualization. Its strength lies in the fact that
complex numerical problems can be solved easily and in a fraction of the time
required by a programming language such as Fortran or C.

Simulation code:
clc;
clear
close all;

m = 3;
N = 10;
h = zeros(N, 1);
h(m+4) = -1;
h(m-2) = 2;
figure();
stem((1:N)-m, h);
xlim([-5 5]);

n1 = 0:1:50;
x1 = cos(0.04*pi*n1);
figure();
stem(n1,x1);

n2 = (-10:9);
x2 = [5,4,3,2,1,5,4,3,2,1,5,4,3,2,1,5,4,3,2,1];
figure();
stem(n2,x2);

n3 = 0:20;
x3 = n3.*(heaviside(n3)-heaviside(n3-10)) + 10*exp((-0.3) *(n3-
10)).*(heaviside(n3-10)-heaviside(n3-20));
figure();
stem(n3,x3);
Obtained Graph:
1.

2.
3.

4.

Inference: Thus, all the signals is generated in the Software called MATLAB and is
verified with the expected graphs of the signals as given above.

You might also like