function template = gaussian_template ( winsize, sigma )

%*****************************************************************************80
%
%% GAUSSIAN_TEMPLATE...
%
  center = floor ( winsize / 2 ) + 1;
  s = 0.0;
  for i = 1 : winsize
    isq = ( ( i - center ) / sigma )^2;
    for j = 1 : winsize
      jsq = ( ( j - center ) / sigma )^2;
      template(j,i) = exp(-(isq+jsq)/2);
      s = s + template(j,i);
    end
  end
  template = template / s;

return
end
