% for entrance77massave;   estimation of pairwise parameters for

err_history=[]; p=[];
%filt = [1 1 1 1 1 1 1];

for l = 1:39   % pairwise of frames 1..20
  A = eval(sprintf('loadframe(%d)',l-1));
  %Af=filt2d(A,filt);
  figure(1);  % keep from running out of memory (limit fig use)
  B = eval(sprintf('loadframe(%d)',l));
  %Bf=filt2d(B,filt);
  disp(sprintf('--- estimating translation frame 0 to %d',l))
  p_trans=est_trans_fft2(A,B); % now takes B to A
  %disp('--- doing single level (est_pchirp2r instead of est_pchirp2m)')
  %p=[p;est_pchirp2r(Af,Bf,5,p_trans)]; % concatenate each time
  p=[p;est_pchirp2m(A,B,5,5,p_trans,1)]; % concatenate each time
  mse=mean2nan(abs(A-pchirp2(p(l,:),B)));
  err_history=[err_history;mse];
  s = sprintf('save entrance77_parameters_pairwisem%02d p err_history',l);
  disp(s)
  eval(s)
end%for
save
exit

