% f(ax,by) <=> (1/(ab))*F(u/a,v/b)

A = zeros(256);
A(78:177,103:152) = ones(100,50);
F_A = abs(fftshift(fft2(A)));
Z = log(1+F_A);
mx = max(max(Z));
c = 255/mx;
Z_A = c*log(1+F_A);

B = zeros(256);
B(103:152,116:140) = ones(50,25);
F_B = abs(fftshift(fft2(B)));
Z = log(1+F_B);
mx = max(max(Z));
c = 255/mx;
Z_B = c*log(1+F_B);

subplot(2,2,1);
imagesc( A )
colormap( gray ( 256 ) )
axis image
subplot(2,2,2);
imagesc( Z_A )
colormap( gray ( 256 ) )
axis image
subplot(2,2,3);
imagesc( B )
colormap( gray ( 256 ) )
axis image
subplot(2,2,4);
imagesc( Z_B )
colormap( gray ( 256 ) )
axis image
