adding Matlab/detect_fit.m from copy of barker2.m and some better input
preparing data in detect_fit.m
computing objective function and gradient