%
%  This function implements a unit rect function
%
%  rect((t+t0)/T) = 1 for |t+t0|<T/2, and is zero otherwise
%
function x = unit_rect(t,t0,T);

x = 1*(abs(t+t0)<T/2);

return;