ip = [ipwrtt ipwrtt]; pad = [zeros(1,length(ipwrtt)) ipwrtt]; auto = xcorr(pad,ip);