Change function filter to filtfilt (zero-phase filterinf) and clean time_picks.m