Real-time accurate detection of the harmonics and inter-harmonics in power grid becomes increasingly prominent. In this paper, the methods for harmonic analysis are divided into two parts according to their application to detect stationary or non-stationary signals. Various methods and their characteristics, such as Fourier transform, wavelet transform, S-transform, artificial neural network, spectrum estimation and Hilbert-Huang transform are discussed in details. Finally, the paper provides a summary and outlook for all the detection methods.