Study of algorithms for analysis of xrf spectra to automate inspection of carpets