Manual 2D fft

11 ビュー (過去 30 日間)
ritika malik
ritika malik 2019 年 12 月 2 日
コメント済み: ritika malik 2019 年 12 月 2 日
I want to do 2D FFT manually, but the result is different fro what we get from MATLAB buit in function. Here is my code I have used for 2d FFT. Can anyone figure it out where is my code running wrong?
r = zeros(40,1);
c= 2;
theta = zeros(40,1);
for i = 0:39
r(i+1) = c*sqrt(i);
theta(i+1) = i*137.508;
end
theta = deg2rad(theta);
xi = r.*cos(theta);
yi = r.*sin(theta);
B = zeros(512,512);
si= 0;
for ii = -256:255
for j = -256:255
for k = 1:40
s = exp(-1i*2*pi*(ii*xi(k) +j*yi(k)));
si = sum(s) +si;
end
B(ii+257,j+257) = si;
si = 0;
end
end
  2 件のコメント
KALYAN ACHARJYA
KALYAN ACHARJYA 2019 年 12 月 2 日
編集済み: KALYAN ACHARJYA 2019 年 12 月 2 日
Can you verify with simple example? Share your manual calculation, I will try to figure out?
ritika malik
ritika malik 2019 年 12 月 2 日
I want to calculate fourier transform of the image attached here. Here, I am using 21 delta function at different position calculated in above code as (xi,yi). Now the fourier transform of these delta funtion is
I want to calculate B(u,v) using this formula. Which expected to be like as the second image (energy c=2.png) I have attached, which I am not getting using above code.

サインインしてコメントする。

回答 (0 件)

カテゴリ

Help Center および File ExchangeFourier Analysis and Filtering についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by