How to detect a signal while ignoring another signal which is a phase shifted version? I have a signal coming from a sensor as shown below. This signal has high frequency noise (as can be seen from small fast wiggles) and four regions of interest where distinct spikes can be seen. The first region of interest starts with signal dropping first and settling. Second interesting region shows similar pattern; it drops first. The third region of interest is different from first and second because this time it spikes upwards and then settles. And fourth area of interest is also similar to third one; it spikes upwards first and then settles.

I consider third and fourth area of interests as similar signals as first and second but phase shifted versions. 



My goal is not only to detect these interesting areas but also distinguish between the first two and last two. I then designed a matched filter and passed the raw signal through this matched-filter. The template for the matched filter was designed to detect the first two variants (the ones which fall downwards first) as shown in the picture below. Note that template is time-reversed version of the first area of interest in the signal.



The output from matched filter is shown in the figure below which improves the SNR quite a bit and allows for easy detection of areas of interest. As can be seen, I can very clearly see the spikes corresponding to the four areas of interest. However, I cannot distinguish between the first two and second two. How do I do that?
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.