Here's the "true" Song:

[Graphics:waveletgr2.gif][Graphics:waveletgr1.gif]

This is what's on the CD:

[Graphics:waveletgr2.gif][Graphics:waveletgr3.gif]

A typical music CD has about 600 megabytes of capacity on it; a 5-minute song can be about 60 megabytes big.
That's alot of diskspace...how can I fit
my favourite CDs on my computer? Is
it possible? Yes! (e.g. mp3)

First, let's start with a smaller example.

Suppose I have 8 samples of some f(t):

f(0) = 12, f(1) = 6, f(2) = 8, f(3) = 10
f(4) = 14, f(5) = 10, f(6) = 20, f(7) = 12

Remember, I don't have the "true" f(t);
all I have are its samples. So let me try
to approximate the true function with
some function I can get my hands on:
b(x):

if 0 <= x < 1 let b(x) = 1, otherwise b(x) = 0

Here's the graph of b(x):

[Graphics:waveletgr2.gif][Graphics:waveletgr4.gif]

And b(x - 1):

[Graphics:waveletgr2.gif][Graphics:waveletgr5.gif]

And b(x-2):

[Graphics:waveletgr2.gif][Graphics:waveletgr6.gif]

V0 = Span{..., b(x+1), b(x), b(x-1),...} is a subspace of L^2(R) (the vector space where the true song function lives)

Using these boxcars, I can approximate
the true function as:

f(x) = f(0) b(x) + f(1) b(x-1) + ... + f(7) b(x-7):

[Graphics:waveletgr2.gif][Graphics:waveletgr7.gif]

Compute averages and differences of consecutive pairs:
samples: {12, 6, 8, 10, 14, 10, 20, 12}
averages: {9, 9, 12, 16}
differences: {3, -1, 2, 4}

Note:
9+3 = 12, 9-3 = 6
9 + -1 = 8, 9 - -1 = 10
12 + 2 = 14, 12 - 2 = 10
16 + 4 = 20, 16 - 4 = 12

So I can get the original samples back!

Let me use those averages to get a new function fa(x) that I'll build out of dilated
boxcars: b(x/2 - i)

Here's the graph of b(x/2):

[Graphics:waveletgr2.gif][Graphics:waveletgr8.gif]

And here's b(x/2 - 1):

[Graphics:waveletgr2.gif][Graphics:waveletgr9.gif]

Notice how it's a stretched version of b(x).

Like before, I can take the subspace spanned by these dilated boxcars:

V1 = Span{b(x/2 - i): i is an integer}

It turns out (not coincidentally) that
V1 is a subspace of V0. (Think of their
graphs.)

fa(x) = 9 b(x/2) + 9 b(x/2-1) + 12 b(x/2-2) + 16 b(x/2 - 3); here is its plot:

[Graphics:waveletgr2.gif][Graphics:waveletgr10.gif]

How does it compare with the original?

[Graphics:waveletgr2.gif][Graphics:waveletgr11.gif]

Ok, now how about the differences, or "details" ?

Let me introduce a new function, called a wavelet, w(x):

If 0<= x< 1/2 then w(x) = 1
If 1/2 <= x < 1 then w(x) = -1
If x < 0 or 1 <= x then w(x) = 0

Here's w(x):

[Graphics:waveletgr2.gif][Graphics:waveletgr12.gif]

And here's w(x/2 - 1)

[Graphics:waveletgr2.gif][Graphics:waveletgr13.gif]

Let W1 = Span{w(x/2 - i): i is an integer}
This is a subspace, too.

Let fw(x) =
3 w(x/2)-w(x/2 -1)+2 w(x/2 -2)+4 w(x/2 -3):

[Graphics:waveletgr2.gif][Graphics:waveletgr14.gif]

Let's plot fa(x) + fw(x):

[Graphics:waveletgr2.gif][Graphics:waveletgr15.gif]

A match with the original!

This picture should make the following statement believable: the function f(x) in V0 can be written as a sum of two functions, fa(x) in V1 and fw(x) in W1.

I can go further with this. Let me now average the averages, and do their differences, too.

averages: {9, 9, 12, 16}
averages of averages: {9, 14}
differences of averages: {0, -2}

Define
faa(x) = 9 b(x/4) + 14 b(x/4 - 1)
faw(x) = 0 w(x/4) - 2 w(x/4 - 1)

Here's how faa(x) compares with f(x):

[Graphics:waveletgr2.gif][Graphics:waveletgr16.gif]

Let
V2 = Span{b(x/4 - i): i is an integer}
W2 = Span{w(x/4 - i): i is an integer}

So we have

f(x) = fa(x) + fw(x) = faa(x) + faw(x) + fw(x)

or in terms of subspaces

V0 = V1 + W1 = (V2 + W2) + W1

So where does the music come in ?

Here are the numbers we computed:

avg of the avgs = { 9, 14 }
diffs of the avgs = {0, -2}
diffs (at the start) = {3, -1, 2, 4}

I can exactly reconstruct the original f(x) from these numbers.

Suppose I decided to throw away all diffs
whose absolute values are less than or equal to 2. Then I have

avg of the avgs = {9, 14}
new diffs of the avgs = {0, 0}
new diffs (at the start) = {3, 0, 0, 4}

Suppose I reconstruct with these numbers. So I get a new function that isn't exactly the original f(x). What does it look like? How does it compare with the original f(x) ?

[Graphics:waveletgr2.gif][Graphics:waveletgr17.gif]

Not the greatest fit, but not bad either, considering we essentially threw away half the numbers.

This is how you get a song to fit on your computer: you represent the song function by f(x) in some subspace of L^2(R), and "massage" f(x) like we just did to throw away the unimportant details, the details that you won't notice are missing.

The boxcar function and wavelet we used in the massaging our necessarily the best functions to use. Neither is the way we chose the "unimportant" details. There are other functions you can use, and lots better ways of dropping the unimportant details.

These ideas will also work for images.

[Graphics:waveletgr2.gif][Graphics:waveletgr18.gif]