Professional Documents
Culture Documents
DSP Lab2
DSP Lab2
EXPERIMENT NO 2
Data presentation
Experimental results
Conclusion
Page | 1
Date: MarkSignature:
Continuous Signals and Discrete Signals Representation and Circular
Convolution in Matlab
Matlab
Submitted To:
Engr. Sharoze Sohail
Lab Engineer
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
x1[n] = 2 δ (n + 2) - δ(n-4), -5 ≤ n ≤ 5
x3[n] is signal of four periods of sequence [5, 4,3,2,1], in the range -10 ≤ n ≤ 9
Code:
Page | 4
Output:
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.
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:
Code:
Page | 10
Output:
Page | 11
Output:
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