K-edge absorption of titanium in the perovskites SrTiO3, BaTiO3 and TiO2