add ability to pass None for detrend
export only xcorr function