crossCorrShiftRF.m 182 B

123456
  1. function [rf, lagDiff] = crossCorrShiftRF(rf, refRF)
  2. [acor, lag] = xcorr(rf, refRF);
  3. [~, I] = max(abs(acor));
  4. lagDiff = lag(I);
  5. rf = circshift(rf, -lagDiff);
  6. end