added matlab code for filtering algorithm