add a new implementation of wave2bitstream like a schmitt trigger