% Test "sliding window" track estimation for SPIE

WINDOW = 0;	% see vit_tr()
WINDOW_DEBUG = 0;

if( ~exist('RANDOM') )
  disp( 'initializing rand() and randn() with TOD');
  rand( 'state', sum(100*clock));
  randn( 'state', sum(100*clock));
  RANDOM = 1;
end

% Simulate the tracks
%
K=1;
onOff;
K=3
onOff;

% Choose window size:
%
tr_period = HUGE_VAL;

% set L
%
L = 8

% save original values
%
XY_offset_orig = XY_offset;
XY_orig = XY;
z_orig = z;
N_orig = N;
MM_orig = MM;

% estimate tracks for each window
%
N = 5;

for win = 0:3
  jj = N*win + [1:N];
  z = z_orig(jj);
  MM = MM_orig(jj);
  XY_offset = XY_offset_orig(jj);
  XY = XY_orig(:,1+[XY_offset(1):(XY_offset(N)+MM(N)-1)]);
  XY_offset = XY_offset - XY_offset(1);
  vit
  paths(1)
  PKK
end
