imin = 5;
imax = 12;
nrep = 3;
mytiming = zeros((imax-imin+1), 1);
mynaivetiming = zeros((imax-imin+1), 1);

for i = imin:imax
      np = 2^i;
      x = rand(np, 1);
      tic();
      for j=1:nrep
          xf = myfft2(x, np);
      end
      mytiming(i-imin+1) = toc();
      tic();
      for j = 1:nrep
          xf1 = mynaiveft(x);
      end
      mynaivetiming(i-imin+1) = toc();
      fprintf('%15i  %.5g\n', np, norm(xf - xf1, inf))
end

plot(imin:imax, log2(mytiming), '-o')
hold on
plot(imin:imax, log2(mynaivetiming), '--o')
hold off
