Baseline identification and peak decomposition for x-ray