Then, a background subtraction process is performed, for example as discussed above. In this embodiment, a cubic spline with k knots is then constructed such that p % of the data between each pair of knots lies below the curve. This curve is then subtracted from the data. In one example, k is 32. In one example, p is 5. A constant value corresponding to the q % quantile of the intensity subtracted data is then subtracted from each intensity. Positive and negative values are retained. In one example, q is 45. Then, a normalisation process is performed, for example as discussed above. In this embodiment, the data are normalised to have mean 
An entry in the library then consists of metadata in the form of a median spectrum value μi and a deviation value Di for each of the Nchan points in the spectrum.
The likelihood for the i'th channel is given by: