function Px = LDPC_P_shift(x, P0)
    %{
    global P0global;
    if(~exist('P0', 'var'))
        P0 = P0global;
    end
%}
    if (isnan(x) || x<0)
        Px = zeros(size(P0));
    else
%         Px = circshift(P0, x, 2);
        Px = circshift(P0,[ x, 2]);
    end

end