A Galerkin approach for power spectrum determination of nonlinear oscillators