view reallocate.m @ 4:72c011ed1977 tip

more elaborate example with non-stat. estimate explanation
author smusevic
date Tue, 30 Jul 2013 09:56:27 +0100
parents e2b116f3b69b
children
line wrap: on
line source
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