Phase transition and optical characteristics of Mg doped CuAlO2 synthesized by facile thermal decomposition process