Wavelets: Analyzing Scale

Posted on February 1, 2008
Filed Under Signal Processing |

Physics is littered with transforms: Fourier, Radon, Wavelet, Laplace, Hilbert and many more. The idea behind each transform is - almost exclusively - to represent data in a way which makes it easy to “see” hidden structures. For instance, the Fourier transform allows you to see if there is any periodicity within your signal quite easily.

In this post I’ll tell you about another way of looking at hidden structure: Wavelets. Well, actually, it’s a pretty big field, so it’s impossible to go into the details, so I’ll just be giving you the general idea of things. Simply put, the Wavelet transform is a way of spotting different scales in your data.

For example, suppose you’re analyzing an earthquake. It is well known that massive earthquakes are preceded by weaker ones (which are preceded by yet weaker ones, ad infinitum - well, in theory at least). So you’ve got a phenomenon which replicates itself on several scales. This makes it quite amendable to Wavelet analysis (that is, analyzing the seismographic signals using Wavelet transforms).

Another example might be a face recognition software. Faces have all sorts of features to them of varying scale - your forehead and cheeks are on a different scale compared to, say, your teeth, which are on a different scale compared, say, to your mustache’s hairs. A good face recognition software would probably ignore details on a very fine scale. Using the Wavelet transform you could easily “discard” those details - in essence, smooth your image quite nicely - before running any tests. Wavelets are also a great way of compressing images. In fact, the FBI chose to store its fingerprint database using Wavelet compression techniques, which have proven very fast and effective, with a high compression ratio.

The Haar Transform

The name “Wavelet Transform” is a bit misleading because there are quite a few of them. We’ll be examining a particular one, called the Haar Transform, which is probably the simplest Wavelet transform. Suppose you have some signal, which we will choose to represent using a vector:

 \mathbf{s} = (s_1, s_2, s_3, ...., s_N)

We can decompose this input signal into two sub-signals by taking the sums and differences of our original vector:

 \mathbf{s}_+ = \frac{1}{\sqrt{2}} (s_2 + s_1, s_4 + s_3, s_6 + s_5, ..., s_{N} + s_{N+1}) \\ \mathbf{s}_- = \frac{1}{\sqrt{2}} (s_2 - s_1, s_4 - s_3, s_6 - s_5, ..., s_{N} - s_{N-1})

The meaning of these two signals (which are each half the length of the original signal) is as follows:

Thus, we’ve extracted two parts from our signal - a slow varying, smooth part, (\mathbf{s}_+), and a part which contains all of the fine details (\mathbf{s}_-). It is quite trivial to go back from this point - that is, reconstruct our original signal, given \mathbf{s}_+ and \mathbf{s}_-. Just add and subtract \mathbf{s}_+ and \mathbf{s}_- and do a bit of algebra, and you’re good to go.

But what’s science without a bit of fancy jargon to back it up? \mathbf{s}_+ is often called the trend, and \mathbf{s}_- is often called the fluctuation of our signal.

Haar Transform, Level 2

What we’ve just done in the previous part is called a level-1 Haar transform. We can now take our trend and once again “chop it up” into its own trend and fluctuation. This would be a level-2 Haar transform. This, in theory, can go on as long as we have signal left - recall that each trend is half the length of the previous one:

Haar Transform

That’s all there is to it, really - you’ve just performed your first Wavelet transform. The fluctuations allow us to observe the fine details of our signal at increasing scale. This is the essence of the Wavelet transform.

This scheme can also be used to compress the signal - by truncating the Wavelet transform at a particular level and keeping merely the trend, we’re saving a compressed, smoothed version of that signal (the compression is lossy). Such compression methods are quite effective, as noted previously.

Wavelets in Reality

Where are wavelets used in reality? Here are just a few examples.

Well, I’m no wavelets-expert, so I’ll be wrapping up my discussion at this point. I hope I’ve given you an idea of the power and usefulness of wavelets. See you next post!

Comments

Leave a Reply