% sat.m

function out = sat(in,boundary)

%out = (1/boundary*in).*(abs(in)<=boundary)+sign(in).*(abs(in)>boundary);

%out=(5/4)*abs((5/4)*x+.2)-(5/4)*abs((5/4)*x-.2)+.5;
out = 0.5*((1/boundary*in).*(abs(in)<=boundary)+sign(in).*(abs(in)>boundary))+0.5;
