xo=dynlimit(xi,dynrange);
dynlimit(xi,dynrange) will threshold the input such that the difference between the maximum and minumum value of xi is exactly dynrange.