Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
verilog code for circular convolution
#1

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
Reply



Forum Jump:


Users browsing this thread:
1 Guest(s)

Powered By MyBB, © 2002-2024 iAndrew & Melroy van den Berg.