Generalized Fourier series and limit cycles of generalized van der Pol oscillators