HandshakeDetection updated

more robust window, analysis of signal triggered by line 21 instead of
always analyzing the window