function lx = shift(x, k)

if k < 0
  lx = x(1:end+k);
  lx = [NaN*zeros([-k, 1]) ; lx]; 
else
  lx = x(1+k:end);
  lx = [lx; NaN*zeros([k, 1])]; 
end

return