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:

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

The meaning of these two signals (which are each half the length of the original signal) is as follows:
- The signal
represents taking some sort of average over our original signal - after all, the average of
and
is
). In other words, it “smooths” things out. - The signal
is the exact opposite: if our signal varies slowly - that is, if it is already quite smooth - then
will be almost zero everywhere. On the other hand, if our signal has fine details and varies quickly, then
- which is composed of differences - would record all of those fast variations.
Thus, we’ve extracted two parts from our signal - a slow varying, smooth part, (
), and a part which contains all of the fine details (
). It is quite trivial to go back from this point - that is, reconstruct our original signal, given
and
. Just add and subtract
and
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?
is often called the trend, and
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:
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.
- The DjVu format for storing scanned documents uses Wavelet compression. A single scanned book can be stored using a megabyte of space or so. This is quite astonishing, when you do the math - a scanned page (say, 800×600 pixels, single color) would need 800×600 bytes = 480 kilobytes of storage. Multiply this by the average number of pages in a book - 300 - and you’ve got yourself over 100 megabytes of storage, and we aren’t even discussing grayscale yet!
- The WSQ wavelet algorithm is used by the FBI to store its fingerprint database. The FBI has about 200,000,000 fingerprints (some not distinct), with each fingerprint scanned at 500 dpi, which translates to about 10 MB of data. The FBI keeps adding about 30,000 new fingerprints to its database every day. This means that about 2000 terrabytes are needed, and more will be needed in the future.
- JPEG-2000 (an improvement over JPEG) was introduced in 1995 and is based on wavelets.
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
