% function y = shift_signal( x, pos)
%
%          Shifts a sequence left or right according to variable POS
%          If POS is negative it shifts to the left
%          If POS is positive it shifts to the right
%

%
% Copyright © 24-Oct-2012 George P. Pavlidis® (sepdek@sepdek.net, gpavlid@ceti.gr)
%
function y = shift_signal( x, pos)

	y = zeros( size( x));
	if pos < 0
		y(1:end-abs(pos)) = x(abs(pos)+1:end);
	elseif pos > 0
		y(pos+1:end) = x(1:end-abs(pos));
	else
		y = x;
	end