     % filename = ['sy' int2str(i) '.bmp'];
  filename='cat.bmp';   
  A = imread(filename);
  A = A(:,:,1);          % r,g, and b channels
  Y = fft2(A);
  X = ifft2(Y);  
  outname = ['cat1.csv'];
  csvwrite(outname, round(real(X)) );            % izvrat! used X because A was in int8 format

  imagesc(real(X))
  
  



% A3 = imread('im3.bmp')(:,:,1);
% A4 = imread('im4.bmp')(:,:,1);
% A5 = imread('im5.bmp')(:,:,1);

n2 = 4;    % number of image pairs

nrow = 96;
ncol = 128/2;
Aa = A2(:,1:ncol);

% A = zeros(nrow,ncol,2*n2);

Y = fft2(A);
X = ifft2(Y);    % ,nrow, ncol);          %   Y(1:10, 1:10)    only keeps first 10 Fourier freqs
                        % nrom ncol screw this up

max(max(real(X))) 









