You are on page 1of 16

AIR UNIVERSITY

DEPARTMENT OF ELECTRICAL AND COMPUTER ENGINEERING

EXPERIMENT NO 2

Lab Title: Continuous


Signals and Discrete Signals Representation and
CircularConvolution in Matlab
Student Name: M Hamza Amin Reg. No:191862
Objective: To generate some simple and complex signals and visualize
them
LAB ASSESSMENT:

Excellent Good Average Satisfactory Unsatisfactory


Attributes (5) (4) (3) (2) (1)
Ability to Conduct
Experiment
Ability to assimilate the
results
Effective use of lab
equipment and follows
the lab safety rules

Total Marks: Obtained Marks:

LAB REPORT ASSESSMENT:

Excellent Good Average Satisfactory Unsatisfactory


Attributes
(5) (4) (3) (2) (1)

Data presentation

Experimental results

Conclusion

Total Marks: Obtained Marks:

Page | 1
Date: MarkSignature:
Continuous Signals and Discrete Signals Representation and Circular
Convolution in Matlab
Matlab

M Hamza Amin (191862)

BACHELOR OF ELECTRICAL AND COMPUTER ENGINEERING


(Fall 2022)

Submitted To:
Engr. Sharoze Sohail
Lab Engineer

DEPARTMENT OF ELECTRICAL AND COMPUTER ENGINEERING


FACULTY OF ENGINEERING
AIR UNIVERSITY,ISLAMABAD

Page | 2
Lab#02
CONTINUOUS SIGNALS AND DISCRETE SIGNALS
REPRESENTATION AND CIRCULAR CONVOLUTION
IN MATLAB
OBJECTIVE:
 To generate some simple and complex signals and visualize them.
 Learn how to plot different signals in time domain.

DISCUSSION;
Signals:
All the signals have to be either vectors (row or column), or matrices in MATLAB of finite
length. The index of the vector usually corresponds to time, and it always has to be 1 to N, if N is
assumed to be the length of the vector. MATLAB has the power to perform vector operations
quite efficiently, implying that processing of signals is easy. As a general rule, discrete signals
are viewed using ‘stem’ and indices must be plotted on the axis. It’s always a good habit to label
all the axes and title the figures properly.

Page | 3
LAB TASKS
Task#01:

Creation of Signals

a) Generate the following signals in MATLAB:

x1[n] = 2 δ (n + 2) - δ(n-4), -5 ≤ n ≤ 5

x2[n] = cos (0.04πn) + 0.02w[n], for 0 ≤ n ≤ 50,

where w[n] is a Gaussian random signal

x3[n] is signal of four periods of sequence [5, 4,3,2,1], in the range -10 ≤ n ≤ 9

Code:

For x1[n] = 2 δ (n + 2) - δ(n-4), -5 ≤ n ≤ 5

Page | 4
Output:

For x2[n] = cos (0.04πn) + 0.02w[n], for 0 ≤ n ≤ 50,

Page | 5
Output:

For x3[n] is signal of four periods of sequence [5, 4,3,2,1], in the range -10 ≤ n
≤9

Page | 6
Output

Page | 7
Task#02:

b) Sinusoids--- The most general category of signals. Yes, it’s true. Believe it
or not, every signal in this universe contains nothing but sinusoids. We’ll
explore this aspect in detail in our later labs, but for now, these signals are
quite interesting and beautiful to be looked in detail.

x1[n] = sin ( 17πn), 0 ≤ n ≤ 25

x2[n] = cos (17πn), -15 ≤ n ≤ 15

x3[n] = sin (3 π n), -10 ≤ n ≤ 10

x4[n] = cos (23πn), 0 ≤ n ≤ 50

Code:

Page | 8
Output:

Page | 9
Task#03:

Complex Exponentials: Generate x0[n] = exp(j*n/3), for some range and see
its real and imaginary parts separately. Also make the following signals:

• x1[n] = e(-0.1+j0.3)n, -10 ≤ n ≤ 10

• x2[n] = an u[n], where a=0.9, and 1.1 for -50 ≤ n ≤ 100

• x3[n] = 3 sin (17πn) + j 4 cos (17πn), 0 ≤ n ≤ 25

Code:

For Generate x0[n] = exp(j*n/3),

Page | 10
Output:

For x1[n] = e(-0.1+j0.3)n, -10 ≤ n ≤ 10

Page | 11
Output:

For x3[n] = 3 sin (17πn) + j 4 cos (17πn), 0 ≤ n ≤ 25

Page | 12
Output:

Page | 13
Task#04;

In the Second Part of Circular Convolution, You all have to write their own
code. Compare with the Linear Convolution code results. Adjust the code so
that the 2 outputs match.

Code:

Page | 14
Output:

Page | 15
Learning outcomes:
In this lab we use different techniques to generate signals on matlab. I learnt
abount discrete or continous signal , sinusoidal signals, complex exponential signal
and visualize or implement these signal on matlab. In tasks I also learnt about the
sequences how use the sequence eq to find period. Then at last implement the
circular convolution on matlab without using the built in function

Page | 16

You might also like