I'm trying to prove convolution in time domain is same as multiplication in frequency domain but I'm not getting the same answer in matlab.
Here is the code:
Signal Processing Stack Exchange is a question and answer site for practitioners of the art and science of signal, image and video processing. It only takes a minute to sign up.
Sign up to join this communityI'm trying to prove convolution in time domain is same as multiplication in frequency domain but I'm not getting the same answer in matlab.
Here is the code:
You need to set the length as well in your fft
command.
The two signals are of length $5$ and their convolution is of length $5+5-1=9$. So use this instead:
a=[1 2 3 4 5];
b=[6 7 8 9 10];
x=fft(a,9);
y=fft(b,9);
ifft(x.*y)
ans =
Columns 1 through 8
6.0000 19.0000 40.0000 70.0000 110.0000 114.0000 106.0000 85.0000
Column 9
50.0000
conv(a,b)
ans =
6 19 40 70 110 114 106 85 50
cconv
:cconv(a,b)
Solution 2 : Try adding cyclic prefix toa
for example.aa=[a a]; conv(aa,b);
The result isifft(x.*y)
from the end of cyclic prefix, in this case since the index 6. $\endgroup$ – AlexTP Jul 27 '17 at 7:06