function y = discretize(f, cutoff)

sze = size(f);
for i = 1:sze(1)
   for k = 1:sze(2)
      if (f(i,k) > cutoff)
         z(i,k) = 1;
      else
         z(i,k) = 0;
      end
   end
end

y = z;
