DSP EXP NO 3


EXP NO 3
TITLE: TO FIND 4 POINT CIRCULAR CONVOLUTION AND COMPARE THE RESULT WITH 8 POINT CIRCULAR CONVOLUTION


% FOR NON ALIASING
clc;
clear all;
close all;
x=input('Enter the input, x[n]=');
h=input('Enter h[n]=');
l1=length(x);
l2=length(h);
%No Aliasing
N=l1+l2-1;
x=[x,zeros(1,(N-l1))];
h=[h,zeros(1,(N-l2))];
m=0:N-1;
n=0:N-1;
y=zeros(1,N);
for n=0:N-1
for m=0:N-1
y(n+1)=y(n+1)+x(m+1)*h(mod(n-m,N)+1);
end;
end;
disp(y);
subplot(1,1,1);
stem(abs(y));
xlabel('n');
ylabel('Amplitude');
title('No Aliasing');

%FOR ALIASING

clc;
clear all;
close all;
x=input('Enter the input, x[n]=');
h=input('Enter h[n]=');
l1=length(x);
l2=length(h);
%With Aliasing
N=max(l1,l2);
x=[x,zeros(1,(N-l1))];
h=[h,zeros(1,(N-l2))];
m=0:N-1;
n=0:N-1;
y=zeros(1,N);
for n=0:N-1
for m=0:N-1
y(n+1)=y(n+1)+x(m+1)*h(mod(n-m,N)+1);
end;
end;
disp(y);
subplot(1,1,1);
stem(abs(y));
xlabel('n');
ylabel('Amplitude');
title('No Aliasing');

Previous Post Next Post