Matlab program for circular convolution property of dft:x=[1,2,3,4]; %first signal
h=[3,6,9,5]; %second signal
N1=length(x);
N2=length(h);
X=[x,zeros(1,N2)];% padding of N2 zeros
H=[h,zeros(1,N1)];% padding of N1 zeros
for i=1:N1+N2-1
y(i)=0;
for j=1:N1
if(i-j+1>0)
y(i)=y(i)+X(j)*H(i-j+1);
else
end
end
end
n=N1+N2-1;
X1=fft(x,n);
X2=fft(h,n);
X=X1.*X2;
subplot(211);
stem(abs(X));
title('Answer using DFT method');
Y=fft(y,n);
subplot(212);
stem(abs(Y));
title('Answer using direct convelution');
Output:-