Exp3 Convolution
Exp3 Convolution
AIM:
To perform linear and circular convolution of the given signals using MATLAB program.
x1(t) =
x2(t) =
● MATLAB
THEORY:
Linear Convolution
● Linear convolution is a mathematical operation done to calculate the output of any Linear-Time
Invariant (LTI) system given its input and impulse response.
● It is applicable for both continuous and discrete-time signals.
● Linear Convolution can be represented as y(n)=x(n)*h(n)
y(n) is the output (also known as convolution sum). x(n) is the input signal, and h(n) is
the impulse response of the LTI system.
● In linear convolution, both the sequences (input and impulse response) may or may not be of
equal sizes.
For example, x(n)= [1,2,3] & h(n)= [1,2,3,4,5]
● The number of samples in the output of linear convolution is L = M + N – 1
Where M is the number of samples in x(n). N is the number of samples in h(n)
● It is possible to find the response of a filter using linear convolution.
Circular Convolution
● Circular convolution is essentially the same process as linear convolution. Just like linear
convolution, it involves the operation of folding a sequence, shifting it, multiplying it with another
sequence, and summing the resulting products
● Circular Convolution is represented as y(n)=x(n)⊕ h(n)
● In circular convolution, both the sequences (input and impulse response) must be of equal
sizes. Circular convolution is possible only after modifying the signals via a method known as zero
padding. In zero padding, zeroes are appended to the sequence that has a lesser size to make the
sizes of the two sequences equal. If x(n) = [1,2,3] , after zero padding x(n) = [1,2,3,0,0]
Vel Tech-ECE-VTR UGE-2021- 10211EC303 - Signal Processing Lab Exp:no:3 Linear and Circular Convolution
FLOWCHART /ALGORITHM:
NOTE: If the lengths of the two sequences are different, then for circular convolution, zero padding
must be performed.
PORGRAM:
LINEAR CONVOLUTION:
clc;
clear all;
close all;
figure;
subplot(2,2,1);
stem(x1);
xlabel('Time');
ylabel('Amplitude');
title('First Input Sequence');
subplot(2,2,2);
stem(x2);
xlabel('Time');
ylabel('Amplitude');
title('Second Input
Sequence'); x3=conv(x1,x2);
subplot(2,2,3);
stem(x3);
disp('Convolution Output');
disp(x3);
xlabel('Time');
ylabel('Amplitude');
title('Output Sequence');
CIRCULAR CONVOLUTION:
clc;
clear all;
close all;
x1=input('enter the first sequence');
x2=input('enter the second
sequence'); figure;
subplot(2,2,1);
Vel Tech-ECE-VTR UGE-2021- 10211EC303 - Signal Processing Lab Exp:no:3 Linear and Circular Convolution
stem(x1);
xlabel('Time');
ylabel('Amplitude');
title('First Input Sequence');
subplot(2,2,2); stem(x2); xlabel('Time'); ylabel('Amplitude');
title('Second Input Sequence');
N1=length(x1);
N2=length(x2);
N3=max(N1,N2);
x3=fft(x1,N3);
x4=fft(x2,N3);
x5=(x3.*x4);
x6=ifft(x5,N3);
subplot(2,2,3);
stem(x6);
disp('Circular Convolution Output');
disp(x6);
xlabel('Time');
ylabel('Amplitude');
title('Output Sequence');
OUTPUT:
LINEAR CONVOLUTION:
Vel Tech-ECE-VTR UGE-2021- 10211EC303 - Signal Processing Lab Exp:no:3 Linear and Circular Convolution
CIRCULAR CONVOLUTION:
RESULT:
Thus the linear and circular convolution operation of the given signals has been performed using
MATLAB and the output is verified.
Vel Tech-ECE-VTR UGE-2021- 10211EC303 - Signal Processing Lab Exp:no:3 Linear and Circular Convolution