function ConvertToWavelets(oldfn,newfn)
%function ConvertToWavelets(oldfn,newfn)
%
% reads the data as 81x81 columns in one matrix 
% returns a new matrix in Wavelet format

load(oldfn,'X');%-->X

NewX = X;
for i = 1:size(X,2);
  fprintf('%d of %d\r',i,size(X,2));
  x = X(:,i);
  wx = wavedec(x,6,'haar');
  if(i==1)
    W = zeros(length(wx),size(X,2));
  end
  W(:,i) = abs(wx(:));
end
fprintf('\n');
X = W;
save(newfn,'X');


