Академический Документы
Профессиональный Документы
Культура Документы
DEPARTMENT
OF
ELECTRICAL AND ELECTRONICS ENGINEERING
SUBMITTED BY
Sahana Shankar(01FB16EEE076)
Varun Chandrashekar(01FB16EEE091)
Vishal Phadtare(01FB16EEE096)
CONVOLUTION
Convolution is one of the four most important DSP operations, the other
three being correlation, discrete transforms, and digital filtering.
Convolution allows us to compute the output signal y(n) of a linear time-
invariant (LTI) system, given its input signal x(n) and its impulse response
h(n) as the system model. This is diagrammatically illustrated in Fig. 5.1
below. We will see later in this course that the digital filters that we would
design are represented as LTI systems.
The convolution y(n) of two sequences h(n) and x(n) is given by the
following:
Generally, we will use the x-vector representation alone when the sample
position information is not required or when such information is trivial (e.g.
when the sequence begins at n = 0). An arbitrary infinite-duration sequence
cannot be represented in MATLAB due to the finite memory limitations.
TYPES OF SEQUENCES We use several elementary sequences in digital signal
processing for analysis purposes. Their definitions and MATLAB
representations follow.
3.Triangle wave
4.Ramp
Matlab implementation:
5.Growing exponential signal
Matlab implementation:
6.Decaying exponential sequence:
Features of the project
In this project we have given the user an option to choose between
predefined input signals(via radio buttons)or inputting a sequence of
their own choice through the command window.
Choice1:
case 1
clc;
clear all;
close all;
x1 = input('Enter First sequence x1(n)[] : ');
t1 = input('Enter Origin location Of Sequence x1 : ');
x2 = input('Enter Second sequence x2(n)[] : ');
t2 = input('Enter Origin location Of Sequence x2 : ');
l1 = length(x1); %length of sequence x1
l2 = length(x2); %length of sequence x2
ln = l1+l2-1; %length of convoluted sequence
y = conv(x1,x2); % performing convolution using x() function
a = t1+l1-1;
t = t1:a;
subplot(3,1,1);
stem(t,x1);
xlabel('Time');
ylabel('Amplitude');
title('x1');
a = t2+l2-1;
t = t2:a;
subplot(3,1,2);
stem(t,x2);
xlabel('Time');
ylabel('Amplitude');
title('x2');
tn = t1+t2;
a = tn+ln-1;
t = tn:a;
subplot(3,1,3);
disp('convoluted Sequence ');
disp(y); % For printing the convoluted output in MATLAB command
window
stem(t,y); % For plotting the convoluted output in MATLAB graph
window
xlabel('Time');
ylabel('Amplitude');
title('Convoluted Sequence');
Command Window Input:
Output:
Choice 2: