The existence of harmonics will cause the quality of power supply in a power system to decline and will affect the normal use of the power system. Therefore, it is important to suppress harmonics in the power system, and the first step of harmonic suppression is harmonic detection. To address this phenomenon, a fast harmonic detection method is proposed in this paper. It is based on the input observer theory to construct a state space model based on the original signal and harmonic components and estimate the state variables so as to achieve harmonic extraction. The characteristic roots are used to prove the convergence of the observer. In addition, the Second-Order Generalized Integration (SOGI) frequency estimation method is chosen to cascade with it so that harmonic detection can be accomplished with unknown frequencies. The simulation results prove that the proposed method can quickly converge and accurately extract each harmonic in the case of fluctuations in the fundamental amplitude, fundamental frequency and phase of the input signal, and the whole process can be completed in 0.02 s. The possible effects of white noise on harmonic extraction are also simulated, and the results prove that the accuracy of harmonic extraction can still be guaranteed in the presence of white noise. By using the Speedgoat real-time target machine built Rapid Control Prototype (RCP) as a testbed, experiments with similar simulation conditions were performed. The results show that the method has fast and accurate harmonic detection performance.