How to detect a signal while ignoring another signal which is a phase shifted version?
Try this: Apply a moving-average-window to the output signal. A window with a length close or equal to your matched-filter template signal. This window is supposed to add all the samples within its range. When this window applies to the location of first and second waves, the result's sign would be different to that of third and forth. You can also try a weighted window like Hanning window.