Ab initio calculations of amplitude and phase functions for extended x-ray absorption fine structure spectroscopy