function rl = reallocate(mag, ests, N_rs, fs)
  frqs = imag(ests(end,:))/2/pi;
  %frqs_rs = [0:N_rs-1]*fs/N_rs;
  bins_rs = round(frqs * N_rs/fs)-1;
  bins_rs = bins_rs(bins_rs > 0 & bins_rs <= N_rs);
  rl = zeros(N_rs,1);
  % can this be done without for loop?
  for k=1:length(bins_rs)
    rl(bins_rs(k)) = rl(bins_rs(k)) + mag(k);
  end
end