According to the convolution theorem, a convolution in the time domain is a product in the fft domain. With correct zero-padding, it works:
% convolution in time domain
a = [1 2 3];
b = [4 5 6];
c = conv(a,b);
a_padded=[a 0 0]; b_padded=[b 0 0];
c_bis=ifft(fft(a_padded).*fft(b_padded));
% we do find c_bis=c
However, this theorem is suposed to work the other way around as well, a product in the time domain is a convolution in the fft domain. I dont get this part:
d = a.*b;
D=conv(fft(a_padded),fft(b_padded));
d_bis=ifft(D);
Which gives a complex vector for d_bis. How could one inverse a point-wise product made in the time domain using a convolution in the frequency domain ?