2d fft matlab,证明2D-FFT能够拆分成两个1D-FFT
經常可以在文獻上看到2D-FFT能夠以兩個1D-FFT來實現,今天我用MATLAB證明了,的確如此。MATLAB的代碼如下clear?all;
clc;
f=ones(256,256);
center_loc?=?size(f);
rd?=?2;
f(round(center_loc(1)/2)-rd:round(center_loc(1)/2)+rd,?round(center_loc(2)/2)-rd:round(center_loc(2)/2)+rd)?=?0;
figure(1);imshow(f);
f2=fft2(f);
f3=(abs(f2));
figure(2);imshow(f3);
tmp=zeros(center_loc(1),center_loc(2));
%-the?first?1D-FFT,?for?each?row
for?i=?1:center_loc(1)
tmp(i,?:)?=?fft(f(i,?:),?center_loc(2));
end
%-transpose?the?tmp,?for?column-based?1d-fft
tmp?=?tmp';
%-the?second?1d-fft,?for?each?column
for?i=?1:center_loc(1)
tmp(i,?:)?=?fft(tmp(i,?:),?center_loc(2));
end
tt?=?abs(tmp);
figure(3);?imshow(tt);
以下三張圖從上到下,分別對應代碼中的figure(1~3)。
Figure(1):
figure(2):
figure(3):
創作挑戰賽新人創作獎勵來咯,堅持創作打卡瓜分現金大獎總結
以上是生活随笔為你收集整理的2d fft matlab,证明2D-FFT能够拆分成两个1D-FFT的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 建行活期利率是多少2022,0.3%
- 下一篇: 这次要玩真的了?FF 91准量产车已抵沪