Logic:
If x1(n) and x1(k) are N-point DFT pairs and x2(n) and x2(k) are another N-point DFT pairs then the circular convolution is defined as
x3(n)=x1(n) (convolve) x2(n)
x3(n)= summation from n=0 to N-1 of x1(m). x2(n-m); n=0,1,2,......,m-1;
Since there is no command exists in the MATLAB to find circular convolution directly. We use indirect method. We know from the property of DFT that the circular convolution of two finite sequences is equal to the IDFT of the product of individual DFTs.
i.e, x1(n) (circular convolution)x2(n)=IDFT[DFF(x,(n)).DFT(x2,(n))]
Program
clear all; % close all
x1=input ('Enter the first sequence x1(n)');
x2=input ('Enter the second sequence x2(n)');
N=input ('Enter the length of the DFT');
x1k=fft(x1,N); %find the DFT of the first sequence
x2k=fft(x2,N); %find the DFT of the second sequence
x3k=x1k*x2k ; %multiply them
x3=ifft(x3k); % Find the IDFT of the product
disp(x3);
wat is the value of N
ReplyDeleteN is the DFT point you need...it may be 8 point or 32 point or 512 point DFT.
ReplyDeletergds
murali