
function y = normsig(x)
% function y = normsig(x)
% normalizes the input signal x to lie within the range [-1 1];
% either the maximum will be 1, or the minimum will be -1.
%        WLM94
tmpmax=max(x);
tmpmin=min(x);
tmp=tmpmax;
if(-tmpmin>tmpmax) tmp=-tmpmin;
end;
tmp=1/tmp; % Hope x is not full of zeroes!
y=tmp*x;
