A fast and efficient method for detecting, identifying, and localizing particular elements in a sample of material of unknown composition, from which a first data set is collected, by comparing said first data set to at least one second data set collected from at least one sample of said material of known composition, each said data set suitable for characterizing components of all said samples at least spectrally and spatially, comprising:
- decomposing said first and second data sets by applying a pre-specified wavelet family to each said first and second data sets;
- generating corresponding wavelet-packets (WPs) for each said decomposed data set using an entropy criterion;
- generating a best tree for each WP, said best tree having nodes;
- generating a branching/non-branching operation for each said best tree,
- wherein said branching/non-branching operation establishes a basis for comparing said nodes of said best trees of said first data set to corresponding said nodes of said best trees of said at least one second data set;
- comparing said corresponding nodes from said branching/non-branching operation to identify for further processing only mismatched pairs of said nodes,
- wherein a mismatched pair comprises said corresponding node branching in one said best tree and said corresponding node not branching in another said best tree being compared;
- employing a principal component analysis (PCA) for each said mismatched pair thus identified, placing in a first data file said data from said first data set corresponding to said corresponding nodes taken from one at least one second data set, but preferably from multiple said at least one second data sets;
- generating a covariance matrix for said first data file;
- deriving eigenvectors, eigenvalues and explained vectors from said covariance matrix;
- adding only data associated with said corresponding node from said first data set to said first data file to obtain a second data file from which eigenvectors, eigenvalues and explained vectors are derived,
- calculating a Q-Limit to compare said first and second data files to a pre-specified threshold;
- finding residuals of said second data file;
- using said residuals, computing corresponding Q-Values, such that if said corresponding Q-values are higher than said calculated Q-Limit, the existence and location of components different from those components in said known composition is indicated as being in said material of unknown composition.