% demo_alias1
% resize the image that is displayed and watch the aliasing

[x y] = ndgrid(-200:200);
r = hypot(x,y);
kmax = 0.8 * pi;
rmax = 200;
w = rmax / 10;
term1 = sin( (kmax * r.^2) / (2 * rmax) );
term2 = 0.5 * tanh((rmax - r)/w) + 0.5;
g = (term1 .* term2 + 1) / 2;
im(g)
