% for tip paper (tip.tex) 5 frames of original data

frameind=3:3:16;

L=length(frameind);

load parameters_pairwisem
P=pintegrate(p,9);   % 9 is the ref frame for now (because 10 not in sequence)

pwd_now=pwd;  % remember current working directory
filt=[1 1 1];
for l=1:L
  % load:
  eval(sprintf('v%02d=loadframe(%d);',frameind(l),frameind(l)))
  eval(sprintf('v%02dd=pchirp2nocrop(P(%d,:),v%02d);',...
       frameind(l),frameind(l)+1,frameind(l)))
  % low pass filter:
  eval(sprintf('v%02ddund=filt2d(v%02dd,filt)/length(filt).^2;',...
       frameind(l),frameind(l)))
  % undersample:
  [M,N]=size(eval(sprintf('v%02dd',frameind(l))));
  eval(sprintf('v%02ddund=v%02ddund(1:3:M,1:3:N);',frameind(l),frameind(l)))

  % trim bacon introduced by filt2d and display in xv:
    % first get in right directory so saves will go to right place by default 
    chdir /mas/vision/bigu/steve/figs/resolutionenhance
    eval(sprintf('tvxv(cropnan(v%02ddund))',frameind(l)))
    % return to this directory
    eval(sprintf('chdir %s',pwd_now))    
end%for

