0% found this document useful (0 votes)
8 views3 pages

Objective: To Compute The Circular Convolution of Two User Defined Descrete Signal Without Using Matlab Inbuilt Function. Code

Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
8 views3 pages

Objective: To Compute The Circular Convolution of Two User Defined Descrete Signal Without Using Matlab Inbuilt Function. Code

Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 3

DSP Name:Chandramani Kumar

EC4 (2021uec1527)

Experiment No. 2

Objective: To Compute the circular convolution of two user defined descrete signal
without using Matlab inbuilt function.

Code:

clc;
clear all;
close all;
x=input('input sequence - ');
h=input('impulse response - ');
n1=length(x);
n2=length(h);
N=max(n1,n2);
X=[x,zeros(N-n1)];
H=[h,zeros(N-n2)];
for i=1:N
Y(i)=0;
Z(i)=0;
for j=1:N
Y(i)=Y(i)+X(j).*H(mod(i-j,N)+1);
if(i-j+1>0)
Z(i)=Z(i)+X(j).*H(i-j+1);
else
end
end
end
l=1:N;
m=1:N;
o=1:N;
p=1:N;
subplot(4,1,1);
stem(l,X);
title('input sequence X[n]');
xlabel('time');
ylabel('amplitude');

subplot(4,1,2);
stem(m,H);title('impulse sequence H[n]');
xlabel('time');
ylabel('amplitude');
subplot(4,1,3);
stem(o,Y);
title('Circular Convolution');
xlabel('time');
ylabel('amplitude');
subplot(4,1,4);
stem(p,Z);
title('linear Convolution');
xlabel('time');
ylabel('amplitude');

INPUT:
input sequence - [1 2 3 4]
impulse response - [2 3 4 5]

Conclusion: The experiment successfully demonstrated how to calculate the


circular convolution of two input signals using MATLAB, without using the built-in
function.
DSP Date:24.08.23
Name:Chandramani kumar
EC4
(2021uec1527)

Experiment No. 3

Objective- To compute the linear convolution of two input signals using circular
convolution.

Code:
clc;
clear all;
close all;
x=input('input sequence -');
h=input('impulse response ');
n1=length(x);
n2=length(h);
N=n1+n2-1;
X=[x,zeros(1,N-n1)];
H=[h,zeros(1,N-n2)];
for i=1:N
Y(i)=0;
for j=1:N
Y(i)=Y(i)+X(j).*H(mod(i-j,N)+1);
end
end
l=1:N;

subplot(4,1,1);
stem(l,X);
title('input sequence X[n]');
xlabel('time');
ylabel('amplitude');

subplot(4,1,2);
stem(l,H);title('impulse sequence H[n]');
xlabel('time');
ylabel('amplitude');
subplot(4,1,3);
stem(l,Y);
title('Circular Convolution');
xlabel('time');
ylabel('amplitude');

Input:
x=[1 2 3 4]
y=[2 3 4]

You might also like