The origin of the broadband luminescence and the effect of nitrogen doping on the optical properties of diamond films