Wavelet theory and its application to pattern recognition