% UHP poles in the upper half plane and corresponding residues.
%
% [UHPpole UHPresid] = UHP(ALLpole,ALLresid)

function [outpole, outresid] = uhp(inpole, inresid)

N = length(inpole);
outpole  = inpole(imag(inpole)>0);
outresid = inresid(imag(inpole)>0);

if length(outpole) < N/2
  outpole(N/2)=1e30
end
