Wearing transfemoral prosthesis is the only way to complete daily physical activity for amputees. Motion pattern recognition is important for the control of prosthesis, especially in the recognizing swing phase and stance phase. In this paper, it is reported that surface electromyography (sEMG) signal is used in swing and stance phase recognition. sEMG signal of related muscles was sampled by Infiniti of a Canadian company. The sEMG signal was then filtered by weighted filtering window and analyzed by height permitted window. The starting time of stance phase and swing phase is determined through analyzing special muscles. The sEMG signal of rectus femoris was used in stance phase recognition and sEMG signal of tibialis anterior is used in swing phase recognition. In a certain tolerating range, the double windows theory, including weighted filtering window and height permitted window, can reach a high accuracy rate. Through experiments, the real walking consciousness of the people was reflected by sEMG signal of related muscles. Using related muscles to recognize swing and stance phase is reachable. The theory used in this paper is useful for analyzing sEMG signal and actual prosthesis control.