finished spectralToDistance except for inferring alpha