Convolution in frequency domain (NOT CONVOLUTION IN TIME DOMAIN)
Afficher commentaires plus anciens
I know there are two theorem:
- convolution in time domain equals multiplication in frequency domain;
- multiplication in time domain equals convolution in frequency domain;
I am confused with the implementation with the 2nd in MATLAB. Here is my codes:
a = 1:5;
b = a+3;
A = fft(a);
B = fft(b);
c = a .* b
ans =
4 10 18 28 40
D = conv(A, B);
d = real(ifft(D))
d =
Columns 1 through 5
11.111 50.544 26.081 58.919 39.694
Columns 6 through 9
73.642 52.666 95.071 42.27
so my quesition is why the "a.*b" is not the same with "real(ifft(D))", is somewhere wrong? I know in the 1st theorem, the Nfft should be length(A)+length(B)-1, however, it seems not work here.
Any help will be thanks!
Réponse acceptée
Plus de réponses (0)
Catégories
En savoir plus sur Correlation and Convolution dans Centre d'aide et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!