generate random phases