Merge pull request #252 from reem-utils/chang_branch

Chang branch
Updating the search wave, solving a bug
Updating wave_detection_sm for less time consuming