Can I remove the for loop in this fft?
Show older comments
I'm new to Matlab, and I'm not sure how to tell if these are equal.
I'm doing a 2D FFT (using fft2) on and arbitrary number of images.
For example, let's say I have 1000 frames of 32 pixel by 32 pixel images.
img=32;
frames=1000;
FT1=zeros(img,img,frames); %Setting up the blanks for storing the FFT
FT2=zeros(img,img,frames);
rand_psf= rand(img,img,frames); %These are the random 32x32 pixel images I want the FFT of
%Option 1 Do a for loop and take the fft2
for ff=1:size(rand_psf,3)
FT1(:,:,ff) = fft2(rand_psf(:,:,ff));
end
%Option 2 Just fft2 the whole thing
FT2(:,:,:) = fft2(rand_psf(:,:,:))
Does FT1=FT2?
Answers (0)
Categories
Find more on Fourier Analysis and Filtering in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!