Hi zhiqin,
The key is properly characterizing your desired signal in a way that is significantly different from the undesired portion of the signal. (Forgive me if I'm stating the obvious.) I can guess a few things from the image you posed, but let me ask some more questions that may help characterize it.
I'm guessing that:
1. You set up your acquisition so that you continue reading the signal until you get the waveform you're looking for, right?
2. Your desired signal starts when the it passes some positive y-axis threshold, right?
3. Your desired signal ends when it is below that threshold for a given time, right?