question regarding convolution theorem

As per the convolution theorem, a convolution in time domain is equivalent to a multiplication in the frequency domain.

Then say (MATLAB code),

x = x(1:256)
y = y(1:256)
conv(x,y) should be equal to ifft(fft(x).*fft(y))


But it is not. Why is it so? What is that I am missing?

• Do you about linear convolution versus circular or cyclic convolution? – Dilip Sarwate Oct 1 '15 at 11:17

2 Answers

Please see help conv (especially third parameter) and help fft. Valid code sample:

x = zeros(1,256); x(120:170)=1;
y = zeros(1,256); y(120:170)=1;
z = conv(x,y,'SAME'); size(z)
z1= ifft(fft(x).*fft(y));
z2 = real(fftshift(z1));
plot(z2);


fft and ifft take finite length inputs and produce a same-length result, thus do circular convolution, not linear convolution. Linear convolution produces a longer result.