Energy-dispersive analysis of x-rays