Professional Documents
Culture Documents
Circular Con Using FFT
Circular Con Using FFT
len_x = length(x);
len_h = length(h);
len_y = max(len_x,len_h);
%Use fft and ifft to compute the output.Specify the fft length as the
%maximum of the lengths of x and h.
%Method to compute circular convolution
%x -> fft -> X ;
%h -> fft -> H ;
%Y = X.*H ;
%Y -> inverse fft -> y. .Display the output
x_fft = fft(x,len_y);
h_fft = fft(h,len_y);
y_fft = x_fft .* h_fft;
y = ifft(y_fft,len_y);
disp('The circular convolution output is :');
disp(y);
subplot(3,1,3);
ay = 0:1:length(y)-1;
stem(ay,y);
xlabel('samples n->');
ylabel('amplitude');
title('circular convolution output y(n)');
OUTPUT:
This is the program to perform circular convolution using fft/ifft
Enter the first sequence :[1 2 3]
Enter the second sequence :[1 2 3 4]
The circular convolution output is :
18 16 10 16