Computing and plotting the PSD multiple images by fft2
Show older comments
Hello,
I have a a folder which contains around 2500 frames were divided from a vido of a wter tank experiment. I am trying to plot the "average" 1D & 2D PSD for the whole images(i.e. (psd1+...psd50)/50;
I have tried many aproaches, but I am not sure about the output.
Here is my code:
min=zeros;
min_1D=zeros;
for K = 1 :1500:75000
this_file = strcat('folder\frame',num2str(K),'.tif');
im_input = imread(this_file);
im_input = rgb2gray(im_input);
%%%%
SLength=length(im_input);
Fs=500;
dt = 1/Fs;
q=round(SLength/2);
f=(1/dt)*(0:q)/SLength;
TX_1=fft(im_input);
Px1=abs(TX_1/SLength);
Pxx1=Px1(1:q+1);
min_1D=min_1D+Pxx1;
%%%%%
zfmin=fft2(im_input);
shiftmin=fftshift(zfmin);
min_2D=abs(shiftmin);
z_min=log10(min_2D);
min=min+z_min;
end
PSD_2D= (min)/ 50;
PSD_1D = (min_1D)/ 50;
figure,
imagesc(PSD_2D)
colormap gray

- Do I have to substract the mean>
TX_1=fft(im_input-mean ((im_input))?
btw the actual length is 0.2398 mm/pixel.
I appreciate your feedback and comments.
Thanks
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!