Extraction of the fine structure from x-ray absorption spectra