Professional Documents
Culture Documents
TY - ET-D - 60 - DAAOA - Lab 2
TY - ET-D - 60 - DAAOA - Lab 2
TY - ET-D - 60 - DAAOA - Lab 2
DAAOA Lab 2
Convolution: A convolution is an integral that expresses the amount of overlap of one function as
it is shifted over another function . It therefore "blends" one function with another.
∞
y ( n )= ∑ x ( k ) .h (n−k )
k=−∞
MATLAB Code:
clear all;
close all;
%Taking input
h=input('Enter H[n]');
l1 = length(x);
l2 = length(h);
N = l1 + l2 -1;
%Convoultion
a=[];
for i=1:l2
g=x.*h(i);
a=[a:g];
end
fprintf("\n");
disp(a);
clinear = conv(x,h);
disp(clinear)
Result:
Name: Ruturaj Uttarwar Class: TY ET-D
GR No: 12020036 Roll No: 60
Time Complexity:
n lies from 0 to n-1 & i lies from 0 to n-1;
Therefore, Complexity = n*I = n2 = o (n2 ).
C++ code:
findConvolution(A, B);
Name: Ruturaj Uttarwar Class: TY ET-D
GR No: 12020036 Roll No: 60
return 0;
}
Result:
Time Complexity: