function [xs,ys] = make_smooth(x,y);

n = length(x);
ki = [(0:n/2) ((-n/2+1):-1)]'*i;
xk = fft(x);
yk = fft(y);

ns = 200;
if (n > ns)
  xs = x;
  ys = y;
else;
  ts = (0:2*pi/ns:2*pi*(1+1/n))';
  for k = 1:ns,
    xs(k) = real(sum(xk/n.*exp(ki*ts(k))));
    ys(k) = real(sum(yk/n.*exp(ki*ts(k))));
  end;

  xs = [xs';xs(1)];
  ys = [ys';ys(1)];
end;
