Application of wavelet transform in infrared spectrometry: spectral compression and library search