标签:2d 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
原文地址:http://rchen.blog.51cto.com/3126333/1654896