function [S] = Normalize_signal(A)
    S = A;
    maxsx = max(S);
    minsx = min(S);
    if(maxsx~=1.0 || minsx ~= -1.0)
        range = maxsx-minsx;
        S = 2*S/range;
        newmx = max(S);
        offset = newmx-1.0;
        S = S-offset;
    end
end