How to shift from convolution product to the scalar product with arrays?

조회 수: 1 (최근 30일)
hy guys, hope you are doing well
I know that the product of the 2 signals in the frequency domain is equal to the Fourier transform of their convolution in the time domain
Y(f)= x(f). h(f)= fft( conv( x(t), h(t))
However, I tried to do the same in 2d with array and I didn't get the same result, i expected that the plot in subplot(244) would be equal to the plot in subplot(247)
Any idea how to fix it ?
Thank you in advance
code:
clear all
clc
n=3;
m=5;
a=rand(n,m)
b=rand(n,m)+1i*rand(n,m);
c=conv2(a,b);
subplot(241)
pcolor(abs(a))
title('a')
subplot(242)
pcolor(abs(b))
title('b')
subplot(243)
pcolor(abs(c))
title('c=conv2(a,b)')
subplot(244)
pcolor(abs(fftshift(fft2(c,n,m))))
title('fft2(c)')
subplot(245)
tfa=fftshift(fft2(a))
pcolor(abs(tfa))
title('tfa')
subplot(246)
tfb=fftshift(fft2(b))
pcolor(abs(tfb))
title('tfb')
subplot(247)
tfab=tfa.*tfb;
pcolor(abs(tfab))
title('tfa.*tfb')

답변 (0개)

카테고리

Help CenterFile Exchange에서 Discrete Fourier and Cosine Transforms에 대해 자세히 알아보기

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by