Removing empty/low amplitude part from signal I have a signal of length 'N' which looks like this

[.......p-set...] [SINE-WAVE] [....q-set...]

amplitude of points in p-set &lt;&lt; amplitude of points in sine-wave


Sometimes there are a few sparse points in p-set whose amplitude is comparable to sine-wave points. However, number of such points is much less than the length of the sine wave.
I want to find the beginning point of the sine-wave.

Clearly I cannot use thersholding as those sparse points will be counted as the beginning of the sine-wave which is wrong.

Is there any effective solution or existing functions? Sliding window may be? Please explain with some code (MATLAB). Due to firewall restrictions I cannot upload image. Sorry.
If you know the frequency of the sine signal  already, you can correlate your [.......p-set...] [SINE-WAVE] [....q-set...] signal with the sine signal. The correlation will give you a peak where sine wave exactly matches with the signal. Since you know the sine signal length you can figure out the beginning of the sine signal in your original signal. I hope this helps you a bit.