for loop - Why do I need a temporary value for the columns in the 2D Fourier Transform (Matlab) -
here matlab code 2d discrete fourier transform. code transcribed from:
scilab textbook companion digital image processing s. jayaraman, s. esakkirajan , t. veerakumar.
i not going on during second loop, , why have use temporary value f_2.
what happening during stage of script?
thank you.
function [ftransformed2d]= dft2d(f) [rows,cols]=size(f); k=1:cols f_1(:,k)=exp(-2*1j*pi*(0:nrows-1)'*(0:rows-1)/rows)*f(:,k); end j=1:rows f_2_a=exp(-2*1j*pi*(0:ncols-1)'*(0:ncols-1)/cols)*(f_1(j,:)).'; f_2(j,:)=f_2_a.'; end ftransformed2d = circshift(f_2,floor(size(f_2)/2)); end
the first loop performs fft on each column, , second loop performs fft on each row. concerns second loop,
f_2_a=exp(-2*1j*pi*(0:cols-1)'*(0:cols-1)/cols)*(f_1(j,:)).'; f_2(j,:)=f_2_a.';
the use of f_2_a
not necessary may have been included ease of reading. have been written instead
f_2(j,:) = ( exp(-2*1j*pi*(0:cols-1)'*(0:cols-1)/cols)*(f_1(j,:)).' ).';
Comments
Post a Comment