Illustration of raw EMG signal, the envelope of the EMG signal and the threshold method. The repetition time was 3 in the figure. By subtracting the signal of EMG electrode channel with EMG reference channel, the ECG artifact could be eliminated. Then the envelope of EMG data was obtained by using a mean filter method. The number of peaks in the EMG envelope was 3 which was equal to the repetition time, so we can know which section the target was in blue to indicate the next target. The offline session, allowed us to optimize stimulus time to achieve the best performance.