Diffraction Analysis of the Microstructure of Materials