Add first artifact detection for stimulus and scan synch

Added median filtered artifact detection to estimate start of
RF/gradient pulsing. Knowing the time offset of first artifact allows
the time of the first TR trigger to be calculated with respect to
pupilometry time series for regressors, etc.