Académique Documents
Professionnel Documents
Culture Documents
Experiment 5
CODE:
%Program to calculate the circular convolution of two signals x(n) and h(n)
%Assuming that number of DFT values to be found out are equal to length of
%input signal
N=L;
%Creating graphs
subplot(4,2,1);
stem(x);
xlabel('n'); ylabel(x(n)); title('Input function x(n)');
subplot(4,2,2);
stem(X);
xlabel('k'); ylabel(X(k)); title('DFT(x(n))=X(k)');
subplot(4,2,3);
stem(h);
xlabel('n'); ylabel(h(n)); title('Input function h(n)');
subplot(4,2,4);
stem(H);
xlabel('k'); ylabel(H(k)); title('DFT(h(n))=H(k)');
subplot(4,2,5);
stem(Y);
xlabel('k'); ylabel(Y(k)); title('Y(k)=H(k)*X(k)');
subplot(4,2,6);
stem(y);
xlabel('n'); ylabel(y(k)); title('y(n)=IDFT(Y(k))');
subplot(4,2,7);
stem(abs(y));
xlabel('n'); ylabel(y(k)); title('absolute values of y(n)=IDFT(Y(k))');
subplot(4,2,8);
stem(cconv(x,h,N));
xlabel('n'); ylabel('x(n)©h(n)'); title('Circular Convulation of x(n) and h(n)');
OUTPUT: