add wave detect utility for wave dtecting