Non-linear refractive index of silicon and GaAs induced by free-carrier generation