Optical spectroscopy and density functional calculations of chromium(V)-doped YVO4 and YPO4: influence of the second coordination sphere.