0
$\begingroup$

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?

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

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);
$\endgroup$
0
$\begingroup$

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.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.