%
%  macm 202 -- 11 jan 03 -- djm
%
%  w2fft.m:  fourier coefficients of matlab monocolor [0,1] data
%                
%    - process image using "w2convert" first
%    - type "w2fft" at the matlab prompt
%

figure(2);  clf

%  compute fourier coefficients (complex form)

imfour = fftshift(fft2(imdata));

%  real-valued by-products

imfcos = real(imfour);
imfsin = imag(imfour);
imfabs =  abs(imfour);

%  fourier mode numbers & mask matrices

k = [-floor(imsize(2)/2):ceil(imsize(2)/2)-1];
l = [-floor(imsize(1)/2):ceil(imsize(1)/2)-1];

[km lm] = meshgrid(k,l);

%  look at the results

imagesc(k,l,log(imfabs));  
%imagesc(-log(abs(imfcos)));  
%imagesc(-log(abs(imfsin)));  

colormap(flipud(hot));  colorbar
axis equal;  axis image
title(['\bf fourier coefficents for ' file ' (magnitude)'])
xlabel(['\bf k-axis'])
ylabel(['\bf l-axis'])

