Free Academic Seminars And Projects Reports
verilog code for circular convolution - Printable Version

+- Free Academic Seminars And Projects Reports (https://easyreport.in)
+-- Forum: Seminars Topics And Discussions (https://easyreport.in/forumdisplay.php?fid=30)
+--- Forum: Engineering Seminars Topics (https://easyreport.in/forumdisplay.php?fid=7)
+---- Forum: Seminar Requests (https://easyreport.in/forumdisplay.php?fid=29)
+---- Thread: verilog code for circular convolution (/showthread.php?tid=66431)



verilog code for circular convolution - hemu - 10-06-2017

verilog code for circular convolution

MATLAB CODE:-
clc
close all
clear all
x=input('Enter the sequence x:');
h=input('Enter the sequence h:');
subplot(3,1,1);
stem(x);
xlabel('-->n');
ylabel('Amp');
legend('Input Sequence');

subplot(3,1,2);
stem(h);
xlabel('-->');
ylabel('Amp');
legend('Impulse Responce');

lx=length(x);
lh=length(h);
l=max(lx,lh);
x=[x,zeros(1,l-lx)];
h=[h,zeros(1,l-lh)];
H=zeros(l,l);
H(1:lh,1)=h;
for j=1:l-1
for i=1:l-1
H(i+1,j+1)=H(i,j);
end
H(1,j+1)=H(l,j);
end
y=H*x';
subplot(3,1,3);
stem(y);
title('Circular Convulation');

INPUT & OUTPUT:-
Enter the sequence x:[1 -1 2 3]
Enter the sequence h:[1 -2 3 1]
>> y

y =

0
8
10
-3